summaryrefslogtreecommitdiff
path: root/doc/from-debstd
blob: 31fd0cdd3bdfccb47f8a4dfab2de5a4849f07e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Converting from debstd to debhelper:
-----------------------------------

Debhelper is designed to be mostly backwards compatible to debstd. I say
mostly because I haven't made debhelper handle everything that debstd does
yet, and in a few cases, debhelper does things differently (and I hope,
better).

In general, you can switch over to using debhelper as follows. In your
debian/rules, you currently will have some lines that read something like
this:

	debstd CHANGES TODO README
	dpkg-gencontrol
	dpkg --build debian/tmp ..

Debhelper comes with a command called dh_debstd that mimics the behavior of
debstd, by calling various debhelper commands. So in the root directory of
your package you are converting, run:

	dh_debstd CHANGES TODO README --verbose --no-act

Notice the parallel to the debstd command above, I just added "--verbose --act"
to the end. This will make dh_debstd output a list of commands that it thinks
will emulate what debstd would have done, without actually doing anything to
your package. The list will look similar to this:

        dh_installdirs
	dh_installdocs TODO README
	dh_installexamples
	dh_installchangelogs CHANGES
	dh_installmenu
	dh_installcron
	dh_installmanpages
	dh_movefiles
	dh_strip
	dh_compress
	dh_fixperms
	dh_suidregister
	dh_shlibdeps
	dh_gencontrol
	dh_makeshlibs
	dh_installdeb
	dh_md5sums
	dh_builddeb

Now copy that output into debian/rules, replacing the debstd command, as
well as any dpkg-gencontol and dpkg --build commands.

Finally, debstd automatically modified postinst, postrm, etc scripts. Some
of the debhelper apps do that too, but they do it differently. Debstd just
appends its commands to the end of the script. Debhelper requires that you
insert a tag into your scripts, that will tell debhelper where to insert
commands. So if you have postinst, postrm, etc scripts, add a line reading
"#DEBHELPER#" to the end of them.

Once you think it's all set up properly, do a test build of your package. If
it works ok, I recommend that you compare the new package and the old
debstd-generated package very closely. Pay special attention to the
postinst, postrm, etc scripts, and make sure that the new package contains
all the same files as the old, with the same permissions.

-- Joey Hess <joeyh@master.debian.org>