From fbabb8038535361c7e4f9ab538f2b9cfa3023367 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:40 +0000 Subject: [PATCH] r17: Initial Import --- README | 53 ++++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 10 +++++++++ debian/copyright | 10 ++++++--- debian/rules | 1 + dh_lib | 6 ++++- dh_md5sums | 17 +++++++++----- dh_md5sums.1 | 12 +++++----- examples/rules | 1 + examples/rules.multi | 2 ++ 9 files changed, 98 insertions(+), 14 deletions(-) diff --git a/README b/README index e43ee33..21ecd51 100644 --- a/README +++ b/README @@ -8,6 +8,58 @@ that uses debhelper commands extensivly. See one good order you can run the different debhelper scripts in (though other variations are possible). + +Converting from debstd to debhelper: +----------------------------------- + +Debhelper is designed to be mostly backwards compatable to debstd. I say +mostly becuase I haven't made debhelper handle everything that debstd does +yet, and in a few cases, it does things differently (and I hope, better). + +In general, you can switch over to using debhelper as follows. In your +debian/rules, where you used to have some lines that read something like: + + debstd CHANGES TODO README + dpkg-gencontrol + dpkg --build debian/tmp .. + +Remove that and replace it with something like: + + dh_installdocs TODO README + dh_installexamples + dh_installmenu + dh_installcron + dh_installmanpages + dh_installchangelogs CHANGES + dh_strip + dh_compress + dh_fixperms + dh_suidregister + dh_installdebfiles + dh_m5dsums + dh_builddeb + +Notice that the parameters sent to debstd get split up among the dh_* +programs. The upstream changelog is passed to dh_installchangelogs, and the +docs are passed to dh_installdocs. + +Debstd has many switches, that turn off differnt parts of it. So if you +were using debstd -m to tell it not to automatically install manpages, +for example, you can just comment out the dh_installmanpages line. + +Finally, debstd automatically modified postinst, postrm, etc scripts. Some +of the dehelper apps do that too, but they do it differnently. Debstd just +appends its commands to the end of the script. Debhelper reqyires 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 reccommend that you compare the new package and the old +debstd-generated package very closely. Pay special attention to the postint, +postrm, etc scripts. + + Automatic generation of debian install scripts: ---------------------------------------------- @@ -23,6 +75,7 @@ by the -n parameter. Note that it will be shell code, so you cannot directly use it in a perl script. + Notes on multiple binary packages: --------------------------------- diff --git a/debian/changelog b/debian/changelog index e70ccf0..a1b0990 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (0.11) unstable; urgency=low + + * dh_md5sums: behavior modification: do not generate md5sums for conffiles. + (Thanks to Charles Briscoe-Smith ) #14048. + * dh_md5sums: can generate conffile md5sums with -x parameter. + * Added a "converting from debstd" section to the README. + * Added dh_du, generates a DEBIAN/du file with disk usage stats (#14048). + + -- Joey Hess Tue, 21 Oct 1997 13:17:28 -0400 + debhelper (0.10) unstable; urgency=medium * dh_installdebfiles: fixed *bad* bug that messed up the names of all diff --git a/debian/copyright b/debian/copyright index 0feed1b..2845a26 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,9 @@ Debhelper is written by Joey Hess . -Parts of the code came from debmake, by Christoph Lameter -. -The copyright of this package is GPL. +Parts of the code (and certianly my inspiration from the whole thing) came +from debmake, by Christoph Lameter . + +Some of the dh_md5sums and dh_du commands is from a program by Charles +Briscoe-Smith . + +The copyright of this package is GPL, version 2 or later. diff --git a/debian/rules b/debian/rules index 8b635e7..eaaeb54 100755 --- a/debian/rules +++ b/debian/rules @@ -45,6 +45,7 @@ binary-indep: build ./dh_fixperms ./dh_suidregister ./dh_installdebfiles + ./dh_du ./dh_md5sums ./dh_builddeb diff --git a/dh_lib b/dh_lib index 618953d..1cc7e30 100644 --- a/dh_lib +++ b/dh_lib @@ -77,7 +77,7 @@ autoscript() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt vianp: $*` +set -- `getopt xvianp: $*` for i; do case "$i" @@ -103,6 +103,10 @@ for i; do DH_NOSCRIPTS=1 shift ;; + -x) + DH_EXCLUDE=1 + shift + ;; --) shift break diff --git a/dh_md5sums b/dh_md5sums index 273faf3..5400bad 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -13,10 +13,17 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/DEBIAN" fi - doit "cd debian/$TMP" # Doit isn't smart enough to hande this next command so echo by hand. (sigh) - verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums DEBIAN/md5sums debian/$TMP/DEBIAN/allfiles' + find debian/$TMP/* -type f ! -regex "^debian/$TMP/DEBIAN/.*" | sed s:debian/$TMP:: | sort > debian/$TMP/DEBIAN/allfiles + # Check if we should exclude conffiles. + if [ ! "$DH_EXCLUDE" -a -r debian/$TMP/DEBIAN/conffiles ]; then + verbose_echo "sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new" + sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new + doit "mv debian/$TMP/DEBIAN/allfiles.new debian/$TMP/DEBIAN/allfiles" + fi + verbose_echo "cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." + cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. + doit "chown root.root debian/$TMP/DEBIAN/md5sums" + doit "rm -f debian/$TMP/DEBIAN/allfiles" done diff --git a/dh_md5sums.1 b/dh_md5sums.1 index 422a4aa..a54c1c1 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -3,12 +3,13 @@ dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-x] [-v] [-a] [-i] [-ppackage]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. .P -All files in DEBIAN/ are omitted from the md5sums file. +All files in DEBIAN/ are omitted from the md5sums file, as are all conffiles +(unless you use the -x switch). .P The md5sums file is installed with proper permissions and ownerships. .SH OPTIONS @@ -24,6 +25,10 @@ Generate md5sums files for all architecture independent packages. .TP .B \-ppackage Generate md5sums file for the package named "package". +.TP +.B \-x +Include conffiles in the md5sums list. Note that this is redundant, and +included elsewhere in debian packages. .SH NOTES The .B \-a @@ -36,9 +41,6 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode -.SH BUGS -It would be better if it did not include md5sums of conffiles, since this -info is duplicated elsewhere. .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/examples/rules b/examples/rules index 054e33a..fc300e6 100755 --- a/examples/rules +++ b/examples/rules @@ -42,6 +42,7 @@ binary-arch: build dh_fixperms dh_suidregister dh_installdebfiles + dh_du dh_m5dsums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index bb0f4fe..4e8b30e 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -40,6 +40,7 @@ binary-indep: build dh_fixperms -i dh_suidregister -i dh_installdebfiles -i + dh_du -a dh_md5sums -i dh_builddeb -i @@ -62,6 +63,7 @@ binary-arch: build dh_fixperms -a dh_suidregister -a dh_installdebfiles -a + dh_du -a dh_md5sums -a dh_builddeb -a -- 2.39.5