]> git.donarmstrong.com Git - debhelper.git/commitdiff
r506: * Introduced the debian/compat file. This is the new, preferred way to say
authorjoey <joey>
Sun, 27 Jan 2002 06:34:33 +0000 (06:34 +0000)
committerjoey <joey>
Sun, 27 Jan 2002 06:34:33 +0000 (06:34 +0000)
     what debhelper compatability level your package uses. It has the big
     advantage of being available to debhelper when you run it at the command
     line, as well as in debian/rules.
   * A new v4 feature: dh_installinit, in v4 mode, will use invoke-rc.d.
     This is in v4 for testing, but I may well roll it back into v3 (and
     earlier) once woody is released and I don't have to worry about breaking
     things (and, presumably, once invoke-rc.d enters policy).
   * Some debhelper commands will now build up a new substvars variable,
     ${misc:Depends}, based on things they know your package needs to depend
     on. For example, dh_installinit in v4 mode adds sysvinit (>= 2.80-1) to
     that dep list, and dh_installxfonts adds a dep on xutils. This variable
     should make it easier to keep track of what your package needs to depends
     on, supplimenting the ${shlibs:Depends} and ${perl:Depends} substvars.
     Hmm, this appears to be based loosely on an idea by Masato Taruishi
     <taru@debian.org>, filtered through a long period of mulling it over.
Closes: #76352
   * Use the addsubstvar function I wrote for the above in dh_perl too.

22 files changed:
Debian/Debhelper/Dh_Lib.pm
autoscripts/postinst-init-invoke [new file with mode: 0644]
autoscripts/postinst-init-norestart-invoke [new file with mode: 0644]
autoscripts/postrm-init-invoke [new file with mode: 0644]
autoscripts/prerm-init-invoke [new file with mode: 0644]
autoscripts/prerm-init-norestart-invoke [new file with mode: 0644]
debhelper.pod
debian/changelog
debian/compat [new file with mode: 0644]
debian/rules
dh_installdeb
dh_installdebconf
dh_installinit
dh_installxfonts
dh_makeshlibs
dh_perl
doc/PROGRAMMING
doc/TODO
examples/rules
examples/rules.indep
examples/rules.multi
examples/rules.multi2

index f5a376fd079dcd9bbb56f6feb198c469dca7b453..a21db5da15ea162bb8d9f3f54c0863d7e09eb462 100644 (file)
@@ -12,7 +12,7 @@ use vars qw(@ISA @EXPORT %dh);
 @ISA=qw(Exporter);
 @EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
            &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages
-           &basename &dirname &xargs %dh &compat);
+           &basename &dirname &xargs %dh &compat &addsubstvar &delsubstvar);
 
 my $max_compat=4;
 
