From 053f6f8b4e7431d32511aef209188a084e8c7e79 Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 9 Feb 2001 00:57:53 +0000 Subject: [PATCH] r420: big monsta changes --- Debian/Debhelper/Dh_Lib.pm | 2 +- debhelper.1 | 18 ++- debian/changelog | 43 ++++++++ debian/rules | 3 +- dh_builddeb | 7 +- dh_clean | 28 +++-- dh_compress | 44 ++++---- dh_debstd | 220 ------------------------------------- dh_debstd.1 | 75 ------------- dh_fixperms | 23 ++-- dh_gencontrol | 21 ++-- dh_installchangelogs | 31 +++--- dh_installcron | 23 ++-- dh_installdeb | 51 ++++----- dh_installdebconf | 25 +++-- dh_installdirs | 19 ++-- dh_installdocs | 69 ++++++------ dh_installdocs.1 | 8 +- dh_installemacsen | 37 ++++--- dh_installexamples | 19 ++-- dh_installinfo | 29 ++--- dh_installinit | 33 +++--- dh_installlogrotate | 14 ++- dh_installman | 129 ++++++++++++++++++++++ dh_installman.1 | 55 ++++++++++ dh_installmanpages.1 | 8 +- dh_installmenu | 33 +++--- dh_installmime | 17 +-- dh_installmodules | 23 ++-- dh_installpam | 15 +-- dh_installwm | 14 ++- dh_installxaw | 21 ++-- dh_installxfonts | 15 +-- dh_link | 24 ++-- dh_listpackages | 1 + dh_makeshlibs | 37 ++++--- dh_md5sums | 25 +++-- dh_movefiles | 33 +++--- dh_testversion.1 | 3 +- doc/TODO | 39 +++++-- doc/from-debstd | 62 ----------- doc/v3 | 36 ------ examples/rules | 5 +- examples/rules.indep | 5 +- examples/rules.multi | 7 +- examples/rules.multi2 | 4 +- 46 files changed, 672 insertions(+), 781 deletions(-) delete mode 100755 dh_debstd delete mode 100644 dh_debstd.1 create mode 100755 dh_installman create mode 100644 dh_installman.1 delete mode 100644 doc/from-debstd delete mode 100644 doc/v3 diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index ef924b6..e17913e 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -12,7 +12,7 @@ use vars qw(@ISA @EXPORT %dh); @ISA=qw(Exporter); @EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages - &xargs %dh); + &basename &xargs %dh &compat); my $max_compat=3; diff --git a/debhelper.1 b/debhelper.1 index b5902d3..3c3a3cc 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -194,11 +194,19 @@ mode is currently set by default in all the example rules files, and you are encouraged to use it. .TP .B V3 -Setting DH_COMPAT=3 will make debhelper start using new v3 features as -they are implemented. This will cause its behavior to change without -notice, and so may break packages that use it. See the file -"/usr/share/doc/debhelper/v3" for more information about planned -changes. +Setting DH_COMPAT=3 does everything V2 does, plus: +.RS +.TP +.B * +Debhelper config files support globbing via * and ?, when appropriate. To +turn this off and use those characters raw, just prefix with a backspash. +.TP +.B * +dh_makeshlibs makes the postinst and postrm scripts call ldconfig. +.TP +.B * +Every file in etc/ is automatically flagged as a conffile by dh_installdeb. +.RE .RE .TP .B Doc directory symlinks diff --git a/debian/changelog b/debian/changelog index cff6699..a5dd8b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,46 @@ +debhelper (3.0.0) unstable; urgency=low + + * The "Does this version number frighten you?" release. + * Added dh_installman, a new program that replaces dh_installmanpages. + It is not DWIM. You tell it what to install and it figures out where + based on .TH section field and filename extention. I reccommend everyone + begin using it, since this is much better then dh_installmanpages's + evilness. I've been meaning to do this for a very long time.. + Closes: #38673, #53964, #64297, #16933, #17061, #54059, #54373, #61816 + * dh_installmanpages remains in the package for backwards compatability, + but is mildly deprecated. + * dh_testversion is deprecated; use build dependancies instead. + * Since dh_debstd requires dh_installmanpages (where do you think the + latter's evil interface came from?), I have removed it. It was a nice + thought-toy, but nobody really used it, right? + * Since the from-debstd document walks the maintainer through running + dh_debstd to get a list of debhelper commands, and since that document + has really outlives its usefullness, I removed it too. Use dh-make + instead. + * dh_installman installs only into /usr/share/man, not the X11R6 + directory. Policy says "files must not be installed into + `/usr/X11R6/bin/', `/usr/X11R6/lib/', or `/usr/X11R6/man/' unless this + is necessary for the package to operate properly", and I really doubt + a man page being in /usr/share/man is going to break many programs. + Closes: #81853 (I hope the bug submitter doesn't care that + dh_installmanpages still puts stuff in the X11R6/man directory.) + * Since with the fixing of the man page installer issue, my checklist for + debhelper v3 is complete, I pronounce debhelper v3 done! Revved the + version number appropriatly (a large jump; v3 changes less than I had + planned). + * Tonnes of changes here and there to mark v3 as done. I don't have a + v4 planned at this time. All the big changes are done. + * Updated to current perl coding standards (use strict; -w; lower-case + variable names). No perl-5.6isms though. +*** to make the version number a little more justified, turn on 'use +strict' throughout.. --- DONE up to dh_perl, not including it**** +*** move man pages into programs as pod docs *** +*** add something to allow specification of the options each program takes, +make them ignore other options, and be able to display usage help *** +*** fix aj's bug, sigh *** + + -- Joey Hess Thu, 8 Feb 2001 14:29:58 -0800 + debhelper (2.2.21) unstable; urgency=low * Fixed a stupid typo in dh_suidregister, Closes: #85110 diff --git a/debian/rules b/debian/rules index 23de85d..2521788 100755 --- a/debian/rules +++ b/debian/rules @@ -14,7 +14,6 @@ export PERL5LIB=. # be sure to use the new templates from this package. export DH_AUTOSCRIPTDIR=autoscripts -# Living dangerously :-) export DH_COMPAT=3 # Figure out the current debhelper version. @@ -60,7 +59,7 @@ binary-indep: build ./dh_installdocs `find doc -type f | grep -v CVS` ./dh_installexamples `find examples -type f | grep -v CVS` ./dh_installmenu - ./dh_installmanpages + ./dh_installman *.1 ./dh_installinfo # Fix up all man pages, filling in the modification time for them. # Note this runs before the command below so debhelper.1 gets the right diff --git a/dh_builddeb b/dh_builddeb index 3d3725a..795d9a0 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -2,6 +2,7 @@ # # Build the .deb package, assuming all the files are set up. +use strict; use Debian::Debhelper::Dh_Lib; init(); @@ -17,7 +18,7 @@ else { $dh{FILENAME}="/$dh{FILENAME}"; } -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - doit("dpkg","--build",$TMP,"$dh{DESTDIR}$dh{FILENAME}",@{$dh{U_PARAMS}}); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + doit("dpkg","--build",$tmp,"$dh{DESTDIR}$dh{FILENAME}",@{$dh{U_PARAMS}}); } diff --git a/dh_clean b/dh_clean index 4b98a6a..c25dbde 100755 --- a/dh_clean +++ b/dh_clean @@ -3,22 +3,23 @@ # Clean up $TMP and other tepmorary files generated by the # build process. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $ext=pkgext($package); if (! $dh{D_FLAG}) { - doit("rm","-f","debian/${EXT}substvars", - "debian/${EXT}postinst.debhelper", - "debian/${EXT}postrm.debhelper", - "debian/${EXT}preinst.debhelper", - "debian/${EXT}prerm.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); + doit ("rm","-rf",$tmp); } if (! $dh{D_FLAG}) { @@ -31,10 +32,8 @@ if (! $dh{D_FLAG}) { } # See if some files that would normally be deleted are excluded. - if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') { - $find_options=""; - } - else { + my $find_options=''; + if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { $find_options="-a ! ( $dh{EXCLUDE_FIND} )"; } @@ -50,6 +49,5 @@ if (! $dh{D_FLAG}) { ) $find_options -exec rm -f {} ;")); } -doit('rm', '-rf', 'debian/tmp') - if -x 'debian/tmp' && ! Debian::Debhelper::Dh_Lib::compat(1); +doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1); diff --git a/dh_compress b/dh_compress index 015a1ab..7a930bc 100755 --- a/dh_compress +++ b/dh_compress @@ -3,24 +3,25 @@ # Compresses files and makes sure that symlinks pointing to the # compressed files get fixed. +use strict; use Cwd; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $compress=pkgfile($PACKAGE,"compress"); +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. - $olddir=getcwd(); - verbose_print("cd $TMP"); - chdir($TMP) || error("Can't cd to $TMP: $!"); + my $olddir=getcwd(); + verbose_print("cd $tmp"); + chdir($tmp) || error("Can't cd to $tmp: $!"); # Figure out what files to compress. - @files=(); + my @files; # First of all, deal with any files specified right on the command line. - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @files, @ARGV; } if ($compress) { @@ -29,12 +30,12 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { push @files, split(/\n/,`sh $olddir/$compress 2>/dev/null`); } else { - # By default, fall back to what the policy manual says to compress. - # 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" - + # By default, fall back to what the policy manual says to + # compress. 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/doc usr/share/doc -type f \\( -size +4k -or -name "changelog*" \\) \\ @@ -48,10 +49,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Exclude files from compression. if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) { - @new=(); + my @new=(); foreach (@files) { - $ok=1; - foreach $x (@{$dh{EXCLUDE}}) { + my $ok=1; + foreach my $x (@{$dh{EXCLUDE}}) { if (/\Q$x\E/) { $ok=''; last; @@ -67,8 +68,9 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # space in the end. my @f=(); my %hardlinks; + my %seen; foreach (@files) { - ($dev, $inode, undef, $nlink)=stat($_); + my ($dev, $inode, undef, $nlink)=stat($_); if ($nlink > 1) { if (! $seen{"$inode.$dev"}) { $seen{"$inode.$dev"}=$_; @@ -104,11 +106,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { chdir($olddir); # Fix up symlinks that were pointing to the uncompressed files. - open (FIND,"find $TMP -type l |"); + open (FIND,"find $tmp -type l |"); while () { chomp; - ($directory)=m:(.*)/:; - $linkval=readlink($_); + my ($directory)=m:(.*)/:; + my $linkval=readlink($_); if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") { doit("rm","-f",$_); doit("ln","-sf","$linkval.gz","$_.gz"); diff --git a/dh_debstd b/dh_debstd deleted file mode 100755 index 6d2290c..0000000 --- a/dh_debstd +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/perl -w -# -# Script to be called from debian/rules to setup all the debian specifc -# required files -# Christoph Lameter, October 10, 1996 -# -# All the parameters are documentation files to be installed. -# (but doc files can also be listed in debian/docs) -# -# This has been gutted and extensively rewritten to function as a debhelper -# command by Joey Hess. And then completly rewritten in perl. - -use Debian::Debhelper::Dh_Lib; - -# Need to stay compatable with debstd, so force use of level 1. -$ENV{DH_COMAPT}=1; - -# Pre-parse command line before we parse the command line, becuase we use a -# different style of arguments. -@argv=(); -foreach (@ARGV) { - if ($_ eq '-p') { - $ds{PERMS}=1; - } - elsif ($_ eq '-u') { - $ds{UNDOC}=1; - } - elsif ($_ eq '-s') { - $ds{SUMS}=1; - } - elsif ($_ eq '-m') { - $ds{NOAUTOMAN}=1; - } - elsif ($_ eq '-c') { - $ds{NOCOMPRESS}=1; - } - else { - push @argv,$_; - } -} -@ARGV=@argv; -init(); - -# Tolerate old style debstd invocations -if ($ARGV[0] && $dh{FIRSTPACKAGE} eq $ARGV[0]) { - shift; -} - -# debinit handles the installation of an init.d script -sub debinit { my ($script, $filename, $package, @params)=@_; - @initparams=(); - $norestart=''; - open (IN,$filename) || warn("$filename: $!"); - while () { - if (/^FLAGS=(.*)/) { - push @initparams, $1; - } - if (/NO_RESTART_ON_UPGRADE/) { - $norestart='--no-restart-on-upgrade'; - } - } - close IN; - $initparams=''; - if (@initparams) { - $initparams="--update-rcd-params='".join(" ",@initparams)."'"; - } - - doit("dh_installinit",$norestart,"-p$package",$initparams,"--init-script=$script",@params); -} - -# Do package specific things for a package. -sub do_package { my ($package, $tmp, $prefix)=@_; - # Deal with scripts in etc directories - if (-d "$prefix/rc.boot") { - warning("file $prefix/rc.boot was ignored."); - } - - # etc files that could need some tweaking - foreach $f ('services','inittab','crontab','protocols','profile', - 'shells','rpc','syslog.conf','conf.modules','modules', - 'aliases','diversions','inetd.conf','X11/Xresources', - 'X11/config','X11/window-managers','X11/xinit','purge') { - if ( -f "$prefix$f") { - warning("file $prefix$f was ignored."); - } - } - - if (-f "${prefix}init.d") { - debinit($package,"${prefix}init.d",$package,""); - } - - # The case of a daemon without the final d - if (-f "${prefix}init") { - $p=$package; - if ($p=~s/d$//) { - debinit($p,"${prefix}init",$package,"--remove-d"); - } - } - - if (-f "${prefix}info") { - warning("debhelper does not yet support info files, so ${prefix}info was ignored."); - } - - # Set up undocumented man page symlinks. - if (defined($ds{UNDOC}) && $ds{UNDOC}) { - open (FIND,"find $tmp -type f -perm +111 2>/dev/null |") || warning("find: $!"); - while () { - chomp; - ($binpath, $binname)=m:$tmp/(.*)/(.*):; - - # Check if manpages exist - $section=''; - if ($binpath eq 'sbin' || $binpath eq 'usr/sbin') { - $section=8; - } - elsif ($binpath eq 'usr/X11R6/bin') { - $section='1x'; - } - elsif ($binpath eq 'bin' || $binpath eq 'usr/bin') { - $section=1; - } - elsif ($binpath eq 'usr/games') { - $section=6; - } - if ($section && `find $tmp/usr/share/man $tmp/usr/X11R6/man -name "$binname.*" 2>/dev/null` eq '') { - doit("dh_undocumented","-p$package","$binname.$section"); - } - } - close FIND; - } -} - -# Special case of changelog -$changelogfile=''; -if ($ARGV[0] && $ARGV[0]=~m/change|news|history/) { - $changelogfile=shift; -} - -doit("dh_installdirs"); # here just to make the debian/tmp, etc directories. -doit("dh_installdocs",@ARGV); -doit("dh_installexamples"); -if ($changelogfile) { - doit("dh_installchangelogs",$changelogfile); -} -else { - doit("dh_installchangelogs"); -} -doit("dh_installmenu"); -doit("dh_installcron"); - -# Manpage scan -if (! $ds{NOAUTOMAN}) { - doit("dh_installmanpages","-p$dh{FIRSTPACKAGE}"); -} - -# Per-package stuff: -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - if ($PACKAGE eq $dh{FIRSTPACKAGE}) { - if (-f "debian/clean") { - warning("file debian/clean ignored."); - } - do_package($PACKAGE,"debian/tmp","debian/"); - } - else { - do_package($PACKAGE,"debian/$PACKAGE","debian/$PACKAGE."); - if ( -x "debian/$PACKAGE.prebuild") { - warning("file debian/$PACKAGE.prebuild ignored."); - } - } -} - -doit("dh_movefiles"); -doit("dh_strip"); - -if (! $ds{NOCOMPRESS}) { - doit("dh_compress"); -} - -doit("dh_fixperms"); -doit("dh_shlibdeps"); -doit("dh_gencontrol"); -doit("dh_makeshlibs"); - -# Check to see if the install scripts have #DEBHELPER# in them, if not, -# warn. -@filelist=(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - foreach $file (qw{postinst postrm preinst prerm}) { - $f=pkgfile($PACKAGE,$file); - if ($f) { - open (IN,$f); - $found=undef; - while () { - if (/#DEBHELPER#/) { - $found=1; - last; - } - } - if (! $found) { - push @filelist, $f; - } - } - } -} -if (@filelist) { - warning("The following scripts do not contain \"#DEBHELPER#\" in them,"); - warning("and so debhelper will not automatically add commands to them:"); - warning(join(" ",@filelist)); -} - -doit("dh_installdeb"); - -if (! $ds{SUMS}) { - doit("dh_md5sums"); -} - -# This causes the main binary package to be built, which -# real debstd does not do. Shouldn't be a problem though, -# if that package gets built twice. -doit("dh_builddeb"); diff --git a/dh_debstd.1 b/dh_debstd.1 deleted file mode 100644 index 81b2cac..0000000 --- a/dh_debstd.1 +++ /dev/null @@ -1,75 +0,0 @@ -.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/share/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 diff --git a/dh_fixperms b/dh_fixperms index 36ce73c..6024c50 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -2,39 +2,38 @@ # # Do some general file permission fixups. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); - if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') { - $find_options=""; - } - else { + 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", + 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", + complex_doit("find $tmp ! -type l $find_options -print0", "2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s"); # Fix up premissions in usr/share/doc, setting everything to not # executable by default, but leave examples directories alone. - complex_doit("find $TMP/usr/share/doc $TMP/usr/doc -type f $find_options ! -regex '.*/examples/.*' -print0", + complex_doit("find $tmp/usr/share/doc $tmp/usr/doc -type f $find_options ! -regex '.*/examples/.*' -print0", "2>/dev/null | xargs -0r chmod 644"); - complex_doit("find $TMP/usr/share/doc $TMP/usr/doc -type d $find_options -print0", + complex_doit("find $tmp/usr/share/doc $tmp/usr/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", + 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", + 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 a-X"); } diff --git a/dh_gencontrol b/dh_gencontrol index 15e0820..e3cfbfe 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -2,29 +2,30 @@ # # Generate and install the control file. Simple dpkg-gencontrol wrapper. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $ext=pkgext($package); - $changelog=pkgfile($PACKAGE,'changelog'); + my $changelog=pkgfile($package,'changelog'); if (! $changelog) { $changelog='debian/changelog'; } - if ( ! -d '$TMP/DEBIAN' ) { - doit("install","-o",0,"-g",0,"-d","$TMP/DEBIAN"); + if ( ! -d "$tmp/DEBIAN" ) { + doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN"); } # Generate and install control file. - doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE", - "-Tdebian/${EXT}substvars","-P$TMP",@{$dh{U_PARAMS}}); + doit("dpkg-gencontrol","-l$changelog","-isp","-p$package", + "-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("chmod","644","$tmp/DEBIAN/control"); - doit("chown","0.0","$TMP/DEBIAN/control"); + doit("chown","0.0","$tmp/DEBIAN/control"); } diff --git a/dh_installchangelogs b/dh_installchangelogs index e14eba6..2a82442 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -7,25 +7,24 @@ # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. +use strict; use Debian::Debhelper::Dh_Lib; init(); -$upstream=shift; +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'; } -else { - $changelog_name='changelog.Debian'; -} -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $changelog=pkgfile($PACKAGE,"changelog"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $changelog=pkgfile($package,"changelog"); if (!$changelog) { $changelog="debian/changelog"; @@ -35,35 +34,35 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { error("could not find changelog $changelog"); } - if (! -d "$TMP/usr/share/doc/$PACKAGE") { + 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"; + next if -l "$tmp/usr/share/doc/$package"; - doit("install","-d","$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"); + "$tmp/usr/share/doc/$package/$changelog_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"); - complex_doit("lynx -dump $upstream > $TMP/usr/share/doc/$PACKAGE/changelog"); + $upstream,"$tmp/usr/share/doc/$package/changelog.html"); + complex_doit("lynx -dump $upstream > $tmp/usr/share/doc/$package/changelog"); $link_to='changelog.html'; } else { doit("install","-o",0,"-g",0,"-p","-m644", - $upstream,"$TMP/usr/share/doc/$PACKAGE/changelog"); - $link_to='changelog'; + $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/".Debian::Debhelper::Dh_Lib::basename($upstream)); + doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream)); } } } diff --git a/dh_installcron b/dh_installcron index 47ef694..0ebb4b5 100755 --- a/dh_installcron +++ b/dh_installcron @@ -2,26 +2,27 @@ # # Install cron scripts into the appropriate places. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - foreach $type (qw{daily weekly monthly}) { - $cron=pkgfile($PACKAGE,"cron.$type"); +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"); + 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"); + doit("install",$cron,"$tmp/etc/cron.$type/$package"); } } # Seperate because this needs to be mode 644. - $cron=pkgfile($PACKAGE,"cron.d"); + 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"); + 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"); + doit("install","-m",644,$cron,"$tmp/etc/cron.d/$package"); } } diff --git a/dh_installdeb b/dh_installdeb index 63e0f7f..d0af6b5 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -2,66 +2,67 @@ # # Install files from debian/ into the package's DEBIAN directory. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); +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"); + 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 $file (qw{postinst preinst prerm postrm}) { - $f=pkgfile($PACKAGE,$file); + foreach my $file (qw{postinst preinst prerm postrm}) { + my $f=pkgfile($package,$file); if ($f) { - if (-f "debian/$EXT$file.debhelper") { + if (-f "debian/$ext$file.debhelper") { # Add this into the script, where it has # #DEBHELPER# # TODO: do internally, no perl fork? - complex_doit("perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < $f > $TMP/DEBIAN/$file"); + 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"); + complex_doit("sed s/#DEBHELPER#// < $f > $tmp/DEBIAN/$file"); } - doit("chown","0.0","$TMP/DEBIAN/$file"); - doit("chmod",755,"$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("echo '#!/bin/sh -e' > $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"); + if (-f "debian/$ext$file.debhelper") { + complex_doit("echo '#!/bin/sh -e' > $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 $file (qw{shlibs conffiles}) { - $f=pkgfile($PACKAGE,$file); + 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"); + 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 (! Debian::Debhelper::Dh_Lib::compat(2) && -d "$TMP/etc") { - complex_doit("find $TMP/etc -type f |sed 's~^$TMP~~' >> $TMP/DEBIAN/conffiles"); + if (! compat(2) && -d "$tmp/etc") { + complex_doit("find $tmp/etc -type f |sed 's~^$tmp~~' >> $tmp/DEBIAN/conffiles"); # Anything found? - if (-z "$TMP/DEBIAN/conffiles") { - doit("rm", "-f", "$TMP/DEBIAN/conffiles"); + if (-z "$tmp/DEBIAN/conffiles") { + doit("rm", "-f", "$tmp/DEBIAN/conffiles"); } else { - doit("chmod", 644, "$TMP/DEBIAN/conffiles"); + doit("chmod", 644, "$tmp/DEBIAN/conffiles"); } } } diff --git a/dh_installdebconf b/dh_installdebconf index f491e29..7be03ca 100755 --- a/dh_installdebconf +++ b/dh_installdebconf @@ -2,38 +2,39 @@ # # Integration with debconf. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $config=pkgfile($PACKAGE,"config"); - $templates=pkgfile($PACKAGE,"templates"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $config=pkgfile($package,"config"); + my $templates=pkgfile($package,"templates"); - if (! -d "$TMP/DEBIAN") { - doit("install","-o",0,"-g",0,"-d","$TMP/DEBIAN"); + if (! -d "$tmp/DEBIAN") { + doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN"); } if ($config ne '') { doit("install", "-o", 0, "-g", 0, "-m", 755, "-p", - $config, "$TMP/DEBIAN/config"); + $config, "$tmp/DEBIAN/config"); } if ($templates ne '') { # Are there translated templates too? my @trans=(glob("$templates.??"), glob("$templates.??_??")); if (@trans) { - complex_doit("debconf-mergetemplate @trans $templates > $TMP/DEBIAN/templates"); - chmod 0644, "$TMP/DEBIAN/templates"; - chown 0, 0, "$TMP/DEBIAN/templates"; + complex_doit("debconf-mergetemplate @trans $templates > $tmp/DEBIAN/templates"); + chmod 0644, "$tmp/DEBIAN/templates"; + chown 0, 0, "$tmp/DEBIAN/templates"; } else { doit("install", "-o", 0, "-g", 0, "-m", 644, "-p", - $templates, "$TMP/DEBIAN/templates"); + $templates, "$tmp/DEBIAN/templates"); } } if (($config ne ''|| $templates ne '') && ! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postrm","postrm-debconf"); + autoscript($package,"postrm","postrm-debconf"); } } diff --git a/dh_installdirs b/dh_installdirs index 1ecf907..340c966 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -2,35 +2,36 @@ # # Reads debian/dirs, creates the directories listed there +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"dirs"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"dirs"); - if (! -e $TMP) { - doit("install","-d",$TMP); + if (! -e $tmp) { + doit("install","-d",$tmp); } - undef @dirs; + my @dirs; if ($file) { @dirs=filearray($file) } - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @dirs, @ARGV; } if (@dirs) { - # Stick the $TMP onto the front of all the 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/$_"; + $_="$tmp/$_"; tr:/:/:s; # just beautification. $_ } @dirs; diff --git a/dh_installdocs b/dh_installdocs index 6191091..7cadc5e 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -1,86 +1,87 @@ #!/usr/bin/perl -w # # Reads debian/docs, installs all files listed there into -# /usr/share/doc/$PACKAGE +# /usr/share/doc/$package # Also installs the debian/copyright and debian/README.debian and debian/TODO # and handles debian/doc-base. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"docs"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $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/share/doc/$package" && + ! -l "$tmp/usr/share/doc/$package") { + doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc/$package"); } - undef @docs; + my @docs; if ($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) { - doit("cp", "-a",@docs,"$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/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"); } # .Debian is correct, according to policy, but I'm easy. - $readme_debian=pkgfile($PACKAGE,'README.Debian'); + my $readme_debian=pkgfile($package,'README.Debian'); if (! $readme_debian) { - $readme_debian=pkgfile($PACKAGE,'README.debian'); + $readme_debian=pkgfile($package,'README.debian'); } if ($readme_debian) { doit("install","-g",0,"-o",0,"-m","644","-p","$readme_debian", - "$TMP/usr/share/doc/$PACKAGE/README.Debian"); + "$tmp/usr/share/doc/$package/README.Debian"); } - $todo=pkgfile($PACKAGE,'TODO'); + my $todo=pkgfile($package,'TODO'); if ($todo) { - if (isnative($PACKAGE)) { + if (isnative($package)) { doit("install","-g",0,"-o",0,"-m","644","-p",$todo, - "$TMP/usr/share/doc/$PACKAGE/TODO"); + "$tmp/usr/share/doc/$package/TODO"); } else { doit("install","-g",0,"-o",0,"-m","644","-p",$todo, - "$TMP/usr/share/doc/$PACKAGE/TODO.Debian"); + "$tmp/usr/share/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") { + 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. - $copyright=pkgfile($PACKAGE,'copyright'); + my $copyright=pkgfile($package,'copyright'); if (! $copyright && -e "debian/copyright") { $copyright="debian/copyright"; } if ($copyright) { doit("install","-g",0,"-o",0,"-m","644","-p",$copyright, - "$TMP/usr/share/doc/$PACKAGE/copyright"); + "$tmp/usr/share/doc/$package/copyright"); } } # Add in the /usr/doc compatability symlinks code. if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-doc", - "s/#PACKAGE#/$PACKAGE/g", + autoscript($package,"postinst","postinst-doc", + "s/#PACKAGE#/$package/g", ); - autoscript($PACKAGE,"prerm","prerm-doc", - "s/#PACKAGE#/$PACKAGE/g", + autoscript($package,"prerm","prerm-doc", + "s/#PACKAGE#/$package/g", ); } @@ -92,8 +93,8 @@ foreach $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)) { @@ -110,18 +111,18 @@ foreach $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","-g",0,"-o",0,"-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}"); + "$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}/", ); } diff --git a/dh_installdocs.1 b/dh_installdocs.1 index aa72b46..6df294c 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -67,6 +67,10 @@ all packages if -A is specified). 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. +.P +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. .SH ENVIRONMENT See .BR debhelper (1) @@ -75,10 +79,6 @@ for a list of environment variables that affect all debhelper commands. .BR debhelper (1) .TP .BR install-docs (8) -.SH 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. .SH BUGS It's impossible to specify filenames with spaces or other whitespace in them in debian/package.docs file. This is more a historical design flaw than a bug. diff --git a/dh_installemacsen b/dh_installemacsen index 8d8982c..a0b8278 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -2,6 +2,7 @@ # # Registration with emacsen-common. +use strict; use Debian::Debhelper::Dh_Lib; init(); @@ -12,40 +13,40 @@ if (! defined $dh{FLAVOR}) { $dh{FLAVOR}='emacs'; } -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); - $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); - $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); - $emacsen_startup=pkgfile($PACKAGE,"emacsen-startup"); + 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"); + 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"); + 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"); + 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"); + 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/"); + 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"); + 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/"); + autoscript($package,"postinst","postinst-emacsen", + "s/#PACKAGE#/$package/"); + autoscript($package,"prerm","prerm-emacsen", + "s/#PACKAGE#/$package/"); } } } diff --git a/dh_installexamples b/dh_installexamples index 7e62767..9fdbdf7 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -1,30 +1,31 @@ #!/usr/bin/perl -w # # Reads debian/examples, installs all files listed there into -# /usr/share/doc/$PACKAGE/examples +# /usr/share/doc/$package/examples +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"examples"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"examples"); - undef @examples; + my @examples; if ($file) { @examples=filearray($file, "."); } - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + 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"); + if (! -d "$tmp/usr/share/doc/$package/examples") { + doit("install","-d","$tmp/usr/share/doc/$package/examples"); } - doit("cp","-a",@examples,"$TMP/usr/share/doc/$PACKAGE/examples"); + doit("cp","-a",@examples,"$tmp/usr/share/doc/$package/examples"); } } diff --git a/dh_installinfo b/dh_installinfo index 146aede..702f4ee 100755 --- a/dh_installinfo +++ b/dh_installinfo @@ -3,30 +3,31 @@ # Reads debian/info, installs all files listed there into /usr/share/info # and puts appropriate commands into the postinst. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"info"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"info"); - undef @info; + my @info; if ($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/share/info") { + doit("install","-d","$tmp/usr/share/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/share/info"); + doit("chmod","-R", "go=rX","$tmp/usr/share/info/"); + doit("chmod","-R", "u+rw","$tmp/usr/share/info/"); } foreach $file (@info) { @@ -44,18 +45,18 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } close IN; - my $fn="/usr/share/info/".Debian::Debhelper::Dh_Lib::basename($file); + my $fn="/usr/share/info/".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:"); } } } diff --git a/dh_installinit b/dh_installinit index cd3fca4..e7f9b70 100755 --- a/dh_installinit +++ b/dh_installinit @@ -3,11 +3,12 @@ # Install debian/init[.d], and set up the postinst and postrm for init # scripts. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); # Figure out what filename to install it as. my $script; @@ -15,30 +16,30 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # -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; + $script=$package; if ($script=~m/(.*)d$/) { $script=$1; } else { - warning("\"$PACKAGE\" has no final d' in its name, but -d was specified."); + warning("\"$package\" has no final d' in its name, but -d was specified."); } } elsif ($dh{INIT_SCRIPT}) { $script=$dh{INIT_SCRIPT}; } else { - $script=$PACKAGE; + $script=$package; } - $init=pkgfile($PACKAGE,$script) || pkgfile($PACKAGE,"init") || - pkgfile($PACKAGE,"init.d"); + my $init=pkgfile($package,$script) || pkgfile($package,"init") || + pkgfile($package,"init.d"); if ($init ne '') { - if (! -d "$TMP/etc/init.d") { - doit("install","-d","$TMP/etc/init.d"); + if (! -d "$tmp/etc/init.d") { + doit("install","-d","$tmp/etc/init.d"); } - doit("install","-p","-m755",$init,"$TMP/etc/init.d/$script"); + 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, @@ -55,19 +56,19 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # -r on the command line sets R_FLAG. If it's set, there # is no restart on upgrade. if ($dh{R_FLAG}) { - autoscript($PACKAGE,"postinst", "postinst-init-norestart", + autoscript($package,"postinst", "postinst-init-norestart", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($PACKAGE,"postrm","postrm-init", + autoscript($package,"postrm","postrm-init", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($PACKAGE,"prerm","prerm-init-norestart", + autoscript($package,"prerm","prerm-init-norestart", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); } else { - autoscript($PACKAGE,"postinst","postinst-init", + autoscript($package,"postinst","postinst-init", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($PACKAGE,"postrm","postrm-init", + autoscript($package,"postrm","postrm-init", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($PACKAGE,"prerm","prerm-init", + autoscript($package,"prerm","prerm-init", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); } } diff --git a/dh_installlogrotate b/dh_installlogrotate index 4f04ed7..8cefc45 100755 --- a/dh_installlogrotate +++ b/dh_installlogrotate @@ -2,16 +2,18 @@ # # Install logrotate config files. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"logrotate"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"logrotate"); + if ($file) { - if (! -d "$TMP/etc/logrotate.d") { - doit("install","-o",0,"-g",0,"-d","$TMP/etc/logrotate.d"); + if (! -d "$tmp/etc/logrotate.d") { + doit("install","-o",0,"-g",0,"-d","$tmp/etc/logrotate.d"); } - doit("install","-m",644,$file,"$TMP/etc/logrotate.d/$PACKAGE"); + doit("install","-m",644,$file,"$tmp/etc/logrotate.d/$package"); } } diff --git a/dh_installman b/dh_installman new file mode 100755 index 0000000..03e5e9f --- /dev/null +++ b/dh_installman @@ -0,0 +1,129 @@ +#!/usr/bin/perl -w +# +# Reads debian/manpages, installs all man pages there into appropriate +# man page directory tree. + +use strict; +use File::Find; +use Debian::Debhelper::Dh_Lib; +init(); + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"manpages"); + my @manpages; + + if ($file) { + @manpages=filearray($file, "."); + } + + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @manpages, @ARGV; + } + + foreach my $page (@manpages) { + my $basename=Debian::Debhelper::Dh_Lib::basename($page); + + # Support compressed pages. + my $gz=''; + if ($basename=~m/(.*)(\.gz)/) { + $basename=$1; + $gz=$2; + } + + my $section; + # See if there is a .TH entry in the man page. If so, + # we'll pull the section field from that. + if ($gz) { + open (IN, "zcat $page|") or die "$page: $!"; + } + else { + open (IN, $page) or die "$page: $!"; + } + while () { + if (/^\.TH\s+[^ ]+\s+(\d+[^ ]*)\s/) { + $section=$1; + last; + } + } + # Failing that, we can try to get it from the filename. + if (! $section) { + ($section)=$basename=~m/.*\.([1-9][^ ]*)/; + } + + # Now get the numeric component of the section. + my ($realsection)=$section=~m/^(\d)/ if defined $section; + + # If there is no numeric section, bail. + if (! $realsection) { + error("Could not determine section for $page"); + } + + my $destdir="$tmp/usr/share/man/man$realsection/"; + # Translated man pages are typically specified by adding the + # language code to the filename, so detect that and + # redirect to appropriate directory. + my ($langcode)=$basename=~m/.*\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/; + if (defined $langcode && $langcode ne '') { + $destdir="$tmp/usr/share/man/$langcode/man$section/"; + } + $destdir=~tr:/:/:s; # just for looks + + # Get the man page's name -- everything up to the last dot. + my ($instname)=$basename=~m/^(.*)\./; + + if (! -e "$destdir/$instname.$section" && + ! -l "$destdir/$instname.$section") { + if (! -d $destdir) { + doit "install","-d",$destdir; + } + doit "install","-p","-m644",$page, + "$destdir$instname.$section$gz"; + } + + } + + # Now the .so conversion. + my @sofiles; + my @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; + } +} + +# 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=; + close SOTEST; + if ($l=~m/\.so\s+(.*)/) { + my $solink=$1; + # This test is here to prevent links like ... man8/../man8/foo.8 + if (Debian::Debhelper::Dh_Lib::basename($File::Find::dir) eq + Debian::Debhelper::Dh_Lib::dirname($solink)) { + $solink=Debian::Debhelper::Dh_Lib::basename($solink); + } + else { + $solink="../$solink"; + } + + push @sofiles,"$File::Find::dir/$_"; + push @sodests,$solink; + } +} diff --git a/dh_installman.1 b/dh_installman.1 new file mode 100644 index 0000000..d77a524 --- /dev/null +++ b/dh_installman.1 @@ -0,0 +1,55 @@ +.TH DH_INSTALLMAN 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installman \- install man pages into package build directories +.SH SYNOPSIS +.B dh_installman +.I "[debhelper options] [manpage ...]" +.SH "DESCRIPTION" +dh_installman is a debhelper program that is responsible for installing +man pages into the correct locations in package build directories. You tell +it what man pages go in your package(s), and it figure out where to install +them based on the section field in their .TH line and their filename +extention. +.P +Any man page filenames specified as parameters will be installed into the +first package dh_installman 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.manpages can list other man pages to be installed. +.P +After the man page installation step, dh_installman will check to see if +any of the man pages in the temporary directories of any of the packages it +is acting on contain ".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 \-A, \--all +Install all files specified by command line parameters in ALL packages +acted on. +.TP +.B manpage ... +Install these man pages into the first package acted on. (Or in all packages +if -A is specified). +.SH NOTES +An older version of this program, +.BR dh_installmanpages (1) +, is still used by some packages, and so is still included in debhelper. +It is, however, deprecated, due to its counterintuiitive and inconsistent +interface. Use this program instead. +.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/package.manpages file. This is more a historical design +flaw than a bug. +.SH AUTHOR +Joey Hess diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index d60430d..a95f463 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -1,6 +1,6 @@ .TH DH_INSTALLMANPAGES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME -dh_installmanpages \- install man pages into package build directories +dh_installmanpages \- old-style man page installer .SH SYNOPSIS .B dh_installmanpages .I "[debhelper options] [file ...]" @@ -9,6 +9,11 @@ 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. .P +This is a DWIM-style program, with an interface unlike the rest of +debhelper. You are encouraged to use +.BR dh_installman (1) +instead. +.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 @@ -43,6 +48,7 @@ See for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) +.BR dh_installman (1) .SH BUGS Man pages with the extension .B .man diff --git a/dh_installmenu b/dh_installmenu index d6050fe..2f73209 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -2,43 +2,44 @@ # # Integration with debian menu system: # -# If debian/menu file exists, save it to $TMP/usr/lib/menu/$PACKAGE +# If debian/menu file exists, save it to $tmp/usr/lib/menu/$package # If debian/menu-method file exists, save it to -# $TMP/etc/menu-methods/$PACKAGE +# $tmp/etc/menu-methods/$package # # Also, add to postinst and postrm. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $menu=pkgfile($PACKAGE,"menu"); - $menu_method=pkgfile($PACKAGE,"menu-method"); +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"); + if (! -d "$tmp/usr/lib/menu") { + doit("install","-d","$tmp/usr/lib/menu"); } - doit("install","-p","-m644",$menu,"$TMP/usr/lib/menu/$PACKAGE"); + 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") + 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"); + if (!-d "$tmp/etc/menu-methods") { + doit("install","-d","$tmp/etc/menu-methods"); } - doit("install","-p",$menu_method,"$TMP/etc/menu-methods/$PACKAGE"); + 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/"); + autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/"); + autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/"); } } } diff --git a/dh_installmime b/dh_installmime index 0dbc08b..59d8c87 100755 --- a/dh_installmime +++ b/dh_installmime @@ -2,22 +2,23 @@ # # Mime support. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $mime=pkgfile($PACKAGE,"mime"); +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"); + 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"); + doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package"); if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-mime"); - autoscript($PACKAGE,"postrm","postrm-mime") + autoscript($package,"postinst","postinst-mime"); + autoscript($package,"postrm","postrm-mime") } } } diff --git a/dh_installmodules b/dh_installmodules index b75c58f..e31d1d0 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -2,6 +2,7 @@ # # Register modules with modutils. +use strict; use Debian::Debhelper::Dh_Lib; use File::Find; init(); @@ -16,24 +17,24 @@ sub find_kernel_modules { return @results > 0; } -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"modules"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"modules"); - if (! -e $TMP) { - doit("install","-d",$TMP); + if (! -e $tmp) { + doit("install","-d",$tmp); } if ($file) { - if (! -e "$TMP/etc/modutils") { - doit("install","-d","$TMP/etc/modutils"); + if (! -e "$tmp/etc/modutils") { + doit("install","-d","$tmp/etc/modutils"); } - doit("install","-m","0644",$file,"$TMP/etc/modutils/$PACKAGE"); + 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/"); + ($file || find_kernel_modules("$tmp/lib/modules"))) { + autoscript($package,"postinst","postinst-modules","s/#PACKAGE#/$package/"); + autoscript($package,"postrm","postrm-modules","s/#PACKAGE#/$package/"); } } diff --git a/dh_installpam b/dh_installpam index 72f8d7d..85ee092 100755 --- a/dh_installpam +++ b/dh_installpam @@ -2,19 +2,20 @@ # # Integration with debian pam system: # -# If debian/pam file exists, save it to $TMP/etc/pam.d/$PACKAGE +# If debian/pam file exists, save it to $tmp/etc/pam.d/$package +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $pam=pkgfile($PACKAGE,"pam"); +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"); + if (! -d "$tmp/etc/pam.d") { + doit("install","-d","$tmp/etc/pam.d"); } - doit("install","-p","-m644",$pam,"$TMP/etc/pam.d/$PACKAGE"); + doit("install","-p","-m644",$pam,"$tmp/etc/pam.d/$package"); } } diff --git a/dh_installwm b/dh_installwm index 9a970fe..8bbee69 100755 --- a/dh_installwm +++ b/dh_installwm @@ -2,6 +2,7 @@ # # Add to postinst and prerm to register a window manager. +use strict; use Debian::Debhelper::Dh_Lib; init(); @@ -17,22 +18,23 @@ if (@ARGV) { } } -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { -# $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"wm"); +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) { + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @wm, @ARGV; } if (@wm && ! $dh{NOSCRIPTS}) { foreach (@wm) { - autoscript($PACKAGE,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",); - autoscript($PACKAGE,"prerm","prerm-wm","s:#WM#:$_:"); + autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",); + autoscript($package,"prerm","prerm-wm","s:#WM#:$_:"); } } } diff --git a/dh_installxaw b/dh_installxaw index 5cb94e2..e5ecf93 100755 --- a/dh_installxaw +++ b/dh_installxaw @@ -3,23 +3,24 @@ # Integration with xaw-wrappers # # If debian/xaw-wrappers file exists, save it to -# $TMP/usr/share/xaw-wrappers/config/$PACKAGE +# $tmp/usr/share/xaw-wrappers/config/$package # # Also, add calls to postinst and postrm. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $xaw=pkgfile($PACKAGE,'xaw'); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $xaw=pkgfile($package,'xaw'); if ($xaw ne '') { - if (! -d "$TMP/usr/share/xaw-wrappers/config") { - doit("install","-d","$TMP/usr/share/xaw-wrappers/config"); + if (! -d "$tmp/usr/share/xaw-wrappers/config") { + doit("install","-d","$tmp/usr/share/xaw-wrappers/config"); } doit("install","-p","-m644",$xaw, - "$TMP/usr/share/xaw-wrappers/config/$PACKAGE"); + "$tmp/usr/share/xaw-wrappers/config/$package"); if (! $dh{NOSCRIPTS}) { # Parse the xaw conf file to figure out what programs @@ -54,11 +55,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $remove_opts.="'$data{'link-name'} $data{wrapped}'"; } - autoscript($PACKAGE,"postinst","postinst-xaw", + autoscript($package,"postinst","postinst-xaw", "s:#OPTS#:$install_opts:"); - autoscript($PACKAGE,"prerm","prerm-xaw", + autoscript($package,"prerm","prerm-xaw", "s:#OPTS#:$remove_opts:"); - autoscript($PACKAGE,"postrm","postrm-xaw"); + autoscript($package,"postrm","postrm-xaw"); } } } diff --git a/dh_installxfonts b/dh_installxfonts index 83f38c0..024307c 100755 --- a/dh_installxfonts +++ b/dh_installxfonts @@ -2,12 +2,13 @@ # # Integration with the Debian X11 font policy. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - my $XFONTDIR="$TMP/usr/X11R6/lib/X11/fonts/"; +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $XFONTDIR="$tmp/usr/X11R6/lib/X11/fonts/"; # Find all fint directories in the package build directory. opendir DIR, $XFONTDIR || next; @@ -19,16 +20,16 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { my @updatecmds=('/usr/bin/X11/mkfontdir'); foreach my $f (@fontdirs) { push @updatecmds, '/usr/sbin/update-fonts-alias' - if -f "$TMP/etc/X11/fonts/$f/$PACKAGE.alias"; + if -f "$tmp/etc/X11/fonts/$f/$package.alias"; # This must come _before_ mkfontdir, thus the unshift. unshift @updatecmds, '/usr/sbin/update-fonts-scale' - if -f "$TMP/etc/X11/fonts/$f/$PACKAGE.scale"; + if -f "$tmp/etc/X11/fonts/$f/$package.scale"; } - autoscript($PACKAGE, "postinst", "postinst-xfonts", + autoscript($package, "postinst", "postinst-xfonts", "s:#FONTDIRS#:".join(' ', @fontdirs). ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":"); - autoscript($PACKAGE, "postrm", "postrm-xfonts", + autoscript($package, "postrm", "postrm-xfonts", "s:#FONTDIRS#:".join(' ', @fontdirs). ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":"); } diff --git a/dh_link b/dh_link index e19a513..4dca363 100755 --- a/dh_link +++ b/dh_link @@ -3,14 +3,15 @@ # Generate symlinks in debian packages, reading debian/links. The # file contains pairs of files and symlinks. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"links"); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); + my $file=pkgfile($package,"links"); - undef @links; + my @links; if ($file) { @links=filearray($file); } @@ -21,7 +22,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { error("$file lists a link without a destination."); } - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @links, @ARGV; } @@ -31,15 +32,15 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } while (@links) { - $dest=pop @links; - $src=pop @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. - $basedir=Debian::Debhelper::Dh_Lib::dirname("$TMP/$dest"); + my $basedir=Debian::Debhelper::Dh_Lib::dirname("$tmp/$dest"); if (! -e $basedir) { doit("install","-d",$basedir); } @@ -47,11 +48,12 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # 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. - @src_dirs=split(m:/+:,$src); - @dest_dirs=split(m:/+:,$dest); + 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=""; @@ -68,6 +70,6 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $src="/$src"; } - doit("ln","-sf",$src,"$TMP/$dest"); + doit("ln","-sf",$src,"$tmp/$dest"); } } diff --git a/dh_listpackages b/dh_listpackages index 1123e6d..ec9d533 100755 --- a/dh_listpackages +++ b/dh_listpackages @@ -2,6 +2,7 @@ # # Output a list of all packages debhelper will act on. +use strict; use Debian::Debhelper::Dh_Lib; init(); print join("\n",@{$dh{DOPACKAGES}})."\n"; diff --git a/dh_makeshlibs b/dh_makeshlibs index 8f3e7a7..20644d8 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -2,19 +2,23 @@ # # Automatically generate shlibs files. +use strict; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); my %seen; my $need_ldconfig = 0; - doit("rm", "-f", "$TMP/DEBIAN/shlibs"); + doit("rm", "-f", "$tmp/DEBIAN/shlibs"); - open (FIND, "find $TMP -xtype f -name '*.so*' |"); + open (FIND, "find $tmp -xtype f -name '*.so*' |"); while () { + my $library; + my $major; + chomp; $need_ldconfig=1; # The second evil regexp is for db3, whose author should @@ -26,10 +30,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { $major=$dh{M_PARAMS}; } - if (! -d "$TMP/DEBIAN") { - doit("install","-d","$TMP/DEBIAN"); + if (! -d "$tmp/DEBIAN") { + doit("install","-d","$tmp/DEBIAN"); } - $deps=$PACKAGE; + my $deps=$package; if ($dh{V_FLAG_SET}) { if ($dh{V_FLAG} ne '') { $deps=$dh{V_FLAG}; @@ -37,8 +41,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { else { # Call isnative becuase it sets $dh{VERSION} # as a side effect. - isnative($PACKAGE); - $deps="$PACKAGE (>= $dh{VERSION})"; + isnative($package); + $deps="$package (>= $dh{VERSION})"; } } if (defined($library) && defined($major) && defined($deps) && @@ -47,21 +51,20 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { my $line="$library $major $deps"; if (! $seen{$line}) { $seen{$line}=1; - complex_doit("echo '$line' >>$TMP/DEBIAN/shlibs"); + complex_doit("echo '$line' >>$tmp/DEBIAN/shlibs"); } } } close FIND; # New as of dh_v3. - if (! Debian::Debhelper::Dh_Lib::compat(2) && - ! $dh{NOSCRIPTS} && $need_ldconfig) { - autoscript($PACKAGE,"postinst","postinst-makeshlibs"); - autoscript($PACKAGE,"postrm","postrm-makeshlibs"); + if (! 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"); + if (-e "$tmp/DEBIAN/shlibs") { + doit("chmod",644,"$tmp/DEBIAN/shlibs"); + doit("chown","0.0","$tmp/DEBIAN/shlibs"); } } diff --git a/dh_md5sums b/dh_md5sums index d69186c..ad3ae71 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -3,22 +3,23 @@ # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the # package. +use strict; use Cwd; use Debian::Debhelper::Dh_Lib; init(); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp=tmpdir($package); - if (! -d "$TMP/DEBIAN") { - doit("install","-d","$TMP/DEBIAN"); + if (! -d "$tmp/DEBIAN") { + doit("install","-d","$tmp/DEBIAN"); } # Check if we should exclude conffiles. my $exclude=""; - if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") { + if (! $dh{INCLUDE} && -r "$tmp/DEBIAN/conffiles") { # Generate exclude regexp. - open (CONFF,"$TMP/DEBIAN/conffiles"); + open (CONFF,"$tmp/DEBIAN/conffiles"); while () { chomp; s/^\///; @@ -32,14 +33,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; } - $olddir=getcwd(); - complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null"); + my $olddir=getcwd(); + complex_doit("cd $tmp >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | 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"); + 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"); + doit("chmod",644,"$tmp/DEBIAN/md5sums"); + doit("chown","0.0","$tmp/DEBIAN/md5sums"); } } diff --git a/dh_movefiles b/dh_movefiles index 140f749..8eac387 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -2,49 +2,48 @@ # # Move files out of debian/tmp, into subpackages. +use strict; use Debian::Debhelper::Dh_Lib; init(); -$ret=0; +my $ret=0; -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $files=pkgfile($PACKAGE,"files"); +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}; } - else { - $sourcedir="debian/tmp"; - } if (! -d $sourcedir) { error("$sourcedir does not exist."); } - @tomove=(); + my @tomove; # debian/files has a different purpose, so ignore it. - if ( $files && $files ne "debian/files" ) { + if ($files && $files ne "debian/files" ) { @tomove=filearray($files, $sourcedir); } - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @tomove, @ARGV; } - if (@tomove && $TMP eq $sourcedir) { + if (@tomove && $tmp eq $sourcedir) { error("I was asked to move files from $sourcedir to $sourcedir. Perhaps you should set DH_COMAPT=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 && Debian::Debhelper::Dh_Lib::compat(2)) { - @filelist=(); + if (@tomove && compat(2)) { + my @filelist=(); foreach (@tomove) { push @filelist, glob("$sourcedir/$_"); } @@ -57,13 +56,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } if (@tomove) { - if (! -d $TMP) { - doit("install","-d",$TMP); + if (! -d $tmp) { + doit("install","-d",$tmp); } doit("rm","-f","debian/movelist"); foreach (@tomove) { - $file=$_; + my $file=$_; if (! -e $file && ! -l $file) { $ret=1; warning("$file not found"); @@ -71,7 +70,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $file=~s:^\Q$sourcedir\E/+::; complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -print || true) >> debian/movelist"); } - complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=../movelist --file -) | (cd $TMP >/dev/null ;tar xpf -)"); + complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=../movelist --file -) | (cd $tmp >/dev/null ;tar xpf -)"); doit("rm","-f","debian/movelist"); } } diff --git a/dh_testversion.1 b/dh_testversion.1 index 30e76fb..cdfc9d0 100644 --- a/dh_testversion.1 +++ b/dh_testversion.1 @@ -4,8 +4,7 @@ dh_testversion \- ensure that the correct version of debhelper is installed .SH SYNOPSIS .B dh_testversion [debhelper options] [operator] [version] .SH "DESCRIPTION" -Note: This program is rapidly becoming obsolete. Soon you will be able to -use build dependencies instead. +Note: This program is deprecated. You should use build dependencies instead. .P dh_testversion compares the version of debhelper against the version you specify, and if the condition is not met, exits with an error message. diff --git a/doc/TODO b/doc/TODO index 102acd3..74a0042 100644 --- a/doc/TODO +++ b/doc/TODO @@ -3,14 +3,33 @@ list grows - I welcome patches to fix items on it! Wishlist items: -* Make dh_* "use strict". -* 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 only accept the options they are documented + to accept (rather than accepting all debhelper options). They should + be able to print breif 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}; + + sub startup { + # Add initialization stuff here. + } + + sub perpackage { + my $package=shift; + + # Stuff to do for each package here. + } + + sub fini { + # And final stuff here, if any. + } + + This needs more thought. + * 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 @@ -50,3 +69,7 @@ Deprecated: them. I'd also like to depercate/remove debian/compress files, -X is a better idea. * dh_suidmanager. 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. Only mildly deprecated right now. Make it emit a warning + by jan 2002, and remove as soon as nothing uses it. diff --git a/doc/from-debstd b/doc/from-debstd deleted file mode 100644 index 3cd179b..0000000 --- a/doc/from-debstd +++ /dev/null @@ -1,62 +0,0 @@ -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 --no-act" to the end. This will make dh_debstd output a list of -commands that it thinks will emulate what debstd would have done, without -actually doing anything to your package. The list will look similar to this: - - dh_installdirs - dh_installdocs TODO README - dh_installexamples - dh_installchangelogs CHANGES - dh_installmenu - dh_installcron - dh_installmanpages - dh_movefiles - dh_strip - dh_compress - dh_fixperms - dh_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 diff --git a/doc/v3 b/doc/v3 deleted file mode 100644 index c1833dc..0000000 --- a/doc/v3 +++ /dev/null @@ -1,36 +0,0 @@ -Debhelper v3 is a major new revision of debhelper. Currently, v3 is still -being worked on, and will change in drastic ways without notice. This -*will* break packages that use it, so don't, unless you like riding the -bleeding edge. - -To enable debhelper v3 features (do this with *caution*), set DH_COMPAT=3 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 v3, based on -prior discussion on debian-devel. - -Items marked with a + are done. All others will happen as soon as I can code -them. - -* 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 extension, and delete that extentation, and add the correct one. - -+ Every file in etc/ is automatically flagged as a conffile by dh_installdeb. - -+ Debhelper config files support globbing via * and ?, when - appropriate. To turn this off and use those characters raw, just prefix - with a backspash. - -+ dh_makeshlibs generates autoscript fragments for ldconfig. This will - require you call it before dh_installdeb. (Many old debian/rules scripts - call it after.) diff --git a/examples/rules b/examples/rules index 7eef799..fc80fe6 100755 --- a/examples/rules +++ b/examples/rules @@ -6,7 +6,7 @@ #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. -export DH_COMPAT=2 +export DH_COMPAT=3 build: build-stamp build-stamp: @@ -43,7 +43,6 @@ binary-indep: build install # Build architecture-dependent files here. binary-arch: build install - dh_testversion 2 dh_testdir dh_testroot # dh_installdebconf @@ -56,7 +55,7 @@ binary-arch: build install # dh_installmime # dh_installinit dh_installcron - dh_installmanpages + dh_installman dh_installinfo # dh_undocumented dh_installchangelogs diff --git a/examples/rules.indep b/examples/rules.indep index 71e0a52..603c79a 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -8,7 +8,7 @@ #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. -export DH_COMPAT=2 +export DH_COMPAT=3 build: build-stamp build-stamp: @@ -41,7 +41,6 @@ install: build # Build architecture-independent files here. binary-indep: build install - dh_testversion 2 dh_testdir dh_testroot # dh_installdebconf @@ -54,7 +53,7 @@ binary-indep: build install # dh_installmime # dh_installinit dh_installcron -# dh_installmanpages +# dh_installman dh_installinfo # dh_undocumented dh_installchangelogs diff --git a/examples/rules.multi b/examples/rules.multi index 0dc703f..cf89c5b 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -10,7 +10,7 @@ #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. -export DH_COMPAT=2 +export DH_COMPAT=3 build: build-stamp build-stamp: @@ -46,7 +46,6 @@ install: build # Build architecture-independent files here. binary-indep: build install - dh_testversion 2 dh_testdir -i dh_testroot -i # dh_installdebconf -i @@ -59,7 +58,7 @@ binary-indep: build install # dh_installmime -i # dh_installinit -i dh_installcron -i -# dh_installmanpages -i + dh_installman -i dh_installinfo -i # dh_undocumented -i dh_installchangelogs -i @@ -87,7 +86,7 @@ binary-arch: build install # dh_installmime -a # dh_installinit -a dh_installcron -a -# dh_installmanpages -a + dh_installman -a dh_installinfo -a # dh_undocumented -a dh_installchangelogs -a diff --git a/examples/rules.multi2 b/examples/rules.multi2 index 0684ca6..09757be 100755 --- a/examples/rules.multi2 +++ b/examples/rules.multi2 @@ -9,7 +9,7 @@ #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. -export DH_COMPAT=2 +export DH_COMPAT=3 # This has to be exported to make some magic below work. export DH_OPTIONS @@ -51,7 +51,6 @@ install: build # 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_testversion 2 dh_testdir dh_testroot # dh_installdebconf @@ -63,6 +62,7 @@ binary-common: # dh_installpam # dh_installmime # dh_installinit +# dh_installman dh_installcron dh_installinfo # dh_undocumented -- 2.39.2