diff options
18 files changed, 91 insertions, 72 deletions
diff --git a/Debian/Debhelper/ b/Debian/Debhelper/
index 02045bb..18157bf 100644
--- a/Debian/Debhelper/
+++ b/Debian/Debhelper/
@@ -126,7 +126,6 @@ sub parseopts {
"filename=s" => \$options{FILENAME},
- "number=i" => \$options{PRIORITY}, # deprecated
"priority=i" => \$options{PRIORITY},
"flavor=s" => \$options{FLAVOR},
diff --git a/Debian/Debhelper/ b/Debian/Debhelper/
index e71895e..8287734 100644
--- a/Debian/Debhelper/
+++ b/Debian/Debhelper/
@@ -190,7 +190,7 @@ sub dirname { my $fn=shift;
# Pass in a number, will return true iff the current compatability level
-# is equal to that number.
+# is less than or equal to that number.
sub compat {
my $num=shift;
@@ -203,7 +203,7 @@ sub compat {
error("Sorry, but $max_compat is the highest compatability level of debhelper currently supported.");
- return ($c == $num);
+ return ($c <= $num);
# Pass it a name of a binary package, it returns the name of the tmp dir to
diff --git a/autoscripts/postinst-makeshlibs b/autoscripts/postinst-makeshlibs
new file mode 100644
index 0000000..8a25b9e
--- /dev/null
+++ b/autoscripts/postinst-makeshlibs
@@ -0,0 +1,3 @@
+if [ "$1" = "configure" ]; then
+ ldconfig
diff --git a/autoscripts/postrm-makeshlibs b/autoscripts/postrm-makeshlibs
new file mode 100644
index 0000000..96bf24e
--- /dev/null
+++ b/autoscripts/postrm-makeshlibs
@@ -0,0 +1,3 @@
+if [ "$1" = "remove" ]; then
+ ldconfig
diff --git a/debian/changelog b/debian/changelog
index 2e81279..1930e77 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,28 @@
+debhelper (2.2.0) unstable; urgency=low
+ * DH_COMPAT=3 now enables the following new features which I can't just
+ turn on by default for fear of breaking backwards compatability:
+ - dh_makeshlibs makes the postinst/postrm call ldconfig. Closes: #77154
+ Patch from Masato Taruishi <> (modified). If you
+ use this, be sure dh_makeshlibs runs before dh_installdeb; many
+ old rules files have the ordering backwards.
+ - dh_installdeb now causes all files in /etc to be registered as
+ conffiles.
+ - debian/README is now supported: it is treated exactly like
+ debian/README.Debian. Either file is installed as README.Debian in
+ non-native packages, and now as just README in native packages.
+ Closes: #34628
+ * This is really only the start of the changes for v3, so use with
+ caution..
+ * dh_du has finally been removed. It has been deprecated for ages, and
+ a grep of the archive shows that nothing is using it except biss-awt
+ and scsh. I filed bugs on both almost exactly a year ago. Those bugs
+ should now be raised to severity important..
+ * --number option (to dh_installemacsen) is removed. It has been
+ deprecated for a while and nothing uses it. Use --priority instead.
+ -- Joey Hess <> Sun, 26 Nov 2000 17:51:58 -0800
debhelper (2.1.28) unstable; urgency=low
* Ok, fine, I'll make debhelper depend on lynx for the one or two
diff --git a/debian/copyright b/debian/copyright
index 3e20958..7686782 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,9 +1,9 @@
Debhelper is written by and copyright 1997-2000 Joey Hess <>.
-Parts of the code (and certainly my inspiration from the whole thing) came
-from debmake, by Christoph Lameter <>.
+Increasinly miniscule parts of the code (and certainly 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
+Some of the dh_md5sums command is from a program by Charles
Briscoe-Smith <>.
The copyright of this package is GPL, version 2 or later. Files in the
diff --git a/dh_du b/dh_du
deleted file mode 100755
index d786e49..0000000
--- a/dh_du
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/perl -w
-# Generate a DEBIAN/du file, that lists the disk usage of the directories in
-# the package.
-# No longer - it was decided these files are a bad idea.
-use Debian::Debhelper::Dh_Lib;
-warning("this program does nothing and is deprecated. Remove it from debian/rules.");
diff --git a/dh_du.1 b/dh_du.1
deleted file mode 100644
index e7487b7..0000000
--- a/dh_du.1
+++ /dev/null
@@ -1,16 +0,0 @@
-.TH DH_DU 1 "" "Debhelper Commands" "Debhelper Commands"
-dh_du \- generate DEBIAN/du file (deprecated)
-.B dh_du
-dh_du is a debhelper program that was responsible for generating
-a DEBIAN/du file, which listed the disk usage of directories in the package.
-This program is now deprecated, and does nothing, after a decision by the
-debian developers that du control files should not exit. It will simply
-output a warning message now.
-.BR debhelper (1)
-Joey Hess <>
diff --git a/dh_fixperms b/dh_fixperms
index 616747e..36ce73c 100755
--- a/dh_fixperms
+++ b/dh_fixperms
@@ -21,7 +21,6 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
complex_doit("find $TMP ! -type l $find_options -print0",
"2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s");
# Fix up premissions in usr/share/doc, setting everything to not
# executable by default, but leave examples directories alone.
complex_doit("find $TMP/usr/share/doc $TMP/usr/doc -type f $find_options ! -regex '.*/examples/.*' -print0",
diff --git a/dh_installdeb b/dh_installdeb
index 6eddb38..1447ebf 100755
--- a/dh_installdeb
+++ b/dh_installdeb
@@ -51,4 +51,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ # Automatic conffiles registration: If it is in /etc, it is a
+ # conffile.
+ if (! Debian::Debhelper::Dh_Lib::compat(2) && -d "$TMP/etc") {
+ complex_doit("find $TMP/etc -type f |sed 's~^$TMP~~' >> $TMP/DEBIAN/conffiles");
+ # Anything found?
+ if (-z "$TMP/DEBIAN/conffiles") {
+ doit("rm", "-f", "$TMP/DEBIAN/conffiles");
+ }
+ }
diff --git a/dh_installdeb.1 b/dh_installdeb.1
index df30597..78f1d7c 100644
--- a/dh_installdeb.1
+++ b/dh_installdeb.1
@@ -6,7 +6,7 @@ dh_installdeb \- install files into the DEBIAN directory
.I "[debhelper options]"
dh_installdeb is a debhelper program that is responsible for installing
-files into the DEBIAN directory in package build directories with the
+files into the DEBIAN directories in package build directories with the
correct permissions.
dh_installdeb automatically installs the following files from debian/ into
@@ -27,6 +27,10 @@ the .debhelper file. The .debhelper files are created by other debhelper
programs, such as
.BR dh_installmenu (1)
, and are shell script fragments.
+If DH_COMPAT is set to 3 or higher, all files in the etc/ directory in a
+package will automatically be flagged as conffiles by this program, so
+there is no need to list them manually in package.conffiles.
.B debhelper options
diff --git a/dh_installdocs b/dh_installdocs
index 7af3809..50bc171 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -39,10 +39,21 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
if (! $readme_debian) {
+ if (! $readme_debian) {
+ $readme_debian=pkgfile($PACKAGE,'README');
+ }
if ($readme_debian) {
- doit("install","-g",0,"-o",0,"-m","644","-p","$readme_debian",
- "$TMP/usr/share/doc/$PACKAGE/README.Debian");
+ if (isnative($PACKAGE)) {
+ doit("install","-g",0,"-o",0,"-m","644","-p",
+ $readme_debian,
+ "$TMP/usr/share/doc/$PACKAGE/README");
+ }
+ else {
+ doit("install","-g",0,"-o",0,"-m","644","-p",
+ $readme_debian,
+ "$TMP/usr/share/doc/$PACKAGE/README.Debian");
+ }
diff --git a/dh_installdocs.1 b/dh_installdocs.1
index 7cc0623..5f2bf99 100644
--- a/dh_installdocs.1
+++ b/dh_installdocs.1
@@ -19,13 +19,13 @@ package dh_installdocs is told to act on. By default, this is the first
binary package in debian/control, but if you use -p, -i, or -a flags, it
will be the first package specified by those flags.
-Also, debian/README.Debian (or debian/README.debian) and debian/TODO, if
+Also, debian/README (or debian/README.Debian) and debian/TODO, if
they exist, will be installed into the first binary package listed in
debian/control, if dh_installdocs is acting on that package. Note that
-debian/TODO will be installed named TODO.Debian, if the package is not a
-debian native package. Also note that README.debian is installed as
-README.Debian, for consitency. Note that debian/package.README.Debian and
-debian/package.TODO can be used to specify files for subpackages.
+they will be named README.Debian and TODO.Debian, if the package is not a
+debian native package, and README and TODO if it is. Also note that
+Additionally, debian/package.README and debian/package.TODO can be used
+to specify files for subpackages.
Files named debian/ can list other files to be installed.
diff --git a/dh_makeshlibs b/dh_makeshlibs
index 6b3ff41..1b50ea1 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -9,12 +9,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
my %seen;
+ my $need_ldconfig = 0;
doit("rm", "-f", "$TMP/DEBIAN/shlibs");
open (FIND, "find $TMP -xtype f -name '*.so*' |");
while (<FIND>) {
+ $need_ldconfig=1;
# The second evil regexp is for db3, whose author should
# be shot.
if (m#.*/(.*)\.so\.(\d*)\.?# || m#.*/(.*)-(\S+)\.so$#) {
@@ -51,6 +53,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
close FIND;
+ # New as of dh_v3.
+ if (! Debian::Debhelper::Dh_Lib::compat(2) &&
+ ! $dh{NOSCRIPTS} && $need_ldconfig) {
+ autoscript($PACKAGE,"postinst","postinst-makeshlibs");
+ autoscript($PACKAGE,"postrm","postrm-makeshlibs");
+ }
if (-e "$TMP/DEBIAN/shlibs") {
diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1
index 68d331b..488356d 100644
--- a/dh_makeshlibs.1
+++ b/dh_makeshlibs.1
@@ -3,10 +3,13 @@
dh_makeshlibs \- automatically create shlibs file
.B dh_makeshlibs
-.I "[debhelper options] [-mmajor] [-V[dependancies]]"
+.I "[debhelper options] [-mmajor] [-V[dependancies]] [-n]"
dh_makeshlibs is a debhelper program that automatically scans for shared
libraries, and generates a shlibs file for the libraries it finds.
+It also adds a call to ldconfig in the postinst and postrm scripts (in
+DH_COMPAT=3 mode and above only).
.B debhelper options
@@ -27,6 +30,9 @@ information, the current version of the package is plugged into a dependancy
that looks like "packagename (>= packageversion)". If -V is specified with
parameters, the parameters can be used to specify the exact dependancy
information needed (be sure to include the package name).
+.B \-n, \--noscripts
+Do not modify postinst/postrm scripts.
.B dh_makeshlibs
diff --git a/doc/TODO b/doc/TODO
index 9277132..fa5fc03 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -4,8 +4,6 @@ list grows - I welcome patches to fix items on it!
Wishlist items:
* Make dh_* "use strict".
-* Make dh_movefiles remove emptied directories after it's moved all the
- files out of them (#17111).
* enhance dh_installmanpages so it associates binaries and man pages and
installs the man pages into the correct areas to suit the binaries they
document. I may need to make this only happen when a switch is given, to
@@ -23,12 +21,6 @@ Wishlist items:
* All programs should also make sure the files they install are owned by
root.root. Situation is currently the same as with permissions above, plus
dh_installchangelogs is fixed.
-* something should add ldconfig calls properly to the postinst of packages
- that contain shared libraries. maybe dh_makeshlibs? But it wasn't designed
- to do that originally, and even worse, it is often run after
- dh_installdeb, so the fragments wouldn't go into the postinst. So maybe a
- new script is called for. But it's probably be best to just have a switch
- to enable this.
* Need a way to make dh_strip not strip any static libs. Also, it'd be nice
if there were options to dh_strip, dh_compress, etc, to allow inclusion of
directories and exclusion of files based on filename globbing. (Request from
@@ -51,14 +43,6 @@ Wishlist items:
-* remove dh_du.
- - need to wait a reasonable length of
- time. I'm currently planning on doing this after slink is released or
- one year after they were deprecated, whichever comes first. Be sure to
- grep whole debian archive for all of them before removing them, though!
- - currently, a few packages in potato use dh_du, but bugs have been filed.
-* Remove support for --number option
- - only dh_installemacsen ever used it, it is not --priority.
* DH_COMPAT 1. Can be removed once all packages are seen to be using 2 or
higher. I won't hold my breath.
* Also, grep the entire archive for all dh_* command lines, and check to
diff --git a/doc/v3 b/doc/v3
index bd923de..1f38b83 100644
--- a/doc/v3
+++ b/doc/v3
@@ -25,17 +25,9 @@ them.
the .man filenames properly. It'll probably just assume all man pages have
an extension, and delete that extentation, and add the correct one.
-* dh_movefiles will use a name other than debian/<package>.files for the
- list of what to move, because it can't use debian/files for the first
- package, since that file is already used elsewhere. It'll use
- debian/<package>.move
-* dh_movefiles should delete empty directories after it's moved all files
- out of them. (#17111)
-* debian/README will be installed as /usr/share/doc/<package>/README in
++ debian/README is installed as /usr/share/doc/<package>/README in
native packages, and as README.Debian in non-native packages. This is
- consistent with the handing of debian/TODO and debian/changelog. (#34628)
+ consistent with the handing of debian/TODO and debian/changelog.
* There will be no change to the names of debhelper config files used, I've
decided against debian/<package>/* and the like, because although those
@@ -45,12 +37,12 @@ them.
documenting that debian/<foo> works, and will deprecate that usage.
debian/<package>.<foo> will be preferred even in single binary packages.
-* Every file in etc/ will be automatically be flagged as a conffile.
++ Every file in etc/ is automatically flagged as a conffile by dh_installdeb.
* Debhelper config files will support globbing via * and ?, when
appropriate. To turn this off and use those changarcters raw, just quote
-* dh_makeshlibs will generate autoscript fragments for ldconfig. This will
- require you call it before dh_installdeb, which isn't always done now.
++ dh_makeshlibs will generate autoscript fragments for ldconfig. This will
+ require you call it before dh_installdeb.
diff --git a/examples/rules.multi b/examples/rules.multi
index 0b5d794..6ba2bc8 100755
--- a/examples/rules.multi
+++ b/examples/rules.multi
@@ -99,8 +99,8 @@ binary-arch: build install
dh_fixperms -a
# You may want to make some executables suid here.
dh_suidregister -a
- dh_installdeb -a
# dh_makeshlibs -a
+ dh_installdeb -a
# dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a