@@ -218,6 +218,12 @@ sub compat {
        if (defined $ENV{DH_COMPAT}) {
                $c=$ENV{DH_COMPAT};
        }
+       elsif (-e 'debian/compat') {
+               # Try the file..
+               open (COMPAT_IN, "debian/compat") || die "debian/compat: $!";
+               $c=<COMPAT_IN>;
+               chomp $c;
+       }
 
        if ($c > $max_compat) {
                error("Sorry, but $max_compat is the highest compatibility level of debhelper currently supported.");
@@ -350,6 +356,64 @@ sub autoscript {
        complex_doit("echo '# End automatically added section' >> $outfile");
 }
 
+# Removes a whole substvar line.
+sub delsubstvar {
+       my $package=shift;
+       my $substvar=shift;
+
+       my $ext=pkgext($package);
+       my $substvarfile="debian/${ext}substvars";
+
+       complex_doit("grep -v '^${substvar}=' $substvarfile > $substvarfile.new || true");
+       doit("mv", "$substvarfile.new","$substvarfile");
+}
+                               
+# Adds a dependency on some package to the specified
+# substvar in a package's substvar's file.
+sub addsubstvar {
+       my $package=shift;
+       my $substvar=shift;
+       my $deppackage=shift;
+       my $verinfo=shift;
+       my $remove=shift;
+
+       my $ext=pkgext($package);
+       my $substvarfile="debian/${ext}substvars";
+       my $str=$deppackage;
+       $str.=" ($verinfo)" if length $verinfo;
+
+       # Figure out what the line will look like, based on what's there
+       # now, and what we're to add or remove.
+       my $line="";
+       if (-e $substvarfile) {
+               my %items;
+               open(SUBSTVARS_IN, "$substvarfile") || die "read $substvarfile: $!";
+               while (<SUBSTVARS_IN>) {
+                       chomp;
+                       if (/^\Q$substvar\E=(.*)/) {
+                               %items = map { $_ => 1} split(", ", $1);
+                               
+                               last;
+                       }
+               }
+               close SUBSTVARS_IN;
+               if (! $remove) {
+                       $items{$str}=1;
+               }
+               else {
+                       delete $items{$str};
+               }
+               $line=join(", ", keys %items);
+       }
+       elsif (! $remove) {
+               $line=$str;
+       }
+
+       if (length $line) {
+                complex_doit("echo '${substvar}=$line' >> $substvarfile");
+       }
+}
+
 # Reads in the specified file, one word at a time, and returns an array of
 # the result. If a value is passed in as the second parameter, then glob
 # expansion is done in the directory specified by the parameter ("." is
diff --git a/autoscripts/postinst-init-invoke b/autoscripts/postinst-init-invoke
new file mode 100644 (file)
index 0000000..217a7c8
--- /dev/null
@@ -0,0 +1,4 @@
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+       update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+       invoke-rc.d #SCRIPT# start
+fi
diff --git a/autoscripts/postinst-init-norestart-invoke b/autoscripts/postinst-init-norestart-invoke
new file mode 100644 (file)
index 0000000..440e8c7
--- /dev/null
@@ -0,0 +1,8 @@
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+       update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+       if [ "$1" = "configure" ]; then
+               if [ -z "$2" -o "$2" = "<unknown>" ]; then
+                       invoke-rc.d #SCRIPT# start
+               fi
+       fi
+fi
diff --git a/autoscripts/postrm-init-invoke b/autoscripts/postrm-init-invoke
new file mode 100644 (file)
index 0000000..1c29298
--- /dev/null
@@ -0,0 +1,3 @@
+if [ "$1" = "purge" ] ; then
+       update-rc.d #SCRIPT# remove >/dev/null
+fi
diff --git a/autoscripts/prerm-init-invoke b/autoscripts/prerm-init-invoke
new file mode 100644 (file)
index 0000000..ced7aba
--- /dev/null
@@ -0,0 +1,3 @@
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+       invoke-rc.d #SCRIPT# stop
+fi
diff --git a/autoscripts/prerm-init-norestart-invoke b/autoscripts/prerm-init-norestart-invoke
new file mode 100644 (file)
index 0000000..f04d45c
--- /dev/null
@@ -0,0 +1,3 @@
+if [ -x "/etc/init.d/#SCRIPT#" -a "$1" = remove ]; then
+       invoke-rc.d #SCRIPT# stop
+fi
index 535d4772a415123903fa426bce02f2e98a91fbb1..df822163aaf48e8fd563be818756ed4bcf55960a 100644 (file)
@@ -182,6 +182,24 @@ the set command):
   system ($temp) / 256 == 0
        or die "Problem with debhelper scripts: $!";
 
+=head2 Automatic generation of miscellaneous dependencies.
+
+Some debhelper commands may make the generated package need to depend on
+some other packages. For example, if you use L<dh_installdebconf(1)>, you'r
+package will generally need to depend on debconf. Or if you use
+L<dh_installxfonts(1)>, your package will generally need to depend on a
+particular version of xutils. Keeping track of these miscellaneous
+dependencies can be annoying, so debhelper offers a way to automate it.
+All commands of this type, besides documenting what dependencies may be
+needed on their man pages, will automatically generate a substvar called
+${misc:Depends}. If you put that token into your debian/control file, it
+will be expanded to the dependencies debhelper figures you need. 
+
+This is entirely independent of the standard ${shlibs:Depends} generated by
+L<dh_makeshlibs(1)>, and the ${perl:Depends} generated by L<dh_perl(1)>.
+You can choose not to use any of these, if debhelper's guesses don't match
+reality.
+
 =head2 Package build directories
 
 By default, all debhelper programs assume that the temporary directory used
@@ -200,29 +218,36 @@ act on.
 From time to time, major non-backwards-compatible changes need to be made
 to debhelper, to keep it clean and well-designed as needs change and its
 author gains more experience. To prevent such major changes from breaking
-existing packages, the DH_COMPAT environment variable was introduced.
-DH_COMPAT may be set to a number, to determine which major revision of
-debhelper should be used. There are currently 3:
+existing packages, the concept of debhelper compatability levels was 
+introduced. You tell debhelper which compatability level it should use, and
+it modifies its behavior in various ways.
+
+You tell debhelper what compatability level to use by writing a number to
+debian/compat. For example, to turn on V3 mode:
+
+  % echo 3 > debian/compat
+
+These are the available compatablity levels:
 
 =over 4
 
 =item V1
 
-Setting DH_COMPAT=1 (or leaving it unset) causes debhelper to act in
-compatibility mode. It will use debian/tmp as the package tree
+This is the original debhelper compatability level, and so it is the default
+one. In this mode, debhelper will use debian/tmp as the package tree
 directory for the first binary package listed in the control file, while using
 debian/<package> for all other packages listed in the control file.
 This mode is deprecated.
 
 =item V2
 
-Setting DH_COMPAT=2 causes debhelper to consistently use debian/<package>
+In this mode, debhelper will consistently use debian/<package>
 as the package tree directory for every package that is built.
 
 =item V3
 
-This is the reccommended mode of operation.
-Setting DH_COMPAT=3 does everything V2 does, plus:
+This is the reccommended mode of operation. It does everything V2 does,
+plus:
 
 =over 8
 
@@ -244,7 +269,7 @@ Every file in etc/ is automatically flagged as a conffile by dh_installdeb.
 =item V4
 
 This mode is still under development, and its behavior may change at any
-time. Currently, setting DH_COMPAT=4 does everything V4 does, plus:
+time. Currently, it does everything V3 does, plus:
 
 =over 8
 
@@ -253,6 +278,11 @@ time. Currently, setting DH_COMPAT=4 does everything V4 does, plus:
 dh_makeshlibs -V will not include the debian part of the version number in
 the generated dependancy line in the shlibs file.
 
+=item -
+
+dh_installinit uses the new invoke-rc.d program in its generated maintainer
+scripts. (This may later be rolled back into V3).
+
 =back
 
 =back
@@ -297,7 +327,8 @@ that modifies files on the build system.
 
 =item DH_COMPAT
 
-Specifies what compatibility level debhelper should run at. See above.
+Temporarily specifies what compatibility level debhelper should run at,
+overriding any value in debian/compat.
 
 =item DH_NO_ACT
 
index 93653398d8f1e5a86bf4cb6a707de01eff81c5d9..2f482b0a929239d9695f962a41610b8ab3a66549 100644 (file)
@@ -1,3 +1,26 @@
+debhelper (3.4.4) unstable; urgency=low
+
+  * Introduced the debian/compat file. This is the new, preferred way to say
+    what debhelper compatability level your package uses. It has the big
+    advantage of being available to debhelper when you run it at the command
+    line, as well as in debian/rules.
+  * A new v4 feature: dh_installinit, in v4 mode, will use invoke-rc.d.
+    This is in v4 for testing, but I may well roll it back into v3 (and
+    earlier) once woody is released and I don't have to worry about breaking
+    things (and, presumably, once invoke-rc.d enters policy).
+  * Some debhelper commands will now build up a new substvars variable,
+    ${misc:Depends}, based on things they know your package needs to depend
+    on. For example, dh_installinit in v4 mode adds sysvinit (>= 2.80-1) to
+    that dep list, and dh_installxfonts adds a dep on xutils. This variable
+    should make it easier to keep track of what your package needs to depends
+    on, supplimenting the ${shlibs:Depends} and ${perl:Depends} substvars.
+    Hmm, this appears to be based loosely on an idea by Masato Taruishi
+    <taru@debian.org>, filtered through a long period of mulling it over.
+    Closes: #76352
+  * Use the addsubstvar function I wrote for the above in dh_perl too.
+
+ -- Joey Hess <joeyh@debian.org>  Sat, 26 Jan 2002 23:30:51 -0500
+
 debhelper (3.4.3) unstable; urgency=low
 
   * Improved dh_installxfonts some more:
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..00750ed
--- /dev/null
@@ -0,0 +1 @@
+3
index bf37bcab11cb1e37bb93f367e84a55ca14f8833b..363c8c81bc91f920dcc2b32e01b2c2aaa7d1d0fe 100755 (executable)
@@ -14,9 +14,6 @@ export PERL5LIB=.
 # be sure to use the new templates from this package.
 export DH_AUTOSCRIPTDIR=autoscripts
 
-# Use most recent compatability level.
-export DH_COMPAT=3
-
 # Figure out the `current debhelper version.
 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
 
index 289970d00161dbfbb8910dae7a128ed95bc379b6..69c66ddc15fbd536705302bf3812ff1a20e91c87 100755 (executable)
@@ -36,7 +36,7 @@ inserted. If the script does not exist, then a script is generated from
 the .debhelper file. The .debhelper files are created by other debhelper
 programs, such as L<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
+In V3 compatability mode and 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.
 
index 5833fbc77b67147deae4c08bbc148ade2cbb14c7..9dc13bbf5b9f21aff1d24971a6b8c2c7027ff341 100755 (executable)
@@ -25,7 +25,8 @@ that works.
 Files named debian/package.config and debian/package.templates are
 installed into the DEBIAN directory in the package build directory.
 
-Note that if you use debconf, your package probably needs to depend on it.
+Note that if you use debconf, your package probably needs to depend on it
+(it will be added to ${misc:Depends by this program).
 
 =head1 LOCALIZED TEMPLATE FILES
 
@@ -84,7 +85,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                }
        }
 
