]> git.donarmstrong.com Git - debhelper.git/blob - doc/from-debstd
r84: Initial revision
[debhelper.git] / doc / from-debstd
1 Converting from debstd to debhelper:
2 -----------------------------------
3
4 Debhelper is designed to be mostly backwards compatible to debstd. I say
5 mostly because I haven't made debhelper handle everything that debstd does
6 yet, and in a few cases, debhelper does things differently (and I hope,
7 better).
8
9 In general, you can switch over to using debhelper as follows. In your
10 debian/rules, you currently will have some lines that read something like
11 this:
12
13         debstd CHANGES TODO README
14         dpkg-gencontrol
15         dpkg --build debian/tmp ..
16
17 Debhelper comes with a command called dh_debstd that mimics the behavior of
18 debstd, by calling various debhelper commands. So in the root directory of
19 your package you are converting, run:
20
21         dh_debstd CHANGES TODO README --verbose --no-act
22
23 Notice the parallel to the debstd command above, I just added "--verbose --act"
24 to the end. This will make dh_debstd output a list of commands that it thinks
25 will emulate what debstd would have done, without actually doing anything to
26 your package. The list will look similar to this:
27
28         dh_installdirs
29         dh_installdocs TODO README
30         dh_installexamples
31         dh_installchangelogs CHANGES
32         dh_installmenu
33         dh_installcron
34         dh_installmanpages
35         dh_movefiles
36         dh_strip
37         dh_compress
38         dh_fixperms
39         dh_suidregister
40         dh_shlibdeps
41         dh_gencontrol
42         dh_makeshlibs
43         dh_installdeb
44         dh_md5sums
45         dh_builddeb
46
47 Now copy that output into debian/rules, replacing the debstd command, as
48 well as any dpkg-gencontol and dpkg --build commands.
49
50 Finally, debstd automatically modified postinst, postrm, etc scripts. Some
51 of the debhelper apps do that too, but they do it differently. Debstd just
52 appends its commands to the end of the script. Debhelper requires that you
53 insert a tag into your scripts, that will tell debhelper where to insert
54 commands. So if you have postinst, postrm, etc scripts, add a line reading
55 "#DEBHELPER#" to the end of them.
56
57 Once you think it's all set up properly, do a test build of your package. If
58 it works ok, I recommend that you compare the new package and the old
59 debstd-generated package very closely. Pay special attention to the
60 postinst, postrm, etc scripts, and make sure that the new package contains
61 all the same files as the old, with the same permissions.
62
63 -- Joey Hess <joeyh@master.debian.org>