1 Debhelper is a collection of programs that can be used in debian/rules files
2 to automate common tasks. For further documentation, see the man pages for
5 To help you get started, I've included an example of a debian/rules file
6 that uses debhelper commands extensivly. See
7 /usr/doc/debhelper/examples/rules . These files are also useful as they give
8 one good order you can run the different debhelper scripts in (though other
9 variations are possible).
12 Converting from debstd to debhelper:
13 -----------------------------------
15 Debhelper is designed to be mostly backwards compatable to debstd. I say
16 mostly becuase I haven't made debhelper handle everything that debstd does
17 yet, and in a few cases, it does things differently (and I hope, better).
19 In general, you can switch over to using debhelper as follows. In your
20 debian/rules, where you used to have some lines that read something like:
22 debstd CHANGES TODO README
24 dpkg --build debian/tmp ..
26 Remove that and replace it with something like:
28 dh_installdocs TODO README
33 dh_installchangelogs CHANGES
43 Notice that the parameters sent to debstd get split up among the dh_*
44 programs. The upstream changelog is passed to dh_installchangelogs, and the
45 docs are passed to dh_installdocs.
47 Debstd has many switches, that turn off differnt parts of it. So if you
48 were using debstd -m to tell it not to automatically install manpages,
49 for example, you can just comment out the dh_installmanpages line.
51 Finally, debstd automatically modified postinst, postrm, etc scripts. Some
52 of the dehelper apps do that too, but they do it differnently. Debstd just
53 appends its commands to the end of the script. Debhelper reqyires that you
54 insert a tag into your scripts, that will tell debhelper where to insert
55 commands. So if you have postinst, postrm, etc scripts, add a line reading
56 "#DEBHELPER" to the end of them.
58 Once you think it's all set up properly, do a test build of your package. If
59 it works ok, I reccommend that you compare the new package and the old
60 debstd-generated package very closely. Pay special attention to the postint,
64 Automatic generation of debian install scripts:
65 ----------------------------------------------
67 Some debhelper commands will automatically generate parts of debian install
68 scripts. If you want these automatically generated things included in your
69 debian install scripts, then you need to add "#DEBHELPER#" to your scripts,
70 in the place the code should be added. "#DEBHELPER#" will be replaced by any
71 autogenerated code when you run dh_installdebfiles.
73 All scripts that automatically generate code in this way let it be disabled
76 Note that it will be shell code, so you cannot directly use it in a perl
80 Notes on multiple binary packages:
81 ---------------------------------
83 If your source package generates more than one binary package, debhelper
84 programs will default to acting on all binary packages when run. If your
85 source package happens to generate one architecture dependent package, and
86 another architecture independent package, this is not the correct behavior,
87 because you need to generate the architecture dependent packages in the
88 binary-arch debian/rules target, and the architecture independent packages
89 in the binary-indep debian/rules target.
91 To faciliatate this, as well as give you more control over which packages
92 are acted on by debhelper programs, all debhelper programs accept the
95 -a Act on architecture dependent packages
96 -i Act on architecture independent packages
97 -ppackage Act on the package named "package" (may be repeated multiple
100 These parameters are cumulative. If none are given, the tools default to
101 effecting all packages.
103 See examples/rules.multi for an example of how to use this.
105 -- Joey Hess <joeyh@master.debian.org>