-       if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) {
+       if ($config ne '' || $templates ne '') {
+               # I'm going with debconf 0.5 because it was the first
+               # "modern" one.
+               addsubstvar($package, "misc:Depends", "debconf", ">= 0.5");
+       }
+       else {
+               addsubstvar($package, "misc:Depends", "debconf", ">= 0.5", 1); # remove
+       }
+       
+       if (($config ne '' || $templates ne '') && ! $dh{NOSCRIPTS}) {
                autoscript($package,"postrm","postrm-debconf");
        }
 }
index d8ab80b8b9db6db591ddbaa5b2544ebc4e37c85a..8af1751e7c0a059ca6e7bae338b783be91e40834 100755 (executable)
@@ -30,6 +30,12 @@ If a file named debian/package.default exists, then it is installed into
 etc/default/package in the package build directory, with "package" replaced
 by the package name.
 
+Historically this program generates postrm and prerm commands that run the
+init scripts by hand. In V4 mode, it uses the invoke-rc.d program instead.
+See L<debhelper(1)> for details about V4 mode. If you decide to use this, you
+should make your package depend on sysvinit (>= 2.80-1) (this dependency is
+added to ${misc:Depends} by this program in V4 mode).
+
 =head1 OPTIONS
 
 =over 4
@@ -133,25 +139,40 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        $params="defaults";
                }
 
