summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dh_Getopt.pm173
-rw-r--r--Dh_Lib.pm371
-rw-r--r--autoscripts/postinst-doc-base2
-rw-r--r--autoscripts/postinst-emacsen5
-rw-r--r--autoscripts/postinst-info4
-rw-r--r--autoscripts/postinst-info-nosection4
-rw-r--r--autoscripts/postinst-init10
-rw-r--r--autoscripts/postinst-init-norestart6
-rw-r--r--autoscripts/postinst-init-nostart3
-rw-r--r--autoscripts/postinst-makeshlibs3
-rw-r--r--autoscripts/postinst-menu2
-rw-r--r--autoscripts/postinst-menu-method2
-rw-r--r--autoscripts/postinst-mime2
-rw-r--r--autoscripts/postinst-modules5
-rw-r--r--autoscripts/postinst-python8
-rw-r--r--autoscripts/postinst-scrollkeeper3
-rw-r--r--autoscripts/postinst-sgmlcatalog7
-rw-r--r--autoscripts/postinst-suid12
-rw-r--r--autoscripts/postinst-usrlocal16
-rw-r--r--autoscripts/postinst-wm5
-rw-r--r--autoscripts/postinst-xaw6
-rw-r--r--autoscripts/postinst-xfonts3
-rw-r--r--autoscripts/postrm-debconf4
-rw-r--r--autoscripts/postrm-init2
-rw-r--r--autoscripts/postrm-makeshlibs3
-rw-r--r--autoscripts/postrm-menu1
-rw-r--r--autoscripts/postrm-menu-method4
-rw-r--r--autoscripts/postrm-mime1
-rw-r--r--autoscripts/postrm-modules3
-rw-r--r--autoscripts/postrm-scrollkeeper3
-rw-r--r--autoscripts/postrm-sgmlcatalog3
-rw-r--r--autoscripts/postrm-suid3
-rw-r--r--autoscripts/postrm-wm4
-rw-r--r--autoscripts/postrm-xaw3
-rw-r--r--autoscripts/postrm-xfonts3
-rw-r--r--autoscripts/prerm-doc-base3
-rw-r--r--autoscripts/prerm-emacsen4
-rw-r--r--autoscripts/prerm-init8
-rw-r--r--autoscripts/prerm-init-norestart7
-rw-r--r--autoscripts/prerm-python5
-rw-r--r--autoscripts/prerm-sgmlcatalog3
-rw-r--r--autoscripts/prerm-usrlocal7
-rw-r--r--autoscripts/prerm-wm3
-rw-r--r--autoscripts/prerm-xaw4
-rw-r--r--debhelper.1152
-rw-r--r--debian/control16
-rw-r--r--debian/copyright24
-rw-r--r--debian/subtsvars1
-rwxr-xr-xdh_builddeb79
-rw-r--r--dh_builddeb.128
-rwxr-xr-xdh_clean111
-rw-r--r--dh_clean.141
-rwxr-xr-xdh_compress191
-rw-r--r--dh_compress.173
-rw-r--r--dh_debstd.175
-rw-r--r--dh_du.116
-rwxr-xr-xdh_fixperms105
-rw-r--r--dh_fixperms.138
-rwxr-xr-xdh_gencontrol80
-rw-r--r--dh_gencontrol.136
-rwxr-xr-xdh_installchangelogs143
-rw-r--r--dh_installchangelogs.152
-rwxr-xr-xdh_installcron58
-rw-r--r--dh_installcron.130
-rwxr-xr-xdh_installdeb117
-rw-r--r--dh_installdeb.150
-rw-r--r--dh_installdebfiles.133
-rwxr-xr-xdh_installdirs97
-rw-r--r--dh_installdirs.146
-rwxr-xr-xdh_installdocs209
-rw-r--r--dh_installdocs.180
-rwxr-xr-xdh_installemacsen118
-rw-r--r--dh_installemacsen.151
-rwxr-xr-xdh_installexamples110
-rw-r--r--dh_installexamples.148
-rwxr-xr-xdh_installinfo111
-rw-r--r--dh_installinfo.154
-rwxr-xr-xdh_installinit181
-rw-r--r--dh_installinit.162
-rwxr-xr-xdh_installmanpages206
-rw-r--r--dh_installmanpages.159
-rwxr-xr-xdh_installmenu91
-rw-r--r--dh_installmenu.145
-rwxr-xr-xdh_installmime75
-rw-r--r--dh_installmime.138
-rwxr-xr-xdh_installmodules94
-rw-r--r--dh_installmodules.135
-rwxr-xr-xdh_installpam50
-rw-r--r--dh_installpam.130
-rwxr-xr-xdh_installwm104
-rw-r--r--dh_installwm.142
-rwxr-xr-xdh_installxaw65
-rw-r--r--dh_installxaw.140
-rwxr-xr-xdh_link181
-rw-r--r--dh_link.173
-rwxr-xr-xdh_listpackages38
-rw-r--r--dh_listpackages.125
-rwxr-xr-xdh_makeshlibs183
-rw-r--r--dh_makeshlibs.163
-rwxr-xr-xdh_md5sums95
-rw-r--r--dh_md5sums.136
-rwxr-xr-xdh_movefiles170
-rw-r--r--dh_movefiles.149
-rwxr-xr-xdh_perl249
-rw-r--r--dh_perl.160
-rwxr-xr-xdh_shlibdeps145
-rw-r--r--dh_shlibdeps.137
-rwxr-xr-xdh_strip154
-rw-r--r--dh_strip.134
-rwxr-xr-xdh_suidregister127
-rw-r--r--dh_suidregister.162
-rwxr-xr-xdh_testdir53
-rw-r--r--dh_testdir.128
-rwxr-xr-xdh_testroot36
-rw-r--r--dh_testroot.125
-rwxr-xr-xdh_testversion84
-rw-r--r--dh_testversion.151
-rwxr-xr-xdh_undocumented38
-rw-r--r--dh_undocumented.162
-rw-r--r--doc/PROGRAMMING111
-rw-r--r--doc/README59
-rw-r--r--doc/TODO96
-rw-r--r--doc/from-debstd63
-rw-r--r--doc/v264
-rwxr-xr-xexamples/rules41
-rwxr-xr-xexamples/rules.indep42
-rwxr-xr-xexamples/rules.multi63
-rwxr-xr-xexamples/rules.multi295
-rw-r--r--t/dh_link12
129 files changed, 3095 insertions, 4132 deletions
diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm
new file mode 100644
index 00000000..0c28500d
--- /dev/null
+++ b/Dh_Getopt.pm
@@ -0,0 +1,173 @@
+#!/usr/bin/perl -w
+#
+# Debhelper option processing library.
+#
+# Joey Hess GPL copyright 1998.
+
+package Dh_Getopt;
+use strict;
+
+use Dh_Lib;
+use Getopt::Long;
+use Exporter;
+#use vars qw{@ISA @EXPORT};
+#@ISA=qw(Exporter);
+#@EXPORT=qw(&aparseopts); # FIXME: for some reason, this doesn't work.
+
+my (%options, %exclude_package);
+
+# Passed an option name and an option value, adds packages to the list
+# of packages. We need this so the list will be built up in the right
+# order.
+sub AddPackage { my($option,$value)=@_;
+ if ($option eq 'i' or $option eq 'indep') {
+ push @{$options{DOPACKAGES}}, GetPackages('indep');
+ $options{DOINDEP}=1;
+ }
+ elsif ($option eq 'a' or $option eq 'arch') {
+ push @{$options{DOPACKAGES}}, GetPackages('arch');
+ $options{DOARCH}=1;
+ }
+ elsif ($option eq 'p' or $option eq 'package') {
+ push @{$options{DOPACKAGES}}, $value;
+ }
+ elsif ($option eq 's' or $option eq 'same-arch') {
+ push @{$options{DOPACKAGES}}, GetPackages('same');
+ $options{DOSAME}=1;
+ }
+ else {
+ error("bad option $option - should never happen!\n");
+ }
+}
+
+# Add a package to a list of packages that should not be acted on.
+sub ExcludePackage { my($option,$value)=@_;
+ $exclude_package{$value}=1;
+}
+
+# Add another item to the exclude list.
+sub AddExclude { my($option,$value)=@_;
+ push @{$options{EXCLUDE}},$value;
+}
+
+# Parse options and return a hash of the values.
+sub parseopts {
+ undef %options;
+
+ my $ret=GetOptions(
+ "v" => \$options{VERBOSE},
+ "verbose" => \$options{VERBOSE},
+
+ "i" => \&AddPackage,
+ "indep" => \&AddPackage,
+
+ "a" => \&AddPackage,
+ "arch" => \&AddPackage,
+
+ "p=s" => \&AddPackage,
+ "package=s" => \&AddPackage,
+
+ "s" => \&AddPackage,
+ "same-arch" => \&AddPackage,
+
+ "N=s" => \&ExcludePackage,
+ "no-package=s" => \&ExcludePackage,
+
+ "n" => \$options{NOSCRIPTS},
+ "noscripts" => \$options{NOSCRIPTS},
+
+ "x" => \$options{INCLUDE_CONFFILES}, # is -x for some unknown historical reason..
+ "include-conffiles" => \$options{INCLUDE_CONFFILES},
+
+ "X=s" => \&AddExclude,
+ "exclude=s" => \&AddExclude,
+
+ "d" => \$options{D_FLAG},
+ "remove-d" => \$options{D_FLAG},
+ "dirs-only" => \$options{D_FLAG},
+
+ "r" => \$options{R_FLAG},
+ "no-restart-on-upgrade" => \$options{R_FLAG},
+
+ "k" => \$options{K_FLAG},
+ "keep" => \$options{K_FLAG},
+
+ "P=s" => \$options{TMPDIR},
+ "tmpdir=s" => \$options{TMPDIR},
+
+ "u=s", => \$options{U_PARAMS},
+ "update-rcd-params=s", => \$options{U_PARAMS},
+ "dpkg-shlibdeps-params=s", => \$options{U_PARAMS},
+ "dpkg-gencontrol-params=s", => \$options{U_PARAMS},
+
+ "m=s", => \$options{M_PARAMS},
+ "major=s" => \$options{M_PARAMS},
+
+ "V:s", => \$options{V_FLAG},
+ "version-info:s" => \$options{V_FLAG},
+
+ "A" => \$options{PARAMS_ALL},
+ "all" => \$options{PARAMS_ALL},
+
+ "no-act" => \$options{NO_ACT},
+
+ "init-script=s" => \$options{INIT_SCRIPT},
+
+ "sourcedir=s" => \$options{SOURCEDIR},
+
+ "destdir=s" => \$options{DESTDIR},
+ );
+
+ if (!$ret) {
+ error("unknown option; aborting");
+ }
+
+ # Check to see if -V was specified. If so, but no parameters were
+ # passed, the variable will be defined but empty.
+ if (defined($options{V_FLAG})) {
+ $options{V_FLAG_SET}=1;
+ }
+
+ # If we have not been given any packages to act on, assume they
+ # want us to act on them all. Note we have to do this before excluding
+ # packages out, below.
+ if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
+ if ($options{DOINDEP} || $options{DOARCH} || $options{DOSAME}) {
+ # User specified that all arch (in)dep package be
+ # built, and there are none of that type.
+ error("I have no package to build");
+ }
+ push @{$options{DOPACKAGES}},GetPackages();
+ }
+
+ # Remove excluded packages from the list of packages to act on.
+ my @package_list;
+ my $package;
+ foreach $package (@{$options{DOPACKAGES}}) {
+ if (! $exclude_package{$package}) {
+ push @package_list, $package;
+ }
+ }
+ @{$options{DOPACKAGES}}=@package_list;
+
+ # Generate EXCLUDE_FIND.
+ $options{EXCLUDE_FIND}='';
+ foreach (@{$options{EXCLUDE}}) {
+ $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or ";
+ }
+ $options{EXCLUDE_FIND}=~s/ -or $//;
+
+ # If there are no packages to act on now, it's an error.
+ if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
+ error("I have no package to build");
+ }
+
+ return %options;
+}
+
+sub import {
+ # Enable bundling of short command line options.
+ Getopt::Long::config("bundling");
+}
+
+1
diff --git a/Dh_Lib.pm b/Dh_Lib.pm
new file mode 100644
index 00000000..e74e8ccb
--- /dev/null
+++ b/Dh_Lib.pm
@@ -0,0 +1,371 @@
+#!/usr/bin/perl -w
+#
+# Library functions for debhelper programs, perl version.
+#
+# Joey Hess, GPL copyright 1997, 1998.
+
+package Dh_Lib;
+use strict;
+
+use Exporter;
+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
+ &xargs
+ %dh);
+
+my $max_compat=2;
+
+sub init {
+ # If DH_OPTIONS is set, prepend it @ARGV.
+ if (defined($ENV{DH_OPTIONS})) {
+ unshift @ARGV,split(/\s+/,$ENV{DH_OPTIONS});
+ }
+
+ # Check to see if an argument on the command line starts with a dash.
+ # if so, we need to pass this off to the resource intensive
+ # Getopt::Long, which I'd prefer to avoid loading at all if possible.
+ my $parseopt=undef;
+ my $arg;
+ foreach $arg (@ARGV) {
+ if ($arg=~m/^-/) {
+ $parseopt=1;
+ last;
+ }
+ }
+ if ($parseopt) {
+ eval "use Dh_Getopt";
+ error($!) if $@;
+ %dh=Dh_Getopt::parseopts();
+ }
+
+ # Check to see if DH_VERBOSE environment variable was set, if so,
+ # make sure verbose is on.
+ if (defined $ENV{DH_VERBOSE} && $ENV{DH_VERBOSE} ne "") {
+ $dh{VERBOSE}=1;
+ }
+
+ # Check to see if DH_NO_ACT environment variable was set, if so,
+ # make sure no act mode is on.
+ if (defined $ENV{DH_NO_ACT} && $ENV{DH_NO_ACT} ne "") {
+ $dh{NO_ACT}=1;
+ }
+
+ # Get the name of the main binary package (first one listed in
+ # debian/control).
+ my @allpackages=GetPackages();
+ $dh{MAINPACKAGE}=$allpackages[0];
+
+ # Check if packages to build have been specified, if not, fall back to
+ # the default, doing them all.
+ if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) {
+ if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) {
+ # User specified that all arch (in)dep package be
+ # built, and there are none of that type.
+ error("I have no package to act on");
+ }
+ push @{$dh{DOPACKAGES}},@allpackages;
+ }
+
+ # Check to see if -P was specified. If so, we can only act on a single
+ # package.
+ if ($dh{TMPDIR} && $#{$dh{DOPACKAGES}} > 0) {
+ error("-P was specified, but multiple packages would be acted on (".join(",",@{$dh{DOPACKAGES}}).").");
+ }
+
+ # Figure out which package is the first one we were instructed to build.
+ # This package gets special treatement: files and directories specified on
+ # the command line may affect it.
+ $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0];
+
+ # Split the U_PARAMS up into an array.
+ my $u=$dh{U_PARAMS};
+ undef $dh{U_PARAMS};
+ if (defined $u) {
+ push @{$dh{U_PARAMS}}, split(/\s+/,$u);
+ }
+}
+
+# Escapes out shell metacharacters in a word of shell script.
+sub escape_shell { my $word=shift;
+ # This list is from _Unix in a Nutshell_. (except '#')
+ $word=~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g;
+ return $word;
+}
+
+# Run a command, and display the command to stdout if verbose mode is on.
+# All commands that modifiy files in $TMP should be ran via this
+# function.
+#
+# Note that this cannot handle complex commands, especially anything
+# involving redirection. Use complex_doit instead.
+sub doit {
+ verbose_print(join(" ",map { escape_shell($_) } @_));
+
+ if (! $dh{NO_ACT}) {
+ system(@_) == 0
+ || error("command returned error code");
+
+ }
+}
+
+# Run a command and display the command to stdout if verbose mode is on.
+# Use doit() if you can, instead of this function, because this function
+# forks a shell. However, this function can handle more complicated stuff
+# like redirection.
+sub complex_doit {
+ verbose_print(join(" ",@_));
+
+ if (! $dh{NO_ACT}) {
+ # The join makes system get a scalar so it forks off a shell.
+ system(join(" ",@_)) == 0
+ || error("command returned error code");
+ }
+}
+
+# Run a command that may have a huge number of arguments, like xargs does.
+# Pass in a reference to an array containing the arguments, and then other
+# parameters that are the command and any parameters that should be passed to
+# it each time.
+sub xargs {
+ my $args=shift;
+
+ # The kernel can accept command lines up to 20k worth of characters.
+ my $command_max=20000;
+
+ # Figure out length of static portion of command.
+ my $static_length=0;
+ foreach (@_) {
+ $static_length+=length($_)+1;
+ }
+
+ my @collect=();
+ my $length=$static_length;
+ foreach (@$args) {
+ if (length($_) + 1 + $static_length > $command_max) {
+ error("This command is greater than the maximum command size allowed by the kernel, and cannot be split up further. What on earth are you doing? \"@_ $_\"");
+ }
+ $length+=length($_) + 1;
+ if ($length < $command_max) {
+ push @collect, $_;
+ }
+ else {
+ doit(@_,@collect) if $#collect > -1;
+ @collect=();
+ $length=$static_length;
+ }
+ }
+ doit(@_,@collect) if $#collect > -1;
+}
+
+# Print something if the verbose flag is on.
+sub verbose_print { my $message=shift;
+ if ($dh{VERBOSE}) {
+ print "\t$message\n";
+ }
+}
+
+# Output an error message and exit.
+sub error { my $message=shift;
+ warning($message);
+ exit 1;
+}
+
+# Output a warning.
+sub warning { my $message=shift;
+ print STDERR basename($0).": $message\n";
+}
+
+# Returns the basename of the argument passed to it.
+sub basename { my $fn=shift;
+ $fn=~s:^.*/(.*?)$:$1:;
+ return $fn;
+}
+
+# Returns the directory name of the argument passed to it.
+sub dirname { my $fn=shift;
+ $fn=~s:^(.*)/.*?$:$1:;
+ return $fn;
+}
+
+# Pass in a number, will return true iff the current compatability level
+# is equal to that number.
+sub compat {
+ my $num=shift;
+
+ my $c=1;
+ if (defined $ENV{DH_COMPAT}) {
+ $c=$ENV{DH_COMPAT};
+ }
+
+ if ($c > $max_compat) {
+ error("Sorry, but $max_compat is the highest compatability level of debhelper currently supported.");
+ }
+
+ return ($c == $num);
+}
+
+# Pass it a name of a binary package, it returns the name of the tmp dir to
+# use, for that package.
+sub tmpdir { my $package=shift;
+ if ($dh{TMPDIR}) {
+ return $dh{TMPDIR};
+ }
+ elsif (compat(1) && $package eq $dh{MAINPACKAGE}) {
+ # This is for back-compatability with the debian/tmp tradition.
+ return "debian/tmp";
+ }
+ else {
+ return "debian/$package";
+ }
+}
+
+# Pass this the name of a binary package, and the name of the file wanted
+# for the package, and it will return the actual filename to use. For
+# example if the package is foo, and the file is somefile, it will look for
+# debian/somefile, and if found return that, otherwise, if the package is
+# the main package, it will look for debian/foo, and if found, return that.
+# Failing that, it will return nothing.
+sub pkgfile { my $package=shift; my $filename=shift;
+ if (-f "debian/$package.$filename") {
+ return "debian/$package.$filename";
+ }
+ elsif ($package eq $dh{MAINPACKAGE} && -f "debian/$filename") {
+ return "debian/$filename";
+ }
+ return "";
+}
+
+# Pass it a name of a binary package, it returns the name to prefix to files
+# in debian for this package.
+sub pkgext { my $package=shift;
+ if ($package ne $dh{MAINPACKAGE}) {
+ return "$package.";
+ }
+ return "";
+}
+
+# Returns 1 if the package is a native debian package, null otherwise.
+# As a side effect, sets $dh{VERSION} to the version of this package.
+{
+ # Caches return code so it only needs to run dpkg-parsechangelog once.
+ my %isnative_cache;
+
+ sub isnative { my $package=shift;
+ if (! defined $isnative_cache{$package}) {
+ # Make sure we look at the correct changelog.
+ my $isnative_changelog=pkgfile($package,"changelog");
+ if (! $isnative_changelog) {
+ $isnative_changelog="debian/changelog";
+ }
+
+ # Get the package version.
+ my $version=`dpkg-parsechangelog -l$isnative_changelog`;
+ ($dh{VERSION})=$version=~m/Version: (.*)/m;
+
+ # Is this a native Debian package?
+ if ($dh{VERSION}=~m/.*-/) {
+ $isnative_cache{$package}=0;
+ }
+ else {
+ $isnative_cache{$package}=1;
+ }
+ }
+
+ return $isnative_cache{$package};
+ }
+}
+
+# Automatically add a shell script snippet to a debian script.
+# Only works if the script has #DEBHELPER# in it.
+#
+# Parameters:
+# 1: package
+# 2: script to add to
+# 3: filename of snippet
+# 4: sed to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/
+sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $sed=shift || "";
+ # This is the file we will append to.
+ my $outfile="debian/".pkgext($package)."$script.debhelper";
+
+ # Figure out what shell script snippet to use.
+ my $infile;
+ if (defined($ENV{DH_AUTOSCRIPTDIR}) &&
+ -e "$ENV{DH_AUTOSCRIPTDIR}/$filename") {
+ $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename";
+ }
+ else {
+ if (-e "/usr/share/debhelper/autoscripts/$filename") {
+ $infile="/usr/share/debhelper/autoscripts/$filename";
+ }
+ else {
+ error("/usr/share/debhelper/autoscripts/$filename does not exist");
+ }
+ }
+
+ # TODO: do this in perl, perhaps?
+ complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile");
+ complex_doit("sed \"$sed\" $infile >> $outfile");
+ complex_doit("echo '# End automatically added section' >> $outfile");
+}
+
+# Reads in the specified file, one word at a time, and returns an array of
+# the result.
+sub filearray { my $file=shift;
+ my @ret;
+ open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1");
+ while (<DH_FARRAY_IN>) {
+ push @ret,split(' ',$_);
+ }
+ close DH_FARRAY_IN;
+
+ return @ret;
+}
+
+# Returns a list of packages in the control file.
+# Must pass "arch" or "indep" or "same" to specify arch-dependant or
+# -independant or same arch packages. If nothing is specified, returns all
+# packages.
+sub GetPackages { my $type=shift;
+ $type="" if ! defined $type;
+
+ # Look up the build arch if we need to.
+ my$buildarch='';
+ if ($type eq 'same') {
+ $buildarch=`dpkg --print-architecture` || error($!);
+ chomp $buildarch;
+ }
+
+ my $package="";
+ my $arch="";
+ my @list=();
+ open (CONTROL,"<debian/control") ||
+ error("cannot read debian/control: $!\n");
+ while (<CONTROL>) {
+ chomp;
+ s/\s+$//;
+ if (/^Package:\s+(.*)/) {
+ $package=$1;
+ }
+ if (/^Architecture:\s+(.*)/) {
+ $arch=$1;
+ }
+ if (!$_ or eof) { # end of stanza.
+ if ($package &&
+ (($type eq 'indep' && $arch eq 'all') ||
+ ($type eq 'arch' && $arch ne 'all') ||
+ ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) ||
+ ! $type)) {
+ push @list, $package;
+ $package="";
+ $arch="";
+ }
+ }
+ }
+ close CONTROL;
+
+ return @list;
+}
+
+1
diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base
index 39265721..c3653bed 100644
--- a/autoscripts/postinst-doc-base
+++ b/autoscripts/postinst-doc-base
@@ -1,3 +1,3 @@
-if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
+if command -v install-docs >/dev/null 2>&1; then
install-docs -i /usr/share/doc-base/#DOC-ID#
fi
diff --git a/autoscripts/postinst-emacsen b/autoscripts/postinst-emacsen
index f80e1dbd..45f1deec 100644
--- a/autoscripts/postinst-emacsen
+++ b/autoscripts/postinst-emacsen
@@ -1,4 +1 @@
-if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]
-then
- /usr/lib/emacsen-common/emacs-package-install #PACKAGE#
-fi
+/usr/lib/emacsen-common/emacs-package-install #PACKAGE#
diff --git a/autoscripts/postinst-info b/autoscripts/postinst-info
index 71ffa19b..59881a19 100644
--- a/autoscripts/postinst-info
+++ b/autoscripts/postinst-info
@@ -1,3 +1 @@
-if [ "$1" = "configure" ]; then
- install-info --quiet --section "#SECTION#" "#SECTION#" #FILE#
-fi
+install-info --quiet --section "#SECTION#" "#SECTION#" #FILE#
diff --git a/autoscripts/postinst-info-nosection b/autoscripts/postinst-info-nosection
index ffef8636..cba27d27 100644
--- a/autoscripts/postinst-info-nosection
+++ b/autoscripts/postinst-info-nosection
@@ -1,3 +1 @@
-if [ "$1" = "configure" ]; then
- install-info --quiet #FILE#
-fi
+install-info --quiet #FILE#
diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init
index b5bd7a57..976c6b34 100644
--- a/autoscripts/postinst-init
+++ b/autoscripts/postinst-init
@@ -1,8 +1,2 @@
-if [ -x "/etc/init.d/#SCRIPT#" ]; then
- update-rc.d #SCRIPT# #INITPARMS# >/dev/null
- if [ -x /usr/sbin/invoke-rc.d ]; then
- invoke-rc.d #SCRIPT# start
- else
- /etc/init.d/#SCRIPT# start
- fi
-fi
+update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+/etc/init.d/#SCRIPT# start
diff --git a/autoscripts/postinst-init-norestart b/autoscripts/postinst-init-norestart
new file mode 100644
index 00000000..b33702c5
--- /dev/null
+++ b/autoscripts/postinst-init-norestart
@@ -0,0 +1,6 @@
+update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+if [ "$1" = "configure" ]; then
+ if [ -z "$2" -o "$2" = "<unknown>" ]; then
+ /etc/init.d/#SCRIPT# start
+ fi
+fi
diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart
deleted file mode 100644
index 5d882b6f..00000000
--- a/autoscripts/postinst-init-nostart
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ -x "/etc/init.d/#SCRIPT#" ]; then
- update-rc.d #SCRIPT# #INITPARMS# >/dev/null
-fi
diff --git a/autoscripts/postinst-makeshlibs b/autoscripts/postinst-makeshlibs
deleted file mode 100644
index 8a25b9e9..00000000
--- a/autoscripts/postinst-makeshlibs
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "configure" ]; then
- ldconfig
-fi
diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu
index 276a3c0a..2be88247 100644
--- a/autoscripts/postinst-menu
+++ b/autoscripts/postinst-menu
@@ -1 +1 @@
-if [ "$1" = "configure" ] && [ -x /usr/bin/update-menus ]; then update-menus ; fi
+if test -x /usr/bin/update-menus ; then update-menus ; fi
diff --git a/autoscripts/postinst-menu-method b/autoscripts/postinst-menu-method
index 01913d82..03acde7f 100644
--- a/autoscripts/postinst-menu-method
+++ b/autoscripts/postinst-menu-method
@@ -1,5 +1,5 @@
inst=/etc/menu-methods/#PACKAGE#
-if [ -x /usr/bin/update-menus ] && [ -f $inst ] ; then
+if [ -x /usr/bin/update-menus -a -f $inst ] ; then
chmod a+x $inst
update-menus
fi
diff --git a/autoscripts/postinst-mime b/autoscripts/postinst-mime
index bef63cc9..e993233b 100644
--- a/autoscripts/postinst-mime
+++ b/autoscripts/postinst-mime
@@ -1 +1 @@
-if [ "$1" = "configure" ] && [ -x /usr/sbin/update-mime ]; then update-mime; fi
+if [ -x /usr/sbin/update-mime ]; then update-mime; fi
diff --git a/autoscripts/postinst-modules b/autoscripts/postinst-modules
index babf39bd..a8f4ce70 100644
--- a/autoscripts/postinst-modules
+++ b/autoscripts/postinst-modules
@@ -1,3 +1,2 @@
-if [ "$1" = "configure" ] && [ -x /sbin/update-modules ]; then
- update-modules >/dev/null
-fi
+update-modules
+depmod -a
diff --git a/autoscripts/postinst-python b/autoscripts/postinst-python
deleted file mode 100644
index 6f1f9a5b..00000000
--- a/autoscripts/postinst-python
+++ /dev/null
@@ -1,8 +0,0 @@
-PYTHON=#PYVER#
-if which $PYTHON >/dev/null 2>&1; then
- DIRLIST="#DIRLIST#"
- for i in $DIRLIST ; do
- $PYTHON -O /usr/lib/$PYTHON/compileall.py -q $i
- $PYTHON /usr/lib/$PYTHON/compileall.py -q $i
- done
-fi
diff --git a/autoscripts/postinst-scrollkeeper b/autoscripts/postinst-scrollkeeper
deleted file mode 100644
index 5f2a255d..00000000
--- a/autoscripts/postinst-scrollkeeper
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "configure" ]; then
- scrollkeeper-update -q
-fi
diff --git a/autoscripts/postinst-sgmlcatalog b/autoscripts/postinst-sgmlcatalog
deleted file mode 100644
index 100dee2f..00000000
--- a/autoscripts/postinst-sgmlcatalog
+++ /dev/null
@@ -1,7 +0,0 @@
-if [ "$1" = "configure" ]; then
- rm -f #CENTRALCAT#
- for ordcat in #ORDCATS#; do
- update-catalog --quiet --add #CENTRALCAT# ${ordcat}
- done
- update-catalog --quiet --add --super #CENTRALCAT#
-fi
diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid
index d0d16c06..dcc277fd 100644
--- a/autoscripts/postinst-suid
+++ b/autoscripts/postinst-suid
@@ -1,8 +1,6 @@
-if [ "$1" = "configure" ]; then
- if which suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
- suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS#
- elif [ -e /#FILE# ]; then
- chown #OWNER#.#GROUP# /#FILE#
- chmod #PERMS# /#FILE#
- fi
+if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
+ suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS#
+elif [ -e /#FILE# ]; then
+ chown #OWNER#.#GROUP# /#FILE#
+ chmod #PERMS# /#FILE#
fi
diff --git a/autoscripts/postinst-usrlocal b/autoscripts/postinst-usrlocal
deleted file mode 100644
index a2f004db..00000000
--- a/autoscripts/postinst-usrlocal
+++ /dev/null
@@ -1,16 +0,0 @@
-if [ "$1" = configure ]; then
-(
- while read line; do
- set -- $line
- dir="$1"; mode="$2"; user="$3"; group="$4"
- if [ ! -e "$dir" ]; then
- if mkdir "$dir" 2>/dev/null; then
- chown "$user":"$group" "$dir"
- chmod "$mode" "$dir"
- fi
- fi
- done
-) << DATA
-#DIRS#
-DATA
-fi
diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm
index aef412a3..925c7883 100644
--- a/autoscripts/postinst-wm
+++ b/autoscripts/postinst-wm
@@ -1,4 +1,3 @@
-if [ "$1" = "configure" ]; then
- update-alternatives --install /usr/bin/x-window-manager \
- x-window-manager #WM# #PRIORITY#
+if command -v register-window-manager >/dev/null 2>&1; then
+ register-window-manager --add #WM#
fi
diff --git a/autoscripts/postinst-xaw b/autoscripts/postinst-xaw
new file mode 100644
index 00000000..3d8e2d1b
--- /dev/null
+++ b/autoscripts/postinst-xaw
@@ -0,0 +1,6 @@
+if test -x /usr/sbin/update-xaw-wrappers; then
+ /usr/sbin/update-xaw-wrappers
+fi
+for opts in #OPTS#; do
+ update-alternatives --quiet --install $opts 25
+done
diff --git a/autoscripts/postinst-xfonts b/autoscripts/postinst-xfonts
deleted file mode 100644
index 96390e4e..00000000
--- a/autoscripts/postinst-xfonts
+++ /dev/null
@@ -1,3 +0,0 @@
-if which update-fonts-dir >/dev/null 2>&1; then
- #CMDS#
-fi
diff --git a/autoscripts/postrm-debconf b/autoscripts/postrm-debconf
deleted file mode 100644
index 5a61724d..00000000
--- a/autoscripts/postrm-debconf
+++ /dev/null
@@ -1,4 +0,0 @@
-if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
- db_purge
-fi
diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init
index 9596dd97..1c292982 100644
--- a/autoscripts/postrm-init
+++ b/autoscripts/postrm-init
@@ -1,3 +1,3 @@
if [ "$1" = "purge" ] ; then
- update-rc.d #SCRIPT# remove #INITPARMS# >/dev/null
+ update-rc.d #SCRIPT# remove >/dev/null
fi
diff --git a/autoscripts/postrm-makeshlibs b/autoscripts/postrm-makeshlibs
deleted file mode 100644
index 96bf24ed..00000000
--- a/autoscripts/postrm-makeshlibs
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "remove" ]; then
- ldconfig
-fi
diff --git a/autoscripts/postrm-menu b/autoscripts/postrm-menu
deleted file mode 100644
index a180558d..00000000
--- a/autoscripts/postrm-menu
+++ /dev/null
@@ -1 +0,0 @@
-if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
diff --git a/autoscripts/postrm-menu-method b/autoscripts/postrm-menu-method
index ffa1e486..3270b7c7 100644
--- a/autoscripts/postrm-menu-method
+++ b/autoscripts/postrm-menu-method
@@ -1,3 +1,3 @@
inst=/etc/menu-methods/#PACKAGE#
-if [ "$1" = "remove" ] && [ -f "$inst" ]; then chmod a-x $inst ; fi
-if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
+if [ "$1" = "remove" -a -f "$inst" ]; then chmod a-x $inst ; fi
+if test -x /usr/bin/update-menus ; then update-menus; fi
diff --git a/autoscripts/postrm-mime b/autoscripts/postrm-mime
deleted file mode 100644
index a9404112..00000000
--- a/autoscripts/postrm-mime
+++ /dev/null
@@ -1 +0,0 @@
-if which update-mime >/dev/null 2>&1; then update-mime; fi
diff --git a/autoscripts/postrm-modules b/autoscripts/postrm-modules
deleted file mode 100644
index f2d4cb7a..00000000
--- a/autoscripts/postrm-modules
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ -x /sbin/update-modules ]; then
- update-modules >/dev/null
-fi
diff --git a/autoscripts/postrm-scrollkeeper b/autoscripts/postrm-scrollkeeper
deleted file mode 100644
index 47b71544..00000000
--- a/autoscripts/postrm-scrollkeeper
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "remove" ] && which scrollkeeper-update >/dev/null 2>&1; then
- scrollkeeper-update -q
-fi
diff --git a/autoscripts/postrm-sgmlcatalog b/autoscripts/postrm-sgmlcatalog
deleted file mode 100644
index 168a6949..00000000
--- a/autoscripts/postrm-sgmlcatalog
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "purge" ]; then
- rm -f #CENTRALCAT# #CENTRALCAT#.old
-fi
diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid
index a4cfecf9..d4a76199 100644
--- a/autoscripts/postrm-suid
+++ b/autoscripts/postrm-suid
@@ -1,4 +1,3 @@
-if [ "$1" = remove ] && [ -e /etc/suid.conf ] && \
- which suidunregister >/dev/null 2>&1; then
+if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
suidunregister -s #PACKAGE# /#FILE#
fi
diff --git a/autoscripts/postrm-wm b/autoscripts/postrm-wm
new file mode 100644
index 00000000..6a7eb47a
--- /dev/null
+++ b/autoscripts/postrm-wm
@@ -0,0 +1,4 @@
+if [ "$1" = "purge" ] && command -v register-window-manager >/dev/null 2>&1
+then
+ register-window-manager --remove #WM#
+fi
diff --git a/autoscripts/postrm-xaw b/autoscripts/postrm-xaw
new file mode 100644
index 00000000..b8d718ea
--- /dev/null
+++ b/autoscripts/postrm-xaw
@@ -0,0 +1,3 @@
+if test -x /usr/sbin/update-xaw-wrappers; then
+ /usr/sbin/update-xaw-wrappers
+fi
diff --git a/autoscripts/postrm-xfonts b/autoscripts/postrm-xfonts
deleted file mode 100644
index a4d0a082..00000000
--- a/autoscripts/postrm-xfonts
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" != "upgrade" ] && [ -x /usr/sbin/update-fonts-dir ]; then
-#CMDS#
-fi
diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base
index c57d999a..9678003e 100644
--- a/autoscripts/prerm-doc-base
+++ b/autoscripts/prerm-doc-base
@@ -1,4 +1,3 @@
-if [ "$1" = remove ] || [ "$1" = upgrade ] && \
- which install-docs >/dev/null 2>&1; then
+if command -v install-docs >/dev/null 2>&1; then
install-docs -r #DOC-ID#
fi
diff --git a/autoscripts/prerm-emacsen b/autoscripts/prerm-emacsen
index 8c3ca64c..d11dafab 100644
--- a/autoscripts/prerm-emacsen
+++ b/autoscripts/prerm-emacsen
@@ -1,3 +1 @@
-if [ -x /usr/lib/emacsen-common/emacs-package-remove ] ; then
- /usr/lib/emacsen-common/emacs-package-remove #PACKAGE#
-fi
+/usr/lib/emacsen-common/emacs-package-remove #PACKAGE#
diff --git a/autoscripts/prerm-init b/autoscripts/prerm-init
index eab98c72..64975a38 100644
--- a/autoscripts/prerm-init
+++ b/autoscripts/prerm-init
@@ -1,7 +1 @@
-if [ -x "/etc/init.d/#SCRIPT#" ]; then
- if [ -x /usr/sbin/invoke-rc.d ] ; then
- invoke-rc.d #SCRIPT# stop
- else
- /etc/init.d/#SCRIPT# stop
- fi
-fi
+/etc/init.d/#SCRIPT# stop
diff --git a/autoscripts/prerm-init-norestart b/autoscripts/prerm-init-norestart
deleted file mode 100644
index fb991524..00000000
--- a/autoscripts/prerm-init-norestart
+++ /dev/null
@@ -1,7 +0,0 @@
-if [ -x "/etc/init.d/#SCRIPT#" ] && [ "$1" = remove ]; then
- if [ -x /usr/sbin/invoke-rc.d ] ; then
- invoke-rc.d #SCRIPT# stop
- else
- /etc/init.d/#SCRIPT# stop
- fi
-fi
diff --git a/autoscripts/prerm-python b/autoscripts/prerm-python
deleted file mode 100644
index 0dc12731..00000000
--- a/autoscripts/prerm-python
+++ /dev/null
@@ -1,5 +0,0 @@
-if [ "$1" = remove ]; then
- dpkg -L #PACKAGE# |
- awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
- xargs rm -f >&2
-fi
diff --git a/autoscripts/prerm-sgmlcatalog b/autoscripts/prerm-sgmlcatalog
deleted file mode 100644
index cdc96e02..00000000
--- a/autoscripts/prerm-sgmlcatalog
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "remove" ]; then
- update-catalog --quiet --remove --super #CENTRALCAT#
-fi
diff --git a/autoscripts/prerm-usrlocal b/autoscripts/prerm-usrlocal
deleted file mode 100644
index baafc23e..00000000
--- a/autoscripts/prerm-usrlocal
+++ /dev/null
@@ -1,7 +0,0 @@
-(
- while read dir; do
- rmdir "$dir" 2>/dev/null || true
- done
-) << DATA
-#JUSTDIRS#
-DATA
diff --git a/autoscripts/prerm-wm b/autoscripts/prerm-wm
deleted file mode 100644
index b97d627f..00000000
--- a/autoscripts/prerm-wm
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "remove" ]; then
- update-alternatives --remove x-window-manager #WM#
-fi
diff --git a/autoscripts/prerm-xaw b/autoscripts/prerm-xaw
new file mode 100644
index 00000000..2507a2f5
--- /dev/null
+++ b/autoscripts/prerm-xaw
@@ -0,0 +1,4 @@
+for opts in #OPTS#; do
+ update-alternatives --quiet --remove $opts
+done
+
diff --git a/debhelper.1 b/debhelper.1
new file mode 100644
index 00000000..438c9505
--- /dev/null
+++ b/debhelper.1
@@ -0,0 +1,152 @@
+.TH DEBHELPER 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+debhelper \- overview of the debhelper commands
+.SH SYNOPSIS
+.B dh_*
+.I "[-v] [-a] [-i] [-s] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]"
+.SH "DESCRIPTION"
+Debhelper is a collection of programs that can be used in debian/rules files
+to automate common tasks related to building debian binary packages. All the
+debhelper commands accept a set of options, and this man page is here to
+document those options and to document debhelper as a whole. For additional
+options, and documentation for each individual command, see the commands' own
+man pages.
+.SH "SHARED DEBHLPER OPTIONS"
+The following command line options are supported by all debhelper programs.
+.TP
+.B \-v, \--verbose
+Verbose mode: show all commands that modify the package build directory.
+.TP
+.B \--no-act
+Do not really do anything. If used with -v, the result is that the command
+will output a list of what it would have done.
+.TP
+.B \-a, \--arch
+Act on all architecture dependent packages.
+.TP
+.B \-i, \--indep
+Act on all architecture independent packages.
+.TP
+.B \-ppackage, \--package=package
+Act on the package named "package".
+.TP
+.B \-s, \--same-arch
+This is a smarter version of the -a flag, that is used in some rare
+circumstances. It understands that if the control file lists "Architecture: i386"
+for the package, the package should not be acted on on other architectures. So
+this flag makes the command act on all "Architecture: any" packages, as well
+as on any packages that have the current architecture explicitly specified.
+Constrast to the -a flag, which makes the command work on all packages that
+are not architecture independant.
+.TP
+.B \-Npackage, \--no-package=package
+Do not act on the specified package even if an -a, -i, or -p option lists
+the package as one that should be acted on.
+.TP
+.B \-Ptmpdir, \--tmpdir=tmpdir
+Use "tmpdir" for package build directory.
+.SH "COMMON DEBHELPER OPTIONS"
+The following command line options are supported by some debhelper programs.
+See the man page of each program for a complete explination of what the
+option does.
+.TP
+.B \-n
+Do not modify postinst/postrm/etc scripts.
+.TP
+.B \-Xitem, \--exclude=item
+Exclude an item from processing.
+.TP
+.B \-A, \-all
+Makes files or other items that are specified on the command line take effect
+in ALL packages acted on, not just the first.
+.SH NOTES
+.TP
+.B Multiple binary package support
+.RS
+If your source package generates more than one binary package, debhelper
+programs will default to acting on all binary packages when run. If your
+source package happens to generate one architecture dependent package, and
+another architecture independent package, this is not the correct behavior,
+because you need to generate the architecture dependent packages in the
+binary-arch debian/rules target, and the architecture independent packages
+in the binary-indep debian/rules target.
+
+To facilitate this, as well as give you more control over which packages
+are acted on by debhelper programs, all debhelper programs accept the
+.B -a
+,
+.B -i
+,
+.B -p
+, and
+.B -s
+parameters. These parameters are cumulative. If none are given,
+debhelper programs default to acting on all packages listed in the control
+file.
+.P
+See
+.BR /usr/doc/debhelper/examples/rules.multi
+for an example of how to use this.
+.RE
+.TP
+.B Package build directories
+.RS
+By default, all debhelper programs assume that the temporary directory used
+for assembling the tree of files in a package is debian/tmp for the first
+package listed in debian/control, and debian/<packagename> for each
+additional package. If DH_COMPAT=2, debian/<packagename> is always used,
+even for the first package.
+.P
+Sometimes, you might want to use some other temporary directory. This is
+supported by the
+.B -P
+flag. For example, "dh_installdocs -Pdebian/tmp", will use debian/tmp as the
+temporary directory. Note that if you use -P, the debhelper programs can only
+be acting on a single package at a time. So if you have a package that builds
+many binary packages, you will need to use the -p flag to specify which
+binary package the debhelper program will act on.
+.RE
+.TP
+.B Other notes
+In general, if any debhelper program needs a directory to exist under
+debian/, it will create it. I haven't bothered to document this in all the
+man pages, but for example, dh_installdeb knows to make debian/<foo>/DEBIAN/
+before trying to put files there, dh_installmenu knows you need a
+debian/<foo>/usr/lib/menu/ before installing the menu files, etc.
+.SH "DEBHELPER COMMANDS"
+Here is the complete list of available debhelper commands.
+#LIST#
+.SH ENVIRONMENT
+.TP
+.I DH_VERBOSE
+Enables verbose mode.
+.TP
+.I DH_COMPAT
+Specifies what compatability level debhelper should run at. The default is 1,
+which makes debhelper behave in a manner compatable with the 1.x series of
+debhelper. If set to 2, debhelper's behavior will change to use the new
+features of the 2.x series. Use this with caution, as the 2.x series makes
+major changes that will break most packages. For documentation on these
+changes, read /usr/doc/debhelper/v2
+.TP
+.I DH_NO_ACT
+Enables no-act mode.
+.TP
+.I DH_OPTIONS
+Anything in this variable will be prepended to the command line
+arguments of all debhelper commands. This in useful in some situations,
+for example, if you need to pass -p to all debhelper commands that will be
+run. If you use DH_OPTIONS, be sure to use "dh_testversion 1.1.17" - older
+debhelpers will ignore it and do things you don't want them to.
+.SH "SEE ALSO"
+.TP
+.BR /usr/doc/debhelper/README
+An introduction to debhelper.
+.TP
+.BR /usr/doc/debhelper/examples/
+A set of example debian/rules files that use debhelper.
+.TP
+.BR http://kitenet.net/programs/debhelper/
+Debhelper web site.
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/debian/control b/debian/control
index 95771531..5a5b45b2 100644
--- a/debian/control
+++ b/debian/control
@@ -1,18 +1,16 @@
Source: debhelper
Section: devel
Priority: optional
-Maintainer: Joey Hess <joeyh@debian.org>
-Build-Depends-Indep: perl (>= 5.6.1), coreutils | fileutils (>= 4.0-2.1), file (>= 3.23-1), dpkg-dev (>= 1.9.0)
-Standards-Version: 3.6.0
+Maintainer: Joey Hess <joeyh@master.debian.org>
+Standards-Version: 3.0.1.0
Package: debhelper
Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}, coreutils | fileutils (>= 4.0-2.1), file (>= 3.23-1), dpkg-dev (>= 1.7.0), html2text, debconf-utils (>= 1.1.1), binutils, po-debconf
+Depends: perl5 | perl (>= 5.004), fileutils (>= 3.16-4), file (>= 3.23-1)
Suggests: dh-make
Description: helper programs for debian/rules
A collection of programs that can be used in a debian/rules file to
- automate common tasks related to building debian packages. Programs
- are included to install various files into your package, compress
- files, fix file permissions, integrate your package with the debian
- menu system, debconf, doc-base, etc. Most debian packages use debhelper
- as part of their build process.
+ automate common tasks related to building binary debian packages. Programs
+ are included to install various files into your package, compress files, fix
+ file permissions, integrate your package with the debian menu system,
+ suidmanager, doc-base, etc.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 931864dd..00000000
--- a/debian/copyright
+++ /dev/null
@@ -1,24 +0,0 @@
-Debhelper is written by and copyright 1997-2003 Joey Hess <joeyh@debian.org>.
-
-Increasinly miniscule parts of the code (and certainly my inspiration from the
-whole thing) came from debmake, by Christoph Lameter <clameter@debian.org>.
-
-Some of the dh_md5sums command is from a program by Charles
-Briscoe-Smith <cpb4@ukc.ac.uk>.
-
-dh_perl is by Brendan O'Dea <bod@debian.org>.
-dh_python is by Josselin Mouette <josselin.mouette@ens-lyon.org>.
-dh_installcatalogs is by Adam Di Carlo <aph@debian.org>.
-dh_scrollkeeper is by Ross Burton <ross@burtonini.com>.
-dh_usrlocal is by Andrew Stribblehill <ads@debian.org>.
-dh_installlogcheck is by Jon Middleton <jjm@debian.org>.
-
-The copyright of this package is GPL, version 2 or later. Files in the
-examples/ directory are in the public domain[1]. On Debian systems the
-complete text of the GPL is in /usr/share/common-licenses/GPL
-
-[1] Pendants who belive I cannot legally say that code I have written is in
- the public domain may consider them instead to be licensed as follows:
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted under any circumstances. No warranty.
diff --git a/debian/subtsvars b/debian/subtsvars
new file mode 100644
index 00000000..458d7871
--- /dev/null
+++ b/debian/subtsvars
@@ -0,0 +1 @@
+perl:Depends=perl5
diff --git a/dh_builddeb b/dh_builddeb
deleted file mode 100755
index 3d9f9d86..00000000
--- a/dh_builddeb
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_builddeb - build debian packages
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_builddeb> [S<I<debhelper options>>] [B<--destdir=>I<directory>] [B<--filename=>I<name>] [S<B<--> I<params>>]
-
-=head1 DESCRIPTION
-
-dh_builddeb simply calls L<dpkg-deb(8)> to build a debian package or
-packages.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<--destdir=>I<directory>
-
-Use this if you want the generated .deb files to be put in a directory
-other than the default of ".."
-
-=item B<--filename=>I<name>
-
-Use this if you want to force the generated .deb file to have a particular
-file name. Does not work well if more than one .deb is generated!
-
-=item B<-u>I<params>
-
-=item B<--> I<params>
-
-Pass I<params> to L<dpkg-deb(1)> when it is used to build the
-package.
-
-=back
-
-=cut
-
-init();
-
-# Set the default destination directory.
-if (! defined $dh{DESTDIR}) {
- $dh{DESTDIR}='..';
-}
-
-if (! defined $dh{FILENAME}) {
- $dh{FILENAME}='';
-}
-else {
- $dh{FILENAME}="/$dh{FILENAME}";
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) {
- complex_doit("find $tmp -name $_ | xargs rm -rf")
- foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
- }
- doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_builddeb.1 b/dh_builddeb.1
new file mode 100644
index 00000000..134cd883
--- /dev/null
+++ b/dh_builddeb.1
@@ -0,0 +1,28 @@
+.TH DH_BUILDDEB 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_builddeb \- build debian packages
+.SH SYNOPSIS
+.B dh_builddeb
+.I "[debhelper options] [--destdir=directory]"
+.SH "DESCRIPTION"
+dh_builddeb simply calls
+.BR dpkg (8)
+to build a .deb package or packages.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B --destdir=directory
+Use this if you want the generated .deb files to be put in a directory other
+than the default of ".."
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_clean b/dh_clean
index d4c5943a..9c6f4f3d 100755
--- a/dh_clean
+++ b/dh_clean
@@ -1,77 +1,25 @@
#!/usr/bin/perl -w
+#
+# Clean up $TMP and other tepmorary files generated by the
+# build process.
-=head1 NAME
-
-dh_clean - clean up package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_clean> [S<I<debhelper options>>] [B<-k>] [B<-d>] [B<-X>I<item>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_clean is a debhelper program that is responsible for cleaning up after a
-package is built. It removes the package build directories, and removes some
-other files including debian/files, and any detritus left behind by other
-debhelper commands. It also removes common files that should not appear in a
-debian diff:
- #*# *~ DEADJOE *.orig *.rej *.SUMS TAGS core .deps/* *.P
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-k>, B<--keep>
-
-Do not delete debian/files. When do you want to use this? Anytime you have a
-debian/rules that has 2 binary targets that build different .deb packages;
-for example, one target is binary-arch, and the other is binary-indep, or
-one target builds the shared library, and the other the -dev package. If you
-didn't use -k in these cases, then debian/files would be deleted in the
-middle, and your changes file will only contain the last binary package that
-was built.
-
-=item B<-d>, B<--dirs-only>
-
-Only clean the package build directories, do not clean up any other files
-at all.
-
-=item B<-X>I<item> B<--exclude=>I<item>
-
-Exclude files that contain "item" anywhere in their filename from being
-deleted, even if they would normally be deleted. You may use this option
-multiple times to build up a list of things to exclude.
-
-=item I<file ...>
-
-Delete these files too.
-
-=back
-
-=cut
-
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
init();
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $ext=pkgext($package);
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $EXT=pkgext($PACKAGE);
if (! $dh{D_FLAG}) {
- doit("rm","-f","debian/${ext}substvars")
- unless excludefile("debian/${ext}substvars");
-
- # These are all debhelper temp files, and so it is safe to
- # wildcard them.
- complex_doit("rm -f debian/$ext*.debhelper");
+ doit("rm","-f","debian/$EXT\substvars",
+ "debian/$EXT\postinst.debhelper",
+ "debian/$EXT\postrm.debhelper",
+ "debian/$EXT\preinst.debhelper",
+ "debian/$EXT\prerm.debhelper");
}
- doit ("rm","-rf",$tmp)
- unless excludefile($tmp);
+ doit ("rm","-rf",$TMP);
}
if (! $dh{D_FLAG}) {
@@ -80,14 +28,7 @@ if (! $dh{D_FLAG}) {
}
if (! $dh{K_FLAG}) {
- doit("rm","-f","debian/files")
- unless excludefile("debian/files");
- }
-
- # See if some files that would normally be deleted are excluded.
- my $find_options='';
- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
- $find_options="-a ! ( $dh{EXCLUDE_FIND} )";
+ doit("rm","-f","debian/files");
}
# Remove other temp files.
@@ -95,27 +36,11 @@ if (! $dh{D_FLAG}) {
# parameters). Note that you _don't_ quote wildcards used by find
# in here.
doit(split(/\s+/,"find . -type f -a
- ( -name #*# -o -name .*~ -o -name *~ -o -name DEADJOE
+ ( -name #*# -o -name *~ -o -name DEADJOE
-o -name *.orig -o -name *.rej -o -name *.bak
-o -name .*.orig -o -name .*.rej -o -name .SUMS
-o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P )
- ) $find_options -exec rm -f {} ;"));
-
- # Stupid autoconf cache directory.
- doit("rm", "-rf", "autom4te.cache")
- unless excludefile("autom4te.cache");
+ ) -exec rm -f {} ;"));
}
-doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1);
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
+doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! Dh_Lib::compat(1);
diff --git a/dh_clean.1 b/dh_clean.1
new file mode 100644
index 00000000..c2e71bf3
--- /dev/null
+++ b/dh_clean.1
@@ -0,0 +1,41 @@
+.TH DH_CLEAN 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_clean \- clean up package build directories
+.SH SYNOPSIS
+.B dh_clean
+.I "[debhelper options] [-k] [-d] [file ...]"
+.SH "DESCRIPTION"
+dh_clean is a debhelper program that is responsible for cleaning up after a
+package is built. It removes the package build directories, and removes some
+other files, such as debian/substvars, debian/files, DEADJOE, emacs backup
+files, any detritus left behind by other debhelper commands, etc.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-k, \--keep
+Do not delete debian/files. When do you want to use this? Anytime you have a
+debian/rules that has 2 binary targets that build different .deb packages;
+for example, one target is binary-arch, and the other is binary-indep, or
+one target builds the shared library, and the other the -dev package. If you
+didn't use -k in these cases, then debian/files would be deleted in the
+middle, and your changes file will only contain the last binary package that
+was built.
+.TP
+.B \-d, \--dirs-only
+Only clean the package build directories, do not clean up any other files at
+all.
+.TP
+.B file ...
+Delete these files too.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_compress b/dh_compress
deleted file mode 100755
index 9d287af4..00000000
--- a/dh_compress
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_compress - compress files and fix symlinks in package build directories
-
-=cut
-
-use strict;
-use Cwd;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_compress> [S<I<debhelper options>>] [B<-X>I<item>] [B<-A>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_compress is a debhelper program that is responsible for compressing
-the files in package build directories, and makes sure that any symlinks
-that pointed to the files before they were compressed are updated to point
-to the new files.
-
-By default, dh_compress compresses files that debian policy mandates should
-be compressed, namely all files in usr/share/info, usr/share/man,
-usr/X11R6/man, files in usr/share/doc that are larger than 4k in size,
-(except the copyright file, .html and .css files, and files that appear to be
-already compressed based on their extensions), and all changelog files. Plus
-PCF fonts underneath usr/X11R6/lib/X11/fonts/
-
-If a debian/package.compress file exists, however, it will be ran as a shell
-script, and all filenames that the shell script outputs will be compressed
-instead of the default files. The shell script will be run from
-inside the package build directory. Note though that using -X is a much
-better idea in general; you should only use a debian/package.compress file
-if you really have to.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-X>I<item>, B<--exclude=>I<item>
-
-Exclude files that contain "item" anywhere in their filename from being
-compressed. For example, -X.jpeg will exclude jpeg's from compression.
-You may use this option multiple times to build up a list of things to
-exclude. You can accomplish the same thing by using a debian/compress file,
-but this is easier.
-
-=item B<-A>, B<--all>
-
-Compress all files specified by command line parameters in ALL packages
-acted on.
-
-=item I<file ...>
-
-Add these files to the list of files to compress.
-
-=back
-
-=head1 CONFORMS TO
-
-Debian policy, version 3.0
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $compress=pkgfile($package,"compress");
-
- # Run the file name gathering commands from within the directory
- # structure that will be effected.
- my $olddir=getcwd();
- verbose_print("cd $tmp");
- chdir($tmp) || error("Can't cd to $tmp: $!");
-
- # Figure out what files to compress.
- my @files;
- # First of all, deal with any files specified right on the command line.
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @files, @ARGV;
- }
- if ($compress) {
- # The config file is a sh script that outputs the files to be compressed
- # (typically using find).
- push @files, split(/\n/,`sh $olddir/$compress 2>/dev/null`);
- }
- else {
- # Note that all the excludes of odd things like _z
- # are because gzip refuses to compress such files, assumming
- # they are zip files. I looked at the gzip source to get the
- # complete list of such extensions: ".gz", ".z", ".taz",
- # ".tgz", "-gz", "-z", "_z"
- push @files, split(/\n/,`
- find usr/info usr/share/info usr/man usr/share/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true;
- find usr/share/doc -type f \\( -size +4k -or -name "changelog*" -or -name "NEWS*" \\) \\
- \\( -name changelog.html -or ! -iname "*.htm*" \\) \\
- ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\
- ! -iname "*.jpeg" ! -iname "*.gz" ! -iname "*.taz" \\
- ! -iname "*.tgz" ! -iname "*.z" ! -iname "*.bz2" \\
- ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\
- ! -iname "*.jar" ! -iname "*.zip" ! -iname "*.css" \\
- ! -name "copyright" 2>/dev/null || true;
- find usr/X11R6/lib/X11/fonts -type f -name "*.pcf" 2>/dev/null || true;
- `);
- }
-
- # Exclude files from compression.
- if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) {
- my @new=();
- foreach (@files) {
- my $ok=1;
- foreach my $x (@{$dh{EXCLUDE}}) {
- if (/\Q$x\E/) {
- $ok='';
- last;
- }
- }
- push @new,$_ if $ok;
- }
- @files=@new;
- }
-
- # Look for files with hard links. If we are going to compress both,
- # we can preserve the hard link across the compression and save
- # space in the end.
- my @f=();
- my %hardlinks;
- my %seen;
- foreach (@files) {
- my ($dev, $inode, undef, $nlink)=stat($_);
- if ($nlink > 1) {
- if (! $seen{"$inode.$dev"}) {
- $seen{"$inode.$dev"}=$_;
- push @f, $_;
- }
- else {
- # This is a hardlink.
- $hardlinks{$_}=$seen{"$inode.$dev"};
- }
- }
- else {
- push @f, $_;
- }
- }
-
- if (@f) {
- # Make executables not be anymore.
- xargs(\@f,"chmod","a-x");
-
- xargs(\@f,"gzip","-9f");
- }
-
- # Now change over any files we can that used to be hard links so
- # they are again.
- foreach (keys %hardlinks) {
- # Remove old file.
- doit("rm","-f","$_");
- # Make new hardlink.
- doit("ln","$hardlinks{$_}.gz","$_.gz");
- }
-
- verbose_print("cd '$olddir'");
- chdir($olddir);
-
- # Fix up symlinks that were pointing to the uncompressed files.
- open (FIND,"find $tmp -type l |");
- while (<FIND>) {
- chomp;
- my ($directory)=m:(.*)/:;
- my $linkval=readlink($_);
- if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") {
- doit("rm","-f",$_);
- doit("ln","-sf","$linkval.gz","$_.gz");
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_compress.1 b/dh_compress.1
new file mode 100644
index 00000000..bab5c199
--- /dev/null
+++ b/dh_compress.1
@@ -0,0 +1,73 @@
+.TH DH_COMPRESS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_compress \- compress files and fix symlinks in package build directories
+.SH SYNOPSIS
+.B dh_compress
+.I "[debhelper options] [-Xitem] [-A] [file ...]"
+.SH "DESCRIPTION"
+dh_compress is a debhelper program that is responsible for compressing
+the files in package build directories, and makes sure that any symlinks
+that pointed to the files before they were compressed are updated to point
+to the new files.
+.P
+By default, dh_compress compresses files that debian policy mandates should
+be compressed, namely all files in usr/info, usr/man, usr/X11R6/man, and
+all files in usr/doc that are larger than 4k in size, except
+the copyright file, .html files and .gif files, and all changelog files. It
+skips any files that appear to be already compressed (based on their
+extentions).
+.P
+If a debian/package.compress file exists (debian/compress may be used for the
+first binary package in debian/control), however, it will be ran as a shell
+script, and all filenames that the shell script outputs will be compressed
+instead of the default files. Note that the shell script will be run from
+inside the package build directory.
+.SH EXAMPLE
+Here is a sample debian/compress file that causes dh_compress to compress
+the same files as it would by default. This is a good starting point for
+customization of what files are compressed:
+.PP
+ find usr/info usr/share/info usr/man usr/share/man usr/X11*/man -type f
+ find usr/doc usr/share/doc -type f \\
+ \\( -size +4k -or -name "changelog*" \\) \\
+ \\( -name changelog.html -or ! -name "*.htm*" \\) \\
+ ! -name "*.gif" ! -iname "*.gz" \\
+ ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\
+ ! -name "copyright"
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-Xitem, \--exclude=item
+Exclude files that contain "item" anywhere in their filename from being
+compressed. For example, -X.jpeg will exclude jpeg's from compression.
+You may use this option multiple times to build up a list of things to
+exclude. You can accomplish the same thing by using a debian/compress file,
+but this is easier.
+.TP
+.B \-A, \--all
+Compress all files specified by command line parameters in ALL packages
+acted on.
+.TP
+.B file ...
+Add these files to the list of files to compress.
+.SH NOTES
+The debian/compress file applies to the first binary package listed in your
+control file. For the other packages, you can make files named
+debian/package.compress, where "package" is the name of the package they
+apply to. (This works for the first binary package too.)
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH BUGS
+Filenames with spaces in them may not properly be compressed.
+.SH "CONFORMS TO"
+Debian policy, version 3.0.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_debstd.1 b/dh_debstd.1
new file mode 100644
index 00000000..e47e64aa
--- /dev/null
+++ b/dh_debstd.1
@@ -0,0 +1,75 @@
+.TH DH_DEBSTD 1
+.SH NAME
+dh_debstd \- mimic debstd with debhelper commands
+.SH SYNOPSIS
+.B dh_debstd
+.I "[-v] [--no-act] [-m] [-c] [-u] [-s] [[changelog] file ...]"
+.SH "DESCRIPTION"
+dh_debstd is a program that mimics the behavior of debstd, by
+calling other debhelper commands. Its behavior is not a complete nor an
+exact copy of what debstd does, but it should be close enough to be usable.
+.P
+dh_debstd is not intended to really be used in building an official debian
+package. Instead, it is intended to help you convert your package that uses
+debstd over to debhelper. If you run dh_debstd with the same parameters you
+passed to debstd, and use the --verbose and --no-act flags, you can see what
+debhelper commands dh_debstd runs, and copy those commands into debian/rules
+to get a start on converting to debhelper.
+.P
+See
+.BR debstd (1)
+for a complete description of what this program does.
+.SH "DEBHELPER STYLE OPTIONS"
+.TP
+.B \-v, \--verbose
+Verbose mode; show all commands that modify the package build directory.
+.TP
+.B \--no-act
+Do not really do anything. If used with -v, the result is that this command
+will output a list of what it would have done.
+.SH "DEBSTD STYLE OPTIONS"
+.TP
+.B \-m
+Switch off automatic man page installation.
+.TP
+.B \-c
+Switch off automatic file compression.
+.TP
+.B \-u
+Enable generation of symlinks to undocumented(7) man page.
+.TP
+.B \-s
+Switch off md5sum file generation.
+.TP
+.B changelog
+Install this file as the upstream changelog. Only happens if it's name
+contains "change", "news", or "history" (not case sensative).
+.TP
+.B file ...
+Install these files as documentation.
+.SH NOTES
+Unlike debstd, dh_debstd does not automatically modify maintainer scripts
+such as the postinst, posrm, etc. To get those scripts to be modified, you
+have to place "#DEBHELPER#" in them at the location you want debhelper to
+insert commands. To help you remember to do that, a warning message will be
+generated if dh_debstd notices scripts without "#DEBHELPER#" in them.
+.SH ENVIRONMENT
+.TP
+.I DH_VERBOSE
+Enables verbose mode
+.TP
+.I DH_NO_ACT
+Enables no-act mode
+.SH "SEE ALSO"
+.TP
+.BR /usr/doc/debhelper/from-debstd
+.TP
+.BR debstd (1)
+.TP
+.BR debhelper (1)
+.SH BUGS
+It doesn't completly mimic debstd. Some things debstd handles are not supported
+by debhelper. Everything that is not supported will generate a warning
+message if you try to use it.
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_du.1 b/dh_du.1
new file mode 100644
index 00000000..aa3849e4
--- /dev/null
+++ b/dh_du.1
@@ -0,0 +1,16 @@
+.TH DH_DU 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_du \- generate DEBIAN/du file (deprecated)
+.SH SYNOPSIS
+.B dh_du
+.SH "DESCRIPTION"
+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.
+.P
+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.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_fixperms b/dh_fixperms
deleted file mode 100755
index 1a35c78d..00000000
--- a/dh_fixperms
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_fixperms - fix permissions of files in package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_fixperms> [S<I<debhelper options>>] [B<-X>I<item>]
-
-=head1 DESCRIPTION
-
-dh_fixperms is a debhelper program that is responsible for setting the
-permissions of files and directories in package build directories to a
-sane state -- a state that complies with Debian policy.
-
-dh_fixperms makes all files in usr/share/doc in the package build directory
-(excluding files in the examples/ directory) be mode 644. It also changes
-the permissions of all man pages to mode 644. It makes all files be owned by
-root, and it removes group and other write permission from all files.
-It removes execute permissions from any libraries that have it set. It makes
-all files in bin/ directories and etc/init.d executable (v4 only). Finally,
-it removes the setuid and setgid bits from all files in the package.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-X>I<item>, B<--exclude> I<item>
-
-Exclude files that contain "item" anywhere in their filename from having
-their permissions changed. You may use this option multiple times to build
-up a list of things to exclude.
-
-=back
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- my $find_options='';
- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
- $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
- }
-
- # General permissions fixing.
- complex_doit("find $tmp $find_options -print0",
- "2>/dev/null | xargs -0r chown --no-dereference 0.0");
- 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 -type f $find_options ! -regex '$tmp/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null",
- "| xargs -0r chmod 644");
- complex_doit("find $tmp/usr/share/doc -type d $find_options -print0 2>/dev/null",
- "| xargs -0r chmod 755");
-
- # Executable man pages are a bad thing..
- complex_doit("find $tmp/usr/share/man $tmp/usr/man/ $tmp/usr/X11*/man/ -type f",
- "$find_options -print0 2>/dev/null | xargs -0r chmod 644");
-
- # ..and so are executable shared and static libraries
- # (and .la files from libtool) ..
- complex_doit("find $tmp -perm -5 -type f",
- "\\( -name '*.so*' -or -name '*.la' -or -name '*.a' \\) $find_options -print0",
- "2>/dev/null | xargs -0r chmod 644");
-
- # .. and perl modules.
- complex_doit("find $tmp/usr/lib/perl5 $tmp/usr/share/perl5 -type f",
- "-perm -5 -name '*.pm' $find_options -print0",
- "2>/dev/null | xargs -0r chmod a-X");
-
- # v4 only
- if (! compat(3)) {
- # Programs in the bin and init.d dirs should be executable..
- for my $dir (qw{usr/bin bin usr/sbin sbin etc/init.d}) {
- if (-d "$tmp/$dir") {
- complex_doit("find $tmp/$dir -type f $find_options -print0 2>/dev/null",
- "| xargs -0r chmod +x");
- }
- }
- }
-
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_fixperms.1 b/dh_fixperms.1
new file mode 100644
index 00000000..2822e27a
--- /dev/null
+++ b/dh_fixperms.1
@@ -0,0 +1,38 @@
+.TH DH_FIXPERMS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_fixperms \- fix permissions of files in package build directories
+.SH SYNOPSIS
+.B dh_fixperms
+.I "[debhelper options] [-Xitem]"
+.SH "DESCRIPTION"
+dh_fixperms is a debhelper program that is responsible for setting the
+permissions of files and directories in package build directories to a
+sane state -- a state that complies with Debian policy.
+.P
+dh_fixperms makes all files in usr/doc in the package build directory
+(excluding files in the examples/ directory) be mode 644. It also changes
+the permissions of all man pages to mode 644. It makes all files be owned by
+root, and it removes group and other write permission from all files.
+It removes execute permissions from any libraries that have it set. Finally,
+it removes the setuid and setgid bits from all files in the package.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-Xitem, \--exclude=item
+Exclude files that contain "item" anywhere in their filename from having
+their permissions changed. You may use this option multiple times to build
+up a list of things to exclude.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_gencontrol b/dh_gencontrol
deleted file mode 100755
index 4e9ff3e8..00000000
--- a/dh_gencontrol
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_gencontrol - generate and install control file
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_gencontrol> [S<I<debhelper options>>] [S<B<--> I<params>>]
-
-=head1 DESCRIPTION
-
-dh_gencontrol is a debhelper program that is responsible for generating
-control files, and installing them into the DEBIAN directory with the
-proper permissions.
-
-This program is merely a wrapper around L<dpkg-gencontrol(1)>, which calls
-it once for each package being acted on, and passes in some additional
-useful flags including "-isp".
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-u>I<params>, B<--dpkg-gencontrol-params>I<params>
-
-=item B<--> I<params>
-
-Pass "params" to L<dpkg-gencontrol(1)>.
-
-=back
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $ext=pkgext($package);
-
- my $changelog=pkgfile($package,'changelog');
- if (! $changelog) {
- $changelog='debian/changelog';
- }
-
- if ( ! -d "$tmp/DEBIAN" ) {
- doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
- }
-
- # Generate and install control file.
- my @command="dpkg-gencontrol";
- if (GetPackages() > 1) {
- push @command, "-p$package";
- }
- doit(@command, "-l$changelog", "-isp", "-Tdebian/${ext}substvars",
- "-P$tmp",@{$dh{U_PARAMS}});
-
- # This chmod is only necessary if the user sets the umask to
- # something odd.
- doit("chmod","644","$tmp/DEBIAN/control");
-
- doit("chown","0.0","$tmp/DEBIAN/control");
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_gencontrol.1 b/dh_gencontrol.1
new file mode 100644
index 00000000..79182619
--- /dev/null
+++ b/dh_gencontrol.1
@@ -0,0 +1,36 @@
+.TH DH_GENCONTROL 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_gencontrol \- generate and install control file
+.SH SYNOPSIS
+.B dh_gencontrol
+.I "[debhelper options] [-uparams]"
+.SH "DESCRIPTION"
+dh_gencontrol is a debhelper program that is responsible for generating
+control files, and installing them into the DEBIAN directory with the proper
+permissions.
+.P
+This program is merely a wrapper around
+.BR dpkg-gencontrol (1)
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-uparams, \--dpkg-gencontrol-params=params
+Pass "params" to
+.BR dpkg-gencontrol (1)
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR dpkg-shlibdeps (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installchangelogs b/dh_installchangelogs
deleted file mode 100755
index 66a02558..00000000
--- a/dh_installchangelogs
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installchangelogs - install changelogs into package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installchangelogs> [<S<I<debhelper options>>] [B<-k>] [I<upstream>]
-
-=head1 DESCRIPTION
-
-dh_installchangelogs is a debhelper program that is responsible for
-installing changelogs into package build directories.
-
-dh_installchangelogs determines if the package is a debian native package,
-and if so, it installs debian/changelog into usr/share/doc/package/changelog
-in the package build directory. Otherwise, it installs debian/changelog
-into usr/share/doc/package/changelog.Debian in the package build directory. (If
-files named debian/package.changelog exist, they will be used in preference
-to debian/changelog.)
-
-Parallelling the debian changelog handling, this program also takes care of
-NEWS.Debian files. If there is a debian/NEWS file, it is installed as
-usr/share/doc/package/NEWS.Debian. debian/package.NEWS files can also be
-used.
-
-If an upstream changelog file is specified as an option, and the package is
-not a native debian package, then this upstream changelog will be installed
-as usr/share/doc/package/changelog in the package build directory. If the
-changelog is a html file (determined by file extension), it will be
-installed as usr/share/doc/package/changelog.html instead, and will be
-converted to plain text with html2text to generate
-usr/share/doc/package/changelog.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-k>, B<--keep>
-
-Keep the original name of the upstream changelog. This will be accomplished
-by installing the upstream changelog as "changelog", and making a symlink from
-that to the original name of the changelog file. This can be useful if the
-upstream changelog has an unusual name, or if other documentation in the
-package refers to the changelog file.
-
-=item I<upstream>
-
-Install this file as the upstream changelog.
-
-=back
-
-=head1 NOTES
-
-It is an error to specify an upstream changelog file for a debian native
-package.
-
-=cut
-
-init();
-
-my $upstream=shift;
-
-if (isnative($dh{MAINPACKAGE}) && defined $upstream) {
- error("Cannot specify an upstream changelog for a native debian package.");
-}
-
-my $changelog_name="changelog.Debian";
-if (isnative($dh{MAINPACKAGE})) {
- $changelog_name='changelog';
-}
-my $news_name="NEWS.Debian";
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $changelog=pkgfile($package,"changelog");
- my $news=pkgfile($package,"NEWS");
-
- if (!$changelog) {
- $changelog="debian/changelog";
- }
- if (!$news) {
- $news="debian/NEWS";
- }
-
- if (! -e $changelog) {
- error("could not find changelog $changelog");
- }
-
- if (! -d "$tmp/usr/share/doc/$package") {
- # If it is a dangling symlink, then don't do anything.
- # Think multi-binary packages that depend on each other and
- # want to link doc dirs.
- next if -l "$tmp/usr/share/doc/$package";
-
- doit("install","-d","$tmp/usr/share/doc/$package");
- }
- doit("install","-o",0,"-g",0,"-p","-m644",$changelog,
- "$tmp/usr/share/doc/$package/$changelog_name");
- if (-e $news) {
- doit("install","-o",0,"-g",0,"-p","-m644",$news,
- "$tmp/usr/share/doc/$package/$news_name");
- }
-
- if ($upstream) {
- my $link_to;
- if ($upstream=~m/\.html?$/i) {
- # HTML changelog
- doit("install","-o",0,"-g",0,"-p","-m644",
- $upstream,"$tmp/usr/share/doc/$package/changelog.html");
- doit("html2text","-nobs","-o","$tmp/usr/share/doc/$package/changelog",$upstream);
- $link_to='changelog.html';
- }
- else {
- doit("install","-o",0,"-g",0,"-p","-m644",
- $upstream,"$tmp/usr/share/doc/$package/changelog");
- $link_to='changelog';
- }
- if ($dh{K_FLAG}) {
- # Install symlink to original name of the upstream changelog file.
- # Use basename in case original file was in a subdirectory or something.
- doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream));
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1
new file mode 100644
index 00000000..b346eef7
--- /dev/null
+++ b/dh_installchangelogs.1
@@ -0,0 +1,52 @@
+.TH DH_INSTALLCHANGELOGS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installchangelogs \- install changelogs into package build directories
+.SH SYNOPSIS
+.B dh_installchangelogs
+.I "[debhelper options] [-k] [upstream]"
+.SH "DESCRIPTION"
+dh_installchangelogs is a debhelper program that is responsible for installing
+changelogs into package build directories.
+.P
+dh_installchangelogs determines if the package is a debian native package,
+and if so, it installs debian/changelog into usr/doc/package/changelog in
+the package build directory. Otherwise, it installs debian/changelog into
+usr/doc/package/changelog.Debian in the package build directory. (If files
+named debian/package.changelog exist, they will be used in preference to
+debian/changelog.)
+.P
+If an upstream changelog file is specified as an option, and the package is
+not a native debian package, then this upstream changelog will be installed
+as usr/doc/package/changelog in the package build directory. If the
+changelog is a html file (determined by file extention), it will be
+installed as usr/doc/package/changelog.html instead (with a link to
+usr/doc/package/changelog).
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-k, \--keep
+Keep the original name of the upstream changelog. This will be accomplished
+by installing the upstream changelog as "changelog", and making a symlink from
+that to the original name of the changelog file. This can be useful if the
+upstream changelog has an unusual name, or if other documentation in the
+package refers to the changelog file.
+.TP
+.B upstream
+Install this file as the upstream changelog.
+.SH NOTES
+It is an error to specify an upstream changelog file for a debian native
+package.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installcron b/dh_installcron
deleted file mode 100755
index d28277c5..00000000
--- a/dh_installcron
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installcron - install cron scripts into etc/cron.*
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installcron> [S<B<debhelper options>>]
-
-=head1 DESCRIPTION
-
-dh_installcron is a debhelper program that is responsible for installing
-cron scripts into etc/cron.*/ in package build directories. The files
-debian/package.cron.daily, debian/package.cron.weekly,
-debian/package.cron.monthly, and debian/package.cron.d are installed.
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- foreach my $type (qw{daily weekly monthly}) {
- my $cron=pkgfile($package,"cron.$type");
- if ($cron) {
- if (! -d "$tmp/etc/cron.$type") {
- doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type");
- }
- doit("install",$cron,"$tmp/etc/cron.$type/$package");
- }
- }
- # Seperate because this needs to be mode 644.
- my $cron=pkgfile($package,"cron.d");
- if ($cron) {
- if (! -d "$tmp/etc/cron.d") {
- doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d");
- }
- doit("install","-m",644,$cron,"$tmp/etc/cron.d/$package");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installcron.1 b/dh_installcron.1
new file mode 100644
index 00000000..a83f0401
--- /dev/null
+++ b/dh_installcron.1
@@ -0,0 +1,30 @@
+.TH DH_INSTALLCRON 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installcron \- install cron scripts into etc/cron.*
+.SH SYNOPSIS
+.B dh_installcron
+.I "[debhelper options]"
+.SH "DESCRIPTION"
+dh_installcron is a debhelper program that is responsible for installing
+cron scripts into etc/cron.* in package build directories. The files
+debian/cron.daily, debian/cron.weekly, debian/cron.monthly, and debian/cron.d
+are installed. If your package generates multiple binary packages (or if you
+just prefer to do it), you can also use filenames like
+debian/package.cron.daily, where "package" is replaced with the name of the
+binary package this cron script goes into.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installdeb b/dh_installdeb
deleted file mode 100755
index 9527ff2e..00000000
--- a/dh_installdeb
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installdeb - install files into the DEBIAN directory
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installdeb> [S<I<debhelper options>>]
-
-=head1 DESCRIPTION
-
-dh_installdeb is a debhelper program that is responsible for installing
-files into the DEBIAN directories in package build directories with the
-correct permissions.
-
-dh_installdeb automatically installs the following files from debian/ into
-the DEBIAN directory:
- package.postinst
- package.preinst
- package.postrm
- package.prerm
- package.shlibs
- package.conffiles
-
-The postinst, preinst, postrm, and prerm are handled specially: If a
-corresponding file named debian/package.script.debhelper exists, the contents
-of that file are merged into the script as follows: If the script exists,
-then anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper
-file is 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.
-
-In V3 compatibility 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.
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $ext=pkgext($package);
-
- if (! -d "$tmp/DEBIAN") {
- doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
- }
-
- # Install debian install scripts.
- # If any .debhelper files exist, add them into the scripts.
- foreach my $file (qw{postinst preinst prerm postrm}) {
- my $f=pkgfile($package,$file);
- if ($f) {
- if (-f "debian/$ext$file.debhelper") {
- # Add this into the script, where it has
- # #DEBHELPER#
- complex_doit("perl -pe 's~#DEBHELPER#~qx{cat debian/$ext$file.debhelper}~eg' < $f > $tmp/DEBIAN/$file");
- }
- else {
- # Just get rid of any #DEBHELPER# in the
- # script.
- complex_doit("sed s/#DEBHELPER#// < $f > $tmp/DEBIAN/$file");
- }
- doit("chown","0.0","$tmp/DEBIAN/$file");
- doit("chmod",755,"$tmp/DEBIAN/$file");
- }
- else {
- # Auto-generate script header and add .debhelper
- # content to it.
- if (-f "debian/$ext$file.debhelper") {
- complex_doit("printf '#!/bin/sh\nset -e\n' > $tmp/DEBIAN/$file");
- complex_doit("cat debian/$ext$file.debhelper >> $tmp/DEBIAN/$file");
- doit("chown","0.0","$tmp/DEBIAN/$file");
- doit("chmod",755,"$tmp/DEBIAN/$file");
- }
- }
- }
-
- # Install non-executable files
- foreach my $file (qw{shlibs conffiles}) {
- my $f=pkgfile($package,$file);
- if ($f) {
- doit("install","-o",0,"-g",0,"-m",644,"-p",$f,"$tmp/DEBIAN/$file");
- }
- }
-
- # Automatic conffiles registration: If it is in /etc, it is a
- # conffile.
- if (! compat(2) && -d "$tmp/etc") {
- complex_doit("find $tmp/etc -type f -printf '/etc/%P\n' >> $tmp/DEBIAN/conffiles");
- # Anything found?
- if (-z "$tmp/DEBIAN/conffiles") {
- doit("rm", "-f", "$tmp/DEBIAN/conffiles");
- }
- else {
- doit("chmod", 644, "$tmp/DEBIAN/conffiles");
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installdeb.1 b/dh_installdeb.1
new file mode 100644
index 00000000..1d17b96c
--- /dev/null
+++ b/dh_installdeb.1
@@ -0,0 +1,50 @@
+.TH DH_INSTALLDEB 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installdeb \- install files into the DEBIAN directory
+.SH SYNOPSIS
+.B dh_installdeb
+.I "[debhelper options]"
+.SH "DESCRIPTION"
+dh_installdeb is a debhelper program that is responsible for installing
+files into the DEBIAN directory in package build directories with the
+correct permissions.
+.P
+dh_installdeb automatically installs the following files from debian/ into
+the DEBIAN directory:
+ postinst
+ preinst
+ postrm
+ prerm
+ shlibs
+ conffiles
+.P
+(For packages other than the first binary package listed in debian/control,
+you must prefix these filenames with then name of the "package.", for example,
+"foo.postinst". You can also prefix the filenames the same way for the first
+binary package, for consitency.)
+.P
+The files postinst, preinst, postrm, and prerm are handled specially: If a
+corresponding file named debian/script.debhelper exists, the contents of that
+file are merged into the script as follows: If the script exists, then
+anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper file is
+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
+.BR dh_installmenu (1)
+, and are shell script fragments.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1
new file mode 100644
index 00000000..bb66ed5b
--- /dev/null
+++ b/dh_installdebfiles.1
@@ -0,0 +1,33 @@
+.TH DH_INSTALLDEBFILES 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installdebfiles \- install files into the DEBIAN directory (deprecated)
+.SH SYNOPSIS
+.B dh_installdebfiles
+.SH "DESCRIPTION"
+dh_installdebfiles is a debhelper program that is responsible for installing
+files into the DEBIAN directory in package build directories with the
+correct permissions, canculating shared library dependancies, and creating a
+control file.
+.P
+This program is deprecated. It is now merely a wrapper around three other
+programs, and you may replace any calls to this program by:
+.P
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+.SH WARNING
+This program will be removed at some time in the future.
+.SH OPTIONS
+Any options passed to this program will be sent to each of the 3 programs
+listed above.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR dh_installdeb (1)
+.TP
+.BR dh_shlibdeps (1)
+.TP
+.BR dh_gencontrol (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installdirs b/dh_installdirs
deleted file mode 100755
index 3bd4ea80..00000000
--- a/dh_installdirs
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installdirs - create subdirectories in package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installdirs> [S<I<debhelper options>>] [B<-A>] [S<I<dir ...>>]
-
-=head1 DESCRIPTION
-
-dh_installdirs is a debhelper program that is responsible for creating
-subdirectories in package build directories.
-
-Any directory names specified as parameters will be created in the package
-build directory of the first package dh_installdirs 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.
-
-A file named debian/package.dirs can list other directories to be created.
-Separate the directory names with whitespace.
-
-Be sure to only use directory names relative to the package build
-directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-A>, B<--all>
-
-Create any directories specified by command line parameters in ALL packages
-acted on, not just the first.
-
-=item I<dir ...>
-
-Create these directories in the package build directory of the first
-package acted on. (Or in all packages if -A is specified.)
-
-=back
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $file=pkgfile($package,"dirs");
-
- if (! -e $tmp) {
- doit("install","-d",$tmp);
- }
-
- my @dirs;
-
- if ($file) {
- @dirs=filearray($file)
- }
-
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @dirs, @ARGV;
- }
-
- if (@dirs) {
- # Stick the $tmp onto the front of all the dirs.
- # This is necessary, for 2 reasons, one to make them
- # be in the right directory, but more importantly, it
- # protects against the danger of absolute dirs being
- # specified.
- @dirs=map {
- $_="$tmp/$_";
- tr:/:/:s; # just beautification.
- $_
- } @dirs;
-
- # Create dirs.
- doit("install","-d",@dirs);
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installdirs.1 b/dh_installdirs.1
new file mode 100644
index 00000000..95be7151
--- /dev/null
+++ b/dh_installdirs.1
@@ -0,0 +1,46 @@
+.TH DH_INSTALLDIRS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installdirs \- create subdirectories in package build directories
+.SH SYNOPSIS
+.B dh_installdirs
+.I "[debhelper options] [-A] [dir ...]"
+.SH "DESCRIPTION"
+dh_installdirs is a debhelper program that is responsible for creating
+subdirectories in package build directories.
+.P
+Any directory names specified as parameters will be created in the package
+build directory of the first package dh_installdirs 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.
+.P
+A file named debian/package.dirs (debian/dirs may be used for the first
+binary package in debian/control) can list other directories to be created.
+Separate the directory names with whitespace.
+.P
+Be sure to only use directory names relative to the package build
+directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Create any directories specified by command line parameters in ALL packages
+acted on, not just the first.
+.TP
+.B dir ...
+Create these directories in the package build directory of the first package
+acted on. (Or in all packages if -A is specified.)
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH BUGS
+It's impossible to specify filenames with spaces or other whitespace in them
+in debian/dirs file. This is more a historical design flaw than a bug.
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installdocs b/dh_installdocs
index b991162f..101110da 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -1,174 +1,67 @@
#!/usr/bin/perl -w
+#
+# Reads debian/docs, installs all files listed there into /usr/doc/$PACKAGE
+# Also installs the debian/copyright and debian/README.debian and debian/TODO
+# and handles debian/doc-base.
-=head1 NAME
-
-dh_installdocs - install documentation into package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installdocs> [S<I<debhelper options>>] [B<-A>] [B<-n>] [B<-X>I<item>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_installdocs is a debhelper program that is responsible for installing
-documentation into usr/share/doc/package in package build directories.
-
-dh_installdocs automatically installs debian/copyright if it exists. If
-dh_installdocs is acting on multiple packages, debian/copyright files will be
-installed into all packages. However, if you need to have seperate copyright
-files for different binary packages, you can use files named
-debian/package.copyright.
-
-Any filenames specified as parameters will be installed into the first
-package dh_installdocs is told to act on. By default, this is the first
-binary package in debian/control, but if you use B<-p>, B<-i>, or B<-a> flags, it
-will be the first package specified by those flags.
-
-Also, debian/README.Debian (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 consistency. Note that debian/package.README.Debian and
-debian/package.TODO can be used to specify files for subpackages.
-
-Files named debian/package.docs can list other files to be installed.
-
-Files named debian/package.doc-base, will be installed as doc-base control
-files, and will make this program automatically generate the postinst and
-prerm commands needed to interface with the doc-base package. Note that the
-doc-id will be determined from the "Document:" entry in the
-doc-base control file in question.
-
-If your package needs to register more than one document, you need multiple
-files. To accomplish this, you can use files named debian/package.doc-base.*
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-A>, B<--all>
-
-Install all files specified by command line parameters in ALL packages
-acted on.
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/prerm scripts.
-
-=item B<-Xitem>, B<--exclude=item>
-
-Exclude files that contain "item" anywhere in their filename from
-being installed.
-
-=item I<file ...>
-
-Install these files as documentation into the first package acted on. (Or
-in all packages if B<-A> is specified).
-
-=back
-
-=head1 NOTES
-
-Note that dh_installdocs will happily copy entire directory hierarchies if
-you ask it to (similar to cp -a). If it is asked to install a
-directory, it will install the complete contents of the directory.
-
-Note that this command is not idempotent. "dh_clean B<-k>" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=cut
-
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
init();
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $file=pkgfile($package,"docs");
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $file=pkgfile($PACKAGE,"docs");
- # If this is a symlink, leave it alone.
- if ( ! -d "$tmp/usr/share/doc/$package" &&
- ! -l "$tmp/usr/share/doc/$package") {
- doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc/$package");
+ if ( ! -d "$TMP/usr/doc/$PACKAGE") {
+ doit("install","-d","$TMP/usr/doc/$PACKAGE");
}
- my @docs;
+ undef @docs;
if ($file) {
- @docs=filearray($file, ".");
+ @docs=filearray($file);
}
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
+ if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
push @docs, @ARGV;
}
if (@docs) {
- my $exclude = '';
- if ($dh{EXCLUDE_FIND}) {
- $exclude = ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
- }
- foreach my $doc (@docs) {
- next if excludefile($doc);
- if (-d $doc && $exclude) {
- my ($dir_basename) = basename($doc);
- # Pity there's no cp --exclude ..
- my $pwd=`pwd`;
- chomp $pwd;
- complex_doit("cd $doc/.. && find $dir_basename -type f$exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package \\;");
- }
- else {
- doit("cp","-a",$doc,"$tmp/usr/share/doc/$package");
- }
- }
- doit("chown","-R","0.0","$tmp/usr/share/doc");
- doit("chmod","-R","go=rX","$tmp/usr/share/doc");
- doit("chmod","-R","u+rw","$tmp/usr/share/doc");
+ doit("cp","-a",@docs,"$TMP/usr/doc/$PACKAGE/");
+ doit("chmod","-R","go=rX","$TMP/usr/doc");
+ doit("chmod","-R","u+rw","$TMP/usr/doc");
}
# .Debian is correct, according to policy, but I'm easy.
- my $readme_debian=pkgfile($package,'README.Debian');
+ $readme_debian=pkgfile($PACKAGE,'README.Debian');
if (! $readme_debian) {
- $readme_debian=pkgfile($package,'README.debian');
+ $readme_debian=pkgfile($PACKAGE,'README.debian');
}
- if ($readme_debian && ! excludefile($readme_debian)) {
- doit("install","-g",0,"-o",0,"-m","644","-p","$readme_debian",
- "$tmp/usr/share/doc/$package/README.Debian");
+ if ($readme_debian) {
+ doit("install","-m","644","-p","$readme_debian","$TMP/usr/doc/$PACKAGE/README.Debian");
}
- my $todo=pkgfile($package,'TODO');
- if ($todo && ! excludefile($todo)) {
- if (isnative($package)) {
- doit("install","-g",0,"-o",0,"-m","644","-p",$todo,
- "$tmp/usr/share/doc/$package/TODO");
+ $todo=pkgfile($PACKAGE,'TODO');
+ if ($todo) {
+ if (isnative($PACKAGE)) {
+ doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO");
}
else {
- doit("install","-g",0,"-o",0,"-m","644","-p",$todo,
- "$tmp/usr/share/doc/$package/TODO.Debian");
+ doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO.Debian");
}
}
- # If the "directory" is a dangling symlink, then don't install
- # the copyright file. This is useful for multibinary packages
- # that share a doc directory.
- if (-d "$tmp/usr/share/doc/$package") {
- # Support debian/package.copyright, but if not present, fall
- # back on debian/copyright for all packages, not just the
- # main binary package.
- my $copyright=pkgfile($package,'copyright');
- if (! $copyright && -e "debian/copyright") {
- $copyright="debian/copyright";
- }
- if ($copyright && ! excludefile($copyright)) {
- doit("install","-g",0,"-o",0,"-m","644","-p",$copyright,
- "$tmp/usr/share/doc/$package/copyright");
- }
+ # Support debian/package.copyright, but if not present, fall back
+ # on debian/copyright for all packages, not just the main binary
+ # package.
+ $copyright=pkgfile($PACKAGE,'copyright');
+ if (! $copyright && -e "debian/copyright") {
+ $copyright="debian/copyright";
}
-
+ if ($copyright) {
+ doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright");
+ }
+
# Handle doc-base files. There are two filename formats, the usual
# plus an extended format (debian/package.*).
my %doc_ids;
@@ -177,15 +70,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
# If this is the main package, we need to handle unprefixed filenames.
# For all packages, we must support both the usual filename format plus
# that format with a period an something appended.
- my $regexp="\Q$package\E\.";
- if ($package eq $dh{MAINPACKAGE}) {
+ my $regexp="\Q$PACKAGE\E\.";
+ if ($PACKAGE eq $dh{MAINPACKAGE}) {
$regexp="(|$regexp)";
}
foreach my $fn (grep {/^${regexp}doc-base(\..*)?$/} readdir(DEB)) {
# Parse the file to get the doc id.
open (IN, "debian/$fn") || die "Cannot read debian/$fn.";
while (<IN>) {
- if (/^Document:\s+(.*)(\s+)?/) {
+ if (/^Document:\s+(.*)/) {
$doc_ids{$fn}=$1;
last;
}
@@ -195,32 +88,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
closedir(DEB);
if (%doc_ids) {
- if (! -d "$tmp/usr/share/doc-base/") {
- doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc-base/");
+ if (! -d "$TMP/usr/share/doc-base/") {
+ doit("install","-d","$TMP/usr/share/doc-base/");
}
}
foreach my $fn (keys %doc_ids) {
- doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
- "$tmp/usr/share/doc-base/$doc_ids{$fn}");
+ doit("install","-m644","-p","debian/$fn",
+ "$TMP/usr/share/doc-base/$doc_ids{$fn}");
if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-doc-base",
+ autoscript($PACKAGE,"postinst","postinst-doc-base",
"s/#DOC-ID#/$doc_ids{$fn}/",
);
- autoscript($package,"prerm","prerm-doc-base",
+ autoscript($PACKAGE,"prerm","prerm-doc-base",
"s/#DOC-ID#/$doc_ids{$fn}/",
);
}
}
}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installdocs.1 b/dh_installdocs.1
new file mode 100644
index 00000000..e2bc845d
--- /dev/null
+++ b/dh_installdocs.1
@@ -0,0 +1,80 @@
+.TH DH_INSTALLDOCS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installdocs \- install documentation into package build directories
+.SH SYNOPSIS
+.B dh_installdocs
+.I "[debhelper options] [-A] [-n] [file ...]"
+.SH "DESCRIPTION"
+dh_installdocs is a debhelper program that is responsible for installing
+documentation into usr/doc/package in package build directories.
+.P
+dh_installdocs automatically installs debian/copyright if it exists. If
+dh_installdocs is acting on multiple packages, debian/copyright files will be
+installed into all packages. However, if you need to have seperate copyright
+files for different binary packages, you can use files named
+debian/package.copyright.
+.P
+Any filenames specified as parameters will be installed into the first
+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.
+.P
+Also, debian/README.Debian (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.
+.P
+A file named debian/package.docs (debian/docs may be used for the first
+binary package in debian/control) can list other files to be installed.
+.P
+A file named debian/package.doc-base (debian/doc-base may be used for the
+first binary package in debian/control), if it exists, will be installed as
+a doc-base control file, and will make this program automatically generate the
+postinst and prerm commands needed to interface with the doc-base package. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+Note that the doc-id will be determined from the doc-base control file
+in question.
+.PP
+If your package needs to register more
+than one document, you need multiple files. To accomplish this, you can use
+files named debian/package.doc-base.*
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Install all files specified by command line parameters in ALL packages
+acted on.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/prerm scripts.
+.TP
+.B file ...
+Install these files as documentation into the first package acted on. (Or in
+all packages if -A is specified).
+.SH NOTES
+Note that dh_installdocs will happily copy entire directory hierarchies if
+you ask it to (it uses cp -a internally). If it is asked to install a
+directory, it will install the complete contents of the directory.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.TP
+.BR install-docs (8)
+.SH BUGS
+It's impossible to specify filenames with spaces or other whitespace in them
+in debian/docs file. This is more a historical design flaw than a bug.
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installemacsen b/dh_installemacsen
deleted file mode 100755
index 80b83e69..00000000
--- a/dh_installemacsen
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installemacsen - register an emacs add on package
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installemacsen> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [B<--flavor=>I<foo>]
-
-=head1 DESCRIPTION
-
-dh_installemacsen is a debhelper program that is responsible for installing
-files used by the debian emacsen-common package into package build
-directories.
-
-It also automatically generates the postinst and prerm commands needed to
-register a package as an emacs add on package. See L<dh_installdeb(1)>
-for an explanation of how this works.
-
-If a file named debian/package.emacsen-install exists, then it is installed
-into
-usr/lib/emacsen-common/packages/install/package in the package build
-directory. Similarly, debian/package.emacsen-remove is installed into
-usr/lib/emacsen-common/packages/remove/package . And similarly,
-debian/package.emacsen-startup is installed into
-etc/emacs/site-start.d/50<package>.el (by default).
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/prerm scripts.
-
-=item B<--priority=>I<n>
-
-Sets the priority number of a site-start.d file. Default is 50.
-
-=item B<--flavor=>I<foo>
-
-Sets the flavor a site-start.d file will be installed in. Default is
-"emacs", alternatives include "xemacs" and "emacs20".
-
-=back
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=cut
-
-init();
-
-if (! defined $dh{PRIORITY}) {
- $dh{PRIORITY}=50;
-}
-if (! defined $dh{FLAVOR}) {
- $dh{FLAVOR}='emacs';
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- my $emacsen_install=pkgfile($package,"emacsen-install");
- my $emacsen_remove=pkgfile($package,"emacsen-remove");
- my $emacsen_startup=pkgfile($package,"emacsen-startup");
-
- if ($emacsen_install ne '') {
- if (! -d "$tmp/usr/lib/emacsen-common/packages/install") {
- doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install");
- }
- doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
- }
-
- if ($emacsen_remove ne '') {
- if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") {
- doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove");
- }
- doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
- }
-
- if ($emacsen_startup ne '') {
- if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") {
- doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/");
- }
- doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
- }
-
- if ($emacsen_install ne '' || $emacsen_remove ne '') {
- if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-emacsen",
- "s/#PACKAGE#/$package/");
- autoscript($package,"prerm","prerm-emacsen",
- "s/#PACKAGE#/$package/");
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installemacsen.1 b/dh_installemacsen.1
new file mode 100644
index 00000000..df1512f5
--- /dev/null
+++ b/dh_installemacsen.1
@@ -0,0 +1,51 @@
+.TH DH_INSTALLEMACSEN 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installemacsen \- register an emacs add on package
+.SH SYNOPSIS
+.B dh_installemacsen
+.I "[debhelper options] [-n] [--number=n] [--flavor=foo]"
+.SH "DESCRIPTION"
+dh_installemacsen is a debhelper program that is responsible for installing
+files used by the debian emacsen-common package into package build directories.
+.P
+It also automatically generates the postinst and prerm commands needed to
+register a package as an emacs add on package. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.P
+If a file named debian/package.emacsen-install exists, then it is installed into
+usr/lib/emacsen-common/packages/install/package in the package build
+directory. Similarly, debian/package.emacsen-remove is installed into
+usr/lib/emacsen-common/packages/remove/package . And similarly,
+debian/package.emacsen-startup is installed into
+etc/emacs/site-start.d/50<package>.el (by default).
+.P
+For the first first binary package listed in the control file, you may use
+debian/emacsen-install, debian/emacsen-remove, and debian/emacsen-startup instead.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/prerm scripts.
+.TP
+.B \--number=n
+Sets the priority number of a site-start.d file. Default is 50.
+.TP
+.B \--flavor=foo
+Sets the flavor a site-start.d file will be installed in. Default is
+"emacs", alternatives include "xemacs" and "emacs20".
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR /usr/doc/emacsen-common/debian-emacs-policy.gz
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installexamples b/dh_installexamples
deleted file mode 100755
index 8934e2fb..00000000
--- a/dh_installexamples
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installexamples - install example files into package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installexamples> [S<I<debhelper options>>] [B<-A>] [B<-X>I<item>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_installexamples is a debhelper program that is responsible for
-installing examples into usr/share/doc/package/examples in package
-build directories.
-
-Any file names specified as parameters will be installed into the first
-package dh_installexamples 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.
-
-Files named debian/package.examples can list other files to be installed.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-A>, B<--all>
-
-Install any files specified by command line parameters in ALL packages
-acted on.
-
-=item I<file ...>
-
-Install these files as examples into the first package acted on. (Or into
-all packages if -A is specified.)
-
-=item B<-Xitem>, B<--exclude=item>
-
-Exclude files that contain "item" anywhere in their filename from
-being installed.
-
-=back
-
-=head1 NOTES
-
-Note that dh_installexamples will happily copy entire directory hierarchies
-if you ask it to (similar to cp -a). If it is asked to install a
-directory, it will install the complete contents of the directory.
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $file=pkgfile($package,"examples");
-
- my @examples;
-
- if ($file) {
- @examples=filearray($file, ".");
- }
-
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @examples, @ARGV;
- }
-
- if (@examples) {
- if (! -d "$tmp/usr/share/doc/$package/examples") {
- doit("install","-d","$tmp/usr/share/doc/$package/examples");
- }
-
- my $exclude = '';
- if ($dh{EXCLUDE_FIND}) {
- $exclude = ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
- }
-
- foreach my $example (@examples) {
- next if excludefile($example);
- if (-d $example && $exclude) {
- my ($dir_basename) = basename($example);
- # Pity there's no cp --exclude ..
- my $pwd=`pwd`;
- chomp $pwd;
- complex_doit("cd $example/.. && find $dir_basename -type f$exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples \\;");
- }
- else {
- doit("cp", "-a", $example, "$tmp/usr/share/doc/$package/examples");
- }
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installexamples.1 b/dh_installexamples.1
new file mode 100644
index 00000000..87ccd1ff
--- /dev/null
+++ b/dh_installexamples.1
@@ -0,0 +1,48 @@
+.TH DH_INSTALLEXAMPLES 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installexamples \- install example files into package build directories
+.SH SYNOPSIS
+.B dh_installexamples
+.I "[debhelper options] [-A] [file ...]"
+.SH "DESCRIPTION"
+dh_installexamples is a debhelper program that is responsible for installing
+examples into usr/doc/package/examples in package build directories.
+.P
+Any file names specified as parameters will be installed into the first
+package dh_installexamples 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.
+.P
+A file named debian/package.examples (debian/examples may be used for the
+first binary package in debian/control) can list other files to be installed.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Install any files specified by command line parameters in ALL packages
+acted on.
+.TP
+.B file ...
+Install these files as examples into the first package acted on. (Or into all
+packages if -A is specified.)
+.SH NOTES
+Note that dh_installexamples will happily copy entire directory hierarchies if
+you ask it to (it uses cp -a internally). If it is asked to install a
+directory, it will install the complete contents of the directory.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH BUGS
+It's impossible to specify filenames with spaces or other whitespace in them
+in debian/examples file. This is more a historical design flaw than a bug.
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installinfo b/dh_installinfo
index 814c831b..2983d28f 100755
--- a/dh_installinfo
+++ b/dh_installinfo
@@ -1,95 +1,39 @@
#!/usr/bin/perl -w
+#
+# Reads debian/info, installs all files listed there into /usr/info
+# and puts appropriate commands into the postinst.
-=head1 NAME
-
-dh_installinfo - install and register info files
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installinfo> [S<I<debhelper options>>] [B<-A>] [B<-n>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_installinfo is a debhelper program that is responsible for installing
-info files and registering the files it installs with install-info.
-
-It determines some information about the info files by parsing them, in
-particular, it looks at the INFO-DIR-SECTION line to determine what section
-the info file belongs in.
-
-Any filenames specified as parameters will be installed into the first
-package dh_installinfo 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.
-
-Files named debian/package.info can list other files to be installed.
-
-dh_installinfo will automatically generate the postinst and prerm commands
-needed to interface with install-info, updating the info . See L<dh_installdeb(1)> for an
-explanation of how this works.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-A>, B<--all>
-
-Install all files specified by command line parameters in ALL packages
-acted on.
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/prerm scripts.
-
-=item I<file ...>
-
-Install these info files into the first package acted on. (Or in
-all packages if -A is specified).
-
-=back
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=cut
-
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
init();
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $file=pkgfile($package,"info");
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $file=pkgfile($PACKAGE,"info");
- my @info;
+ undef @info;
if ($file) {
- @info=filearray($file, ".");
+ @info=filearray($file);
}
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
+ if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
push @info, @ARGV;
}
if (@info) {
- if ( ! -d "$tmp/usr/share/info") {
- doit("install","-d","$tmp/usr/share/info");
+ if ( ! -d "$TMP/usr/info") {
+ doit("install","-d","$TMP/usr/info");
}
- doit("cp",@info,"$tmp/usr/share/info");
- doit("chmod","-R", "go=rX","$tmp/usr/share/info/");
- doit("chmod","-R", "u+rw","$tmp/usr/share/info/");
+ doit("cp",@info,"$TMP/usr/info");
+ doit("chmod","-R", "go=rX","$TMP/usr/info/");
+ doit("chmod","-R", "u+rw","$TMP/usr/info/");
}
foreach $file (@info) {
# Only register with install-info if this is a head file in
# a tree of info files.
- if ($file !~ /-\d+$/ && ! $dh{NOSCRIPTS}) {
+ if ($file=~/\.info$/ && ! $dh{NOSCRIPTS}) {
# Figure out what section this file goes in.
my $section='';
open (IN, "<$file") || die "$file: $!";
@@ -101,30 +45,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
close IN;
- my $fn="/usr/share/info/".basename($file);
+ my $fn="/usr/info/".Dh_Lib::basename($file);
if ($section ne '') {
- $section=~s:/:\\/:g; # allow / in section.
- autoscript($package,"postinst","postinst-info",
+ autoscript($PACKAGE,"postinst","postinst-info",
"s/#SECTION#/$section/g;s:#FILE#:$fn:");
}
else {
- autoscript($package,"postinst","postinst-info-nosection",
+ autoscript($PACKAGE,"postinst","postinst-info-nosection",
"s:#FILE#:$fn:");
}
- autoscript($package,"prerm","prerm-info", "s:#FILE#:$fn:");
+ autoscript($PACKAGE,"prerm","prerm-info", "s:#FILE#:$fn:");
}
}
}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installinfo.1 b/dh_installinfo.1
new file mode 100644
index 00000000..33e388a7
--- /dev/null
+++ b/dh_installinfo.1
@@ -0,0 +1,54 @@
+.TH DH_INSTALLINFO 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installinfo \- install and register info files
+.SH SYNOPSIS
+.B dh_installinfo
+.I "[debhelper options] [-A] [-n] [file ...]"
+.SH "DESCRIPTION"
+dh_installinfo is a debhelper program that is responsible for installing
+info files and registering them with install-info.
+.P
+Any filenames specified as parameters will be installed into the first
+package dh_installinfo 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.
+.P
+A file named debian/package.info (debian/info may be used for the first
+binary package in debian/control) can list other files to be installed.
+.P
+dh_installinfo will automatically generate the postinst and prerm commands
+needed to interface with install-info. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Install all files specified by command line parameters in ALL packages
+acted on.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/prerm scripts.
+.TP
+.B file ...
+Install these info files into the first package acted on. (Or in
+all packages if -A is specified).
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.TP
+.BR install-info (8)
+.SH BUGS
+It's impossible to specify filenames with spaces or other whitespace in them
+in debian/info file. This is more a historical design flaw than a bug.
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installinit b/dh_installinit
deleted file mode 100755
index 5e4e1f35..00000000
--- a/dh_installinit
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installinit - install init scripts into package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installinit> [S<I<debhelper options>>] [B<--init-script=>I<scriptname>] [B<-n>] [B<-r>] [B<-d>] [S<B<--> I<params>>]
-
-=head1 DESCRIPTION
-
-dh_installinit is a debhelper program that is responsible for installing
-init scripts and associated defaults files into package build directories.
-
-It also automatically generates the postinst and postrm and prerm commands
-needed to set up the symlinks in /etc/rc*.d/ and to start and stop the init
-scripts.
-
-If a file named debian/package.init exists, then it is installed into
-etc/init.d/package in the package build directory, with "package" replaced
-by the package name.
-
-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.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/postrm/prerm scripts.
-
-=item B<-r>, B<--no-restart-on-upgrade>
-
-Do not restart init script on upgrade.
-
-=item B<--no-start>
-
-Do not start the init script on install or upgrade, or stop it on removal.
-Only call update-rc.d. Useful for rcS scripts.
-
-=item B<-d>, B<--remove-d>
-
-Remove trailing "d" from the name of the package, and use the result for the
-filename the init script is installed as in etc/init.d/ , and the default file
-is installed as in etc/default/ . This may be useful for daemons with names
-ending in "d". (Note: this takes precedence over the --init-script parameter
-described below.)
-
-=item B<-u>I<params> B<--update-rcd-params=>I<params>
-
-=item B<--> I<params>
-
-Pass "params" to L<update-rc.d(8)>. If not specified, "defaults" will be
-passed to L<update-rc.d(8)>.
-
-=item B<--init-script=>I<scriptname>
-
-Use "scriptname" as for the filename the init script is installed as in
-etc/init.d/ (and also use it as the filename for the defaults file, if it
-is installed). This is useful if you need to have an init script with a name
-different from the package's name. Note that if you use this parameter,
-dh_installinit will look to see if a file in the debian/ directory exists
-that looks like "package.scriptname" and if so will install it as the init
-script in preference to the files it normally installs. This feature is really
-only useful if you need a single package to install more than one init script.
-
-=back
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- # Figure out what filename to install it as.
- my $script;
- if ($dh{D_FLAG}) {
- # -d on the command line sets D_FLAG. We will
- # remove a trailing 'd' from the package name and
- # use that as the name.
- $script=$package;
- if ($script=~m/(.*)d$/) {
- $script=$1;
- }
- else {
- warning("\"$package\" has no final d' in its name, but -d was specified.");
- }
- }
- elsif ($dh{INIT_SCRIPT}) {
- $script=$dh{INIT_SCRIPT};
- }
- else {
- $script=$package;
- }
-
- my $init=pkgfile($package,$script) || pkgfile($package,"init") ||
- pkgfile($package,"init.d");
- my $default=pkgfile($package,'default');
-
- if ($default ne '') {
- if (! -d "$tmp/etc/default") {
- doit("install","-d","$tmp/etc/default");
- }
- doit("install","-p","-m644",$default,"$tmp/etc/default/$script");
- }
-
- if ($init ne '') {
- if (! -d "$tmp/etc/init.d") {
- doit("install","-d","$tmp/etc/init.d");
- }
-
- doit("install","-p","-m755",$init,"$tmp/etc/init.d/$script");
-
- # This is set by the -u "foo" command line switch, it's
- # the parameters to pass to update-rc.d. If not set,
- # we have to say "defaults".
- my $params='';
- if (defined($dh{U_PARAMS})) {
- $params=join(' ',@{$dh{U_PARAMS}});
- }
- if ($params eq '') {
- $params="defaults";
- }
-
- if (! $dh{NOSCRIPTS}) {
- if (! $dh{NO_START}) {
- # update-rc.d, and start script
- autoscript($package,"postinst", "postinst-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
-
- if ($dh{R_FLAG}) {
- # stops script only on remove
- autoscript($package,"prerm","prerm-init-norestart",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
- }
- else {
- # always stops script
- autoscript($package,"prerm","prerm-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
- }
- }
- else {
- # just update-rc.d
- autoscript($package,"postinst", "postinst-init-nostart",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
- }
-
- # removes rc.d links
- autoscript($package,"postrm","postrm-init",
- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installinit.1 b/dh_installinit.1
new file mode 100644
index 00000000..cbb4b444
--- /dev/null
+++ b/dh_installinit.1
@@ -0,0 +1,62 @@
+.TH DH_INSTALLINIT 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installinit \- install init scripts into package build directories
+.SH SYNOPSIS
+.B dh_installinit
+.I "[debhelper options] [--init-script=scriptname] [-n] [-r] [-d] [-uparams]"
+.SH "DESCRIPTION"
+dh_installinit is a debhelper program that is responsible for installing
+init scripts into package build directories.
+.P
+It also automatically generates the postinst and postrm and prerm commands
+needed to set up the symlinks in /etc/rc*.d/ and to start and stop the init
+scripts.
+.P
+If a file named debian/package.init (or debian/package.init.d for backwards
+compatibility with debstd) exists, then it is installed into
+etc/init.d/package in the package build directory, with "package" replaced
+by the packagename. (You may use debian/init for the first binary package
+listed in the control file.)
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/postrm/prerm scripts.
+.TP
+.B \-r, \--no-restart-on-upgrade
+Do not restart daemon on upgrade.
+.TP
+.B \-d, \--remove-d
+Remove trailing "d" from the name of the package, and use the result for the
+filename the init script is installed as in etc/init.d/ . This may be useful
+for daemons with names ending in "d". (Note: this takes precedence over
+the --init-script parameter described below.)
+.TP
+.B \-uparams, \--update-rcd-params=params
+Pass "params" to
+.BR update-rc.d (8)
+If not specified, "defaults" will be passed to
+.BR update-rc.d (8)
+.TP
+.B \--init-script=scriptname
+Use "scriptname" as for the filename the init script is installed as in
+etc/init.d/ . This is useful if you need to have an init script with a name
+different from the package's name. Note that if you use this parameter,
+dh_installinit will look to see if a file in the debian/ directory exists
+that looks like "scriptname" or "package.scriptname" and if so will install
+it as the inist script in preference to the files it normally installs. This
+feature is really only useful if you need a single package to install more
+than one init script.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1),
+.BR update_rc.d (8)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installmanpages b/dh_installmanpages
deleted file mode 100755
index 39946f6a..00000000
--- a/dh_installmanpages
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installmanpages - old-style man page installer
-
-=cut
-
-use strict;
-use File::Find;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installmanpages> [S<I<debhelper options>>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_installmanpages is a debhelper program that is responsible for
-automatically installing man pages into usr/share/man/ and usr/X11R6/man/
-in package build directories.
-
-This is a DWIM-style program, with an interface unlike the rest of
-debhelper. You are encouraged to use L<dh_installman(1)> instead.
-
-dh_installmanpages scans the current directory and all subdirectories for
-filenames that look like man pages. (Note that only real files are looked
-at; symlinks are ignored.) It uses L<file(1)> to verify that the files are
-in the correct format. Then, based on the files' extensions, it installs
-them into the correct man directory.
-
-All filenames specified as parameters will be skipped by dh_installmanpages.
-This is useful if by default it installs some man pages that you do not
-want to be installed.
-
-After the man page installation step, dh_installmanpages will check to see
-if any of the man pages are ".so" links. If so, it changes them to symlinks.
-
-=head1 OPTIONS
-
-=over 4
-
-=item I<file ...>
-
-Do not install these files as man pages, even if they look like valid man
-pages.
-
-=back
-
-=head1 BUGS
-
-dh_installmanpages will install the man pages it finds into B<all> packages
-you tell it to act on, since it can't tell what package the man
-pages belong in. This is almost never what you really want (use -p to work
-around this, or use the much better L<dh_installman(1)> program instead).
-
-Files ending in I<.man> will be ignored.
-
-Files specified as parameters that contain spaces in their filenames will
-not be processed properly.
-
-=cut
-
-init();
-
-# Check if a file is a man page, for use by File::Find.
-my @manpages;
-my @allpackages;
-sub find_man {
- # Does its filename look like a man page?
- # .ex files are examples installed by deb-make,
- # we don't want those, or .in files, which are
- # from configure, nor do we want CVS .#* files.
- if (! (-f $_ && /^.*\.[1-9].*$/ && ! /\.(ex|in)$/ && ! /^\.#/)) {
- return;
- }
-
- # It's not in a tmp directory is it?
- if ($File::Find::dir=~m:debian/.*tmp.*:) {
- return;
- }
- foreach my $dir (@allpackages) {
- if ($File::Find::dir=~m:debian/\Q$dir\E:) {
- return;
- }
- }
-
- # And file does think it's a real man page?
- my $type=`file -z $_`;
- if ($type !~ m/:.*roff/) {
- return;
- }
-
- # Good enough.
- push @manpages,"$File::Find::dir/$_";
-}
-
-# Check if a file is a .so man page, for use by File::Find.
-my @sofiles;
-my @sodests;
-sub find_so_man {
- # The -s test is becuase a .so file tends to be small. We don't want
- # to open every man page. 1024 is arbitrary.
- if (! -f $_ || -s $_ > 1024) {
- return;
- }
-
- # Test first line of file for the .so thing.
- open (SOTEST,$_);
- my $l=<SOTEST>;
- close SOTEST;
- if ($l=~m/\.so\s+(.*)/) {
- my $solink=$1;
- # This test is here to prevent links like ... man8/../man8/foo.8
- if (basename($File::Find::dir) eq
- dirname($solink)) {
- $solink=basename($solink);
- }
- else {
- $solink="../$solink";
- }
-
- push @sofiles,"$File::Find::dir/$_";
- push @sodests,$solink;
- }
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- # Find all filenames that look like man pages.
- @manpages=();
- @allpackages=GetPackages('');
- find(\&find_man,'.'); # populates @manpages
-
- foreach my $page (@manpages) {
- $page=~s:^\./::; # just for looks
-
- my $basename=basename($page);
-
- # Skip all files listed on command line.
- my $install=1;
- foreach my $skip (@ARGV) {
- # Look at basename of what's on connect line
- # for backwards compatibility.
- if ($basename eq basename($skip)) {
- $install=undef;
- last;
- }
- }
-
- if ($install) {
- my $extdir="share";
- # Handle X man pages specially.
- if ($basename=~/x$/) {
- $extdir="X11R6";
- }
-
- my ($section)=$basename=~m/.*\.([1-9])/;
-
- my $destdir="$tmp/usr/$extdir/man/man$section/";
-
- # Handle translated man pages.
- my $instname=$basename;
- my ($langcode)=$basename=~m/.*\.([a-z][a-z])\.([1-9])/;
- if (defined $langcode && $langcode ne '') {
- $destdir="$tmp/usr/$extdir/man/$langcode/man$section/";
- $instname=~s/\.$langcode\./\./;
- }
-
- $destdir=~tr:/:/:s; # just for looks
-
- if (! -e "$destdir/$basename" && !-l "$destdir/$basename") {
- if (! -d $destdir) {
- doit "install","-d",$destdir;
- }
- doit "install","-p","-m644",$page,$destdir.$instname;
- }
- }
- }
-
- # Now the .so conversion.
- @sofiles=@sodests=();
- foreach my $dir (qw{usr/share/man usr/X11R6/man}) {
- if (-e "$tmp/$dir") {
- find(\&find_so_man, "$tmp/$dir");
- }
- }
- foreach my $sofile (@sofiles) {
- my $sodest=shift(@sodests);
- doit "rm","-f",$sofile;
- doit "ln","-sf",$sodest,$sofile;
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installmanpages.1 b/dh_installmanpages.1
new file mode 100644
index 00000000..edc37c21
--- /dev/null
+++ b/dh_installmanpages.1
@@ -0,0 +1,59 @@
+.TH DH_INSTALLMANPAGES 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installmanpages \- install man pages into package build directories
+.SH SYNOPSIS
+.B dh_installmanpages
+.I "[debhelper options] [file ...]"
+.SH "DESCRIPTION"
+dh_installmanpages is a debhelper program that is responsible for
+automatically installing man pages into usr/man/ and usr/X11R6/man/ in
+package build directories.
+.P
+dh_installmanpages scans the current directory and all subdirectories for
+filenames that look like man pages. (Note that only real files are looked
+at; symlinks are ignored.) It uses
+.BR file (1)
+to verify that the files are in the correct format. Then, based on the
+files' extensions, it installs them into the correct man directory.
+.P
+All filenames specified as parameters will be skipped by dh_installmanpages.
+This is useful if by default it installs some man pages that you do not want
+to be installed.
+.P
+After the man page installation step, dh_installmanpages will check to see if
+any of the man pages are ".so" links. If so, it changes them to symlinks.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B file ...
+Do not install these files as man pages, even if they look like valid man
+pages.
+.SH NOTES
+dh_installmanpages will install the man pages it finds into
+.B all
+packages you tell it to act on, since it can't tell what package the man
+pages belong in.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH BUGS
+Man pages with the extension
+.B .man
+are not automatically installed.
+.P
+Files specified as parameters that contain spaces in their filenames will
+not be processed properly.
+.P
+By default, all man pages are installed into all binary packages, which is
+almost never what you really want (use -p to work around this).
+.P
+This is a "Do what I Mean" type program - you have been warned!
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installmenu b/dh_installmenu
deleted file mode 100755
index 420b2164..00000000
--- a/dh_installmenu
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installmenu - install debian menu files into package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installmenu> [S<B<debhelper options>>] [B<-n>]
-
-=head1 DESCRIPTION
-
-dh_installmenu is a debhelper program that is responsible for installing
-files used by the debian menu package into package build directories.
-
-It also automatically generates the postinst and postrm commands needed to
-interface with the debian menu package. See L<dh_installdeb(1)> for an
-explanation of how this works.
-
-If a file named debian/package.menu exists, then it is installed into
-usr/lib/menu/package in the package build directory. This is a debian menu
-file. See L<menufile(5L)> for its format.
-
-If a file named debian/package.menu-method exits, then it is installed into
-etc/menu-methods/package in the package build directory. This is a debian
-menu method file.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/postrm scripts.
-
-=back
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $menu=pkgfile($package,"menu");
- my $menu_method=pkgfile($package,"menu-method");
-
- if ($menu ne '') {
- if (! -d "$tmp/usr/lib/menu") {
- doit("install","-d","$tmp/usr/lib/menu");
- }
- doit("install","-p","-m644",$menu,"$tmp/usr/lib/menu/$package");
-
- # Add the scripts if a menu-method file doesn't exist.
- # The scripts for menu-method handle everything these do, too.
- if ($menu_method eq "" && ! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-menu");
- autoscript($package,"postrm","postrm-menu")
- }
- }
-
- if ($menu_method ne '') {
- if (!-d "$tmp/etc/menu-methods") {
- doit("install","-d","$tmp/etc/menu-methods");
- }
- doit("install","-p",$menu_method,"$tmp/etc/menu-methods/$package");
-
- if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/");
- autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/");
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-L<update-menus(1)>
-L<menufile(5)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installmenu.1 b/dh_installmenu.1
new file mode 100644
index 00000000..d9d8296a
--- /dev/null
+++ b/dh_installmenu.1
@@ -0,0 +1,45 @@
+.TH DH_INSTALLMENU 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installmenu \- install debian menu files into package build directories
+.SH SYNOPSIS
+.B dh_installmenu
+.I "[debhelper options] [-n]"
+.SH "DESCRIPTION"
+dh_installmenu is a debhelper program that is responsible for installing
+files used by the debian menu package into package build directories.
+.P
+It also automatically generates the postinst and postrm commands needed to
+interface with the debian menu package. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.P
+If a file named debian/package.menu exists, then it is installed into
+usr/lib/menu/package in the package build directory. This is a debian menu
+file.
+.P
+If a file named debian/package.menu-method exits, then it is installed into
+etc/menu-methods/package in the package build directory. This is a debian
+menu method file.
+.P
+For the first first binary package listed in the control file, you may use
+debian/menu and debian/menu-method instead.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/postrm scripts.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR menufile (5)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installmime b/dh_installmime
deleted file mode 100755
index 8ffd5236..00000000
--- a/dh_installmime
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installmime - install mime files into package build directories
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installmime> [S<I<debhelper options>>] [B<-n>]
-
-=head1 DESCRIPTION
-
-dh_installmime is a debhelper program that is responsible for installing
-mime files into package build directories.
-
-It also automatically generates the postinst and postrm commands needed to
-interface with the debian mime-support package. See L<dh_installdeb(1)> for
-an explanation of how this works.
-
-If a file named debian/package.mime exists, then it is installed into
-usr/lib/mime/packages/package in the package build directory.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/postrm scripts.
-
-=back
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $mime=pkgfile($package,"mime");
-
- if ($mime ne '') {
- if (! -d "$tmp/usr/lib/mime/packages") {
- doit("install","-d","$tmp/usr/lib/mime/packages");
- }
- doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package");
-
- if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-mime");
- autoscript($package,"postrm","postrm-mime")
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installmime.1 b/dh_installmime.1
new file mode 100644
index 00000000..4ace9985
--- /dev/null
+++ b/dh_installmime.1
@@ -0,0 +1,38 @@
+.TH DH_INSTALLMIME 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installmime \- install mime files into package build directories
+.SH SYNOPSIS
+.B dh_installmime
+.I "[debhelper options] [-n]"
+.SH "DESCRIPTION"
+dh_installmime is a debhelper program that is responsible for installing
+mime files into package build directories.
+.P
+It also automatically generates the postinst and postrm commands needed to
+interface with the debian mime-support package. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.P
+If a file named debian/package.mime exists, then it is installed into
+usr/lib/mime/packages/package in the package build directory.
+.P
+For the first first binary package listed in the control file, you may use
+debian/mime instead.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/postrm scripts.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installmodules b/dh_installmodules
deleted file mode 100755
index 13fd8f5c..00000000
--- a/dh_installmodules
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installmodules - register modules with modutils
-
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-use File::Find;
-
-=head1 SYNOPSIS
-
-B<dh_installmodules> [S<I<debhelper options>>] [B<-n>]
-
-=head1 DESCRIPTION
-
-dh_installmodules is a debhelper program that is responsible for
-registering kernel modules with modutils.
-
-Files named debian/package.modules will be installed as
-etc/modutils/package in the package build directory.
-
-Then postinst and postrm commands are automatically generated to register
-the modules when the package is installed. See L<dh_installdeb(1)> for an
-explanation of how this works. Note that this will be done for any
-package this program acts on which has either the above-mentioned file, or
-has .o files in /lib/modules.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/postrm scripts.
-
-=back
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=cut
-
-init();
-
-# Returns true if there are any .o files in the passed directory.
-sub find_kernel_modules {
- my $searchdir=shift;
- my @results=();
-
- return unless -d $searchdir;
- find(sub { push @results, $_ if /\.o$/ }, $searchdir);
- return @results > 0;
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $file=pkgfile($package,"modules");
-
- if (! -e $tmp) {
- doit("install","-d",$tmp);
- }
-
- if ($file) {
- if (! -e "$tmp/etc/modutils") {
- doit("install","-d","$tmp/etc/modutils");
- }
- doit("install","-m","0644",$file,"$tmp/etc/modutils/$package");
- }
-
- if (! $dh{NOSCRIPTS} &&
- ($file || find_kernel_modules("$tmp/lib/modules"))) {
- autoscript($package,"postinst","postinst-modules","s/#PACKAGE#/$package/");
- autoscript($package,"postrm","postrm-modules","s/#PACKAGE#/$package/");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installmodules.1 b/dh_installmodules.1
new file mode 100644
index 00000000..6d9016fe
--- /dev/null
+++ b/dh_installmodules.1
@@ -0,0 +1,35 @@
+.TH DH_INSTALLMODULES 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installmodules \- register modules with modutils
+.SH SYNOPSIS
+.B dh_installmodules
+.I "[debhelper options] [-n]"
+.SH "DESCRIPTION"
+dh_installmodules is a debhelper program that is responsible for registering
+kernel modules with modutils.
+.P
+A file named debian/package.modules (debian/modules my be used for the first
+binary package in debian/control) will be installed as etc/modutils/package
+in the package build directory.
+.P
+Then postinst and postrm commands are automatically generated to register
+the modules when the package is installed. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/postrm scripts.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installpam b/dh_installpam
deleted file mode 100755
index 0f251798..00000000
--- a/dh_installpam
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installpam - install pam support files
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installpam> [S<I<debhelper options>>] [B<-n>]
-
-=head1 DESCRIPTION
-
-dh_installpam is a debhelper program that is responsible for installing
-files used by PAM into package build directories.
-
-If a file named debian/package.pam exists, then it is installed into
-etc/pam.d/package in the package build directory.
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $pam=pkgfile($package,"pam");
-
- if ($pam ne '') {
- if (! -d "$tmp/etc/pam.d") {
- doit("install","-d","$tmp/etc/pam.d");
- }
- doit("install","-p","-m644",$pam,"$tmp/etc/pam.d/$package");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installpam.1 b/dh_installpam.1
new file mode 100644
index 00000000..bb34a45c
--- /dev/null
+++ b/dh_installpam.1
@@ -0,0 +1,30 @@
+.TH DH_INSTALLPAM 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installpam \- install pam support files
+.SH SYNOPSIS
+.B dh_installpam
+.I "[debhelper options] [-n]"
+.SH "DESCRIPTION"
+dh_installpam is a debhelper program that is responsible for installing
+files used by PAM into package build directories.
+.P
+If a file named debian/package.pam exists, then it is installed into
+etc/pam.d/package in the package build directory.
+.P
+For the first first binary package listed in the control file, you may use
+debian/pam instead.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installwm b/dh_installwm
deleted file mode 100755
index 31ce63c6..00000000
--- a/dh_installwm
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_installwm - register a window manager
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_installwm> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [S<I<wm ...>>]
-
-=head1 DESCRIPTION
-
-dh_installwm is a debhelper program that is responsible for
-generating the postinst and postrm commands that register a window manager
-with L<update-alternatives(8)>
-
-Any window manager programs specified as parameters will be registered in
-the first package dh_installwm 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.
-
-Files named debian/package.wm can list other window manager programs to
-register.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<--priority=>I<n>
-
-Set the priority of the window manager. Default is 20, which is too low for
-most window managers; see the Debian Policy document for instructions on
-calculating the correct value.
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/postrm scripts. Turns this command into a no-op.
-
-=item I<wm ...>
-
-The commands used to run the window manager or window managers you want to
-register.
-
-=head1 NOTES
-
-Note that this command is not idempotent. "dh_clean -k" should be called
-between invocations of this command. Otherwise, it may cause multiple
-instances of the same text to be added to maintainer scripts.
-
-=back
-
-=cut
-
-init();
-
-if (! defined $dh{PRIORITY}) {
- $dh{PRIORITY}=20;
-}
-
-if (@ARGV) {
- # This is here for backwards compatibility. If the filename doesn't
- # include a path, assume it's in /usr/X11R6/bin.
- if ($ARGV[0] !~ m:/:) {
- $ARGV[0]="/usr/X11R6/bin/$ARGV[0]";
- }
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
-# my $tmp=tmpdir($package);
- my $file=pkgfile($package,"wm");
-
- my @wm;
- if ($file) {
- @wm=filearray($file, '.');
- }
-
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @wm, @ARGV;
- }
-
- if (! $dh{NOSCRIPTS}) {
- foreach (@wm) {
- autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",);
- autoscript($package,"prerm","prerm-wm","s:#WM#:$_:");
- }
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_installwm.1 b/dh_installwm.1
new file mode 100644
index 00000000..d319d755
--- /dev/null
+++ b/dh_installwm.1
@@ -0,0 +1,42 @@
+.TH DH_INSTALLWM 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installwm \- register a window manager
+.SH SYNOPSIS
+.B dh_installwm
+.I "[debhelper options] [-n] wmfilename"
+.SH "DESCRIPTION"
+dh_installwm is a debhelper program that is responsible for
+generating the postinst and postrm commands needed to
+interface with the the
+.BR register-window-manager (8)
+command. This results in a window manager being registered when it is
+installed.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/postrm scripts. Turns this command into a no-op.
+.TP
+.B wmfilename
+The filename of the window manager you wish to register. May be either a
+simple filename if the window manager is in /usr/X11R6/bin/, or a complete
+path otherwise.
+.SH NOTES
+Note that this command will set up postinst and postrm scripts for every
+package it acts on. It's wise to limit its action to a single package with,
+for example, the -p switch.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR register-window-manager (8)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_installxaw b/dh_installxaw
new file mode 100755
index 00000000..d71be544
--- /dev/null
+++ b/dh_installxaw
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+#
+# Integration with xaw-wrappers
+#
+# If debian/xaw-wrappers file exists, save it to
+# $TMP/usr/lib/xaw-wrappers/conf/$PACKAGE
+#
+# Also, add calls to postinst and postrm.
+
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
+init();
+
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $xaw=pkgfile($PACKAGE,'xaw');
+
+ if ($xaw ne '') {
+ if (! -d "$TMP/usr/lib/xaw-wrappers/config") {
+ doit("install","-d","$TMP/usr/lib/xaw-wrappers/config");
+ }
+ doit("install","-p","-m644",$xaw,
+ "$TMP/usr/lib/xaw-wrappers/config/$PACKAGE");
+
+ if (! $dh{NOSCRIPTS}) {
+ # Parse the xaw conf file to figure out what programs
+ # and link names are present in it. Have to pass
+ # those into the scripts.
+ my %data;
+ my $install_opts='';
+ my $remove_opts='';
+ my $stanza='';
+
+ open (IN,$xaw);
+ while (<IN>) {
+ chomp;
+ s/\s+/ /g;
+ if (/^#/ eq '') {
+ if (/(.*?):\s?(.*)/) {
+ $data{lc($1)}=$2;
+ $stanza=1;
+ }
+ elsif ($stanza) {
+ $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}' ";
+ $remove_opts.="'$data{'link-name'} $data{wrapped}' ";
+ undef %data;
+ $stanza='';
+ }
+ }
+ }
+ close IN;
+
+ if ($stanza) {
+ $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'";
+ $remove_opts.="'$data{'link-name'} $data{wrapped}'";
+ }
+
+ autoscript($PACKAGE,"postinst","postinst-xaw",
+ "s:#OPTS#:$install_opts:");
+ autoscript($PACKAGE,"prerm","prerm-xaw",
+ "s:#OPTS#:$remove_opts:");
+ autoscript($PACKAGE,"postrm","postrm-xaw");
+ }
+ }
+}
diff --git a/dh_installxaw.1 b/dh_installxaw.1
new file mode 100644
index 00000000..4fb9ebf6
--- /dev/null
+++ b/dh_installxaw.1
@@ -0,0 +1,40 @@
+.TH DH_INSTALLXAW 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installxaw \- install xaw wrappers config files into package build directories
+.SH SYNOPSIS
+.B dh_installxaw
+.I "[debhelper options] [-n]"
+.SH "DESCRIPTION"
+dh_installxaw is a debhelper program that is responsible for installing
+xaw wrappers config files into package build directories.
+.P
+It also automatically generates the postinst, prerm, and postrm commands needed to
+interface with the debian xaw-wrappers package. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.P
+If a file named debian/package.xaw exists, then it is installed into
+usr/lib/xaw-wrappers/config/package in the package build directory.
+.P
+For the first first binary package listed in the control file, you may use
+debian/xaw instead.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-n, \--noscripts
+Do not modify postinst/prerm/postrm scripts.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR update-xaw-wrappers (8)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_link b/dh_link
deleted file mode 100755
index 6cb889cd..00000000
--- a/dh_link
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_link - create symlinks in package build directories
-
-=cut
-
-use strict;
-use File::Find;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_link> [S<I<debhelper options>>] [B<-A>] [S<I<source destination ...>>]
-
-=head1 DESCRIPTION
-
-dh_link is a debhelper program that creates symlinks in package build
-directories.
-
-dh_link accepts a list of pairs of source and destination files. The source
-files are the already existing files that will be symlinked from. The
-destination files are the symlinks that will be created. There B<must> be
-an equal number of source and destination files specified.
-
-The list can be specified in two ways. A file named debian/package.links
-can list pairs of files. If you use this file, you should put each pair
-of files on its own line, and separate the files within the pair with
-whitespace. Also, pairs of files can be specified as parameters - these
-pairs will only be created in the package build directory of the first
-package dh_link 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.
-
-Be sure you B<do> specify the full filename to both the source and
-destination files (unlike you would do if you were using something like
-L<ln(1)>).
-
-dh_link will generate symlinks that comply with debian policy - absolute
-when policy says they should be absolute, and relative links with as short
-a path as possible. It will also create any subdirectories it needs to to put
-the symlinks in.
-
-dh_link also scans the package build tree for existing symlinks which do not
-conform to debian policy, and corrects them (v4 only).
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-A>, B<--all>
-
-Create any links specified by command line parameters in ALL packages
-acted on, not just the first.
-
-=item I<source destination ...>
-
-Create a file named "destination" as a link to a file named "source". Do
-this in the package build directory of the first package acted on.
-(Or in all packages if -A is specified.)
-
-=back
-
-=head1 EXAMPLES
-
- dh_link usr/share/man/man1/foo.1 usr/share/man/man1/bar.1
-
-Make bar.1 be a symlink to foo.1
-
- dh_link var/lib/foo usr/lib/foo \
- usr/X11R6/man/man1/foo.1x usr/share/man/man1/bar.1
-
-Make /usr/lib/foo/ be a link to /var/lib/foo/, and bar.1 be a symlink to
-the X man page foo.1x
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $file=pkgfile($package,"links");
-
- my @links;
- if ($file) {
- @links=filearray($file);
- }
-
- # Make sure it has pairs of symlinks and destinations. If it
- # doesn't, $#links will be _odd_ (not even, -- it's zero-based).
- if (int($#links/2) eq $#links/2) {
- error("$file lists a link without a destination.");
- }
-
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @links, @ARGV;
- }
-
- # Same test as above, including arguments this time.
- if (int($#links/2) eq $#links/2) {
- error("parameters list a link without a destination.");
- }
-
- # v4 only and only if there is a temp dir already
- if (! compat(3) && -e $tmp) {
- # Scan for existing links and add them to @links, so they
- # are recreated policy conformant.
- find(
- sub {
- return unless -l;
- my $dir=$File::Find::dir;
- $dir=~s/^\Q$tmp\E//;
- my $target = readlink($_);
- if ($target=~/^\//) {
- push @links, $target;
- }
- else {
- push @links, "$dir/$target";
- }
- push @links, "$dir/$_";
- doit("rm","-f",$_);
-
- },
- $tmp);
- }
-
- while (@links) {
- my $dest=pop @links;
- my $src=pop @links;
-
- # Relavatize src and dest.
- $src=~s:^/::;
- $dest=~s:^/::;
-
- # Make sure the directory the link will be in exists.
- my $basedir=dirname("$tmp/$dest");
- if (! -e $basedir) {
- doit("install","-d",$basedir);
- }
-
- # Policy says that if the link is all within one toplevel
- # directory, it should be relative. If it's between
- # top level directories, leave it absolute.
- my @src_dirs=split(m:/+:,$src);
- my @dest_dirs=split(m:/+:,$dest);
- if ($src_dirs[0] eq $dest_dirs[0]) {
- # Figure out how much of a path $src and $dest
- # share in common.
- my $x;
- for ($x=0; $x<$#src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {}
- # Build up the new src.
- $src="";
- for (1..$#dest_dirs - $x) {
- $src.="../";
- }
- for ($x .. $#src_dirs) {
- $src.=$src_dirs[$_]."/";
- }
- $src=~s:/$::;
- }
- else {
- # Make sure it's properly absolute.
- $src="/$src";
- }
-
- doit("ln","-sf",$src,"$tmp/$dest");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_link.1 b/dh_link.1
new file mode 100644
index 00000000..eb2cce21
--- /dev/null
+++ b/dh_link.1
@@ -0,0 +1,73 @@
+.TH DH_LINK 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_link \- create symlinks in package build directories
+.SH SYNOPSIS
+.B dh_link
+.I "[debhelper options] [-A] [source destination ...]"
+.SH "DESCRIPTION"
+dh_link is a debhelper program that creates symlinks in package build
+directories.
+.P
+dh_link accepts a list of pairs of source and destination files. The source
+files are the already existing files that will be symlinked from. The
+destination files are the symlinks that will be created. There
+.B must
+be an equal number of source and destination files specified.
+.P
+The list can be specified in two ways. A file named debian/package.links
+(debian/links may be used for the first binary package in debian/control)
+can list pairs of files. If you use this file, you should put each pair
+of files on its own line, and separate the files within the pair with
+whitespace. Also, pairs of files can be specified as parameters - these
+pairs will only be created in the package build directory of the first
+ackage dh_link 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.
+.P
+Be sure you
+.B do
+specify the full filename to both the source and destination files (unlike
+you would do if you were using something like
+.BR ln (1)
+).
+.P
+dh_link will generate symlinks that comply with debian policy - absolute
+when policy says they should be absolute, and relative links with as short a
+path as possible. It will also create any subdirectories it needs to to put
+the symlinks in.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Create any links specified by command line parameters in ALL packages
+acted on, not just the first.
+.TP
+.B source destination ...
+Create a file named "destination" as a link to a file named "source". Do
+this in the package build directory of the first package acted on.
+(Or in all packages if -A is specified.)
+.SH EXAMPLES
+.TP
+.B dh_link usr/man/man1/foo.1 usr/man/man1/bar.1
+Make bar.1 be a symlink to foo.1
+.TP
+.B dh_link var/lib/foo usr/lib/foo usr/X11R6/man/man1/foo.1x usr/man/man1/bar.1
+Make /usr/lib/foo/ be a link to /var/lib/foo/, and bar.1 be a symlink to the
+X man page foo.1x
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH BUGS
+It's impossible to specify filenames with spaces or other whitespace in them
+in debian/links file. This is more a historical design flaw than a bug.
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_listpackages b/dh_listpackages
deleted file mode 100755
index f919ef62..00000000
--- a/dh_listpackages
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_listpackages - list binary packages debhelper will act on
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_listpackages> [S<I<debhelper options>>]
-
-=head1 DESCRIPTION
-
-dh_listpackages is a debhelper program that outputs a list of all binary
-packages debhelper commands will act on. If you pass it some options, it
-will change the list to match the packages other debhelper commands would
-act on if passed the same options.
-
-=cut
-
-init();
-print join("\n",@{$dh{DOPACKAGES}})."\n";
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_listpackages.1 b/dh_listpackages.1
new file mode 100644
index 00000000..aa4e7419
--- /dev/null
+++ b/dh_listpackages.1
@@ -0,0 +1,25 @@
+.TH DH_LISTPACKAGES 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_listpackages \- list binary packages debhelper will act on
+.SH SYNOPSIS
+.B dh_listpackages
+.I "[debhelper options]"
+.SH "DESCRIPTION"
+dh_listpackages is a debhelper program that outputs a list of all binary
+packages debhelper commands will act on. If you pass it some options, it
+will change the list to match the packages other debhelper commands would
+act on if passed the same options.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_makeshlibs b/dh_makeshlibs
deleted file mode 100755
index de9f7827..00000000
--- a/dh_makeshlibs
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_makeshlibs - automatically create shlibs file
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_makeshlibs> [S<I<debhelper options>>] [B<-m>I<major>] [B<-V>I<[dependancies]>] [B<-n>] [B<-X>I<item>]
-
-=head1 DESCRIPTION
-
-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
-V3 mode and above only) to any packages which it finds shared libraries in.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-m>I<major>, B<--major=>I<major>
-
-Instead of trying to guess the major number of the library with objdump,
-use the major number specified after the -m parameter. This is much less
-useful than it used to be, back in the bad old days when this program
-looked at library filenames rather than using objdump.
-
-=item B<-V>, B<-V>I<dependancies>
-
-=item B<--version-info>, B<--version-info=>I<dependancies>
-
-By default, the shlibs file generated by this program does not make packages
-depend on any particular version of the package containing the shared
-library. It may be necessary for you to add some version dependancy
-information to the shlibs file. If -V is specified with no dependancy
-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).
-
-Beware of using -V without any parameters; this is a conservative setting
-that always ensures that other packages' shared library dependencies are at
-least as tight as they need to be, so that if the maintainer screws up then
-they won't break. The flip side is that packages might end up with
-dependencies that are too tight and so find it harder to be upgraded.
-
-=item B<-n>, B<--noscripts>
-
-Do not modify postinst/postrm scripts.
-
-=item B<-X>I<item>, B<--exclude=>I<item>
-
-Exclude files that contain "item" anywhere in their filename or directory
-from being treated as shared libraries.
-
-=back
-
-=head1 EXAMPLES
-
- dh_makeshlibs
-
-Assuming this is a package named libfoobar1, generates a shlibs file that
-looks something like:
- libfoobar 1 libfoobar1
-
- dh_makeshlibs -V
-
-Assuming the current version of the package is 1.0-3, generates a shlibs
-file that looks something like:
- libfoobar 1 libfoobar1 (>= 1.0-3)
-
- dh_makeshlibs -V 'libfoobar1 (>= 1.0)'
-
-Generates a shlibs file that looks something like:
- libfoobar 1 libfoobar1 (>= 1.0)
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- my %seen;
- my $need_ldconfig = 0;
-
- doit("rm", "-f", "$tmp/DEBIAN/shlibs");
-
- # So, we look for files or links to existing files with names that
- # match "*.so*". Matching *.so.* is not good enough because of
- # broken crap like db3. And we only look at real files not
- # symlinks, so we don't accidentually add shlibs data to -dev
- # packages. This may have a few false positives, which is ok,
- # because only if we can get a library name and a major number from
- # objdump is anything actually added.
- my $exclude='';
- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
- $exclude="! \\( $dh{EXCLUDE_FIND} \\) ";
- }
- open (FIND, "find $tmp -type f -name '*.so*' $exclude |");
- while (<FIND>) {
- my ($library, $major);
- my $objdump=`objdump -p $_`;
- if ($objdump=~m/\s+SONAME\s+(.+)\.so\.(.+)/) {
- # proper soname format
- $library=$1;
- $major=$2;
- }
- elsif ($objdump=~m/\s+SONAME\s+(.+)-(.+)\.so/) {
- # idiotic crap soname format
- $library=$1;
- $major=$2;
- }
-
- if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') {
- $major=$dh{M_PARAMS};
- }
-
- if (! -d "$tmp/DEBIAN") {
- doit("install","-d","$tmp/DEBIAN");
- }
- my $deps=$package;
- if ($dh{V_FLAG_SET}) {
- if ($dh{V_FLAG} ne '') {
- $deps=$dh{V_FLAG};
- }
- else {
- # Call isnative becuase it sets $dh{VERSION}
- # as a side effect.
- isnative($package);
- my $version = $dh{VERSION};
- # Old compatability levels include the
- # debian revision, while new do not.
- if (! compat(3)) {
- # Remove debian version, if any.
- $version =~ s/-[^-]+$//;
- }
- $deps="$package (>= $version)";
- }
- }
- if (defined($library) && defined($major) && defined($deps) &&
- $library ne '' && $major ne '' && $deps ne '') {
- $need_ldconfig=1;
- # Prevent duplicate lines from entering the file.
- my $line="$library $major $deps";
- if (! $seen{$line}) {
- $seen{$line}=1;
- complex_doit("echo '$line' >>$tmp/DEBIAN/shlibs");
- }
- }
- }
- close FIND;
-
- # New as of dh_v3.
- if (! compat(2) && ! $dh{NOSCRIPTS} && $need_ldconfig) {
- autoscript($package,"postinst","postinst-makeshlibs");
- autoscript($package,"postrm","postrm-makeshlibs");
- }
-
- if (-e "$tmp/DEBIAN/shlibs") {
- doit("chmod",644,"$tmp/DEBIAN/shlibs");
- doit("chown","0.0","$tmp/DEBIAN/shlibs");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1
new file mode 100644
index 00000000..282d54fe
--- /dev/null
+++ b/dh_makeshlibs.1
@@ -0,0 +1,63 @@
+.TH DH_MAKESHLIBS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_makeshlibs \- automatically create shlibs file
+.SH SYNOPSIS
+.B dh_makeshlibs
+.I "[debhelper options] [-mmajor] [-V[dependancies]]"
+.SH "DESCRIPTION"
+dh_makeshlibs is a debhelper program that automatically scans for shared
+libraries, and generates a shlibs file for the libraries it finds.
+.P
+For this program to work, you cannot have already installed a DEBIAN/shlibs
+file. If such a file exits, the program will exit with an error.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-mmajor, \--major=major
+Instead of trying to guess the major number of the library from the filename
+of the library, use the major number specified after the -m parameter.
+.TP
+.B \-V[dependancies], \--version-info, \--version-info=dependancies
+By default, the shlibs file generated by this program does not make packages
+depend on any particular version of the package containing the shared
+library. It may be necessary for you to add some version dependancy
+information to the shlibs file. If -V is specified with no dependancy
+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).
+.SH EXAMPLES
+.TP
+.B dh_makeshlibs
+Assuming this is a package named libfoobar1, generates a shlibs file that
+looks something like:
+ libfoobar 1 libfoobar1
+.TP
+.B dh_makeshlibs \-V
+Assuming the current version of the package is 1.0-3, generates a shlibs
+file that looks something like:
+ libfoobar 1 libfoobar1 (>= 1.0-3)
+.TP
+.B dh_makeshlibs \-V "'libfoobar1 (>= 1.0)'"
+Generates a shlibs file that looks something like:
+ libfoobar 1 libfoobar1 (>= 1.0)
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH BUGS
+There is no guarantee that the program will get the shlibs file right. For
+example, it may not correctly guess the major number of your package. In
+cases like these (and perhaps in general, just to be safe), it is better to
+create a debian/shlibs file by hand, or force it to use the correct major
+number by specifying the -m parameter.
+.P
+This is a "do what I Mean" type program - you have been warned!
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_md5sums b/dh_md5sums
deleted file mode 100755
index 6f794e7f..00000000
--- a/dh_md5sums
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_md5sums - generate DEBIAN/md5sums file
-
-=cut
-
-use strict;
-use Cwd;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_md5sums> [S<I<debhelper options>>] [B<-x>] [B<-X>I<item>] [B<--include-conffiles>]
-
-=head1 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.
-These files are used by the debsums package.
-
-All files in DEBIAN/ are omitted from the md5sums file, as are all
-conffiles (unless you use the --include-conffiles switch).
-
-The md5sums file is installed with proper permissions and ownerships.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-x>, B<--include-conffiles>
-
-Include conffiles in the md5sums list. Note that this information is
-redundant since it is included elsewhere in debian packages.
-
-=item B<-X>I<item>, B<--exclude=>I<item>
-
-Exclude files that contain "item" anywhere in their filename from
-being listed in the md5sums file.
-
-=back
-
-=cut
-
-init();
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- if (! -d "$tmp/DEBIAN") {
- doit("install","-d","$tmp/DEBIAN");
- }
-
- # Check if we should exclude conffiles.
- my $exclude="";
- if (! $dh{INCLUDE_CONFFILES} && -r "$tmp/DEBIAN/conffiles") {
- # Generate exclude regexp.
- open (CONFF,"$tmp/DEBIAN/conffiles");
- while (<CONFF>) {
- chomp;
- s/^\///;
- $exclude.="! -path \"$_\" ";
- }
- close CONFF;
- }
-
- # See if we should exclude other files.
- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
- $exclude.="! \\( $dh{EXCLUDE_FIND} \\) ";
- }
-
- my $olddir=getcwd();
- complex_doit("cd $tmp >/dev/null ; find . -type f $exclude ! -regex '.*/DEBIAN/.*' -printf '%P\\0' | xargs -r0 md5sum > DEBIAN/md5sums ; cd '$olddir' >/dev/null");
- # If the file's empty, no reason to waste inodes on it.
- if (-z "$tmp/DEBIAN/md5sums") {
- doit("rm","-f","$tmp/DEBIAN/md5sums");
- }
- else {
- doit("chmod",644,"$tmp/DEBIAN/md5sums");
- doit("chown","0.0","$tmp/DEBIAN/md5sums");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_md5sums.1 b/dh_md5sums.1
new file mode 100644
index 00000000..b044077c
--- /dev/null
+++ b/dh_md5sums.1
@@ -0,0 +1,36 @@
+.TH DH_MD5SUMS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_md5sums \- generate DEBIAN/md5sums file
+.SH SYNOPSIS
+.B dh_md5sums
+.I "[debhelper options] [-x] [-Xitem]"
+.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, as are all conffiles
+(unless you use the -x switch).
+.P
+The md5sums file is installed with proper permissions and ownerships.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-x, \--include-conffiles
+Include conffiles in the md5sums list. Note that this information is
+redundant since it is included elsewhere in debian packages.
+.TP
+.B \-Xitem, --exclude=item
+Exclude files that contain "item" anywhere in their filename from
+being listed in the md5sums file.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_movefiles b/dh_movefiles
deleted file mode 100755
index 2c8a63fd..00000000
--- a/dh_movefiles
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_movefiles - move files out of debian/tmp into subpackages
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_movefiles> [S<I<debhelper options>>] [B<--sourcedir=>I<dir>] [B<-X>I<item>] S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_movefiles is a debhelper program that is responsible for moving files
-out of debian/tmp or some other directory and into other package build
-directories. This may be useful if your package has a Makefile that installs
-everything into debian/tmp, and you need to break that up into subpackages.
-
-Files named debian/package.files list the files to be moved, separated by
-whitespace. The filenames listed should be relative to debian/tmp/. You can
-also list directory names, and the whole directory will be moved. If you
-prefer, you can list the files to move on the command line and this will
-apply to the first package dh_movefiles is told to act on.
-
-Note: dh_install is a much better program that can do everything this one can,
-and more.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<--sourcedir=>I<dir>
-
-Instead of moving files out of debian/tmp (the default), this option makes
-it move files out of some other directory. Since the entire contents of
-the sourcedir is moved, specifiying something like --sourcedir=/ is very
-unsafe, so to prevent mistakes, the sourcedir must be a relative filename;
-it cannot begin with a `/'.
-
-=item B<-Xitem>, B<--exclude=item>
-
-Exclude files that contain "item" anywhere in their filename from
-being installed.
-
-=item I<file ...>
-
-Lists files to move. The filenames listed should be relative to
-debian/tmp/. You can also list directory names, and the whole directory will
-be moved. It is an error to list files here unless you use -p, -i, or -a to
-tell dh_movefiles which subpackage to put them in.
-
-=back
-
-=head1 NOTES
-
-Note that files are always moved out of debian/tmp by default (even if you
-have instructed debhelper to use a compatibility level higher than one,
-which does not otherwise use debian/tmp for anything at all). The idea
-behind this is that the package that is being built can be told to install
-into debian/tmp, and then files can be moved by dh_movefiles from that
-directory. Any files or directories that remain are ignored, and get
-deleted by dh_clean later.
-
-=cut
-
-init();
-
-my $ret=0;
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $files=pkgfile($package,"files");
-
- my $sourcedir="debian/tmp";
- if ($dh{SOURCEDIR}) {
- if ($dh{SOURCEDIR}=~m:^/:) {
- error("The sourcedir must be a relative filename, not starting with `/'.");
- }
- $sourcedir=$dh{SOURCEDIR};
- }
-
- if (! -d $sourcedir) {
- error("$sourcedir does not exist.");
- }
-
- my @tomove;
-
- # debian/files has a different purpose, so ignore it.
- if ($files && $files ne "debian/files" ) {
- @tomove=filearray($files, $sourcedir);
- }
-
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @tomove, @ARGV;
- }
-
- if (@tomove && $tmp eq $sourcedir) {
- error("I was asked to move files from $sourcedir to $sourcedir. Perhaps you should set DH_COMPAT=2?");
- }
-
- # Now we need to expand wildcards in @tomove.
- # This is only necessary in pre-v3 land -- as of v3, the
- # expension is automatically done by filearray().
- if (@tomove && compat(2)) {
- my @filelist=();
- foreach (@tomove) {
- push @filelist, glob("$sourcedir/$_");
- }
- @tomove=@filelist;
- }
- else {
- # However, filearray() does not add the sourcedir,
- # which we need.
- @tomove = map { "$sourcedir/$_" } @tomove;
- }
-
- if (@tomove) {
- if (! -d $tmp) {
- doit("install","-d",$tmp);
- }
-
- doit("rm","-f","debian/movelist");
- foreach (@tomove) {
- my $file=$_;
- if (! -e $file && ! -l $file && ! $dh{NO_ACT}) {
- $ret=1;
- warning("$file not found (supposed to put it in $package)");
- }
- $file=~s:^\Q$sourcedir\E/+::;
- my $cmd="(cd $sourcedir >/dev/null ; find $file ! -type d ";
- if ($dh{EXCLUDE_FIND}) {
- $cmd.="-a ! \\( $dh{EXCLUDE_FIND} \\) ";
- }
- $cmd.="-print || true) >> debian/movelist";
- complex_doit($cmd);
- }
- my $pwd=`pwd`;
- chomp $pwd;
- complex_doit("(cd $sourcedir >/dev/null ; tar --create --files-from=$pwd/debian/movelist --file -) | (cd $tmp >/dev/null ;tar xpf -)");
- # --remove-files is not used above because tar then doesn't
- # preserve hard links
- complex_doit("(cd $sourcedir >/dev/null ; cat $pwd/debian/movelist | xargs rm -f)");
- doit("rm","-f","debian/movelist");
- }
-}
-
-# If $ret is set, we wern't actually able to find some
-# files that were specified to be moved, and we should
-# exit with the code in $ret. This program puts off
-# exiting with an error until all files have been tried
-# to be moved, because this makes it easier for some
-# packages that arn't always sure exactly which files need
-# to be moved.
-exit $ret;
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_movefiles.1 b/dh_movefiles.1
new file mode 100644
index 00000000..45b84a64
--- /dev/null
+++ b/dh_movefiles.1
@@ -0,0 +1,49 @@
+.TH DH_MOVEFILES 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_movefiles \- move files out of debian/tmp into subpackages
+.SH SYNOPSIS
+.B dh_movefiles
+.I "[debhelper options] [--sourcedir=dir] [file ..]"
+.SH "DESCRIPTION"
+dh_movefiles is a debhelper program that is responsible for moving files out
+of debian/tmp or some other directory and into other package build
+directories. This may be useful if your package has a Makefile that installs
+everything into debian/tmp, and you need to break that up into subpackages.
+.P
+Files named debian/package.files list the files to be moved, separated by
+whitespace. The filenames listed should be relative to debian/tmp/. You can
+also list directory names, and the whole directory will be moved. You can
+even use wildcards if you like. If you prefer, you can list the files to
+move on the command line and this will apply to the first package
+dh_movefiles is told to act on.
+.P
+The files will be moved in a special order: first all normal files, then all
+symlinks. This is done because it tends to be a good thing to have symlinks
+last in debian packages, particularly in shared library packages.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B --sourcedir=dir
+Instead of moveing files out of debian/tmp (the default), this option makes
+it move files out of some other directory. Since the entire contents of
+the sourcedir is moved, specifiying something like --sourcedir=/ is very
+unsafe, so to prevent mistakes, the sourcedir must be a relative filename; it
+cannot begin with a `/'.
+.TP
+.B file ..
+Lists files to move. The filenames listed should be relative to debian/tmp/.
+You can also list directory names, and the whole directory will be moved. You
+can even use wildcards if you like. It is an error to list files here unless
+you use -p, -i, or -a to tell dh_movefiles which subpackage to put them in.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_perl b/dh_perl
index 34624d3f..fa9c8eb0 100755
--- a/dh_perl
+++ b/dh_perl
@@ -1,72 +1,21 @@
#!/usr/bin/perl -w
+#
+# Find dependencies on perl stuff
+# Remove .packlist files
-=head1 NAME
-
-dh_perl - calculates perl dependencies
-
-=cut
-
-use strict;
-use Config;
-use File::Find;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-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 program will look at perl scripts and modules in your package,
-and will use this information to generate a dependency on perl or
-perlapi. The dependency will be substituted into your package's control
-file wherever you place the token "${perl:Depends}".
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-d>
-
-In some specific cases you may want to depend on perl-base rather than the
-full perl package. If so, you can pass the -d option to make dh_perl generate
-a dependency on the correct base package. This is only necessary for some
-packages that are included in the base system.
-
-=item B<-V>
-
-By default, scripts and architecture independent modules don't depend
-on any specific version of perl. The -V option causes the current
-version of the perl (or perl-base with -d) package to be specified.
-
-=item I<library dirs>
-
-If your package installs perl modules in non-standard
-directories, you can make dh_perl check those directories by passing their
-names on the command line. It will only check the vendorlib and vendorarch
-directories by default.
-
-=back
-
-=head1 CONFORMS TO
-
-Debian policy, version 3.0.1
-
-Perl policy, version 1.18
-
-=cut
-
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
init();
-my $vendorlib = substr $Config{vendorlib}, 1;
-my $vendorarch = substr $Config{vendorarch}, 1;
+my $ext = '';
+my $lib_dir = 'usr/lib/perl5';
-# the installation dir for arch-indep modules changed to
-# /usr/share/perl5 in this version:
-my $min_version = '5.6.0-16';
+# Figure out the version of perl. If $ENV{PERL} is set, query the perl binary
+# it points to, otherwise query perl directly.
+my $version=sprintf("%.3f", $]);
+if (defined $ENV{PERL}) {
+ $version=`$ENV{PERL} -e 'printf "%.3f", \$]'`;
+}
# Cleaning the paths given on the command line
foreach (@ARGV) {
@@ -74,74 +23,136 @@ foreach (@ARGV) {
s#^/##;
}
-my $perl = 'perl';
-# If -d is given, then the dependency is on perl-base rather than perl.
-$perl .= '-base' if $dh{D_FLAG};
-my $version;
+# If -d is given, then we'll try to depend on one of the perl-5.00X-base
+# package instead of perl-5.00X
+$ext='-base' if ($dh{'D_FLAG'});
-# dependency types
-use constant PROGRAM => 1;
-use constant PM_MODULE => 2;
-use constant XS_MODULE => 4;
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $EXT=pkgext($PACKAGE);
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp = tmpdir($package);
- my $ext = pkgext($package);
+ my ($file, $v, $arch);
+ my $dep_arch = '';
+ my $dep = '';
+ my $found = 0;
- 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;
+ my $dirs = '';
+ foreach ($lib_dir, @ARGV) {
+ $dirs .= "$TMP/$_ " if (-d "$TMP/$_");
+ }
+ my $re = '(?:' . join('|', ($lib_dir, @ARGV)) . ')';
# Look for perl modules and check where they are installed
- my $deps = 0;
- find sub {
- return unless -f;
- $deps |= PM_MODULE if /\.pm$/;
- $deps |= XS_MODULE if /\.so$/;
- }, @dirs if @dirs;
-
- # find scripts
- find sub {
- return unless -f and (-x or /\.pl$/);
- local *F;
- return unless open F, $_;
- if (read F, local $_, 32 and m%^#!\s*(/usr/bin/perl|/usr/bin/env\s+perl)\s%) {
- $deps |= PROGRAM;
+ if ($dirs) {
+ foreach $file (split(/\n/,`find $dirs -type f \\( -name "*.pm" -or -name "*.so" \\)`)) {
+ $found++;
+ if ($file =~ m<^$TMP/$re/(\d\.\d{3})/([^/]+)/>) {
+ $v = $1;
+ $arch = $2;
+ check_module_version ($v, $version);
+ $v .= '-thread' if ($arch =~ /-thread/);
+ $dep_arch = add_deps ($dep_arch, "perl-$v");
+ } elsif ($file =~ m<^$TMP/$re/(\d.\d{3})/>) {
+ $v = $1;
+ check_module_version ($v, $version);
+ $dep_arch = add_deps ($dep_arch, "perl-$v");
}
- close F;
- }, $tmp;
-
- if ($deps) {
- my $version="";
- if ($deps & XS_MODULE or $dh{V_FLAG_SET}) {
- ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m
- unless $version;
- $version = ">= $version";
+ }
+ }
+
+ if ($found and not $dep_arch) {
+ $dep = "perl5$ext";
+ } elsif ($dep_arch) {
+ $dep = $dep_arch;
+ }
+
+ # Look for perl scripts
+ my ($ff, $newdep);
+ foreach $file (split(/\n/,`find $TMP -type f \\( -name "*.pl" -or -perm +111 \\)`)) {
+ $ff=`file -b $file`;
+ if ($ff =~ /perl/) {
+ $newdep = dep_from_script ($file);
+ $dep = add_deps ($dep, $newdep) if $newdep;
}
- elsif ($deps & PM_MODULE) {
- $version = ">= $min_version";
+ }
+
+ # Remove .packlist files and eventually some empty directories
+ if (not $dh{'K_FLAG'}) {
+ foreach $file (split(/\n/,`find $TMP -type f -name .packlist`))
+ {
+ unlink($file);
+ # Get the directory name
+ while ($file =~ s#/[^/]+$##){
+ last if (not -d $file);
+ last if (not rmdir $file);
+ }
}
-
- # 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
- addsubstvar($package, "perl:Depends", "perlapi-$Config{version}")
- if $deps & XS_MODULE;
}
-}
-=head1 SEE ALSO
+ next unless $dep;
-L<debhelper(7)>
+ if (-e "debian/$EXT\substvars") {
+ open (IN, "<debian/$EXT\substvars");
+ my @lines=grep { ! /^perl:Depends=/ } <IN>;
+ close IN;
+ open (OUT, ">debian/$EXT\substvars");
+ print OUT @lines;
+ } else {
+ open (OUT, ">debian/$EXT\substvars");
+ }
+ print OUT "perl:Depends=$dep\n";
+ close OUT;
+}
-This program is a part of debhelper.
+sub add_deps {
+ my ($dep, $new) = @_;
+
+ # If the $new-base package can exist then add $ext to $new
+ $new = "$new$ext" if ($new =~ m/^(?:perl5|perl-\d\.\d{3})$/);
+
+ # If $new = perl5 or perl5-thread check if perl-X.XXX(-thread)?
+ # is not already in the dependencies
+ if ($new eq "perl5") {
+ return $dep if ($dep =~ m/(^|\s)perl-5\.\d{3}(\s|,|$)/);
+ } elsif ($new eq "perl5-thread") {
+ return $dep if ($dep =~ m/(^|\s)perl-5\.\d{3}-thread(\s|,|$)/);
+ }
+
+ if (not $dep) {
+ $dep = $new;
+ } else {
+ $dep .= ", $new" unless ($dep =~ m/(^|\s)$new(\s|,|$)/);
+ }
-=head1 AUTHOR
+ return $dep;
+}
-Brendan O'Dea <bod@debian.org>
+sub check_module_version {
+ my ($v1, $v2) = @_;
+ unless ($v1 eq $v2) {
+ warning("A module has been found in perl-$v1 arch directory. But perl-$v2 is the perl currently used ...\n");
+ }
+}
-=cut
+sub dep_from_script {
+ my $file = shift;
+ my ($line, $perl, $dep);
+ open (SCRIPT, "<$file") || die "Can't open $file: $!\n";
+ $line = <SCRIPT>;
+ close (SCRIPT);
+ if ($line =~ m<^#!\s*/usr/bin/(perl\S*)(?:\s+|$)>) {
+ $perl = $1;
+ if ($perl eq "perl") {
+ $dep = "perl5";
+ } elsif ($perl eq "perl-thread") {
+ $dep = "perl5-thread";
+ } elsif ($perl =~ m/^perl-\d\.\d{3}(?:-thread)?$/) {
+ $dep = $perl;
+ } elsif ($perl =~ m/^perl(\d\.\d{3})(\d\d)$/) {
+ # Should never happen but ...
+ $dep = "perl-$1 (=$1.$2)";
+ }
+ }
+ return $dep;
+}
diff --git a/dh_perl.1 b/dh_perl.1
new file mode 100644
index 00000000..cc2bb503
--- /dev/null
+++ b/dh_perl.1
@@ -0,0 +1,60 @@
+.TH DH_PERL 1 "22 June 1999" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_perl \- calculates perl scripts & modules dependencies
+.SH SYNOPSIS
+.B dh_perl
+.I "[debhelper options] [-k] [-d] [library dirs ...]"
+.SH "DESCRIPTION"
+dh_perl is a debhelper program that is responsible for generating
+the perl:Depends substitutions and adding them to substvars files.
+.P
+The program will look for the location of installed modules and will
+use this information to generate a dependency (at the present time
+it can only be perl5, perl5-thread, perl-5.00X or perl-5.00X-thread).
+.P
+It will also look at #! lines of perl scripts in order to be able
+to calculate a dependency for perl scripts and not only perl modules.
+.P
+In addition it will automatically remove .packlist file and will
+remove the directory in which it was if it's empty. You can
+switch off this option by passing -k.
+.SH OPTIONS
+.TP
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B -k
+Keep .packlist files.
+.TP
+.B -d
+In some specific cases you may want to depend on a -base package
+(ie perl-5.00X-base or perl5-base). If so, you can pass
+the -d option to make
+.BR dh_perl
+generate a dependency on the correct base package. This is only necessary
+for some modules that are included in the base system.
+.TP
+.B library dirs
+If your package does install perl modules in non-standard
+directories, you can make
+.BR dh_perl
+check those directories by passing their names on the command line.
+.BR dh_perl
+will only check usr/lib/perl5 by default.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.SH "CONFORMS TO"
+.P
+Debian policy, version 2.5.0.0
+.P
+Perl policy, version 1.0
+.SH AUTHOR
+Raphaël Hertzog <hertzog@debian.org>
diff --git a/dh_shlibdeps b/dh_shlibdeps
deleted file mode 100755
index 3fae6a66..00000000
--- a/dh_shlibdeps
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_shlibdeps - calculate shared library dependancies
-
-=cut
-
-use strict;
-use Cwd;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_shlibdeps> [S<I<debhelper options>>] [B<-L>I<package>] [B<-l>I<directory>] [B<-X>I<item>] [S<B<--> I<params>>]
-
-=head1 DESCRIPTION
-
-dh_shlibdeps is a debhelper program that is responsible for calculating
-shared library dependancies for packages.
-
-This program is merely a wrapper around L<dpkg-shlibdeps(1)> that calls it
-once for each package listed in the control file, passing it
-a list of ELF executables and shared libraries it has found.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-u>I<params>, B<--dpkg-shlibdeps-params=>I<params>
-
-=item B<--> I<params>
-
-Pass "params" to L<dpkg-shlibdeps(1)>.
-
-=item B<-X>I<item>, B<--exclude=>I<item>
-
-Exclude files that contain "item" anywhere in their filename from being
-passed to dpkg-shlibdeps. This will make their dependancies be ignored.
-This may be useful in some situations, but use it with caution. This option
-may be used more than once to exclude more than one thing.
-
-=item B<-l>I<directory>[:directory:directory:..]
-
-Before dpkg-shlibdeps is run, LD_LIBRARY_PATH will have added to it the
-specified directory (or directories -- separate with colons). This is
-useful for multi-binary packages where a library is built in one
-package and another package contains binaries linked against said
-library. Relative paths will be made absolute for the benefit of
-dpkg-shlibdeps.
-
-Note that the directory given should be the complete or relative path to
-a directory that contains the library. See example below.
-
-=item B<-L>I<package>, B<--libpackage=>I<package>
-
-Use the shlibs file automatically generated by dh_makeshlibs for the named
-package as a kind of automatically generated shlibs.local file. You can us
-this switch in concert with the -l switch to make dpkg-shlibdeps find a
-library built as part of the current package, and get the shlibs information.
-See example below.
-
-=back
-
-=head1 EXAMPLES
-
-Suppose that your source package produces libfoo1, libfoo-dev, and
-libfoo-bin binary packages. libfoo-bin links against libfoo1, and should
-depend on it. In your rules file, first run dh_makeshlibs, then dh_shlibdeps:
-
- dh_makeshlibs
- dh_shlibdeps -L libfoo1 -l debian/libfoo1/usr/lib
-
-This will have the effect of generating automatically a shlibs file for
-libfoo1, and using that file and the libfoo1 library in the
-debian/libfoo1/usr/lib directory to calculate shared library dependency
-information.
-
-=cut
-
-init();
-
-# Add directory to library search path.
-if ($dh{L_PARAMS}) {
- my @paths=();
- # Add to existing paths, if set.
- push @paths, $ENV{'LD_LIBRARY_PATH'}
- if exists $ENV{'LD_LIBRARY_PATH'};
- foreach (split(/:/, $dh{L_PARAMS})) {
- # Force the path absolute.
- if (m:^/:) {
- push @paths, $_;
- }
- else {
- push @paths, getcwd()."/$_";
- }
- }
- $dh{L_PARAMS}=join(':', @paths);
- $ENV{'LD_LIBRARY_PATH'}=$dh{L_PARAMS};
- verbose_print("LD_LIBRARY_PATH=$dh{L_PARAMS}");
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $ext=pkgext($package);
-
- my @filelist;
- my $ff;
-
- # Generate a list of ELF binaries in the package, ignoring any
- # we were told to exclude.
- my $find_options='';
- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
- $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
- }
- foreach my $file (split(/\n/,`find $tmp -type f \\( -perm +111 -or -name "*.so*" \\) $find_options`)) {
- # TODO this is slow, optimize. Ie, file can run once on
- # multiple files..
- $ff=`file "$file"`;
- if ($ff=~m/ELF/ && $ff!~/statically linked/) {
- push @filelist,$file;
- }
- }
-
- if (@filelist) {
- my @opts;
- if (defined $dh{LIBPACKAGE} && length $dh{LIBPACKAGE}) {
- @opts=("-L".tmpdir($dh{LIBPACKAGE}."/DEBIAN/shlibs"));
- }
- doit("dpkg-shlibdeps","-Tdebian/${ext}substvars",
- @opts,@{$dh{U_PARAMS}},@filelist);
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1
new file mode 100644
index 00000000..b414965f
--- /dev/null
+++ b/dh_shlibdeps.1
@@ -0,0 +1,37 @@
+.TH DH_SHLIBDEPS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_shlibdeps \- calculate shared library dependancies
+.SH SYNOPSIS
+.B dh_shlibdeps
+.I "[debhelper options] [-uparams]"
+.SH "DESCRIPTION"
+dh_shlibdeps is a debhelper program that is responsible for calculating
+shared library dependancies for all executables found in the package build
+directory.
+.P
+This program is merely a wrapper around
+.BR dpkg-shlibdeps (1)
+that calls it once for each package listed in the control file.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-uparams, \--dpkg-shlibdeps-params=params
+Pass "params" to
+.BR dpkg-shlibdeps (1)
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR dpkg-shlibdeps (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_strip b/dh_strip
deleted file mode 100755
index 9e107f46..00000000
--- a/dh_strip
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_strip - strip executables, shared libraries, and some static libraries
-
-=cut
-
-use strict;
-use File::Find;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>]
-
-=head1 DESCRIPTION
-
-dh_strip is a debhelper program that is responsible for stripping
-executables, shared libraries, and static libraries that are not used for
-debugging.
-
-This program examines your package build directories and works out what
-to strip on its own. It uses L<file(1)> and file permisions and filenames
-to figure out what files are shared libraries (*.so), executable binaries,
-and static (lib*.a) and debugging libraries (lib*_g.a, debug/*.so), and
-strips each as much as is possible. (Which is not at all for debugging
-libraries.) In general it seems to make very good guesses, and will do the
-right thing in almost all cases.
-
-Since it is very hard to automatically guess if a file is a
-module, and hard to determine how to strip a module, dh_strip does not
-currently deal with stripping binary modules such as .o files.
-
-=head1 OPTIONS
-
-=over 4
-
-=item B<-X>I<item>, B<--exclude=>I<item>
-
-Exclude files that contain "item" anywhere in their filename from being
-stripped. You may use this option multiple times to build up a list of
-things to exclude.
-
-=back
-
-=head1 NOTES
-
-If the DEB_BUILD_OPTIONS environment variable contains "nostrip", nothing
-will be stripped, in accordance with Debian policy.
-
-=head1 CONFORMS TO
-
-Debian policy, version 3.0.1
-
-=cut
-
-init();
-
-# This variable can be used to turn off stripping (see Policy).
-if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS} =~ /nostrip/) {
- exit;
-}
-
-# I could just use `file $_[0]`, but this is safer
-sub get_file_type {
- my $file=shift;
- open (FILE, '-|') # handle all filenames safely
- || exec('file', $file)
- || die "can't exec file: $!";
- my $type=<FILE>;
- close FILE;
- return $type;
-}
-
-# Check if a file is an elf binary, shared library, or static library,
-# for use by File::Find. It'll fill the following 3 arrays with anything
-# it finds:
-my (@shared_libs, @executables, @static_libs);
-sub testfile {
- return if -l $_ or -d $_; # Skip directories and symlinks always.
-
- # See if we were asked to exclude this file.
- # Note that we have to test on the full filename, including directory.
- my $fn="$File::Find::dir/$_";
- foreach my $f (@{$dh{EXCLUDE}}) {
- return if ($fn=~m/\Q$f\E/);
- }
-
- # Is it a debug library in a debug subdir?
- return if $fn=~m/debug\/.*\.so/;
-
- # Does its filename look like a shared library?
- if (m/.*\.so.*?/) {
- # Ok, do the expensive test.
- my $type=get_file_type($_);
- if ($type=~m/.*ELF.*shared.*/) {
- push @shared_libs, $fn;
- return;
- }
- }
-
- # Is it executable? -x isn't good enough, so we need to use stat.
- my (undef,undef,$mode,undef)=stat(_);
- if ($mode & 0111) {
- # Ok, expensive test.
- my $type=get_file_type($_);
- if ($type=~m/.*ELF.*(executable|shared).*/) {
- push @executables, $fn;
- return;
- }
- }
-
- # Is it a static library, and not a debug library?
- if (m/lib.*\.a$/ && ! m/.*_g\.a$/) {
- push @static_libs, $fn;
- return;
- }
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
-
- @shared_libs=@executables=@static_libs=();
- find(\&testfile,$tmp);
-
- foreach (@shared_libs) {
- # Note that all calls to strip on shared libs
- # *must* inclde the --strip-unneeded.
- doit("strip","--remove-section=.comment",
- "--remove-section=.note","--strip-unneeded",$_);
- }
-
- foreach (@executables) {
- doit("strip","--remove-section=.comment",
- "--remove-section=.note",$_);
- }
-
- foreach (@static_libs) {
- doit("strip","--strip-debug",$_);
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_strip.1 b/dh_strip.1
new file mode 100644
index 00000000..683de57c
--- /dev/null
+++ b/dh_strip.1
@@ -0,0 +1,34 @@
+.TH DH_STRIP 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_strip \- strip executables, shared libraries, and some static libraries.
+.SH SYNOPSIS
+.B dh_strip
+.I "[debhelper options] [-Xitem]"
+.SH "DESCRIPTION"
+dh_strip is a debhelper program that is responsible for stripping
+executables, shared libraries, and static libraries that are not used for
+debugging.
+.P
+It assumes that files that have names like lib*_g.a are static libraries
+used in debugging, and will not strip them.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-Xitem, \--exclude=item
+Exclude files that contain "item" anywhere in their filename from being
+stripped. You may use this option multiple times to build up a list of
+things to exclude.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_suidregister b/dh_suidregister
deleted file mode 100755
index 3bc9bd98..00000000
--- a/dh_suidregister
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_suidregister - obsolete suid registration program
-
-=head1 SYNOPSIS
-
-Do not run!
-
-=head1 DESCRIPTION
-
-This program used to register suid and sgid files with L<suidregister(1)>,
-but with the introduction of L<dpkg-statoverride(8)>, registration of files
-in this way is unnecessary, and even harmful, so this program should not be
-used.
-
-=head1 CONVERTING TO STATOVERRIDE
-
-Converting a package that uses this program to use the new statoverride
-mechanism is easy. Just remove the call to dh_suidregister from
-debian/rules, and add a versioned conflicts into your control file, as
-follows:
-
- Conflicts: suidmanager (<< 0.50)
-
-The conflicts is only necessary if your package used to register things
-with suidmanager; if it did not, you can just remove the call to this
-program from your rules file.
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-init();
-
-my $notused=1;
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp=tmpdir($package);
- my $suid=pkgfile($package,"suid");
- my $tostrip='';
-
- my @files;
- if ($suid) {
- @files=filearray($suid, $tmp);
- }
-
- if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
- push @files, @ARGV;
- }
-
- if (! @files && ! $suid) {
- # No files specified (and no empty debian/suid file), so
- # guess what files to process.
- @files=split(/\n/,`find $tmp -type f -perm +6000`);
-
- # Strip the debian working directory off of the filenames.
- $tostrip="$tmp/";
- }
- else {
- # We will strip leading /'s, so the user can feed this
- # program either absolute filenames, or relative filenames,
- # and it will do the right thing either way.
- $tostrip="/";
- }
-
- # Register files with suidregister.
- foreach my $file (@files) {
- # Strip leading $tostrip from $file.
- $file=~s/^$tostrip//;
-
- # Create the sed string that will be used to
- # fill in the blanks in the autoscript files.
- # Fill with the owner, group, and perms of the file.
- my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$tmp/$file");
- # Now come up with the user and group names for the uid and
- # gid.
- my $user=getpwuid($uid);
- if (! defined $user) {
- warning("$file has odd uid $uid, not in /etc/passwd");
- $user=$uid;
- }
- my $group=getgrgid($gid);
- if (! defined $group) {
- warning("$file has odd gid $gid not in /etc/group");
- $group=$gid;
- }
- # Note that I have to print mode in ocal, stripping file
- # type.
- my $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$package/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/",
- $mode & 07777);
- autoscript($package,"postinst","postinst-suid",$sedstr);
- autoscript($package,"postrm","postrm-suid","$sedstr");
- }
-
- # Remove suid bits from files. This is delayed to this point, because
- # of a situation with hard linked files if it is done earlier.
- # See changelog for 2.0.77.
- foreach my $file (@files) {
- if ( -e "$tmp/$file") {
- doit("chmod","a-s","$tmp/$file");
- }
- }
-
- if (@files) {
- warning("This program should no longer be used. Please read the dh_suidregister(1) man page.");
- $notused=0;
- }
-}
-
-# Although they called it, it's not going to do anything.
-if ($notused) {
- warning("This program is obsolete, does nothing, and may be safely removed from your rules file.");
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_suidregister.1 b/dh_suidregister.1
new file mode 100644
index 00000000..4e0984b4
--- /dev/null
+++ b/dh_suidregister.1
@@ -0,0 +1,62 @@
+.TH DH_SUIDREGISTER 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_suidregister \- set up package to register files with suidregister
+.SH SYNOPSIS
+.B dh_suidregister
+.I "[debhelper options] [-A] [file ...]"
+.SH "DESCRIPTION"
+dh_suidregister is a debhelper program that is responsible for modifying the
+postinst and postrm scripts of a package so the package will register files
+with
+.BR suidregister (1)
+when it is installed.
+.P
+Any filenames specified as parameters will be registered in the first
+package dh_suidregister 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.
+.P
+Files named debian/package.suid (or debian/suid for the first binary package
+in debian/control) can list other files to be registered.
+.P
+If neither of these methods is used to specify files, dh_suidregister will
+scan the package build directory for files that have suid permissions, and
+will automatically register all files it finds.
+.P
+Note that this program modifies your postinst and postrm files. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.P
+Also note that all files registered by this program will *not* be suid in the
+resulting .deb file. The postinst of the package will set their permissions
+(even if the user doesn't have suidmanager installed).
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Register any files specified by command line parameters in ALL packages
+acted on. I doubt anyone will find this useful, it's here for consitency
+with other debhelper programs.
+.TP
+.B file ...
+Register these files in the first package acted on. (Or in all packages if
+-A is specified.)
+.SH NOTES
+dh_suidregister does not make anything suid. It merely records the
+permissions binaries already have. If you need to make something suid, you
+must do so manually before calling dh_suidregister.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR suidregister (8)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_testdir b/dh_testdir
deleted file mode 100755
index 451b9aeb..00000000
--- a/dh_testdir
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_testdir - test directory before building debian package
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-B<dh_testdir> [S<I<debhelper options>>] [S<I<file ...>>]
-
-=head1 DESCRIPTION
-
-dh_testdir tries to make sure that you are in the correct directory when
-building a debian package. It makes sure that the file debian/control
-exists, as well as any other files you specify. If not,
-it exits with an error.
-
-=head1 OPTIONS
-
-=over 4
-
-=item I<file ...>
-
-Test for the existence of these files too.
-
-=back
-
-=cut
-
-init();
-
-foreach my $file ('debian/control', @ARGV) {
- if (! -e $file) {
- error("\"$file\" not found. Are you sure you are in the correct directory?");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_testdir.1 b/dh_testdir.1
new file mode 100644
index 00000000..43c7439a
--- /dev/null
+++ b/dh_testdir.1
@@ -0,0 +1,28 @@
+.TH DH_TESTDIR 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_testdir \- test directory before building debian package
+.SH SYNOPSIS
+.B dh_testdir
+.I "[debhelper options] [file ...]"
+.SH "DESCRIPTION"
+dh_testdir tries to make sure that you are in the correct directory when
+building a debian package. It makes sure that the file debian/control
+exists, as well as any other files you specify. If not,
+it exits with an error.
+.SH OPTIONS
+.TP
+.B [debhelper options]
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B file ...
+Test for the existence of these files.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_testroot b/dh_testroot
deleted file mode 100755
index 34684768..00000000
--- a/dh_testroot
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_testroot - ensure that a package is built as root
-
-=head1 SYNOPSIS
-
-B<dh_testroot> [S<I<debhelper options>>]
-
-=head1 DESCRIPTION
-
-dh_testroot simply checks to see if you are root. If not, it exits with an
-error. Debian packages must be built as root, though you can use
-L<fakeroot(1)>
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-if ($< != 0) {
- error("You must run this as root (or use fakeroot).");
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_testroot.1 b/dh_testroot.1
new file mode 100644
index 00000000..6fcdf4f2
--- /dev/null
+++ b/dh_testroot.1
@@ -0,0 +1,25 @@
+.TH DH_TESTROOT 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_testroot \- ensure that a package is built as root
+.SH SYNOPSIS
+.B dh_testroot
+.I "[debhelper options]"
+.SH "DESCRIPTION"
+dh_testroot simply checks to see if you are root. If not, it exits with an
+error. Debian packages must be built as root, though you can use
+.BR fakeroot (1)
+to work around this.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_testversion b/dh_testversion
deleted file mode 100755
index a17f22e9..00000000
--- a/dh_testversion
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_testversion - ensure that the correct version of debhelper is installed
-
-=cut
-
-use Debian::Debhelper::Dh_Lib;
-use Debian::Debhelper::Dh_Version; # contains the version number of debhelper.
-
-=head1 SYNOPSIS
-
-B<dh_testversion> [S<I<debhelper options>>] [I<operator>] [I<version>]
-
-=head1 DESCRIPTION
-
-Note: This program is deprecated. You should use build dependencies
-instead.
-
-dh_testversion compares the version of debhelper against the version you
-specify, and if the condition is not met, exits with an error message.
-
-You can use this in your debian/rules files if a new debhelper feature is
-introduced, and your package requires that feature to build correctly. Use
-debhelper's changelog to figure out the version you need.
-
-Be sure not to overuse dh_testversion. If debhelper version 9.5
-introduces a new dh_autofixbugs command, and your package uses it, then if
-someone tries to build it with debhelper 1.0, the build will fail anyway when
-dh_autofixbugs cannot be found, so there is no need for you to use
-dh_testversion.
-
-=head1 OPTIONS
-
-=over 4
-
-=item I<operator>
-
-Optional comparison operator used in comparing the versions. If not
-specified, ">=" is used. For descriptions of the comparison operators, see
-dpkg --help.
-
-=item I<version>
-
-Version number to compare against the current version of debhelper. If not
-specified, dh_testversion does nothing.
-
-=back
-
-=cut
-
-init();
-
-my($compare, $ver);
-
-if ($#ARGV > 0) {
- $compare=shift;
- $ver=shift;
-}
-elsif ($#ARGV eq 0) {
- $compare=">=";
- $ver=shift;
-}
-
-warning("This program is deprecated, you should use build dependencies instead.");
-
-if (defined $compare and defined $ver) {
- warning("Something like: \"Build-Depends: debhelper ($compare $ver)\"");
- system('dpkg','--compare-versions',$Debian::Debhelper::Dh_Version::version,$compare,$ver) == 0 ||
- error("debhelper version $Debian::Debhelper::Dh_Version::version is installed, but a version $compare $ver is needed to build this package.");
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_testversion.1 b/dh_testversion.1
new file mode 100644
index 00000000..19ded263
--- /dev/null
+++ b/dh_testversion.1
@@ -0,0 +1,51 @@
+.TH DH_TESTVERSION 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_testversion \- ensure that the correct version of debhelper is installed
+.SH SYNOPSIS
+.B dh_testversion [debhelper options] [operator] [version]
+.SH "DESCRIPTION"
+dh_testversion compares the version of debhelper against the version you
+specify, and if the condition is not met, exits with an error message.
+.P
+You should use this in your debian/rules files if a new debhelper feature is
+introduced, and your package requires that feature to build correctly. Use
+debhelper's changelog to figure out the version you need.
+.P
+Be sure not to overuse dh_testversion. If debhelper version 9.5
+introduces a new dh_autofixbugs command, and your package uses it, then if
+someone tries to build it with debhelper 1.0, the build will fail anyway when
+dh_autofixbugs cannot be found, so there is no need for you to use
+dh_testversion.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B operator
+Optional comparison operator used in comparing the versions. If not
+specified, ">=" is used. For descriptions of the comparison operators, see
+dpkg --help.
+.TP
+.B version
+Version number to compare against the current version of debhelper. If not
+specified, dh_testversion does nothing.
+.SH EXAMPLES
+.TP
+.I dh_testversion 1.0
+Make sure debhelper version 1.0 or higher is installed.
+.TP
+.I dh_testversion ge 1.0
+Another way to make sure debhelper version 1.0 or higher is installed.
+.TP
+.I dh_testversion lt 1.0
+Make sure a version of debhelper less than version 1.0 is installed.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/dh_undocumented b/dh_undocumented
deleted file mode 100755
index 5596485c..00000000
--- a/dh_undocumented
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-dh_undocumented - obsolete undocumented.7 symlink program
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-
-=head1 SYNOPSIS
-
-Do not run!
-
-=head1 DESCRIPTION
-
-This program used to make symlinks to the undocumented.7 man page for man
-pages not present in a package. Debian policy now frowns on use of the
-undocumented.7 man page, and so this program does nothing, and should not
-be used.
-
-=cut
-
-init();
-warning("This program does nothing and should no longer be used.");
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is a part of debhelper.
-
-=head1 AUTHOR
-
-Joey Hess <joeyh@debian.org>
-
-=cut
diff --git a/dh_undocumented.1 b/dh_undocumented.1
new file mode 100644
index 00000000..63a83970
--- /dev/null
+++ b/dh_undocumented.1
@@ -0,0 +1,62 @@
+.TH DH_UNDOCUMENTED 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_undocumented \- make symlinks to undocumented.7.gz man page
+.SH SYNOPSIS
+.B dh_undocumented
+.I "[debhelper options [-A] [manpage ...]"
+.SH "DESCRIPTION"
+dh_undocumented is a debhelper program that is responsible for making
+symlinks to the
+.BR undocumented (7)
+man page for man pages that are not present in your package.
+.P
+The program takes a list of man pages that should be symlinked to
+.BR undocumented (7)
+It determines what directory the man pages should be placed in by examining
+their extensions - pages ending in "x" go into /usr/X11R6/man/, while pages
+that end in anything else go in /usr/man/. It also examines the extention to
+see what section the man page belongs in. After figuring this out, it
+generates the necessary symlinks to
+.BR undocumented (7)
+, placing the sylinks in the package build directory.
+.P
+The lists of man pages that need
+.BR undocumented (7)
+symlinks can be specified in two ways. Any man page names specified as
+parameters will be set up in the first package dh_undocumented 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, a file named debian/package.undocumented (or debian/undocumented, for
+the first binary package in debian/control) can list other man page names to
+set up.
+.SH OPTIONS
+.TP
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.TP
+.B \-A, \--all
+Install undocumented man page symlinks for any man pages specified by
+command line parameters in ALL packages acted on. I doubt anyone will find
+this useful, it's here for consitency with other debhelper programs.
+.TP
+.B manpage ...
+Install undocumented man page symlinks for each of these man pages
+into the first package acted on. (Or in all packages acted on if -A is
+specified.)
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.TP
+.BR debhelper (1)
+.TP
+.BR undocumented (7)
+.SH "CONFORMS TO"
+Debian policy, version 2.5.0.0
+.SH AUTHOR
+Joey Hess <joeyh@master.debian.org>
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 6cae08a5..da21ea9d 100644
--- a/doc/PROGRAMMING
+++ b/doc/PROGRAMMING
@@ -1,6 +1,4 @@
This file documents things you should know to write a new debhelper program.
-Any program with a name that begins with dh_ should conform to these
-guidelines (with the historical exception of dh_make).
Standardization:
---------------
@@ -13,14 +11,14 @@ pollute the name space too much.
Debhelper programs should never output anything to standard output except
error messages, important warnings, and the actual commands they run that
-modify files under debian/ (this last only if they are passed -v, and if you
-output the commands, you should indent them with 1 tab). This is so we don't
-have a lot of noise output when all the debhelper commands in a debian/rules
-are run, so the important stuff is clearly visible.
+modify files under debian/ and debian/tmp, etc (this last only if they are
+passed -v, and if you output the commands, you should indent them with 1 tab).
+This is so we don't have a lot of noise output when all the debhelper commands
+in a debian/rules are run, so the important stuff is clearly visible.
-Debhelper programs should accept all options listed in the "SHARED
-DEBHELPER OPTIONS" section of debhelper(7), including any long forms of
-these options, like --verbose . If necessary, the options may be ignored.
+Debhelper programs should accept the options, -v, -i, -a, -p, --no-act, and
+-P, and any long forms of these options, like --verbose . If necessary, the
+options may be ignored.
If debhelper commands need config files, they should use
debian/package.filename as the name of the config file (replace filename
@@ -31,25 +29,19 @@ information that appears in the config files, on their command lines, if
possible, and apply that information to the first package they act on.
Debhelper programs should never modify the debian/postinst, debian/prerm,
-etc scripts. Instead, they can add lines to debian/postinst.debhelper, etc.
+etc scripts, instead, they can add lines to debian/postinst.debhelper, etc.
The autoscript() function (see below) is one easy way to do this.
dh_installdeb is an exception, it will run after the other commands and
merge these modifications into the actual postinst scripts.
-In general, files named debian/*.debhelper are internal to debhelper, and
-their existence or use should not be relied on by external programs such as
-the build process of a package.
-
-Debhelper programs should default to doing exactly what policy says to do.
-
There are always exceptions. Just ask me.
Introducing Dh_Lib.pm:
---------------------
-Dh_Lib.pm is the library used by all debhelper programs to parse their
+Dh_lib.pm is the library used by all debhelper programs to parse their
arguments and set some useful variables. It's not mandatory that your
-program use Dh_Lib.pm, but it will make it a lot easier to keep it in sync
+program use Dh_lib.pm, but it will make it a lot easier to keep it in sync
with the rest of debhelper if it does, so this is highly encouraged.
(There used to be a version of Dh_lib.pm that was a library of functions for
@@ -57,16 +49,17 @@ shell scripts. If you want to write a debhelper command that is a shell
script, I can dig up that old library for you. Only the perl one is
supported now, though.)
-Use Dh_Lib.pm like this:
+Use Dh_lib.pm like this:
-use Debian::Debhelper::Dh_Lib
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
init();
The BEGIN block is there to make perl look for the module in all the right
places.
-The init() function causes Dh_lib to parse the command line and do some other
-initialization tasks.
+The init() function in the perl version. This causes Dh_lib to
+parse the command line and do some other initialization tasks.
Argument processing:
-------------------
@@ -85,10 +78,10 @@ switch variable description
--no-act NO_ACT should the program not actually do anything?
-i,-a,-p,-N DOPACKAGES a space delimited list of the binary packages
to act on (in Dh_Lib.pm, this is an array)
--i DOINDEP set if we're acting on binary independent
- packages
--a DOARCH set if we're acting on binary dependent
- packages
+-i,-p,-N DOINDEP a space delimited list of the binary independent
+ packages to act on
+-a,-p,-N DOARCH a space delimited list of the binary dependent
+ packages to act on
-n NOSCRIPTS if set, do not make any modifications to the
package's postinst, postrm, etc scripts.
-X EXCLUDE exclude a something from processing (you
@@ -111,8 +104,6 @@ switch variable description
other program. (This is an array)
-m M_PARAMS will be set to a string, you decide what it
means to your program
--l L_PARAMS will be set to a string, you decide what it
- means to your program
-V V_FLAG will be set to a string, you decide what it
means to your program
-V V_FLAG_SET will be 1 if -V was specified, even if no
@@ -125,15 +116,6 @@ switch variable description
--init-script INIT_SCRIPT will be set to a string, which specifies an
init script name (probably only
dh_installinit will ever use this)
---sourcedir SOURCEDIR will be set to a string (probably only
- dh_movefiles will ever use this)
---destdir DESTDIR will be set to a string (probably only
- dh_builddeb will ever use this)
---filename FILENAME will be set to a string
---flavor FLAVOR will be set to a string (probably only
- dh_installemacsen will ever use this)
---number PRIORITY will be set to a number (deprecated)
---priority PRIORITY will be set to a number
Any additional command line parameters that do not start with "-" will be
ignored, and you can access them later just as you normally would.
@@ -148,7 +130,7 @@ The following keys are also set in the %dh hash when you call init():
MAINPACKAGE the name of the first binary package listed in
debian/control
FIRSTPACKAGE the first package we were instructed to act on. This package
- typically gets special treatment; additional arguments
+ typically gets special treatment, additional arguments
specified on the command line may effect it.
Functions:
@@ -156,34 +138,31 @@ Functions:
Dh_Lib.pm also contains a number of functions you may find useful.
-doit(@command)
+doit()
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($command)
+complex_doit()
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($message)
+verbose_print()
Pass this command a string, and it will echo it if $dh{VERBOSE} is set.
-error($errormsg)
+error()
Pass this command a string, it will output it to standard error and
exit.
-warning($message)
+warning()
Pass this command a string, and it will output it to standard error
as a warning message.
-tmpdir($dir)
+tmpdir()
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($num)
- Pass this command a number, and if the current compatibility level
- is less than or equal to that number, it will return true.
- Looks at DH_COMPAT to get the compatibility level.
-pkgfile($package, $basename)
+ package build directory. Typically, this will be "debian/tmp" or
+ "debian/package".
+pkgfile()
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 +170,17 @@ pkgfile($package, $basename)
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($package)
+pkgext()
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($package)
+isnative()
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($package, $scriptname, $snippetname, $sedcommands)
+autoscript()
Pass parameters:
- binary package to be affected
- script to add to
@@ -210,29 +189,5 @@ autoscript($package, $scriptname, $snippetname, $sedcommands)
(optional)
This command automatically adds shell script snippets to a debian
maintainer script (like the postinst or prerm).
-dirname($pathname)
- Return directory part of pathname.
-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.
-excludefile($filename)
- This function returns true if -X has been used to ask for the file
- to be excluded.
-
--- Joey Hess <joeyh@debian.org>
+-- Joey Hess <joeyh@master.debian.org>
diff --git a/doc/README b/doc/README
index cffbea28..b283af20 100644
--- a/doc/README
+++ b/doc/README
@@ -1 +1,58 @@
-Please see the debhelper(7) man page for documentation.
+Debhelper is a collection of programs that can be used in debian/rules files
+to automate common tasks related to building debian binary packages. For
+further documentation, see the man pages for dh_* commands. For an overview
+of debhelper, see the debhelper(1) man page.
+
+To help you get started, I've included examples of debian/rules files
+that use debhelper commands extensively. See /usr/doc/debhelper/examples/ .
+These files are also useful as they give one good order you can run the
+various debhelper scripts in (though other variations are possible).
+
+Starting a new package:
+----------------------
+
+You can just use the example rules files and do the rest of the new package
+set up by hand, or you could try the new dh-make package, which contains a
+"dh_make" command that is similar to debmake, and tries to automate the
+process.
+
+Converting from debstd to debhelper:
+-----------------------------------
+
+See the file "from-debstd" for documentation on how to do this.
+
+Automatic generation of debian install scripts:
+----------------------------------------------
+
+Some debhelper commands will automatically generate parts of debian install
+scripts. If you want these automatically generated things included in your
+debian install scripts, then you need to add "#DEBHELPER#" to your scripts,
+in the place the code should be added. "#DEBHELPER#" will be replaced by any
+auto-generated code when you run dh_installdeb.
+
+All scripts that automatically generate code in this way let it be disabled
+by the -n parameter.
+
+Note that it will be shell code, so you cannot directly use it in a perl
+script. If you would like to embed it into a perl script, here is one way to
+do that (note the tricky use of backquotes) (also note that I made sure that
+$1, $2, etc are set with the set command):
+
+print << `EOF`
+set -- @ARGV
+#DEBHELPER#
+EOF
+
+Other notes:
+-----------
+
+Note that if you are generating a debian package that has arch-indep and
+arch-dependent portions, and you are using dh_movefiles to move the
+arch-indep files out of debian/tmp, you need to make sure that dh_movefiles
+does this even if only the arch-dependent package is being built (for ports
+to other architectures). I handle this in debian/rules.multi by calling
+dh_movefiles in the install target.
+
+Debhelper's home page is at http://kitenet.net/programs/debhelper/
+
+-- Joey Hess <joeyh@master.debian.org>
diff --git a/doc/TODO b/doc/TODO
index 7dc57ff5..282c24ed 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,52 +1,62 @@
This is the TODO for debhelper. As more and more people use debhelper, this
list grows - I welcome patches to fix items on it!
-Wishlist items:
-
-* All debhelper programs should only accept the options they are documented
- to accept (rather than accepting all debhelper options). They should
- be able to print brief usage summaries.
-
- I think this calls for a restucturing. Make a Debhelper.pm class. Each
- program subclasses the class. The class provides command line parsing,
- useful functions, and so on. Skeleton of a debhelper command would then
- be:
-
- use base qw{Debhelper};
+Bugs:
- sub startup {
- # Add initialization stuff here.
- }
+* all commands should print a warning message if non-cumulative parameters
+ are given more than once (ie, two -u's to dh_gencontrol). (#22588)
+ (Bug currently under dispute, I think this is bogus).
- sub perpackage {
- my $package=shift;
-
- # Stuff to do for each package here.
- }
-
- sub fini {
- # And final stuff here, if any.
- }
+Wishlist items:
- This needs more thought.
-
-* install-info, as of dpkg 1.10, parses the info file for section if
- --section is not given. So I should be able to stop parsing it myself for
- section, after dpkg 1.10 has been around long enough.
+* Make dh_movefiles remove emptied directories after it's moved all the
+ files out of them (#17111).
+* info support for debhelper (currently implemented, but I hate how I did it,
+ so it's not in the package.) (#15717)
+* 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
+ preserve backward compatibility. (#16933, #17061)
+* maybe make dh_installmanpages look at the .TH line of man pages whose
+ filenames end in .man, to figure out what section they go it. This would
+ require a switch to turn on, for backwards compatibility.
+* All debhelper programs should be checked that they output files with the
+ correct permissions no matter what the umask is set to. Currently, only
+ those programs that run after dh_fixperms have been so checked. (Checking
+ the rest is low priority, since dh_fixperms fixes any incorrect permissions
+ they might have; still it would be nice to check them too, just to make
+ debhelper more flexible.) One easy fix is to add umask 022 to dh_lib,
+ however, there may be unforeseen ramifications of such a change.
+* 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.
+* 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
+ Matthias Klose <doko@cs.tu-berlin.de>)
+* docbase support (#25233). Waiting for docbase to stabilize and be used
+ widely.
+* dhelp support. Currently pending on dhelp use becoming widespead (#18342)
+* Support use of environment variables in data taken from user, ie, in
+ debian/dirs. The problem with doing this is that we really want to allow
+ any filenames in that input, even those that look like environment
+ variables. However, it may be worth adding a switch to make it parse
+ environment variables. (#20964)
+* It's possible to speed up debhelper by having it cache some values that
+ multiple commands call. One way to do this would be to write dh_cache,
+ that generates the cache. The catch is that if the user runs that program,
+ they are stating that they don't do anything later to invalidate the cache,
+ without calling ch_cache again. (#23792)
+* Add a switch to dh_installdeb to allow it to do user defined
+ substitutions. OTOH, maybe it's better if people just sed
+ postinst.in before debhelper gets it's hands on it... (#25235)
Deprecated:
-* 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 (I do this now),
- and check to see what other switches are not being used, and maybe remove
- some of them. I'd also like to deprecate/remove debian/compress files, -X is
- a better idea.
-* dh_suidregister. Once nothing in the archive uses it.
-* dh_installmanpages. Only mildly deprecated right now. Once dh_installman
- catches on, make it emit a warning, and then wait for it to go away.
-* dh_testversion. Remove as soon as nothing uses it.
-* dh_movefiles. I won't hold my breath.
-* debconf-mergetemplates support and the debian/template.ll files and the
- debconf-utils dependency.
-* dh_undocumented
+* remove dh_installdebfiles, 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!
diff --git a/doc/from-debstd b/doc/from-debstd
new file mode 100644
index 00000000..86f29dce
--- /dev/null
+++ b/doc/from-debstd
@@ -0,0 +1,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 --noact" 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-gencontrol 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>
diff --git a/doc/v2 b/doc/v2
new file mode 100644
index 00000000..b120d036
--- /dev/null
+++ b/doc/v2
@@ -0,0 +1,64 @@
+Debhelper v2 is a major new revision of debhelper. Currently, v2 is still
+being worked on, and will change in drastic ways without notice. To keep
+this from breaking packages, debhelper will continue to operate in v1
+compatability mode by default.
+
+To enable debhelper v2 features (do this with *caution*), set DH_COMPAT=2 in
+your debian/rules. Also, it is a very good idea to add a call to your
+debian/rules like this:
+ dh_testversion 2
+To ensure that your package won't be built with some old version of
+debhelper that ignores the DH_COMPAT flag.
+
+Here are the changes I'm planning to make to debhelper for v2, based on
+prior discussion on debian-devel.
+
+Items marked with a + are done. All others will happen as soon as I can code
+them.
+
++ Standardize on the name used for the temporary build directory of a
+ package. Currently it's debian/tmp/ for the first package and
+ debian/<package>/ for other packages of a multi-binary package. I've
+ decided after much agonizing to to use debian/<package>. The main thing this
+ has going for it is it means lots of multi-binary packages need only small
+ alterations, since they already use debian/<package> for making most of
+ thier .deb's anyway. I eliminated the other ideas for these reasons:
+ - debian/tmp/<package>: debian/tmp already has history behind it,
+ changing how it's used would be confusing.
+ - debian/build/<package>: confusing (is the code compiled there?)
+ - debian/tmp-<package>, debian/package-<tmp>: too long, little gain
+
+* dh_installmanpages will be made into a non-DWIM program, so you'll have to
+ specify all man pages to install and possibly where to put them. This may
+ look something like:
+ dh_installmanpages -x xterm.1 xfoo.1 xbar.man
+ dh_installmanpages --section=8 su.man
+ Ok, there's a _little_ DWIM left in there, it'll be smart enough to munge
+ the .man filenames properly. It'll probably just assume all man pages have
+ an extention, 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/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)
+
+* 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
+ subdirs do work, they're not allowed by the packaging manual, and they'd
+ make source unpacking by hand a lot harder. I will leave these files
+ completly as they are now. However, I will remove most of the language
+ 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.
+
+* Debhelper config files will support globbing via * and ?, when
+ appropriate. To turn this off and use those changarcters raw, just quote
+ them.
diff --git a/examples/rules b/examples/rules
index f62b8e5e..78cfed49 100755
--- a/examples/rules
+++ b/examples/rules
@@ -1,10 +1,12 @@
#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# This file is public domain software, originally written by Joey Hess.
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
build: build-stamp
build-stamp:
dh_testdir
@@ -17,7 +19,7 @@ build-stamp:
clean:
dh_testdir
dh_testroot
- rm -f build-stamp
+ rm -f build-stamp install-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) clean
@@ -25,14 +27,17 @@ clean:
dh_clean
-install: build
+install: install-stamp
+install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
- # Add here commands to install the package into debian/<packagename>
- #$(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
+ # Add here commands to install the package into debian/tmp.
+ #$(MAKE) prefix=`pwd`/debian/tmp/usr install
+
+ touch install-stamp
# Build architecture-independent files here.
binary-indep: build install
@@ -40,36 +45,36 @@ binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
+# dh_testversion
dh_testdir
dh_testroot
- dh_installchangelogs
dh_installdocs
dh_installexamples
-# dh_install
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
+ dh_installmenu
# dh_installemacsen
-# dh_installcatalogs
# dh_installpam
-# dh_installmime
# dh_installinit
-# dh_installcron
-# dh_installinfo
+ dh_installcron
+ dh_installmanpages
+ dh_installinfo
# dh_undocumented
- dh_installman
+ dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
-# dh_perl
-# dh_python
+ # You may want to make some executables suid here.
+ dh_suidregister
# dh_makeshlibs
dh_installdeb
+# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
diff --git a/examples/rules.indep b/examples/rules.indep
index c8524256..e8a2b5d5 100755
--- a/examples/rules.indep
+++ b/examples/rules.indep
@@ -1,12 +1,13 @@
#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# This file is public domain software, originally written by Joey Hess.
-#
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for packages that are architecture independent.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
build: build-stamp
build-stamp:
dh_testdir
@@ -19,7 +20,7 @@ build-stamp:
clean:
dh_testdir
dh_testroot
- rm -f build-stamp
+ rm -f build-stamp install-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) clean
@@ -27,41 +28,41 @@ clean:
dh_clean
-install: build
+install: install-stamp
+install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
- # Add here commands to install the package into debian/<packagename>.
- #$(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
+ # Add here commands to install the package into debian/tmp.
+ #$(MAKE) prefix=`pwd`/debian/tmp/usr install
+
+ touch install-stamp
# Build architecture-independent files here.
binary-indep: build install
+# dh_testversion
dh_testdir
dh_testroot
- dh_installchangelogs
dh_installdocs
dh_installexamples
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
+ dh_installmenu
# dh_installemacsen
-# dh_installcatalogs
# dh_installpam
-# dh_installmime
# dh_installinit
-# dh_installcron
-# dh_installman
-# dh_installinfo
+ dh_installcron
+# dh_installmanpages
+ dh_installinfo
# dh_undocumented
- dh_installman
+ dh_installchangelogs
dh_link
dh_compress
dh_fixperms
-# dh_perl
-# dh_python
+ # You may want to make some executables suid here.
+ dh_suidregister
dh_installdeb
+# dh_perl
dh_gencontrol
dh_md5sums
dh_builddeb
@@ -70,5 +71,8 @@ binary-indep: build install
binary-arch: build install
# We have nothing to do by default.
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
diff --git a/examples/rules.multi b/examples/rules.multi
index fe7c20a7..7329437a 100755
--- a/examples/rules.multi
+++ b/examples/rules.multi
@@ -1,7 +1,5 @@
#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# This file is public domain software, originally written by Joey Hess.
-#
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.
@@ -9,6 +7,9 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
build: build-stamp
build-stamp:
dh_testdir
@@ -21,7 +22,7 @@ build-stamp:
clean:
dh_testdir
dh_testroot
- rm -f build-stamp
+ rm -f build-stamp install-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) clean
@@ -29,8 +30,8 @@ clean:
dh_clean
-install:
-install: build
+install: install-stamp
+install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
@@ -39,68 +40,68 @@ install: build
# Add here commands to install the package into debian/tmp.
#$(MAKE) prefix=`pwd`/debian/tmp/usr install
- dh_install
+ dh_movefiles
+ touch install-stamp
# Build architecture-independent files here.
binary-indep: build install
+# dh_testversion
dh_testdir -i
dh_testroot -i
- dh_installchangelogs -i
dh_installdocs -i
dh_installexamples -i
-# dh_installmenu -i
-# dh_installdebconf -i
-# dh_installlogrotate -i
+ dh_installmenu -i
# dh_installemacsen -i
-# dh_installcatalogs -i
# dh_installpam -i
-# dh_installmime -i
# dh_installinit -i
-# dh_installcron -i
-# dh_installinfo -i
-# dh_undocumented -i
- dh_installman -i
+ dh_installcron -i
+# dh_installmanpages -i
+ dh_installinfo -i
+# dh_undocumented
+ dh_installchangelogs -i
dh_link -i
dh_compress -i
dh_fixperms -i
-# dh_perl -i
-# dh_python -i
+ # You may want to make some executables suid here.
+ dh_suidregister -i
dh_installdeb -i
+# dh_perl -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
+# dh_testversion
dh_testdir -a
dh_testroot -a
- dh_installchangelogs -a
dh_installdocs -a
dh_installexamples -a
dh_installmenu -a
-# dh_installdebconf -a
-# dh_installlogrotate -a
# dh_installemacsen -a
-# dh_installcatalogs -a
# dh_installpam -a
-# dh_installmime -a
# dh_installinit -a
-# dh_installcron -a
-# dh_installinfo -a
-# dh_undocumented -a
- dh_installman -a
+ dh_installcron -a
+ dh_installmanpages -a
+ dh_installinfo -a
+# dh_undocumented
+ dh_installchangelogs -a
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
-# dh_perl -a
-# dh_python -a
-# dh_makeshlibs -a
+ # You may want to make some executables suid here.
+ dh_suidregister -a
dh_installdeb -a
+# dh_makeshlibs -a
+# dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
diff --git a/examples/rules.multi2 b/examples/rules.multi2
deleted file mode 100755
index 12b2d9c5..00000000
--- a/examples/rules.multi2
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# This file is public domain software, originally written by Joey Hess.
-#
-# This version is for a multibinary package. It also allows you to build any
-# of the binary packages independantly, via binary-<package> targets.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
-
-build: build-stamp
-build-stamp:
- dh_testdir
-
- # Add here commands to compile the package.
- #$(MAKE)
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
-
- # Add here commands to clean up after the build process.
- #-$(MAKE) clean
- #-$(MAKE) distclean
-
- dh_clean
-
-install: DH_OPTIONS=
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/tmp.
- #$(MAKE) prefix=`pwd`/debian/tmp/usr install
-
- dh_install
-
-# This single target is used to build all the packages, all at once, or
-# one at a time. So keep in mind: any options passed to commands here will
-# affect _all_ packages. Anything you want to only affect one package
-# should be put in another target, such as the install target.
-binary-common:
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installcatalogs
-# dh_installpam
-# dh_installmime
-# dh_installinit
-# dh_installman
-# dh_installcron
-# dh_installinfo
-# dh_undocumented
- dh_strip
- dh_link
- dh_compress
- dh_fixperms
-# dh_perl
-# dh_python
-# dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-# Build architecture independant packages using the common target.
-binary-indep: build install
-# (Uncomment this next line if you have such packages.)
-# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
-
-# Build architecture dependant packages using the common target.
-binary-arch: build install
- $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
-
-# Any other binary targets build just one binary package at a time.
-binary-%: build install
- make -f debian/rules binary-common DH_OPTIONS=-p$*
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary-common binary install
diff --git a/t/dh_link b/t/dh_link
index 9f644e78..1e210558 100644
--- a/t/dh_link
+++ b/t/dh_link
@@ -1,16 +1,20 @@
#!/usr/bin/perl
use Test;
-plan(tests => 3);
+plan(tests => 4);
# It used to not make absolute links in this situation, and it should.
# #37774
system("./dh_link","etc/foo","usr/lib/bar");
-ok("/etc/foo",readlink("debian/tmp/usr/lib/bar"));
+ok("/etc/foo",readlink("debian/debhelper/usr/lib/bar"));
# let's make sure it makes simple relative links ok.
system("./dh_link","usr/bin/foo","usr/bin/bar");
-ok("foo",readlink("debian/tmp/usr/bin/bar"));
+ok("foo",readlink("debian/debhelper/usr/bin/bar"));
# ok, more complex relative links.
system("./dh_link","usr/lib/1","usr/bin/2");
-ok("../lib/1",readlink("debian/tmp/usr/bin/2"));
+ok("../lib/1",readlink("debian/debhelper/usr/bin/2"));
+
+# this was bug #40159. Absolute links passes to dh_link.
+system("./dh_link","/etc/X11/dfm/system.dfmext","usr/share/dfm/dfmext");
+ok("/etc/X11/dfm/system.dfmext",readlink("debian/debhelper/usr/share/dfm/dfmext"));