+               my $substvaradded=0;
                if (! $dh{NOSCRIPTS}) {
-                       # -r on the command line sets R_FLAG. If it's set, there
-                       # is no restart on upgrade.
+                       # In v4 mode, use invoke-rc.d versions of the
+                       # autoscripts; prior to that use the old,
+                       # manual-invoking versions.
+                       my $tailstr="";
+                       if (! compat(3)) {
+                               $tailstr="-invoke";
+                               addsubstvar($package, "misc:Depends", "sysvinit", ">= 2.80-1");
+                               $substvaradded=1;
+                       }
+                       # -r on the command line sets R_FLAG. If it's set,
+                       # there  is no restart on upgrade.
                        if ($dh{R_FLAG}) {
-                               autoscript($package,"postinst", "postinst-init-norestart",
-                                       "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
-                               autoscript($package,"postrm","postrm-init",
+                               autoscript($package,"postinst", "postinst-init-norestart$tailstr",
                                        "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
-                               autoscript($package,"prerm","prerm-init-norestart",
+                               autoscript($package,"prerm","prerm-init-norestart$tailstr",
                                        "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
                        }
                        else {
-                               autoscript($package,"postinst","postinst-init",
+                               autoscript($package,"postinst","postinst-init$tailstr",
                                        "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
-                               autoscript($package,"postrm","postrm-init",
-                                       "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
-                               autoscript($package,"prerm","prerm-init",
+                               autoscript($package,"prerm","prerm-init$tailstr",
                                        "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
                        }
+                       # This script just removes the links, so it's the
+                       # same for all varients.
+                       autoscript($package,"postrm","postrm-init",
+                               "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+               }
+
+               if (! $substvaradded) {
+                       # Remove it, for idemotency's sake.
+                       addsubstvar($package, "misc:Depends", "sysvinit", ">= 2.80-1", 1);
                }
        }
 }
index fb7f7feea808ab4d4a31517c30c2c9edc09cd827..5159868045581b61a3f4a6a1809796ae54240de0 100755 (executable)
@@ -26,7 +26,8 @@ install them into the correct location under etc/X11/fonts in your package
 build directory.
 
 Your package should should depend on xutils (>= 4.0.3) so that the
-update-fonts-* commands are available.
+update-fonts-* commands are available. (This program adds that dependency to
+${misc:Depends}.)
 
 This programt automatically generates the postinst and postrm commands needed
 to register X fonts.  See L<dh_installdeb(1)> for an explanation of how this
@@ -70,6 +71,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        "s:#CMDS#:".join("\n", map { "\t$_" } @cmds).":;");
                autoscript($package, "postrm", "postrm-xfonts",
                        "s:#CMDS#:".join("\n", @cmds).":;");
+
+               addsubstvar($package, "misc:Depends", "xutils", ">= 4.0.3");
+       }
+       else {
+               # remove
+               addsubstvar($package, "misc:Depends", "xutils", ">= 4.0.3", 1);
        }
 }
 
index 478c861b001c297833654edbbd304dfe0a7c238b..3d63991c81fe9de271dea4667cc45e1cabf2cb6f 100755 (executable)
@@ -19,8 +19,7 @@ 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) to any packages which it finds shared
-libraries in.
+V3 mode and above only) to any packages which it finds shared libraries in.
 
 =head1 OPTIONS
 
diff --git a/dh_perl b/dh_perl
index facad8d60b7d5c559cc6b427fea6842189349fe4..a40c6fd563a23e9a81cbb6e7f21807e9096c28ed 100755 (executable)
--- a/dh_perl
+++ b/dh_perl
@@ -18,7 +18,7 @@ B<dh_perl> [S<I<debhelper options>>] [B<-d>] [S<I<library dirs ...>>]
 =head1 DESCRIPTION
 
 dh_perl is a debhelper program that is responsible for generating
-the perl:Depends substitutions and adding them to substvars files.
+the ${perl:Depends} substitutions and adding them to substvars files.
 
 The program will look at perl scripts and modules in your package,
 and will use this information to generate a dependency.
@@ -88,13 +88,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp = tmpdir($package);
        my $ext = pkgext($package);
 
-       # For idempotency, remove anything this program might have
-       # previously added to the substvars file.
-       if (-e "debian/${ext}substvars") {
-               complex_doit("grep -v ^perl:Depends= debian/${ext}substvars > debian/${ext}substvars.new || true");
-               doit("mv", "debian/${ext}substvars.new","debian/${ext}substvars");
-       }
-
+       delsubstvar($package, "perl:Depends"); # for idempotency
+       
        # Check also for alternate locations given on the command line
        my @dirs = grep -d, map "$tmp/$_", $vendorlib, $vendorarch, @ARGV;
 
@@ -118,25 +113,24 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        }, $tmp;
 
        if ($deps) {
-               my $perl_depends = $perl;
+               my $version="";
                if ($deps & XS_MODULE or $dh{V_FLAG_SET}) {
                        ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m
                                unless $version;
-                       $perl_depends .= " (>= $version)";
+                       $version = ">= $version";
                }
                elsif ($deps & PM_MODULE) {
-                       $perl_depends .= " (>= $min_version)";
+                       $version = ">= $min_version";
                }
+               
+               # no need to depend on an un-versioned perl-base -- it's
+               # essential
+               addsubstvar($package, "perl:Depends", $perl, $version)
+                       unless $perl eq 'perl-base' && ! length($version);
 
                # add perlapi-<ver> for XS modules
-               $perl_depends .= ", perlapi-$Config{version}"
+               addsubstvar($package, "perl:Depends", "perlapi-$Config{version}")
                        if $deps & XS_MODULE;
-
-               # don't need to depend on an un-versioned perl-base, it's
-               # essential
-               unless ($perl_depends eq 'perl-base') {
-                       complex_doit("echo 'perl:Depends=$perl_depends' >> debian/${ext}substvars");
-               }
        }
 }
 
index 7a78711b2a4c29e74b6af42c5d9a67fb29d3e72c..b12a1a262a302e9c4cbfb937983148ec5ba5098c 100644 (file)
@@ -156,34 +156,34 @@ Functions:
 
 Dh_Lib.pm also contains a number of functions you may find useful.
 
-doit()
+doit(@command)
        Pass this function an array that is a 
        shell command. It will run the command (unless $dh{NO_ACT} is set), and
        if $dh{VERBOSE} is set, it will also output the command to stdout. You
        should use this function for almost all commands your program performs
        that manipulate files in the package build directories.
-complex_doit()
+complex_doit($command)
        Pass this function a string that is a shell command, it will run it
        similarly to how doit() does. You can pass more complicated commands 
        to this (ie, commands involving piping redirection), however, you 
        have to worry about things like escaping shell metacharacters.
-verbose_print()
+verbose_print($message)
        Pass this command a string, and it will echo it if $dh{VERBOSE} is set.
-error()
+error($errormsg)
        Pass this command a string, it will output it to standard error and
        exit.
-warning()
+warning($message)
        Pass this command a string, and it will output it to standard error
        as a warning message.
-tmpdir()
+tmpdir($dir)
        Pass this command the name of a binary package, it will return the
        name of the tmp directory that will be used as this package's
        package build directory. Typically, this will be "debian/package".
-compat()
+compat($num)
        Pass this command a number, and if the current compatibility level
-       equals that number, it will return true. Looks at DH_COMPAT to get
-       the compatibility level.
-pkgfile()
+       is less than or equal to that number, it will return true.
+       Looks at DH_COMPAT to get the compatibility level.
+pkgfile($package, $basename)
        Pass this command the name of a binary package, and the base name of a
        file, and it will return the actual filename to use. This is used
        for allowing debhelper programs to have configuration files in the
@@ -191,17 +191,17 @@ pkgfile()
        package. The convention is that the files are named
        debian/package.filename, and debian/filename is also allowable for
        the $dh{MAINPACKAGE}. If the file does not exist, nothing is returned.
-pkgext()
+pkgext($package)
        Pass this command the name of a binary package, and it will return
        the name to prefix to files in debian/ for this package. For the
        $dh{MAINPACKAGE}, it returns nothing (there is no prefix), for the other
        packages, it returns "package.".
-isnative()
+isnative($package)
        Pass this command the name of a package, it returns 1 if the package
        is a native debian package.
        As a side effect, $dh{VERSION} is set to the version number of the
        package.
-autoscript()
+autoscript($package, $scriptname, $snippetname, $sedcommands)
        Pass parameters:
         - binary package to be affected
         - script to add to
@@ -210,10 +210,26 @@ autoscript()
           (optional)
        This command automatically adds shell script snippets to a debian
        maintainer script (like the postinst or prerm).
-dirname()
+dirname($pathname)
        Return directory part of pathname.
-basename()
+basename($pathname)
        Return base of pathname,
+addsubstvar($package, $substvar, $deppackage, $verinfo, $remove)
+       This function adds a dependency on some package to the specified
+       substvar in a package's substvar's file. It needs all these
+       parameters:
+       - binary package that gets the item
+       - name of the substvar to add the item to
+       - the package that will be depended on
+       - version info for the package (optional) (ie: ">= 1.1")
+       - if this last parameter is passed, the thing that would be added
+         is removed instead. This can be useful to ensure that a debhelper
+         command is idempotent. Note that without this parameter, if you
+         call the function twice with the same values it will only add one
+         item to the substvars file.
+delsubstvar($package, $substvar)
+       This function removes the entire line for the substvar from the
+       package's shlibs file.
 
 -- Joey Hess <joeyh@debian.org>
 
index 2b1e3030a1feec131069e84560d902b15c6ae33d..548a394958c1a2e3e3067330a12c227bc848c52d 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -58,10 +58,7 @@ Wishlist items:
 
 v4:
 
-These items are part of v4 already:
-
-* dhmakeshlibs -V omits the debian part of the version number from the
-  generated dependancy in the shlibs file
+See debhelper's man page for what's implemented so far.
 
 These items are planned:
 
index fc80fe62d8bbe463fb7afd22db7e52781ebc2f2e..1e57eab5e2dfc11fe64405e8d8fa6fedbb769f04 100755 (executable)
@@ -5,9 +5,6 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# This is the debhelper compatibility version to use.
-export DH_COMPAT=3
-
 build: build-stamp
 build-stamp:
        dh_testdir
index 603c79a9f235e8050f14b117c461b44bf2409fb9..aa5a970137cfc1fd2a34629336b920df3fddd21b 100755 (executable)
@@ -7,9 +7,6 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# This is the debhelper compatibility version to use.
-export DH_COMPAT=3
-
 build: build-stamp
 build-stamp:
        dh_testdir
index 9e7f58b42eb38eb58be1e1a7d8983a23dd076de5..8e1e89279f85201fdefb0e1d62c4fe8d93291575 100755 (executable)
@@ -9,9 +9,6 @@
 # Uncomment this to turn on verbose mode. 
 #export DH_VERBOSE=1
 
-# This is the debhelper compatibility version to use.
-export DH_COMPAT=3
-
 build: build-stamp
 build-stamp:
        dh_testdir
index ca66c154496215ac7d898c44dba86f3b3f6af9b5..4434b0c01a1833b9deec3dd0a6aab515c96df3d5 100755 (executable)
@@ -8,9 +8,6 @@
 # Uncomment this to turn on verbose mode. 
 #export DH_VERBOSE=1
 
-# This is the debhelper compatibility version to use.
-export DH_COMPAT=3
-
 # This has to be exported to make some magic below work.
 export DH_OPTIONS