From 4a03496417f521caa06f7f4e02592aa5f0b6a390 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:21:03 +0000 Subject: r5: Initial Import --- dh_installdocs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dh_installdocs') diff --git a/dh_installdocs b/dh_installdocs index 336ed6ee..dc216288 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -17,7 +17,7 @@ for PACKAGE in $DH_DOPACKAGES; do docs="" if [ -e debian/${EXT}docs ]; then - docs=`cat debian/${EXT}docs | tr "\n" " "` + docs=`tr "\n" " " < debian/${EXT}docs` fi if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then -- cgit v1.2.3 From d079e6683cfcbef6a979eb7a02780eebdf480a74 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:34:25 +0000 Subject: r12: Initial Import --- .foo | 0 BUGS | 3 + autoscripts/postinst-init | 2 + autoscripts/postinst-init-norestart | 1 + autoscripts/postinst-suid | 6 ++ autoscripts/postrm-init | 3 + autoscripts/postrm-suid | 3 + autoscripts/prerm-init | 1 + debian/changelog | 6 ++ dh_builddeb | 2 +- dh_clean | 2 +- dh_compress | 2 +- dh_du | 19 +++++ dh_du.1 | 42 +++++++++++ dh_fixperms | 2 +- dh_gencontrol | 19 +++++ dh_gencontrol.1 | 55 ++++++++++++++ dh_getopt.pl | 138 ++++++++++++++++++++++++++++++++++++ dh_installchangelogs | 2 +- dh_installcron | 2 +- dh_installdeb | 46 ++++++++++++ dh_installdeb.1 | 67 +++++++++++++++++ dh_installdebfiles | 2 +- dh_installdirs | 39 ++++++++++ dh_installdirs.1 | 59 +++++++++++++++ dh_installdocs | 2 +- dh_installdocs.1 | 13 ++-- dh_installexamples | 2 +- dh_installexamples.1 | 4 ++ dh_installinit | 58 +++++++++++++++ dh_installinit.1 | 70 ++++++++++++++++++ dh_installmanpages | 2 +- dh_installmenu | 2 +- dh_lib | 12 ++-- dh_makeshlibs | 30 ++++++++ dh_makeshlibs.1 | 47 ++++++++++++ dh_md5sums | 22 ++++++ dh_md5sums.1 | 45 ++++++++++++ dh_movefiles.1 | 46 ++++++++++++ dh_shlibdeps | 24 +++++++ dh_shlibdeps.1 | 56 +++++++++++++++ dh_strip | 2 +- dh_suidregister | 58 +++++++++++++++ dh_suidregister.1 | 62 ++++++++++++++++ dh_testdir | 2 +- dh_testroot | 2 +- dh_testversion.1 | 46 ++++++++++++ dh_testversion.in | 23 ++++++ dh_undocumented | 51 +++++++++++++ dh_undocumented.1 | 68 ++++++++++++++++++ examples/rules.indep | 56 +++++++++++++++ 51 files changed, 1304 insertions(+), 24 deletions(-) create mode 100644 .foo create mode 100644 BUGS create mode 100644 autoscripts/postinst-init create mode 100644 autoscripts/postinst-init-norestart create mode 100644 autoscripts/postinst-suid create mode 100644 autoscripts/postrm-init create mode 100644 autoscripts/postrm-suid create mode 100644 autoscripts/prerm-init create mode 100755 dh_du create mode 100644 dh_du.1 create mode 100755 dh_gencontrol create mode 100644 dh_gencontrol.1 create mode 100755 dh_getopt.pl create mode 100755 dh_installdeb create mode 100644 dh_installdeb.1 create mode 100755 dh_installdirs create mode 100644 dh_installdirs.1 create mode 100755 dh_installinit create mode 100644 dh_installinit.1 create mode 100755 dh_makeshlibs create mode 100644 dh_makeshlibs.1 create mode 100755 dh_md5sums create mode 100644 dh_md5sums.1 create mode 100644 dh_movefiles.1 create mode 100755 dh_shlibdeps create mode 100644 dh_shlibdeps.1 create mode 100755 dh_suidregister create mode 100644 dh_suidregister.1 create mode 100644 dh_testversion.1 create mode 100644 dh_testversion.in create mode 100755 dh_undocumented create mode 100644 dh_undocumented.1 create mode 100755 examples/rules.indep (limited to 'dh_installdocs') diff --git a/.foo b/.foo new file mode 100644 index 00000000..e69de29b diff --git a/BUGS b/BUGS new file mode 100644 index 00000000..3a33f32e --- /dev/null +++ b/BUGS @@ -0,0 +1,3 @@ +dh_compress: doesn't verbose echo that it's cd'd to $TMP. +dh_installdirs, dh_md5sums: uses ../.. to cd back to original location, but + we don't know that $TMP is 2 levels deep. diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init new file mode 100644 index 00000000..976c6b34 --- /dev/null +++ b/autoscripts/postinst-init @@ -0,0 +1,2 @@ +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..05357d07 --- /dev/null +++ b/autoscripts/postinst-init-norestart @@ -0,0 +1 @@ +update-rc.d #SCRIPT# #INITPARMS# >/dev/null diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid new file mode 100644 index 00000000..1294d313 --- /dev/null +++ b/autoscripts/postinst-suid @@ -0,0 +1,6 @@ +if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]; then + suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# +else + chown #OWNER#.#GROUP# /#FILE# + chmod #PERMS# /#FILE# +fi diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init new file mode 100644 index 00000000..9596dd97 --- /dev/null +++ b/autoscripts/postrm-init @@ -0,0 +1,3 @@ +if [ "$1" = "purge" ] ; then + update-rc.d #SCRIPT# remove #INITPARMS# >/dev/null +fi diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid new file mode 100644 index 00000000..9712d256 --- /dev/null +++ b/autoscripts/postrm-suid @@ -0,0 +1,3 @@ +if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]; then + suidunregister -s #PACKAGE# /#FILE# +fi diff --git a/autoscripts/prerm-init b/autoscripts/prerm-init new file mode 100644 index 00000000..64975a38 --- /dev/null +++ b/autoscripts/prerm-init @@ -0,0 +1 @@ +/etc/init.d/#SCRIPT# stop diff --git a/debian/changelog b/debian/changelog index 99a22f79..a4d47c4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.6) unstable; urgency=low + + * Got rid of bashisms - this package should work now if /bin/sh is ash. + + -- Joey Hess Fri, 10 Oct 1997 15:24:40 -0400 + debhelper (0.5) unstable; urgency=low * Added dh_installcron to install cron jobs. diff --git a/dh_builddeb b/dh_builddeb index 7bea3c06..aea8a1b1 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -3,7 +3,7 @@ # Build the .deb package, assuming all the files are set up. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_clean b/dh_clean index cb20e973..964eec3d 100755 --- a/dh_clean +++ b/dh_clean @@ -4,7 +4,7 @@ # build process. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_compress b/dh_compress index a1ff97e3..347f0f5f 100755 --- a/dh_compress +++ b/dh_compress @@ -4,7 +4,7 @@ # compressed files get fixed. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_du b/dh_du new file mode 100755 index 00000000..a7ec6f48 --- /dev/null +++ b/dh_du @@ -0,0 +1,19 @@ +#!/bin/sh -e +# +# Generate a DEBIAN/du file, that lists the disk usage of the directories in +# the package. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ ! -d "debian/$TMP/DEBIAN" ]; then + doit "install -d debian/$TMP/DEBIAN" + fi + + verbose_echo "du -k debian/$TMP | sed \"s: debian/$TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" debian/$TMP$\" > debian/$TMP/DEBIAN/du" + du -k debian/$TMP | sed "s: debian/$TMP/: :" | grep -v " DEBIAN$" | grep -v " debian/$TMP$" >debian/$TMP/DEBIAN/du + doit "chown root.root debian/tmp/DEBIAN/du" +done diff --git a/dh_du.1 b/dh_du.1 new file mode 100644 index 00000000..98a9c80a --- /dev/null +++ b/dh_du.1 @@ -0,0 +1,42 @@ +.TH DH_DU 1 +.SH NAME +dh_du \- generate DEBIAN/du file +.SH SYNOPSIS +.B dh_md5sums +.I "[-v] [-a] [-i] [-ppackage]" +.SH "DESCRIPTION" +dh_du is a debhelper program that is responsible for generating +a DEBIAN/du file, which lists the disk usage of directories in the package. +This file isn't used by anthing yet, but it could be helpful for a future +debian installer program. +.P +The du file is installed with proper permissions and ownerships. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Generate du files for all architecture dependent packages. +.TP +.B \-i +Generate du files for all architecture independent packages. +.TP +.B \-ppackage +Generate du file for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_fixperms b/dh_fixperms index 97738313..6e935a8a 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -3,7 +3,7 @@ # Do some general file permission fixups. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_gencontrol b/dh_gencontrol new file mode 100755 index 00000000..e2a4e701 --- /dev/null +++ b/dh_gencontrol @@ -0,0 +1,19 @@ +#!/bin/sh -e +# +# Generate and install the control file. Simple dpkg-gencontrol wrapper. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ ! -d $TMP/DEBIAN ]; then + doit "install -o root -g root -d $TMP/DEBIAN" + fi + + # Generate and install control file. + doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit "chown root.root $TMP/DEBIAN/control" +done diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 new file mode 100644 index 00000000..7b78248f --- /dev/null +++ b/dh_gencontrol.1 @@ -0,0 +1,55 @@ +.TH DH_INSTALLDEBFILES 1 +.SH NAME +dh_gencontrol \- generate and install control file +.SH SYNOPSIS +.B dh_gencontrol +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-uparams]" +.SH "DESCRIPTION" +dh_gencontrol is a debhelper program that is responsible for generating and +installing 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) +You may prefer to simply run +.BR dpkg-gencontrol (1) +by hand. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install files for all architecture dependent packages. +.TP +.B \-i +Install files for all architecture independent packages. +.TP +.B \-ppackage +Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B \-uparams +Pass "params" to +.BR dpkg-gencontrol (1) +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.BR dpkg-shlibdeps (1) +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_getopt.pl b/dh_getopt.pl new file mode 100755 index 00000000..bb7d5133 --- /dev/null +++ b/dh_getopt.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +# +# Because the getopt() program is so horribly broken, I wrote my own argument +# processer that uses the find Getopt::Long module. This is used by all +# debhelper scripts. +# +# Joey Hess, GPL copyright 1998. + +# Returns a list of packages in the control file. +# Must pass "arch" or "indep" to specify arch-dependant or -independant +# packages. +sub GetPackages { $type=shift; + my $package; + my $arch; + my @list; + open (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'))) { + push @list, $package; + undef $package, $arch; + } + } + } + close CONTROL; + + return @list; +} + +# 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 @packages, GetPackages('indep'); + $indep=1; + } + elsif ($option eq 'a' or $option eq 'arch') { + push @packages, GetPackages('arch'); + $arch=1; + } + elsif ($option eq 'p' or $option eq 'package') { + push @packages, $value; + } + else { + $parse_error="bad option $option - should never happen!\n"; + } +} + +use Getopt::Long; + +# Enable bundling of short command line options. +Getopt::Long::config("bundling"); + +# Parse options. +GetOptions( + "v" => \$verbose, + "verbose" => \$verbose, + + "i" => \&AddPackage, + "indep" => \&AddPackage, + + "a" => \&AddPackage, + "arch" => \&AddPackage, + + "p=s" => \&AddPackage, + "package=s" => \&AddPackage, + + "n" => \$noscripts, + "noscripts" => \$noscripts, + + "x" => \$include, # is -x for some unknown historical reason.. + "include-conffiles" => \$include, + + "d" => \$d_flag, + "remove-d" => \$d_flag, + + "r" => \$r_flag, + "no-restart-on-upgrade" => \$r_flag, + + "k" => \$k_flag, + "keep" => \$k_flag, + + "P=s" => \$tmpdir, + "tmpdir=s" => \$tmpdir, + + "u=s", => \$u_params, + "update-rcd-params=s", => \$u_params, + "dpkg-shlibdeps-params=s", => \$u_params, + + "m=s", => \$major, + "major=s" => \$major, + + "V:s", => \$version_info, + "version-info:s" => \$version_info, + + "A" => \$all, + "all" => \$all, +); + +# Check to see if -V was specified. If so, but no parameters were passed, +# the variable will be defined but empty. +if (defined($version_info)) { + $version_info_set=1; +} + +# Now output everything, in a format suitable for a shell to eval it. +# Note the last line sets $@ in the shell to whatever arguements remain. +print qq{ +DH_VERBOSE='$verbose' +DH_DOPACKAGES='@packages' +DH_DOINDEP='$indep' +DH_DOARCH='$arch' +DH_NOSCRIPTS='$noscripts' +DH_EXCLUDE='$include' +DH_D_FLAG='$d_flag' +DH_R_FLAG='$r_flag' +DH_K_FLAG='$k_flag' +DH_TMPDIR='$tmpdir' +DH_U_PARAMS='$u_params' +DH_M_PARAMS='$major' +DH_V_FLAG='$version_info' +DH_V_FLAG_SET='$version_info_set' +DH_PARAMS_ALL='$all' +DH_PARSE_ERROR='$parse_error' +set -- @ARGV +}; diff --git a/dh_installchangelogs b/dh_installchangelogs index 4a93188c..17ff7312 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -8,7 +8,7 @@ # error to specify an upstream changelog on the command line. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib UPSTREAM=$1 diff --git a/dh_installcron b/dh_installcron index 7db8cdc6..f5c4f8b8 100755 --- a/dh_installcron +++ b/dh_installcron @@ -3,7 +3,7 @@ # Install cron scripts into the appropriate places. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installdeb b/dh_installdeb new file mode 100755 index 00000000..43aca902 --- /dev/null +++ b/dh_installdeb @@ -0,0 +1,46 @@ +#!/bin/sh -e +# +# Install files from debian/ into the package's DEBIAN directory. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ ! -d $TMP/DEBIAN ]; then + doit "install -o root -g root -d $TMP/DEBIAN" + fi + + # Install debian install scripts. + # If any .debhelper files exist, add them into the scripts. + for file in postinst preinst prerm postrm; do + if [ -f debian/$EXT$file ]; then + # Add this into the script, where it has #DEBHELPER# + if [ -f debian/$EXT$file.debhelper ]; then + complex_doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < debian/$EXT$file > $TMP/DEBIAN/$file" + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" + else + doit "install -o root -g root -p debian/$EXT$file $TMP/DEBIAN/$file" + fi + else + # Auto-generate script header and add .debhelper + # content to it. + if [ -f debian/$EXT$file.debhelper ]; then + complex_doit "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" + complex_doit "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" + fi + fi + done + + # Install non-executable files + for file in shlibs conffiles; do + if [ -f debian/$EXT$file ]; then + doit "install -o root -g root -m 644 -p debian/$EXT$file $TMP/DEBIAN/$file" + fi + done +done diff --git a/dh_installdeb.1 b/dh_installdeb.1 new file mode 100644 index 00000000..08b6cbae --- /dev/null +++ b/dh_installdeb.1 @@ -0,0 +1,67 @@ +.TH DH_INSTALLDEBFILES 1 +.SH NAME +dh_installdeb \- install files into the DEBIAN directory +.SH SYNOPSIS +.B dh_installdeb +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.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: +.IP postinst +.IP preinst +.IP postrm +.IP prerm +.IP shlibs +.IP conffiles +.P +(For packages other than the first binary package listed in debian/control, +prefix these filenames with then name of the "package.", for example, +"foo.postinst".) +.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 scripts. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install files for all architecture dependent packages. +.TP +.B \-i +Install files for all architecture independent packages. +.TP +.B \-ppackage +Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_installdebfiles b/dh_installdebfiles index 37c63089..58aed3b3 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -4,7 +4,7 @@ # Also generates the control file. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installdirs b/dh_installdirs new file mode 100755 index 00000000..bab883d7 --- /dev/null +++ b/dh_installdirs @@ -0,0 +1,39 @@ +#!/bin/sh -e +# +# Reads debian/dirs, creates the directories listed there there + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then + doit "install -d $TMP/usr/doc/$PACKAGE" + fi + + dirs="" + + if [ -e debian/${EXT}dirs ]; then + dirs=`tr "\n" " " < debian/${EXT}dirs` + fi + + if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + dirs="$* $dirs" + fi + + if [ "$dirs" ]; then + # Check to see if any of the dirs are absolute. + for dir in "$dirs" ; do + if expr "$dir" : "/" >/dev/null ; then + error "Absolute directory name \"$dir\" specified." + fi + done + # Create dirs. + verbose_echo "cd $TMP && install -d $dirs && cd ../.." + cd $TMP + install -d $dirs + cd ../.. + fi +done diff --git a/dh_installdirs.1 b/dh_installdirs.1 new file mode 100644 index 00000000..41dd0fd8 --- /dev/null +++ b/dh_installdirs.1 @@ -0,0 +1,59 @@ +.TH DH_INSTALLDIRS 1 +.SH NAME +dh_installdirs \- create subdirectories in package build directories +.SH SYNOPSIS +.B dh_installdirs +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [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 binary package listed in debian/control, if +dh_installdirs is acting on that package. +.P +A file named debian/dirs (for the first binary package in debian/control), +or debian/package.dirs (for each additional package in debian/control) can +list other directories to be created. Seperate 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 \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Create directories for all architecture dependent packages. +.TP +.B \-i +Create directories for all architecture independent packages. +.TP +.B \-ppackage +Create directories for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B dir ... +Create these directories in the package build directory of the first binary +package listed in debian/control, if we are acting on that package. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH BUGS +Directories with spaces in them will not currently be installed. +.SH AUTHOR +Joey Hess diff --git a/dh_installdocs b/dh_installdocs index dc216288..90be53c7 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -4,7 +4,7 @@ # Also installs the debian/copyright and debian/README.debian and debian/TODO PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installdocs.1 b/dh_installdocs.1 index f21563ca..4b5f068e 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -12,10 +12,11 @@ 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. .P -Any filenames specified as parameters, as well as 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. +Any filenames specified as parameters, as well as 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. .P A file named debian/docs (for the first binary package in debian/control), or debian/package.docs (for each additional package in debian/control) can @@ -45,6 +46,10 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. +.P +Note that dh_installdocs will happily copy entire directory hiearchies 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 .TP .I DH_VERBOSE diff --git a/dh_installexamples b/dh_installexamples index f82b0004..23d11af8 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -4,7 +4,7 @@ # /usr/doc/$PACKAGE/examples PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 1fb5c44a..e7ad6c62 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -40,6 +40,10 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. +.P +Note that dh_examples will happily copy entire directory hiearchies 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 .TP .I DH_VERBOSE diff --git a/dh_installinit b/dh_installinit new file mode 100755 index 00000000..2ea3440f --- /dev/null +++ b/dh_installinit @@ -0,0 +1,58 @@ +#!/bin/sh -e +# +# Install debian/init[.d], and set up the postinst and postrm for init +# scripts. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ -e debian/${EXT}init ]; then + if [ ! -d $TMP/etc/init.d ]; then + doit "install -d $TMP/etc/init.d" + fi + + # Figure out what filename to install it as. + if [ "$DH_D_FLAG" ]; then + # -d on the command line sets DH_D_FLAG. We will + # remove a trailing 'd' from the package name and + # use that as the name. + script=`expr $PACKAGE : '\(.*\)d$'` || true + if [ ! "$script" ]; then + echo `basename $0`" warning: \"$PACKAGE\" has no final -d, but -d was specified." + script=$PACKAGE + fi + else + script=$PACKAGE + fi + doit "install -p -m755 debian/${EXT}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". + if [ "$DH_U_PARAMS" = "" ]; then + DH_U_PARAMS="defaults" + fi + + # -r on the command line sets DH_R_FLAG. If it's set, there + # is no restart on upgrade. + if [ ! "$DH_NOSCRIPTS" ]; then + if [ "$DH_R_FLAG" ]; then + autoscript "postinst" "postinst-init-norestart" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + autoscript "postrm" "postrm-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + else + autoscript "postinst" "postinst-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + autoscript "postrm" "postrm-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + autoscript "prerm" "prerm-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + fi + fi + fi +done diff --git a/dh_installinit.1 b/dh_installinit.1 new file mode 100644 index 00000000..4eb4ee07 --- /dev/null +++ b/dh_installinit.1 @@ -0,0 +1,70 @@ +.TH DH_INSTALLINIT 1 +.SH NAME +dh_installinit \- install init scripts into package build directories +.SH SYNOPSIS +.B dh_installinit +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-u params]" +.SH "DESCRIPTION" +dh_installmenu 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/init exists, then it is installed into +etc/init.d/package in the package build directory (with "package" replaced +by the package name, unless the -d flag is specified, see below) +.P +For packages other than the first binary package listed in +the control file, use debian/package.init instead (replace "package" with +the name of the package.) +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install init scripts into all architecture dependent packages. +.TP +.B \-i +Install init scripts into all architecture independent packages. +.TP +.B \-ppackage +Install init scripts into the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B \-n +Do not modify postinst/postrm/prerm scripts. +.TP +.B \-r +Do not restart daemon on upgrade. +.TP +.B \-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 named ending in "d". +.TP +.B \-u params +Pass "params" to +.BR update-rc.d (8) +If not specified, "default" will be passed to +.BR update-rc.d (8) +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_installmanpages b/dh_installmanpages index 7ee35a90..304c3b12 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -5,7 +5,7 @@ # This is a little bit DWIMish, but still very handy. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installmenu b/dh_installmenu index 1180c60b..c837e04f 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -9,7 +9,7 @@ # Also, add to postinst and postrm. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_lib b/dh_lib index b18c7e5a..618953d8 100644 --- a/dh_lib +++ b/dh_lib @@ -5,20 +5,20 @@ # function. # Unfortunatly, this function doesn't work if your command uses redirection, # you will have to call verbose_echo by hand then. -function doit() { +doit() { verbose_echo "$*" $* } # Echo something if the verbose flag is on. -function verbose_echo() { +verbose_echo() { if [ "$DH_VERBOSE" ]; then echo " $*" fi } # Echo an error message and exit. -function error() { +error() { echo `basename $0`": $1" >&2 exit 1 } @@ -26,7 +26,7 @@ function error() { # Pass it a name of a binary package, it returns the name of the tmp dir to # use, for that package, relative to debian/ # This is for back-compatability with the debian/tmp tradition. -function tmpdir() { +tmpdir() { if [ "$1" = "$MAINPACKAGE" ]; then echo tmp else @@ -36,7 +36,7 @@ function tmpdir() { # Pass it a name of a binary package, it returns the name to prefix to files # in debian for this package. -function pkgext() { +pkgext() { if [ "$1" != "$MAINPACKAGE" ]; then echo "$PACKAGE." fi @@ -49,7 +49,7 @@ function pkgext() { # 1: script to add to # 2: filename of snippet # 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ -function autoscript() { +autoscript() { autoscript_script=$1 autoscript_filename=$2 autoscript_sed=$3 diff --git a/dh_makeshlibs b/dh_makeshlibs new file mode 100755 index 00000000..a09e26f6 --- /dev/null +++ b/dh_makeshlibs @@ -0,0 +1,30 @@ +#!/bin/sh -e +# +# Automatically generate shlibs files. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then + error "debian/$TMP/DEBIAN/shlibs already exists." + fi + + for file in `find debian/$TMP -type f -name "*.so*" | tr "\n" " "` ; do + LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true + VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true + MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true + LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true + if [ ! -d "debian/$TMP/DEBIAN" ] ; then + doit "install -d debian/$TMP/DEBIAN" + fi + verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>debian/$TMP/DEBIAN/shlibs" + echo "$LIBRARY $MAJOR $PACKAGE" >>debian/$TMP/DEBIAN/shlibs + done + + if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then + doit "chown root.root debian/$TMP/DEBIAN/shlibs" + fi +done diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 new file mode 100644 index 00000000..51ba8fee --- /dev/null +++ b/dh_makeshlibs.1 @@ -0,0 +1,47 @@ +.TH DH_MAKESHLIBS 1 +.SH NAME +dh_makeshlibs \- automatically create shlibs file +.SH SYNOPSIS +.B dh_makeshlibs +.I "[-v] [-a] [-i] [-ppackage]" +.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 \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Generate shlibs files for all architecture dependent packages. +.TP +.B \-i +Generate shlibs files for all architecture independent packages. +.TP +.B \-ppackage +Generate shlibs file for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH BUGS +There is no guarentee that the program will get the shlibs file right. For +example, it may not correctly guess the major number of your package. In +casews like these (and perhaps in general, just to be safe), it is better to +create a debian/shlibs file by hand. +This is a "do what I Mean" type program - you have been warned! +.SH AUTHOR +Joey Hess diff --git a/dh_md5sums b/dh_md5sums new file mode 100755 index 00000000..634e2fd6 --- /dev/null +++ b/dh_md5sums @@ -0,0 +1,22 @@ +#!/bin/sh -e +# +# Generate a DEBIAN/md5sums file, that lists the md5sums of all +# non-conffiles in the package + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ ! -d "debian/$TMP/DEBIAN" ]; then + doit "install -d debian/$TMP/DEBIAN" + fi + + doit "pushd debian/$TMP" >/dev/null + # Doit isn't smart enough to hande this next command so echo by hand. (sigh) + verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums DEBIAN/md5sums /dev/null" >/dev/null +done diff --git a/dh_md5sums.1 b/dh_md5sums.1 new file mode 100644 index 00000000..422a4aa7 --- /dev/null +++ b/dh_md5sums.1 @@ -0,0 +1,45 @@ +.TH DH_MD5SUMS 1 +.SH NAME +dh_md5sums \- generate DEBIAN/md5sums file +.SH SYNOPSIS +.B dh_md5sums +.I "[-v] [-a] [-i] [-ppackage]" +.SH "DESCRIPTION" +dh_md5sums is a debhelper program that is responsible for generating +a DEBIAN/md5sums file, which lists the md5sums of each file in the package. +.P +All files in DEBIAN/ are omitted from the md5sums file. +.P +The md5sums file is installed with proper permissions and ownerships. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Generate md5sums files for all architecture dependent packages. +.TP +.B \-i +Generate md5sums files for all architecture independent packages. +.TP +.B \-ppackage +Generate md5sums file for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH BUGS +It would be better if it did not include md5sums of conffiles, since this +info is duplicated elsewhere. +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_movefiles.1 b/dh_movefiles.1 new file mode 100644 index 00000000..228f9401 --- /dev/null +++ b/dh_movefiles.1 @@ -0,0 +1,46 @@ +.TH DH_MOVEFILES 1 +.SH NAME +dh_movefiles \- moves files out of debian/tmp into subpackages +.SH SYNOPSIS +.B dh_movefiles +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.SH "DESCRIPTION" +dh_movefiles is a debhelper program that is responsible for moving files out +of debian/tmp 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. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Move files for all architecture dependent packages. +.TP +.B \-i +Move files for all architecture independent packages. +.TP +.B \-ppackage +Move files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_shlibdeps b/dh_shlibdeps new file mode 100755 index 00000000..e30c4a5b --- /dev/null +++ b/dh_shlibdeps @@ -0,0 +1,24 @@ +#!/bin/sh -e +# +# Find dependancies. Simple dpkg-shlibdeps wrapper. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + # Run dpkg-shlibdeps to generate dependancies. + filelist="" + for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do + case "`file $file`" in + *ELF*) + filelist="$file $filelist" + ;; + esac + done + if [ "$filelist" ]; then + doit "dpkg-shlibdeps -Tdebian/${EXT}substvars $DH_U_PARAMS $filelist" + fi +done diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 new file mode 100644 index 00000000..77d90c25 --- /dev/null +++ b/dh_shlibdeps.1 @@ -0,0 +1,56 @@ +.TH DH_INSTALLDEBFILES 1 +.SH NAME +dh_shlibdeps \- calculate shared library dependancies +.SH SYNOPSIS +.B dh_shlibdeps +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-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. You may +prefer to simply run +.BR dpkg-shlibdeps (1) +by hand. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install files for all architecture dependent packages. +.TP +.B \-i +Install files for all architecture independent packages. +.TP +.B \-ppackage +Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B \-uparams +Pass "params" to +.BR dpkg-shlibdeps (1) +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.BR dpkg-shlibdeps (1) +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_strip b/dh_strip index 2ecdcd2c..77d670a6 100755 --- a/dh_strip +++ b/dh_strip @@ -3,7 +3,7 @@ # Strip files. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_suidregister b/dh_suidregister new file mode 100755 index 00000000..4ca72a1c --- /dev/null +++ b/dh_suidregister @@ -0,0 +1,58 @@ +#!/bin/sh -e +# +# If no parameters are given, and no debian/suid files exists, scan for +# suid/sgid files and suidregister them. +# +# If there are parameters, or there is a debian/suid, register the files +# listed there. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + files="" + + if [ -e debian/${EXT}suid ]; then + files=`tr "\n" " " < debian/${EXT}suid` + fi + + if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + files="$* $files" + fi + + if [ ! "$files" -a ! -e debian/${EXT}suid ]; then + # No files specified (and no empty debian/suid file), so + # guess what files to process. + files=`find debian/$TMP -type f -perm +6000` + + # We will strip the debian working directory off of the + # filenames. + tostrip="debian/$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="/" + fi + + if [ "$files" ]; then + for file in $files; do + # Strip leading $tostrip from $file. If not there, + # leave $file untouched. + if [ `expr "$file" : "$tostrip\\(.*\\)"` ]; then + file=`expr "$file" : "$tostrip\\(.*\\)"` + fi + + # 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. + sedstr=`find debian/$TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"` + + autoscript "postinst" "postinst-suid" "$sedstr" + autoscript "postrm" "postrm-suid" "$sedstr" + done + fi +done diff --git a/dh_suidregister.1 b/dh_suidregister.1 new file mode 100644 index 00000000..e15e6d5f --- /dev/null +++ b/dh_suidregister.1 @@ -0,0 +1,62 @@ +.TH DH_SUIDREGISTER 1 +.SH NAME +dh_suidregister \- set up package to register files with suidregister +.SH SYNOPSIS +.B dh_suidregister +.I "[-v] [-a] [-i] [-ppackage] [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 files specified as parameters will be registered, if dh_suidregister is +acting on the first binary package listed in debian/control. +.P +The files debian/suid (for the first binary package in debian/control) or +debian/package.suid (for each additional 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 package modifies your postinst and postrm files. See +.BR dh_installdebfiles (1) +for an explination of how this works. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Register files for all architecture dependent packages. +.TP +.B \-i +Register files for all architecture independent packages. +.TP +.B \-ppackage +Register files for the package named "package". +.TP +.B file ... +Register these files in the first binary package listed in debian/control, +if we are acting on that package. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +, +.BR suidregister (1) +.SH AUTHOR +Joey Hess diff --git a/dh_testdir b/dh_testdir index 4d3c700b..4e482fce 100755 --- a/dh_testdir +++ b/dh_testdir @@ -5,7 +5,7 @@ # of any other files you specify on the command line. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for file in debian/control $@; do if [ ! -e "$file" ] ; then diff --git a/dh_testroot b/dh_testroot index fcc9b474..36577b29 100755 --- a/dh_testroot +++ b/dh_testroot @@ -3,7 +3,7 @@ # Checks to make sure you are root. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib if [ "`whoami`" != root ]; then error "You must run this as root." diff --git a/dh_testversion.1 b/dh_testversion.1 new file mode 100644 index 00000000..f385a8ca --- /dev/null +++ b/dh_testversion.1 @@ -0,0 +1,46 @@ +.TH DH_TESTROOT 1 +.SH NAME +dh_testversion \- ensure that the correct version of debhelper is installed +.SH SYNOPSIS +.B dh_testversion [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 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_testroot does nothing. +.SH EXAMPLES +.TP +.I dh_testversion 0.50 +Make sure debhelper version 0.50 or higher is installed. +.TP +.I dh_testversion ge 0.50 +Another way to make sure debhelper version 0.50 or higher is installed. +.TP +.I dh_testversion le 0.50 +Make sure a version of debhelper less than version 0.50 is installed. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode. +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_testversion.in b/dh_testversion.in new file mode 100644 index 00000000..9e2f14ef --- /dev/null +++ b/dh_testversion.in @@ -0,0 +1,23 @@ +#!/bin/sh -e +# +# Debhelper version check. + +# Current version of debhelper is: +DH_VERSION=#DEBHELPER_VERSION# + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +if [ "$1" -a "$2" ]; then + compare=$1 + ver=$2 +elif [ "$1" ]; then + compare=">=" + ver=$1 +fi + +if [ "$compare" -a "$ver" ] ; then + if ! dpkg --compare-versions $DH_VERSION $compare $ver; then + error "debhelper version $DH_VERSION is installed, but a version $compare $ver is needed to build this package." + fi +fi diff --git a/dh_undocumented b/dh_undocumented new file mode 100755 index 00000000..ebde8904 --- /dev/null +++ b/dh_undocumented @@ -0,0 +1,51 @@ +#!/bin/sh -e +# +# Passed a list of undocumented man pages, generates symlinks to +# undocumented.7 for those man pages. +# +# Also, it looks for debian/undocumented files for more lists of +# undocumented man pages. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + undoc="" + + if [ -e debian/${EXT}undocumented ]; then + undoc=`tr "\n" " " < debian/${EXT}undocumented` + fi + + if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + undoc="$* $undoc" + fi + + if [ "$undoc" ]; then + for file in $undoc; do + # Remove .gz extention from the filename, if present. + if [ `expr "$file" : '\(.*\).gz'` ]; then + file=`expr "$file" : '\(.*\).gz'` + fi + + # Determine what directory the file belongs in, + # /usr/man, or /usr/X11R6/man. + section=`expr "$file" : '.*\.\([123456789]\)'` + if [ `expr "$file" : '.*\.[123456789]\(x\)'` ] ; then + dir=usr/X11R6/man/man$section + reldir=../../../man + else + dir=usr/man/man$section + reldir=.. + fi + + if [ ! -d debian/$TMP/$dir ]; then + doit "install -d debian/$TMP/$dir" + fi + + doit ln -s $reldir/man7/undocumented.7.gz debian/$TMP/$dir/$file.gz + done + fi +done diff --git a/dh_undocumented.1 b/dh_undocumented.1 new file mode 100644 index 00000000..ab45baad --- /dev/null +++ b/dh_undocumented.1 @@ -0,0 +1,68 @@ +.TH DH_UNDOCUMENTED 1 +.SH NAME +dh_undocumented \- make symlinks to undocumented.7 man page +.SH SYNOPSIS +.B dh_undocumented +.I "[-v] [-a] [-i] [-ppackage] [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 extentions - 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 binary package listed in +debian/control, if dh_installdocs is acting on that package. +Also, if a file named debian/undocumented (for the first binary package in +debian/control), or debian/package.undocumented (for each additional package +in debian/control) can list other man page names to set up. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install undocumented man page symlinks for all architecture dependent packages. +.TP +.B \-i +Install undocumented man page symlinks for all architecture independent packages. +.TP +.B \-ppackage +Install undocumented man page symlinks for the package named "package". +.TP +.B manpage ... +Install undocumented man page symlinks for each of these man pages +into the first binary package listed in debian/control, if we are acting on +that package. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +, +.BR undocumented (7) +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/examples/rules.indep b/examples/rules.indep new file mode 100755 index 00000000..a257a197 --- /dev/null +++ b/examples/rules.indep @@ -0,0 +1,56 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# This version is for packages that are architecure independant. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp +build-stamp: + dh_testdir + # Add here commands to compile the pacckage. + #$(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + # Add here commands to clean up after the build process. + #-$(MAKE) distclean + dh_clean + +# Build architecture-independent files here. +binary-indep: build + dh_testdir + dh_testroot + dh_clean + dh_installdirs + # Add here commands to install the files into debian/tmp + #$(MAKE) PREFIX=debian/tmp install + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installinit + dh_installcron +# dh_installmanpages +# dh_undocumented + dh_installchangelogs + dh_compress + dh_fixperms + dh_suidregister + dh_installdeb + dh_gencontrol + dh_du + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build +# 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 -- cgit v1.2.3 From a63461740c5f769c9a11d53a8b652dfbbfee7503 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:35:41 +0000 Subject: r13: Initial Import --- README | 4 +++- debian/changelog | 17 +++++++++++++++++ debian/rules | 1 + dh_installdocs | 20 +++++++++++++------- dh_installexamples | 4 +--- examples/rules | 3 ++- examples/rules.multi | 6 ++++-- 7 files changed, 41 insertions(+), 14 deletions(-) (limited to 'dh_installdocs') diff --git a/README b/README index a13c7726..e43ee336 100644 --- a/README +++ b/README @@ -4,7 +4,9 @@ dh_* commands. To help you get started, I've included an example of a debian/rules file that uses debhelper commands extensivly. See -/usr/doc/debhelper/examples/rules . +/usr/doc/debhelper/examples/rules . These files are also useful as they give +one good order you can run the different debhelper scripts in (though other +variations are possible). Automatic generation of debian install scripts: ---------------------------------------------- diff --git a/debian/changelog b/debian/changelog index a4d47c4c..e865dc67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +debhelper (0.7) unstable; urgency=low + + * Sped up some things by removing unnecesary for loops. + * dh_installdocs: behavior modifcation: if there is a debian/TODO, it is + named like a debian/changelog file: if the package is a debian native + package, it is installed as TODO. If the package is not a native package, + it is installed as TODO.Debian. + * dh_installdocs: handle debian/README.Debian as well as + debian/README.debian. + * Added dh_undocumented program, which can set up undocumented.7 symlinks. + * Moved dh_installdebfiles to come after dh_fixperms in the example rules + files. (dh_installdebfiles makes sure it installs things with the proper + permissions, and this reorganization makes the file a bit more flexable + in a few situations.) + + -- Joey Hess Mon, 13 Oct 1997 20:08:05 -0400 + debhelper (0.6) unstable; urgency=low * Got rid of bashisms - this package should work now if /bin/sh is ash. diff --git a/debian/rules b/debian/rules index c6a4fa95..55fd8e98 100755 --- a/debian/rules +++ b/debian/rules @@ -44,6 +44,7 @@ binary-indep: build ./dh_compress ./dh_installdebfiles ./dh_fixperms + ./dh_md5sums ./dh_builddeb binary: binary-indep binary-arch diff --git a/dh_installdocs b/dh_installdocs index 90be53c7..3859d34b 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -25,18 +25,24 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ "$docs" ]; then - for file in $docs; do - doit "cp -a $file debian/$TMP/usr/doc/$PACKAGE/" - done + doit "cp -a $docs debian/$TMP/usr/doc/$PACKAGE/" fi # Install these files only into the main package by default. if [ "$PACKAGE" = "$MAINPACKAGE" ]; then - for file in README.debian TODO ; do - if [ -f debian/$file ]; then - doit "install -m 644 -p debian/$file debian/$TMP/usr/doc/$PACKAGE/" + if [ -f debian/README.debian ]; then + doit "install -m 644 -p debian/README.debian debian/$TMP/usr/doc/$PACKAGE/" + fi + if [ -f debian/README.Debian ]; then + doit "install -m 644 -p debian/README.Debian debian/$TMP/usr/doc/$PACKAGE/" + fi + if [ -f debian/TODO ]; then + if [ "$NATIVE" ]; then + doit "install -m 655 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO" + else + doit "install -m 644 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO.Debian" fi - done + fi fi if [ -f debian/copyright ]; then diff --git a/dh_installexamples b/dh_installexamples index 23d11af8..61ceae20 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -25,8 +25,6 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/usr/doc/$PACKAGE/examples" fi - for file in $examples; do - doit "cp -a $file debian/$TMP/usr/doc/$PACKAGE/examples/" - done + doit "cp -a $examples debian/$TMP/usr/doc/$PACKAGE/examples/" fi done diff --git a/examples/rules b/examples/rules index 65e6878e..961ab459 100755 --- a/examples/rules +++ b/examples/rules @@ -35,11 +35,12 @@ binary-arch: build dh_installmenu dh_installcron dh_installmanpages +# dh_undocumented dh_installchangelogs dh_strip dh_compress - dh_installdebfiles dh_fixperms + dh_installdebfiles dh_builddeb binary: binary-indep binary-arch diff --git a/examples/rules.multi b/examples/rules.multi index f5e82597..fd9bf5de 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -34,10 +34,11 @@ binary-indep: build dh_installmenu -i dh_installcron -i # dh_installmanpages -i +# dh_undocumented dh_installchangelogs -i dh_compress -i - dh_installdebfiles -i dh_fixperms -i + dh_installdebfiles -i dh_builddeb -i # Build architecture-dependent files here. @@ -52,11 +53,12 @@ binary-arch: build dh_installmenu -a dh_installcron -a dh_installmanpages -a +# dh_undocumented dh_installchangelogs -a dh_strip -a dh_compress -a - dh_installdebfiles -a dh_fixperms -a + dh_installdebfiles -a dh_builddeb -a binary: binary-indep binary-arch -- cgit v1.2.3 From 0c4875b3fecb5b376257e248b129537dd148e0c4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:02 +0000 Subject: r21: Initial Import --- README | 23 +++++++++++++++++++++++ debian/changelog | 9 +++++++++ dh_builddeb | 2 +- dh_builddeb.1 | 5 ++++- dh_clean | 4 ++-- dh_clean.1 | 5 ++++- dh_compress | 4 ++-- dh_compress.1 | 5 ++++- dh_du | 8 ++++---- dh_du.1 | 5 ++++- dh_fixperms | 12 ++++++------ dh_fixperms.1 | 5 ++++- dh_installchangelogs | 8 ++++---- dh_installchangelogs.1 | 5 ++++- dh_installcron | 6 +++--- dh_installcron.1 | 5 ++++- dh_installdebfiles | 34 +++++++++++++++++----------------- dh_installdebfiles.1 | 5 ++++- dh_installdocs | 16 ++++++++-------- dh_installdocs.1 | 5 ++++- dh_installexamples | 6 +++--- dh_installexamples.1 | 5 ++++- dh_installmanpages | 12 ++++++------ dh_installmanpages.1 | 5 ++++- dh_installmenu | 16 ++++++++-------- dh_installmenu.1 | 5 ++++- dh_lib | 25 +++++++++++++++++++------ dh_makeshlibs | 18 +++++++++--------- dh_makeshlibs.1 | 5 ++++- dh_md5sums | 24 ++++++++++++------------ dh_md5sums.1 | 5 ++++- dh_strip | 4 ++-- dh_strip.1 | 5 ++++- dh_suidregister | 6 +++--- dh_suidregister.1 | 5 ++++- dh_undocumented | 6 +++--- dh_undocumented.1 | 5 ++++- 37 files changed, 212 insertions(+), 116 deletions(-) (limited to 'dh_installdocs') diff --git a/README b/README index d84add45..2f2e7c2c 100644 --- a/README +++ b/README @@ -102,4 +102,27 @@ effecting all packages. See examples/rules.multi for an example of how to use this. + +Package build directories -- debian/tmp, etc: +-------------------------------------------- + +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/ for each +additional package. + +Sometimes, you might want to use some other temporary directory. This is +supported by the -P flag. The direcotry to use is specified after -P, 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. For example: + + dh_installdocs -pfoolib1 -Pdebian/tmp-foolib1 + dh_installdocs -pfoolib1-dev -Pdebian/tmp-foolib1-dev + dh_installdocs -pfoolib-bin -Pdebian/tmp-foolib-bin + +This uses debian/tmp- as the package build directory. + -- Joey Hess diff --git a/debian/changelog b/debian/changelog index a33224d9..f7d47b17 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.15) unstable; urgency=low + + * README: documented what temporary directories are used by default for + installing package files into. + * dh_*: added -P flag, to let a different package build directory be + specified. + + -- Joey Hess Thu, 6 Nov 1997 15:51:22 -0500 + debhelper (0.14) unstable; urgency=low * dh_fixperms: leave permissions on files in /usr/doc/packages/examples diff --git a/dh_builddeb b/dh_builddeb index aea8a1b1..9ddd21dc 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -7,5 +7,5 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - doit "dpkg --build debian/$TMP .." + doit "dpkg --build $TMP .." done diff --git a/dh_builddeb.1 b/dh_builddeb.1 index bfe72e72..8a51a8f4 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -3,7 +3,7 @@ dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) @@ -21,6 +21,9 @@ Build all architecture independent packages. .TP .B \-ppackage Build the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_clean b/dh_clean index 76522dda..874604ed 100755 --- a/dh_clean +++ b/dh_clean @@ -1,6 +1,6 @@ #!/bin/sh -e # -# Clean up debian/$TMP and other tepmorary files generated by the +# Clean up $TMP and other tepmorary files generated by the # build process. PATH=debian:$PATH:/usr/lib/debhelper @@ -9,7 +9,7 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - doit "rm -rf debian/$TMP" + doit "rm -rf $TMP" doit "rm -f debian/${EXT}substvars" done doit "rm -f debian/files* debian/*.debhelper $*" diff --git a/dh_clean.1 b/dh_clean.1 index e387c4eb..651b5b08 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -3,7 +3,7 @@ dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [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 @@ -23,6 +23,9 @@ Clean up the package build directory for all architecture independent packages. .B \-ppackage Clean up the package build directory for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Delete these files too. .SH NOTES diff --git a/dh_compress b/dh_compress index 347f0f5f..86ab8373 100755 --- a/dh_compress +++ b/dh_compress @@ -13,7 +13,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Run the file name gatering commands from within the directory # structure that will be effected. olddir=`pwd` - cd debian/$TMP + cd $TMP if [ -f debian/${EXT}compress ]; then # The config file is a sh script that outputs the files to be compressed @@ -40,7 +40,7 @@ for PACKAGE in $DH_DOPACKAGES; do cd $olddir # Fix up symlinks that were pointing to the uncompressed files. - for file in `find debian/$TMP -type l`; do + for file in `find $TMP -type l`; do DIRECTORY=`expr $file : "\(.*\)/[^/]*"` NAME=`expr $file : ".*/\([^/]*\)"` LINKVAL=`ls -l $DIRECTORY/$NAME | awk '{ print $11;}'` diff --git a/dh_compress.1 b/dh_compress.1 index 06087b8e..d7e8dc5c 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .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 @@ -41,6 +41,9 @@ Compress files for all architecture independent packages. .TP .B \-ppackage Compress files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_du b/dh_du index a7ec6f48..5fcb1418 100755 --- a/dh_du +++ b/dh_du @@ -9,11 +9,11 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ ! -d "debian/$TMP/DEBIAN" ]; then - doit "install -d debian/$TMP/DEBIAN" + if [ ! -d "$TMP/DEBIAN" ]; then + doit "install -d $TMP/DEBIAN" fi - verbose_echo "du -k debian/$TMP | sed \"s: debian/$TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" debian/$TMP$\" > debian/$TMP/DEBIAN/du" - du -k debian/$TMP | sed "s: debian/$TMP/: :" | grep -v " DEBIAN$" | grep -v " debian/$TMP$" >debian/$TMP/DEBIAN/du + verbose_echo "du -k $TMP | sed \"s: $TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" $TMP$\" > $TMP/DEBIAN/du" + du -k $TMP | sed "s: $TMP/: :" | grep -v " DEBIAN$" | grep -v " $TMP$" >$TMP/DEBIAN/du doit "chown root.root debian/tmp/DEBIAN/du" done diff --git a/dh_du.1 b/dh_du.1 index 98a9c80a..42509a50 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -3,7 +3,7 @@ dh_du \- generate DEBIAN/du file .SH SYNOPSIS .B dh_md5sums -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_du is a debhelper program that is responsible for generating a DEBIAN/du file, which lists the disk usage of directories in the package. @@ -24,6 +24,9 @@ Generate du files for all architecture independent packages. .TP .B \-ppackage Generate du file for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_fixperms b/dh_fixperms index 1c4fef7c..0534549c 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -10,24 +10,24 @@ for PACKAGE in $DH_DOPACKAGES; do EXT=`pkgext $PACKAGE` # General things.. - if [ -d debian/$TMP ]; then - doit "chown -R root.root debian/$TMP" - doit "chmod -R go=rX debian/$TMP" + if [ -d $TMP ]; then + doit "chown -R root.root $TMP" + doit "chmod -R go=rX $TMP" fi # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - files=`find debian/$TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true + files=`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi - files=`find debian/$TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true + files=`find $TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 755 $files" fi # Executable man pages are a bad thing. - files=`find debian/$TMP/usr/man/ debian/$TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true + files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi diff --git a/dh_fixperms.1 b/dh_fixperms.1 index cfba6481..8ae36def 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -3,7 +3,7 @@ dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS .B dh_fixperms -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -25,6 +25,9 @@ Fix permissions for all architecture independent packages. .TP .B \-ppackage Fix permissions for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installchangelogs b/dh_installchangelogs index 17ff7312..7405daae 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -25,12 +25,12 @@ fi for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ ! -d debian/$TMP/usr/doc/$PACKAGE ]; then - doit "install -d debian/$TMP/usr/doc/$PACKAGE" + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then + doit "install -d $TMP/usr/doc/$PACKAGE" fi - doit "install -p -m644 debian/changelog debian/$TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" + doit "install -p -m644 debian/changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" if [ "$UPSTREAM" ]; then - doit "install -p -m644 $UPSTREAM debian/$TMP/usr/doc/$PACKAGE/changelog" + doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog" fi done diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 2371af17..8c42a011 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -3,7 +3,7 @@ dh_installchangelogs \- install changelogs into package build directories .SH SYNOPSIS .B dh_installchangelogs -.I "[-v] [-a] [-i] [-ppackage] upstream" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] upstream" .SH "DESCRIPTION" dh_installchangelogs is a debhelper program that is responsible for installing changelogs into package build directories. @@ -29,6 +29,9 @@ Install changelogs for all architecture independent packages. .TP .B \-ppackage Install changelogs for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installcron b/dh_installcron index f5c4f8b8..6ea5daa3 100755 --- a/dh_installcron +++ b/dh_installcron @@ -11,10 +11,10 @@ for PACKAGE in $DH_DOPACKAGES; do for type in daily weekly monthly; do if [ -e debian/${EXT}cron.$type ]; then - if [ ! -d debian/$TMP/etc/cron.$type ]; then - doit "install -o root -g root -d debian/$TMP/etc/cron.$type" + if [ ! -d $TMP/etc/cron.$type ]; then + doit "install -o root -g root -d $TMP/etc/cron.$type" fi - doit "install debian/${EXT}cron.$type debian/$TMP/etc/cron.$type/$PACKAGE" + doit "install debian/${EXT}cron.$type $TMP/etc/cron.$type/$PACKAGE" fi done done diff --git a/dh_installcron.1 b/dh_installcron.1 index 2819958b..ff76760b 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -3,7 +3,7 @@ dh_installcron \- install cron scripts into etc/cron.* .SH SYNOPSIS .B dh_installcron -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installcron is a debhelper program that is responsible for installing cron scripts into etc/cron.* in package build directories. The files @@ -24,6 +24,9 @@ Install cron files for all architecture independent packages. .TP .B \-ppackage Install cron files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installdebfiles b/dh_installdebfiles index 403375f4..ad08f8d3 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -10,8 +10,8 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - if [ ! -d debian/$TMP/DEBIAN ]; then - doit "install -o root -g root -d debian/$TMP/DEBIAN" + if [ ! -d $TMP/DEBIAN ]; then + doit "install -o root -g root -d $TMP/DEBIAN" fi # Install debian install scripts. @@ -20,23 +20,23 @@ for PACKAGE in $DH_DOPACKAGES; do if [ -f debian/$EXT$file ]; then # Add this into the script, where it has #DEBHELPER# if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > debian/$TMP/DEBIAN/$file" - perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > debian/$TMP/DEBIAN/$file - doit "chown root.root debian/$TMP/DEBIAN/$file" - doit "chmod 755 debian/$TMP/DEBIAN/$file" + verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > $TMP/DEBIAN/$file" + perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > $TMP/DEBIAN/$file + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" else - doit "install -o root -g root -p debian/$EXT$file debian/$TMP/DEBIAN/$file" + doit "install -o root -g root -p debian/$EXT$file $TMP/DEBIAN/$file" fi else # Auto-generate script header and add .debhelper # content to it. if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$file" - echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$file - verbose_echo "cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$file" - cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$file - doit "chown root.root debian/$TMP/DEBIAN/$file" - doit "chmod 755 debian/$TMP/DEBIAN/$file" + verbose_echo "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" + echo '#!/bin/sh -e' > $TMP/DEBIAN/$file + verbose_echo "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" + cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" fi fi done @@ -44,13 +44,13 @@ for PACKAGE in $DH_DOPACKAGES; do # Install non-executable files for file in shlibs conffiles; do if [ -f debian/$EXT$file ]; then - doit "install -o root -g root -m 644 -p debian/$EXT$file debian/$TMP/DEBIAN/$file" + doit "install -o root -g root -m 644 -p debian/$EXT$file $TMP/DEBIAN/$file" fi done # Run dpkg-shlibdeps to generate dependancies. filelist="" - for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do + for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do case "`file $file`" in *ELF*) filelist="$file $filelist" @@ -62,6 +62,6 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Generate and install control file. - doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -Pdebian/$TMP" - doit "chown root.root debian/$TMP/DEBIAN/control" + doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP" + doit "chown root.root $TMP/DEBIAN/control" done diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 924e04b4..429481f4 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -3,7 +3,7 @@ dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS .B dh_installdebfils -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installdebfiles is a debhelper program that is responsible for installing files into the DEBIAN directory in package build directories with the @@ -49,6 +49,9 @@ Install files for all architecture independent packages. .TP .B \-ppackage Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installdocs b/dh_installdocs index 3859d34b..bcc26342 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -10,8 +10,8 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - if [ ! -d debian/$TMP/usr/doc/$PACKAGE ]; then - doit "install -d debian/$TMP/usr/doc/$PACKAGE" + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then + doit "install -d $TMP/usr/doc/$PACKAGE" fi docs="" @@ -25,27 +25,27 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ "$docs" ]; then - doit "cp -a $docs debian/$TMP/usr/doc/$PACKAGE/" + doit "cp -a $docs $TMP/usr/doc/$PACKAGE/" fi # Install these files only into the main package by default. if [ "$PACKAGE" = "$MAINPACKAGE" ]; then if [ -f debian/README.debian ]; then - doit "install -m 644 -p debian/README.debian debian/$TMP/usr/doc/$PACKAGE/" + doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/" fi if [ -f debian/README.Debian ]; then - doit "install -m 644 -p debian/README.Debian debian/$TMP/usr/doc/$PACKAGE/" + doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" fi if [ -f debian/TODO ]; then if [ "$NATIVE" ]; then - doit "install -m 655 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO" + doit "install -m 655 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO" else - doit "install -m 644 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO.Debian" + doit "install -m 644 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO.Debian" fi fi fi if [ -f debian/copyright ]; then - doit "install -m 644 -p debian/copyright debian/$TMP/usr/doc/$PACKAGE/" + doit "install -m 644 -p debian/copyright $TMP/usr/doc/$PACKAGE/" fi done diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 4b5f068e..fc001130 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -35,6 +35,9 @@ Install files for all architecture independent packages. .B \-ppackage Install files for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Install these files as documentation into the first binary package listed in debian/control, if we are acting on that package. diff --git a/dh_installexamples b/dh_installexamples index 61ceae20..bc16991a 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -21,10 +21,10 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ "$examples" ]; then - if [ ! -d debian/$TMP/usr/doc/$PACKAGE/examples ]; then - doit "install -d debian/$TMP/usr/doc/$PACKAGE/examples" + if [ ! -d $TMP/usr/doc/$PACKAGE/examples ]; then + doit "install -d $TMP/usr/doc/$PACKAGE/examples" fi - doit "cp -a $examples debian/$TMP/usr/doc/$PACKAGE/examples/" + doit "cp -a $examples $TMP/usr/doc/$PACKAGE/examples/" fi done diff --git a/dh_installexamples.1 b/dh_installexamples.1 index e7ad6c62..5c8ce8c0 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -3,7 +3,7 @@ dh_installexamples \- install example files into package build directories .SH SYNOPSIS .B dh_installexamples -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. @@ -29,6 +29,9 @@ Install files for all architecture independent packages. .B \-ppackage Install files for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Install these files as documentation into the first binary package listed in debian/control, if we are acting on that package. diff --git a/dh_installmanpages b/dh_installmanpages index 304c3b12..4a0ffb47 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -13,7 +13,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Find all filenames that look like man pages. # .ex files are examples installed by deb-make, we don't want those, or # .in files, which are from configure. - for file in `find * -name "*.[1-9]*" ! -name "*.ex" ! -name "*.in" | grep -v ^debian/$TMP`; do + for file in `find * -name "*.[1-9]*" ! -name "*.ex" ! -name "*.in" | grep -v ^$TMP`; do # Make sure file thinks they are man pages. if file $file|grep -q roff; then if echo $file|grep -q /; then @@ -32,12 +32,12 @@ for PACKAGE in $DH_DOPACKAGES; do done if [ "$install" ]; then SECTION=man`expr $NAME : '.*\.\([123456789]\)'` - if [ ! -e debian/$TMP/usr/man/$SECTION/$NAME -a \ - ! -e debian/$TMP/usr/X11*/man/$SECTION/$NAME ]; then - if [ ! -d debian/$TMP/usr/man/$SECTION ]; then - doit "install -d debian/$TMP/usr/man/$SECTION" + if [ ! -e $TMP/usr/man/$SECTION/$NAME -a \ + ! -e $TMP/usr/X11*/man/$SECTION/$NAME ]; then + if [ ! -d $TMP/usr/man/$SECTION ]; then + doit "install -d $TMP/usr/man/$SECTION" fi - doit "install -p -m644 $file debian/$TMP/usr/man/$SECTION/$NAME" + doit "install -p -m644 $file $TMP/usr/man/$SECTION/$NAME" fi fi fi diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index bb08181b..06794044 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -3,7 +3,7 @@ dh_installmanpages \- install man pages into package build directories .SH SYNOPSIS .B dh_installmanpages -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [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 @@ -32,6 +32,9 @@ Install man pages into all architecture independent packages. .B \-ppackage Install man pages into the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Do not install these files as man pages, even if they look like valid man pages. diff --git a/dh_installmenu b/dh_installmenu index c837e04f..5071a2f3 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -2,9 +2,9 @@ # # Integration with debian menu system: # -# If debian/menu file exists, save it to debian/$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 -# debian/$TMP/etc/menu-methods/$PACKAGE +# $TMP/etc/menu-methods/$PACKAGE # # Also, add to postinst and postrm. @@ -16,10 +16,10 @@ for PACKAGE in $DH_DOPACKAGES; do EXT=`pkgext $PACKAGE` if [ -e debian/${EXT}menu ]; then - if [ ! -d debian/$TMP/usr/lib/menu ]; then - doit "install -d debian/$TMP/usr/lib/menu" + if [ ! -d $TMP/usr/lib/menu ]; then + doit "install -d $TMP/usr/lib/menu" fi - doit "install -p -m644 debian/${EXT}menu debian/$TMP/usr/lib/menu/$PACKAGE" + doit "install -p -m644 debian/${EXT}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. @@ -30,10 +30,10 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ -e debian/${EXT}menu-method ]; then - if [ ! -d debian/$TMP/etc/menu-methods ]; then - doit "install -d debian/$TMP/etc/menu-methods" + if [ ! -d $TMP/etc/menu-methods ]; then + doit "install -d $TMP/etc/menu-methods" fi - doit "install -p debian/${EXT}menu-method debian/$TMP/etc/menu-methods/$PACKAGE" + doit "install -p debian/${EXT}menu-method $TMP/etc/menu-methods/$PACKAGE" if [ ! "$DH_NOSCRIPTS" ]; then autoscript "postinst" "postinst-menu-method" "s/#PACKAGE#/$PACKAGE/" diff --git a/dh_installmenu.1 b/dh_installmenu.1 index e26c84e5..b5337f30 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -3,7 +3,7 @@ dh_installmenu \- install debian menu files into package build directories .SH SYNOPSIS .B dh_installmenu -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installmenu is a debhelper program that is responsible for installing fils used by the debian menu package into package build directories. @@ -40,6 +40,9 @@ Install menu files into the package named "package". .TP .B \-n Do not automatically generate code. +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_lib b/dh_lib index 1cc7e308..c2dd9777 100644 --- a/dh_lib +++ b/dh_lib @@ -1,7 +1,7 @@ # Library functions for debhelper programs. # Run a command, and display the command to stdout if verbose mode is on. -# All commands that modifiy files in debian/$TMP should be ran via this +# All commands that modifiy files in $TMP should be ran via this # function. # Unfortunatly, this function doesn't work if your command uses redirection, # you will have to call verbose_echo by hand then. @@ -24,13 +24,15 @@ error() { } # Pass it a name of a binary package, it returns the name of the tmp dir to -# use, for that package, relative to debian/ +# use, for that package. # This is for back-compatability with the debian/tmp tradition. tmpdir() { - if [ "$1" = "$MAINPACKAGE" ]; then - echo tmp + if [ "$DH_TMPDIR" ]; then + echo "$DH_TMPDIR" + elif [ "$1" = "$MAINPACKAGE" ]; then + echo debian/tmp else - echo "$PACKAGE" + echo "debian/$PACKAGE" fi } @@ -77,7 +79,7 @@ autoscript() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvianp: $*` +set -- `getopt xvianp:P: $*` for i; do case "$i" @@ -107,6 +109,11 @@ for i; do DH_EXCLUDE=1 shift ;; + -P) + DH_TMPDIR="$2" + shift + shift + ;; --) shift break @@ -172,3 +179,9 @@ if [ ! "$DH_DOPACKAGES" -o "$DH_DOPACKAGES" = " " ]; then fi DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2` fi + +# Check to see if -P was specified. If so, we can only act on a single +# package. +if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | grep -q " "; then + error "-P was specified, but multiple packages would be acted on." +fi diff --git a/dh_makeshlibs b/dh_makeshlibs index a09e26f6..f1ab8899 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -8,23 +8,23 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then - error "debian/$TMP/DEBIAN/shlibs already exists." + if [ -e "$TMP/DEBIAN/shlibs" ]; then + error "$TMP/DEBIAN/shlibs already exists." fi - for file in `find debian/$TMP -type f -name "*.so*" | tr "\n" " "` ; do + for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true - if [ ! -d "debian/$TMP/DEBIAN" ] ; then - doit "install -d debian/$TMP/DEBIAN" + if [ ! -d "$TMP/DEBIAN" ] ; then + doit "install -d $TMP/DEBIAN" fi - verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>debian/$TMP/DEBIAN/shlibs" - echo "$LIBRARY $MAJOR $PACKAGE" >>debian/$TMP/DEBIAN/shlibs + verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>$TMP/DEBIAN/shlibs" + echo "$LIBRARY $MAJOR $PACKAGE" >>$TMP/DEBIAN/shlibs done - if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then - doit "chown root.root debian/$TMP/DEBIAN/shlibs" + if [ -e "$TMP/DEBIAN/shlibs" ]; then + doit "chown root.root $TMP/DEBIAN/shlibs" fi done diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 51ba8fee..e4296e47 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -23,6 +23,9 @@ Generate shlibs files for all architecture independent packages. .TP .B \-ppackage Generate shlibs file for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_md5sums b/dh_md5sums index 5400bad9..f71ab529 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -9,21 +9,21 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ ! -d "debian/$TMP/DEBIAN" ]; then - doit "install -d debian/$TMP/DEBIAN" + if [ ! -d "$TMP/DEBIAN" ]; then + doit "install -d $TMP/DEBIAN" fi # Doit isn't smart enough to hande this next command so echo by hand. (sigh) - verbose_echo 'find debian/$TMP/* -type f ! -regex "^debian/$TMP/DEBIAN/.*" | sed s:debian/$TMP/:: | sort > debian/$TMP/DEBIAN/allfiles' - find debian/$TMP/* -type f ! -regex "^debian/$TMP/DEBIAN/.*" | sed s:debian/$TMP:: | sort > debian/$TMP/DEBIAN/allfiles + verbose_echo 'find $TMP/* -type f ! -regex "^$TMP/DEBIAN/.*" | sed s:$TMP/:: | sort > $TMP/DEBIAN/allfiles' + find $TMP/* -type f ! -regex "^$TMP/DEBIAN/.*" | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles # Check if we should exclude conffiles. - if [ ! "$DH_EXCLUDE" -a -r debian/$TMP/DEBIAN/conffiles ]; then - verbose_echo "sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new" - sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new - doit "mv debian/$TMP/DEBIAN/allfiles.new debian/$TMP/DEBIAN/allfiles" + if [ ! "$DH_EXCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then + verbose_echo "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" + sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new + doit "mv $TMP/DEBIAN/allfiles.new $TMP/DEBIAN/allfiles" fi - verbose_echo "cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." - cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. - doit "chown root.root debian/$TMP/DEBIAN/md5sums" - doit "rm -f debian/$TMP/DEBIAN/allfiles" + verbose_echo "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." + cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. + doit "chown root.root $TMP/DEBIAN/md5sums" + doit "rm -f $TMP/DEBIAN/allfiles" done diff --git a/dh_md5sums.1 b/dh_md5sums.1 index a54c1c15..28f7fe45 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -3,7 +3,7 @@ dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-x] [-v] [-a] [-i] [-ppackage]" +.I "[-x] [-v] [-a] [-i] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. @@ -29,6 +29,9 @@ Generate md5sums file for the package named "package". .B \-x Include conffiles in the md5sums list. Note that this is redundant, and included elsewhere in debian packages. +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_strip b/dh_strip index 77d670a6..57725d70 100755 --- a/dh_strip +++ b/dh_strip @@ -9,7 +9,7 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` # Handle executables and shared libraries. - for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do + for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do case "`file $file`" in *ELF*shared*) doit "strip --strip-unneeded $file" @@ -21,7 +21,7 @@ for PACKAGE in $DH_DOPACKAGES; do done # Handle static libraries. - for file in `find debian/$TMP -type f -name "lib*.a" 2>/dev/null` ; do + for file in `find $TMP -type f -name "lib*.a" 2>/dev/null` ; do # Don't strip debug libraries. if ! expr "$file" : ".*_g\.a" >/dev/null ; then doit "strip --strip-debug $file" diff --git a/dh_strip.1 b/dh_strip.1 index 2eba9914..fa3c7694 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -3,7 +3,7 @@ dh_strip \- strip executables, shared libraries, and some static libraries. .SH SYNOPSIS .B dh_strip -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_strip is a debhelper program that is responsible for stripping executables, shared libraries, and static libraries that are not used for @@ -25,6 +25,9 @@ pointless :-). .TP .B \-ppackage Strip files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_suidregister b/dh_suidregister index 4ca72a1c..e03379f6 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -26,11 +26,11 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! "$files" -a ! -e debian/${EXT}suid ]; then # No files specified (and no empty debian/suid file), so # guess what files to process. - files=`find debian/$TMP -type f -perm +6000` + files=`find $TMP -type f -perm +6000` # We will strip the debian working directory off of the # filenames. - tostrip="debian/$TMP/" + tostrip="$TMP/" else # We will strip leading /'s, so the user can feed this # program either absolute filenames, or relative filenames, @@ -49,7 +49,7 @@ for PACKAGE in $DH_DOPACKAGES; do # 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. - sedstr=`find debian/$TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"` + sedstr=`find $TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"` autoscript "postinst" "postinst-suid" "$sedstr" autoscript "postrm" "postrm-suid" "$sedstr" diff --git a/dh_suidregister.1 b/dh_suidregister.1 index e15e6d5f..97dcb24b 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -3,7 +3,7 @@ dh_suidregister \- set up package to register files with suidregister .SH SYNOPSIS .B dh_suidregister -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [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 @@ -39,6 +39,9 @@ Register files for all architecture independent packages. .B \-ppackage Register files for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Register these files in the first binary package listed in debian/control, if we are acting on that package. diff --git a/dh_undocumented b/dh_undocumented index ebde8904..fe1dbf2d 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -41,11 +41,11 @@ for PACKAGE in $DH_DOPACKAGES; do reldir=.. fi - if [ ! -d debian/$TMP/$dir ]; then - doit "install -d debian/$TMP/$dir" + if [ ! -d $TMP/$dir ]; then + doit "install -d $TMP/$dir" fi - doit ln -s $reldir/man7/undocumented.7.gz debian/$TMP/$dir/$file.gz + doit ln -s $reldir/man7/undocumented.7.gz $TMP/$dir/$file.gz done fi done diff --git a/dh_undocumented.1 b/dh_undocumented.1 index ab45baad..d6ec21bf 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -3,7 +3,7 @@ dh_undocumented \- make symlinks to undocumented.7 man page .SH SYNOPSIS .B dh_undocumented -.I "[-v] [-a] [-i] [-ppackage] [manpage ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -42,6 +42,9 @@ Install undocumented man page symlinks for all architecture independent packages .B \-ppackage Install undocumented man page symlinks for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B manpage ... Install undocumented man page symlinks for each of these man pages into the first binary package listed in debian/control, if we are acting on -- cgit v1.2.3 From 15e132da65d0ce115f0b9a12ada848a06d6a195e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:16 +0000 Subject: r28: Initial Import --- debian/changelog | 7 +++++++ dh_installdocs | 3 ++- dh_installdocs.1 | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 82e193f3..ae73986f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.22) unstable; urgency=low + + * dh_installdocs: Install README.debian as README.Debian (of course, + README.Debian is installed with the same name..) + + -- Joey Hess Tue, 18 Nov 1997 01:23:53 -0500 + debhelper (0.21) unstable; urgency=low * dh_installinit: on removal, fixed how update-rc.d is called. diff --git a/dh_installdocs b/dh_installdocs index bcc26342..153be9a2 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -31,7 +31,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Install these files only into the main package by default. if [ "$PACKAGE" = "$MAINPACKAGE" ]; then if [ -f debian/README.debian ]; then - doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/" + # .Debian is correct according to policy. + doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/README.Debian" fi if [ -f debian/README.Debian ]; then doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" diff --git a/dh_installdocs.1 b/dh_installdocs.1 index fc001130..68f3808c 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -12,8 +12,8 @@ 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. .P -Any filenames specified as parameters, as well as debian/README.debian (or -debian/README.Debian) and debian/TODO, if they exist, will be installed into +Any filenames specified as parameters, as well as 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. -- cgit v1.2.3 From 2dc6b1e7754c88976aadefb20a4d387e8cf8b4ce Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:41:40 +0000 Subject: r43: Initial Import --- README | 18 ++++--- TODO | 2 - debian/changelog | 9 ++++ debian/rules | 13 +++-- dh_du | 2 +- dh_installchangelogs | 4 +- dh_installdirs.1 | 9 ++-- dh_installdocs | 2 +- dh_installinit | 6 +++ dh_lib | 140 ++++++++++++++++++++++++++++++++------------------- dh_suidregister | 2 +- 11 files changed, 134 insertions(+), 73 deletions(-) (limited to 'dh_installdocs') diff --git a/README b/README index 280da781..5c3bf91e 100644 --- a/README +++ b/README @@ -2,11 +2,10 @@ Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks. For further documentation, see the man pages for dh_* commands. -To help you get started, I've included an example of a debian/rules file -that uses debhelper commands extensively. See -/usr/doc/debhelper/examples/rules . These files are also useful as they give -one good order you can run the different debhelper scripts in (though other -variations are possible). +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). Converting from debstd to debhelper: @@ -76,7 +75,12 @@ 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. +script. If you would like to embed it into a perl script, here is one way to +do that: + +print << `EOF` +#DEBHELPER# +EOF Notes on multiple binary packages: @@ -100,7 +104,7 @@ following parameters: times) These parameters are cumulative. If none are given, the tools default to -effecting all packages. +affecting all packages. See examples/rules.multi for an example of how to use this. diff --git a/TODO b/TODO index 3118ab95..00281d70 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,5 @@ * add all other functionality of debstd (??) * dh_fixperms: allow listing of files not to be touched (diffucult). * add a dh_debstd, which mimics debstd, but uses debhelper tools internally. -* dh_du: change it so it doesn't grep for things with tabs in them. That's - nasty. (and makes cut-and-paste from dh_du -v not work). * dh_compress: add --exclude "*.conf" type-thingy * info support for debhelper diff --git a/debian/changelog b/debian/changelog index 80d0aaa3..a1139e5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.37) unstable; urgency=low + + * dh_du: Fixed hardcoded debian/tmp. + * This change got lost by accident, redid it: Optimized out most of the + slowdown caused byusing dpkg-parsechangelog - now it's only called by + 2 dh_* programs. + + -- Joey Hess Sun, 28 Dec 1997 20:45:22 -0500 + debhelper (0.36) unstable; urgency=low * dh_undocumented: exit with an error message if the man page specified diff --git a/debian/rules b/debian/rules index b236fb1f..6ac6d672 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,5 @@ #!/usr/bin/make -f -# Note that I have to refer to debhelper programs witrh ./, to make sure +# Note that I have to refer to debhelper programs with ./, to make sure # I run the most current ones. That's also why there is a symlink to the # current dh_lib in this debian/ directory. @@ -7,17 +7,24 @@ # be sure to use the new templates from this package. export DH_AUTOSCRIPTDIR=autoscripts +# Figure out the current debhelper version. +VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null`" : \ + '.*Version: \(.*\).*Distribution:') + export DH_VERBOSE=1 test_files=dh_lib build: ./dh_testdir $(test_files) + sed "s/#DEBHELPER_VERSION#/$(VERSION)/" < dh_testversion.in \ + > dh_testversion + chmod 755 dh_testversion clean: ./dh_testdir $(test_files) ./dh_testroot - ./dh_clean + ./dh_clean dh_testversion # Build architecture-dependent files here. binary-arch: build @@ -35,7 +42,7 @@ binary-indep: build cp dh_lib debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper - ./dh_installdocs TODO README BUGS + ./dh_installdocs TODO README ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages diff --git a/dh_du b/dh_du index 39c684eb..71ce2b13 100755 --- a/dh_du +++ b/dh_du @@ -15,5 +15,5 @@ for PACKAGE in $DH_DOPACKAGES; do # Note that the tabs in this next line are important. complex_doit "du -k $TMP | sed 's: $TMP/: :' | grep -v ' DEBIAN$' | grep -v ' $TMP$' >$TMP/DEBIAN/du" - doit "chown root.root debian/tmp/DEBIAN/du" + doit "chown root.root $TMP/DEBIAN/du" done diff --git a/dh_installchangelogs b/dh_installchangelogs index 7405daae..0dd09918 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -12,11 +12,11 @@ PATH=debian:$PATH:/usr/lib/debhelper UPSTREAM=$1 -if [ "$NATIVE" -a "$UPSTREAM" ]; then +if isnative && [ "$UPSTREAM" ]; then error "Cannot specify an upstream changelog for a native debian package." fi -if [ "$NATIVE" ]; then +if isnative; then CHANGELOG_NAME=changelog else CHANGELOG_NAME=changelog.Debian diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 9f5bc351..fc5c8d62 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -9,8 +9,9 @@ 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 binary package listed in debian/control, if -dh_installdirs is acting on that 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/dirs (for the first binary package in debian/control), or debian/package.dirs (for each additional package in debian/control) can @@ -37,8 +38,8 @@ Create directories for the package named "package". Use "tmpdir" for package build directory. .TP .B dir ... -Create these directories in the package build directory of the first binary -package listed in debian/control, if we are acting on that package. +Create these directories in the package build directory of the first package +acted on. .SH NOTES The .B \-a diff --git a/dh_installdocs b/dh_installdocs index 153be9a2..a1da8aa9 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -38,7 +38,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" fi if [ -f debian/TODO ]; then - if [ "$NATIVE" ]; then + if isnative; then doit "install -m 655 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO" else doit "install -m 644 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO.Debian" diff --git a/dh_installinit b/dh_installinit index 2ea3440f..857e2793 100755 --- a/dh_installinit +++ b/dh_installinit @@ -6,6 +6,12 @@ PATH=debian:$PATH:/usr/lib/debhelper . dh_lib +# This works around a bug in getopt(1), where it ignores some parameters. +# Sigh. +if [ "$*" ]; then + DH_U_PARAMS="$DH_U_PARAMS $*" +fi + for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` diff --git a/dh_lib b/dh_lib index 8347aae8..2c2b995f 100644 --- a/dh_lib +++ b/dh_lib @@ -52,19 +52,26 @@ pkgext() { } # Returns 1 if the package is a native debian package, null otherwise. +# Caches return code so it only needs to run dpkg-parsechangelog once. isnative() { - # Get the package version. - # Note that the 2>/dev/null is because a bug in dpkg-parsechangelog makes it - # output a bogus error message to stderr. - # If it actually has a real error, then the expr will fail, and this whole - # script will come crashing to a halt, which is good enough to inform - # the user something's wrong. :-) - VERSION=`expr "\`dpkg-parsechangelog 2>/dev/null\`" : \ - '.*Version: \(.*\).*Distribution:'` - # Is this a native Debian package? - if expr "$VERSION" : '.*-' >/dev/null; then - return 1 + if [ -z "$DH_ISNATIVE" ]; then + # Get the package version. + # Note that the 2>/dev/null is because a bug in dpkg-parsechangelog makes it + # output a bogus error message to stderr. + # If it actually has a real error, then the expr will fail, and this whole + # script will come crashing to a halt, which is good enough to inform + # the user something's wrong. :-) + VERSION=`expr "\`dpkg-parsechangelog 2>/dev/null\`" : \ + '.*Version: \(.*\).*Distribution:'` + # Is this a native Debian package? + if expr "$VERSION" : '.*-' >/dev/null; then + DH_ISNATIVE=1 + else + DH_ISNATIVE=0 + fi fi + + return "$DH_ISNATIVE" } # Automatically add a shell script snippet to a debian script. @@ -95,10 +102,46 @@ autoscript() { complex_doit "echo '# End automatically added section' >> $autoscript_debscript" } +# Sets 2 global variables, INDEP_PACKAGES is all the arch-independant +# packages, ARCH_PACKAGES is the arch-dependant packages. +get_arch_indep_packages() { + INDEP_PACKAGES="" + ARCH_PACKAGES="" + + # First, get the list of all binary packages. + # Notice we want the list in reverse order, thus the tac. + PACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tac | tr "\n" " "` + # Remove trailing space. + PACKAGES=`expr "$PACKAGES" : '\(.*\) '` + # Loop on the list of architectures. + for ARCH in `grep ^Architecture: debian/control | cut -d " " -f 2` ; do + # Pull the last package off the list. + THISPKG=`expr "$PACKAGES" : '.* \(.*\)'` || true + if [ ! "$THISPKG" ]; then + THISPKG=$PACKAGES + fi + PACKAGES=`expr "$PACKAGES" : '\(.*\) .*'` || true + + if [ ! "$THISPKG" ]; then + error "debian/control invalid - too many Architecture lines or too few Package lines" + fi + + if [ "$ARCH" = "all" ]; then + INDEP_PACKAGES="$INDEP_PACKAGES $THISPKG" + else + ARCH_PACKAGES="$ARCH_PACKAGES $THISPKG" + fi + done + + if [ "$PACKAGES" ]; then + error "debian/control invalid - too many Architecure lines or too few Package lines" + fi +} + # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvidrnakp:P:u: $*` +set -- `getopt xvidrnakp:P:u:m: $*` for i; do case "$i" @@ -108,10 +151,14 @@ for i; do shift ;; -i) + get_arch_indep_packages + DH_DOPACKAGES="$DH_DOPACKAGES $INDEP_PACKAGES" DH_DOINDEP=1 shift ;; -a) + get_arch_indep_packages + DH_DOPACKAGES="$DH_DOPACKAGES $ARCH_PACKAGES" DH_DOARCH=1 shift ;; @@ -150,6 +197,11 @@ for i; do shift shift ;; + -m) + DH_M_PARAMS="$2" + shift + shift + ;; --) shift break @@ -157,54 +209,22 @@ for i; do esac done -# Get the name of the main binary package. +# Get the name of the main binary package (first one listed in +# debian/control). MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1` -if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then - # Figure out all the binary packages to be produced, by looking at the - # control file. Break it into 2 lists, INDEP_PACKAGES and ARCH_PACKAGES. - # - # First, get the list of all binary packages. - PACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "` - # Remove trailing space. - PACKAGES=`expr "$PACKAGES" : '\(.*\) '` - # Loop on the list of architectures. Note that we tac the result to reverse - # it, becuase we are going through the list of packages in reverse. - for ARCH in `grep ^Architecture: debian/control | tac | cut -d " " -f 2` ; do - THISPKG=`expr "$PACKAGES" : '.* \(.*\)'` || true - if [ ! "$THISPKG" ]; then - THISPKG=$PACKAGES - fi - PACKAGES=`expr "$PACKAGES" : '\(.*\) .*'` || true - if [ ! "$THISPKG" ]; then - error "debian/control invalid - too many Architecture lines or too few Package lines" - fi - if [ "$ARCH" = "all" ]; then - INDEP_PACKAGES="$INDEP_PACKAGES $THISPKG" - else - ARCH_PACKAGES="$ARCH_PACKAGES $THISPKG" - fi - done - - if [ "$PACKAGES" ]; then - error "debian/control invalid - too many Architecure lines or too few Package lines" - fi - if [ "$DH_DOINDEP" ]; then - DH_DOPACKAGES="$DH_DOPACKAGES $INDEP_PACKAGES" - fi - if [ "$DH_DOARCH" ]; then - DH_DOPACKAGES="$DH_DOPACKAGES $ARCH_PACKAGES" - fi +# Remove leading spaces from DH_DOPACKAGES. +if expr "$DH_DOPACKAGES" : ' *.*' >/dev/null ; then + DH_DOPACKAGES_NEW=`expr "$DH_DOPACKAGES" : ' *\(.*\)'` fi # Check if packages to build have been specified, if not, fall back to -# the default, doing them all. Note that DH_DOPACKAGES may have a leading -# space and be empty otherwise. -if [ ! "$DH_DOPACKAGES" -o "$DH_DOPACKAGES" = " " ]; then +# the default, doing them all. +if [ ! "$DH_DOPACKAGES" ]; then if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then error "I have no package to build." fi - DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2` + DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "` fi # Check to see if -P was specified. If so, we can only act on a single @@ -212,3 +232,19 @@ fi if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | egrep -q '.+ .+' ; then error "-P was specified, but multiple packages would be acted on." fi + +# 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 effect it. +for PACKAGE in $DH_DOPACKAGES ; do + DH_FIRSTPACKAGE="$PACKAGE" + break +done + +# Check to see if: DH_FIRSTPACKAGE is not the MAINPACKAGE, and +# some command line arguemnts are passed. Display a warning, becuase +# debhelper's behaviour has changed in this case. +if [ "$DH_FIRSTPACKAGE" != "$MAINPACKAGE" -a "$*" ]; then + echo `basename $0`": Warning: my behavior has changed, and command line" >&2 + echo `basename $0`": arguments \"$*\" will apply to package \"$DH_FIRSTPACKAGE\"" >&2 +fi diff --git a/dh_suidregister b/dh_suidregister index e03379f6..42e4d16d 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do files=`tr "\n" " " < debian/${EXT}suid` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then files="$* $files" fi -- cgit v1.2.3 From e742573dc1696f78dacb1cf36827e9a04f6f3514 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:41:40 +0000 Subject: r44: Initial Import --- debian/changelog | 29 ++++++++++++++++++++++++++++- dh_installdirs | 2 +- dh_installdocs | 2 +- dh_installdocs.1 | 20 ++++++++++++-------- dh_installexamples | 2 +- dh_installexamples.1 | 10 +++++----- dh_installinit.1 | 7 +++++++ dh_makeshlibs | 8 ++++++-- dh_makeshlibs.1 | 10 ++++++++-- dh_suidregister.1 | 9 +++++---- dh_undocumented | 2 +- dh_undocumented.1 | 13 +++++++------ 12 files changed, 82 insertions(+), 32 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index a1139e5b..75e03dae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,35 @@ +debhelper (0.50) unstable; urgency=low + + * dh_makeshlibs: added -m parameter, which can force the major number + of the shared library if it is guessed incorrectly. + * Added dh_testversion to let your package depend on a certian version of + debhelper to build. + * dh_{installdirs,installdocs,installexamples,suidregieter,undocumented}: + behavior modification - any files/directories specified on the command + line now apply to the first package acted on. This may not be the + first package listed in debian/control, if you use -p to make it act on + a given package, or -i or -a. + * If you take advantage of the above new behavior, I suggest you add + "dh_testversion 0.50" to your debian/rules. + * Display a warning message in cases where the above behavior is triggered, + and debhelper's behavior has altered. + * I have grepped debian's source packages, and I'm quite sure this + is not going to affect any packages currently in debian. + * dh_lib: isnative() now caches its return value, which should optimize + away several more calls to dpkg-parsechangelog. + * README: explain a way to embed debhelper generated shell script into a + perl script. + * dh_installinit: A hack to work around the problem in getopt(1) that + led to bug report #16229: Any text specified on the command line that is + not a flag will be presumed to be part of the -u flag. Yuck. + + -- Joey Hess Sat, 3 Jan 1998 14:36:15 -0500 + debhelper (0.37) unstable; urgency=low * dh_du: Fixed hardcoded debian/tmp. * This change got lost by accident, redid it: Optimized out most of the - slowdown caused byusing dpkg-parsechangelog - now it's only called by + slowdown caused by using dpkg-parsechangelog - now it's only called by 2 dh_* programs. -- Joey Hess Sun, 28 Dec 1997 20:45:22 -0500 diff --git a/dh_installdirs b/dh_installdirs index b5480851..51ef2ce7 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do dirs=`tr "\n" " " < debian/${EXT}dirs` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then dirs="$* $dirs" fi diff --git a/dh_installdocs b/dh_installdocs index a1da8aa9..11014229 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -20,7 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do docs=`tr "\n" " " < debian/${EXT}docs` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then docs="$* $docs" fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 9724635e..86195b79 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -9,14 +9,19 @@ 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 +dh_installdocs is acting on multiple packages, debian/copyright files will be installed into all packages. .P -Any filenames specified as parameters, as well as 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. +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. .P A file named debian/docs (for the first binary package in debian/control), or debian/package.docs (for each additional package in debian/control) can @@ -39,8 +44,7 @@ Install files for the package named "package". Use "tmpdir" for package build directory. .TP .B file ... -Install these files as documentation into the first binary package listed in -debian/control, if we are acting on that package. +Install these files as documentation into the first package acted on. .SH NOTES The .B \-a diff --git a/dh_installexamples b/dh_installexamples index bc16991a..98a752df 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -16,7 +16,7 @@ for PACKAGE in $DH_DOPACKAGES; do examples=`tr "\n" " " < debian/${EXT}examples` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then examples="$* $examples" fi diff --git a/dh_installexamples.1 b/dh_installexamples.1 index c940d256..f70b98ce 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -8,9 +8,10 @@ dh_installexamples \- install example files into package build directories dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. .P -Any filenames specified as parameters will be installed into the first -binary package listed in debian/control, if dh_installexamples is acting on -that package. +Any file names specified as parameters will be installed into 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/examples (for the first binary package in debian/control), or debian/package.examples (for each additional package in debian/control) can @@ -33,8 +34,7 @@ Install files for the package named "package". Use "tmpdir" for package build directory. .TP .B file ... -Install these files as documentation into the first binary package listed in -debian/control, if we are acting on that package. +Install these files as examples into the first package acted on. .SH NOTES The .B \-a diff --git a/dh_installinit.1 b/dh_installinit.1 index e0daac42..13f87549 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -60,6 +60,13 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. +.P +Due to a bug in +.BR getopt (1) +, you cannot really text with spaces in it to the -u flag. However, this bug +has been worked around, and it should appear to work. What it's really doing +is looking at any parameters passed that are not known flags, and appending +that text onto the end of the text specified by the -u flag. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_makeshlibs b/dh_makeshlibs index 0943ba57..6cf9c803 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -15,8 +15,12 @@ for PACKAGE in $DH_DOPACKAGES; do for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true - MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true - LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true + if [ -z "$DH_M_PARAMS" ]; then + MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true + else + MAJOR="$DH_M_PARAMS" + fi +# LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 0b7df353..02c7ea8a 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" +.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -26,6 +26,10 @@ Generate shlibs file for the package named "package". .TP .B \-Ptmpdir Use "tmpdir" for package build directory. +.TP +.B \-mmajor +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. .SH NOTES The .B \-a @@ -44,7 +48,9 @@ Enables verbose mode 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. +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 diff --git a/dh_suidregister.1 b/dh_suidregister.1 index b66c2140..d374a4c1 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -11,8 +11,10 @@ with .BR suidregister (1) when it is installed. .P -Any files specified as parameters will be registered, if dh_suidregister is -acting on the first binary package listed in debian/control. +Any filenames specified as parameters will be registered in 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 The files debian/suid (for the first binary package in debian/control) or debian/package.suid (for each additional package in debian/control) can @@ -43,8 +45,7 @@ Register files for the package named "package". Use "tmpdir" for package build directory. .TP .B file ... -Register these files in the first binary package listed in debian/control, -if we are acting on that package. +Register these files in the first package acted on. .SH NOTES The .B \-a diff --git a/dh_undocumented b/dh_undocumented index d0a8febd..e8ca0e01 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do undoc=`tr "\n" " " < debian/${EXT}undocumented` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then undoc="$* $undoc" fi diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 3f554989..2bbf24a1 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -22,10 +22,12 @@ generates the necessary symlinks to .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 binary package listed in -debian/control, if dh_installdocs is acting on that package. -Also, if a file named debian/undocumented (for the first binary package in +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/undocumented (for the first binary package in debian/control), or debian/package.undocumented (for each additional package in debian/control) can list other man page names to set up. .SH OPTIONS @@ -47,8 +49,7 @@ Use "tmpdir" for package build directory. .TP .B manpage ... Install undocumented man page symlinks for each of these man pages -into the first binary package listed in debian/control, if we are acting on -that package. +into the first package acted on. .SH NOTES The .B \-a -- cgit v1.2.3 From 94f1df06050aa3c512fd8af6e67690f482fbcd5a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:41:45 +0000 Subject: r45: Initial Import --- debian/changelog | 13 +++++++++++++ debian/control | 2 +- dh_fixperms | 8 +++++++- dh_fixperms.1 | 3 ++- dh_installdirs | 3 ++- dh_installdirs.1 | 8 ++++++-- dh_installdocs | 3 ++- dh_installdocs.1 | 9 +++++++-- dh_installexamples | 3 ++- dh_installexamples.1 | 9 +++++++-- dh_lib | 12 +++++++++++- dh_makeshlibs | 14 ++++++++++++-- dh_makeshlibs.1 | 35 ++++++++++++++++++++++++++++++++++- dh_suidregister | 3 ++- dh_suidregister.1 | 10 ++++++++-- dh_undocumented | 3 ++- dh_undocumented.1 | 10 ++++++++-- 17 files changed, 126 insertions(+), 22 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 75e03dae..15b91d46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (0.51) unstable; urgency=low + + * dh_fixperms: make shared libraries non-executable, in accordance with + policy. (#16644) + * dh_makeshlibs: introduced a -V flag, which allows you to specify explicit + version requirements in the shlibs file. + * dh_{installdirs,installdocs,installexamples,suidregister,undocumented}: + Added a -A flag, which makes any files/directories specified on the + command line apply to ALL packages acted on. + * Updated Standards-Version to latest. + + -- Joey Hess Mon, 5 Jan 1998 16:15:01 -0500 + debhelper (0.50) unstable; urgency=low * dh_makeshlibs: added -m parameter, which can force the major number diff --git a/debian/control b/debian/control index e22d969b..6883f628 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.1.1.0 +Standards-Version: 2.3.0.1 Package: debhelper Architecture: all diff --git a/dh_fixperms b/dh_fixperms index 0534549c..32c9dbef 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -26,9 +26,15 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod 755 $files" fi - # Executable man pages are a bad thing. + # Executable man pages are a bad thing.. files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi + + # ..so are executable shared libraries. + files=`find $TMP -perm -5 -type f -name "*.so*" | tr "\n" " "` || true + if [ "$files" ]; then + doit "chmod a-X $files" + fi done diff --git a/dh_fixperms.1 b/dh_fixperms.1 index c403836c..1fac26c3 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -12,6 +12,7 @@ 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. +Finally, it removes execute permissions from any libraries that have it set. .SH OPTIONS .TP .B \-v @@ -43,6 +44,6 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.3.0.1 .SH AUTHOR Joey Hess diff --git a/dh_installdirs b/dh_installdirs index 51ef2ce7..1ef311e7 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do dirs=`tr "\n" " " < debian/${EXT}dirs` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then dirs="$* $dirs" fi diff --git a/dh_installdirs.1 b/dh_installdirs.1 index fc5c8d62..0fba87de 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -3,7 +3,7 @@ dh_installdirs \- create subdirectories in package build directories .SH SYNOPSIS .B dh_installdirs -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [dir ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [dir ...]" .SH "DESCRIPTION" dh_installdirs is a debhelper program that is responsible for creating subdirectories in package build directories. @@ -37,9 +37,13 @@ Create directories for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Create any directories specified by command line parameters in ALL packages +acted on. +.TP .B dir ... Create these directories in the package build directory of the first package -acted on. +acted on. (Or in all packages if -A is specified.) .SH NOTES The .B \-a diff --git a/dh_installdocs b/dh_installdocs index 11014229..f345a282 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -20,7 +20,8 @@ for PACKAGE in $DH_DOPACKAGES; do docs=`tr "\n" " " < debian/${EXT}docs` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then docs="$* $docs" fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 86195b79..ab9ed476 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -43,8 +43,13 @@ Install files for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Install all files specified by command line parameters in ALL packages +acted on. +.TP .B file ... -Install these files as documentation into the first package acted on. +Install these files as documentation into the first package acted on. (Or in +all packages if -A is specified). .SH NOTES The .B \-a diff --git a/dh_installexamples b/dh_installexamples index 98a752df..423c647a 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -16,7 +16,8 @@ for PACKAGE in $DH_DOPACKAGES; do examples=`tr "\n" " " < debian/${EXT}examples` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then examples="$* $examples" fi diff --git a/dh_installexamples.1 b/dh_installexamples.1 index f70b98ce..e46ed826 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -3,7 +3,7 @@ dh_installexamples \- install example files into package build directories .SH SYNOPSIS .B dh_installexamples -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-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. @@ -33,8 +33,13 @@ Install files for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +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. +Install these files as examples into the first package acted on. (Or into all +packages if -A is specified.) .SH NOTES The .B \-a diff --git a/dh_lib b/dh_lib index 2c2b995f..39dae2a5 100644 --- a/dh_lib +++ b/dh_lib @@ -10,6 +10,7 @@ doit() { eval '$@' } + # This is an identical command to doit, except the parameter passed to it # are evaled with double quotes. This version can handle compound commands. complex_doit() { @@ -52,6 +53,7 @@ pkgext() { } # Returns 1 if the package is a native debian package, null otherwise. +# As a side effect, sets $VERSION to the version of this package. # Caches return code so it only needs to run dpkg-parsechangelog once. isnative() { if [ -z "$DH_ISNATIVE" ]; then @@ -141,7 +143,7 @@ get_arch_indep_packages() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvidrnakp:P:u:m: $*` +set -- `getopt xvidrnakVAp:P:u:m: $*` for i; do case "$i" @@ -202,6 +204,14 @@ for i; do shift shift ;; + -V) + DH_V_FLAG=1 + shift + ;; + -A) + DH_PARAMS_ALL=1 + shift + ;; --) shift break diff --git a/dh_makeshlibs b/dh_makeshlibs index 6cf9c803..f96c327f 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -14,9 +14,9 @@ for PACKAGE in $DH_DOPACKAGES; do for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true - VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true + LIB_VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true if [ -z "$DH_M_PARAMS" ]; then - MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true + MAJOR=`expr $LIB_VERSION : "\([0-9]*\)\."` || true else MAJOR="$DH_M_PARAMS" fi @@ -24,6 +24,16 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi + if [ "$DH_V_FLAG" ]; then + if [ "$*" ]; then + PACKAGE="$*" + else + # Call isnative becuase it sets $VERSION + # as a side effect. + isnative + PACKAGE="$PACKAGE (>= $VERSION)" + fi + fi complex_doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs" done diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 02c7ea8a..056cc0f2 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage]" +.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage] [-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. @@ -30,6 +30,31 @@ Use "tmpdir" for package build directory. .B \-mmajor 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] +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 NOTES The .B \-a @@ -45,6 +70,14 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS +Due to limitations in +.BR getopt (1) +, I had to fudge a bit on how the -V parameter really works. When -V is +specified, it's really examining the rest of the command line for any text +that isn't a switch, and using that for the dependancy information. This +means that the -V switch and any dependancy parameters should come last on +the command line. +.P 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 diff --git a/dh_suidregister b/dh_suidregister index 42e4d16d..3f7622af 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do files=`tr "\n" " " < debian/${EXT}suid` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then files="$* $files" fi diff --git a/dh_suidregister.1 b/dh_suidregister.1 index d374a4c1..ef5b08dc 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -3,7 +3,7 @@ dh_suidregister \- set up package to register files with suidregister .SH SYNOPSIS .B dh_suidregister -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-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 @@ -44,8 +44,14 @@ Register files for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +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. +Register these files in the first package acted on. (Or in all packages if +-A is specified.) .SH NOTES The .B \-a diff --git a/dh_undocumented b/dh_undocumented index e8ca0e01..31b2f987 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do undoc=`tr "\n" " " < debian/${EXT}undocumented` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then undoc="$* $undoc" fi diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 2bbf24a1..9df8e311 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -3,7 +3,7 @@ dh_undocumented \- make symlinks to undocumented.7.gz man page .SH SYNOPSIS .B dh_undocumented -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [manpage ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -47,9 +47,15 @@ Install undocumented man page symlinks for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +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. +into the first package acted on. (Or in all packages acted on if -A is +specified.) .SH NOTES The .B \-a -- cgit v1.2.3 From 151fcdd2c72ee77597124c74450d66ba2840b14b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:42:10 +0000 Subject: r47: Initial Import --- README | 1 + debian/changelog | 7 +++++++ debian/rules | 1 + dh_clean | 6 ++++-- dh_compress | 4 ++-- dh_compress.1 | 2 +- dh_installcron | 6 +++--- dh_installcron.1 | 7 ++++--- dh_installdeb | 14 ++++++++------ dh_installdeb.1 | 19 ++++++++++--------- dh_installdocs | 17 ++++++++++++----- dh_installinit | 6 +++--- dh_lib | 16 +++++++++++++++- dh_movefiles | 27 +++++++++++++++++++++++++++ 14 files changed, 98 insertions(+), 35 deletions(-) create mode 100755 dh_movefiles (limited to 'dh_installdocs') diff --git a/README b/README index 5c3bf91e..bb4b6f06 100644 --- a/README +++ b/README @@ -30,6 +30,7 @@ Remove that and replace it with something like: dh_installcron dh_installmanpages dh_installchangelogs CHANGES + dh_movefiles dh_strip dh_compress dh_fixperms diff --git a/debian/changelog b/debian/changelog index 15b91d46..6eab06d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.52) unstable; urgency=low + + * dh_compress: compress file belongs in debian/. It was looking in ./ + This has been broken since version 0.30. + + -- Joey Hess Tue, 6 Jan 1998 14:08:31 -0500 + debhelper (0.51) unstable; urgency=low * dh_fixperms: make shared libraries non-executable, in accordance with diff --git a/debian/rules b/debian/rules index 6ac6d672..8bbcad55 100755 --- a/debian/rules +++ b/debian/rules @@ -47,6 +47,7 @@ binary-indep: build ./dh_installmenu ./dh_installmanpages ./dh_installchangelogs + ./dh_movefiles ./dh_compress ./dh_fixperms ./dh_suidregister diff --git a/dh_clean b/dh_clean index 6306adda..ba20e3ea 100755 --- a/dh_clean +++ b/dh_clean @@ -8,9 +8,11 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + substvars=`pkgfile $PACKAGE substvars` + if [ "$substvars" ]; then + doit "rm -f debian/$substvars" + fi doit "rm -rf $TMP" - doit "rm -f debian/${EXT}substvars" done doit "rm -f debian/*.debhelper $*" if [ ! "$DH_K_FLAG" ]; then diff --git a/dh_compress b/dh_compress index fe16b6cb..4626ed09 100755 --- a/dh_compress +++ b/dh_compress @@ -15,10 +15,10 @@ for PACKAGE in $DH_DOPACKAGES; do olddir=`pwd` doit "cd $TMP" - if [ -f $olddir/${EXT}compress ]; then + if [ -f $olddir/debian/${EXT}compress ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - files=`sh $olddir/${EXT}compress 2>/dev/null` + files=`sh $olddir/debian/${EXT}compress 2>/dev/null` else # By default fall back on what the policy manual says to compress. files=` diff --git a/dh_compress.1 b/dh_compress.1 index 0e6c6198..ce8f539a 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -57,7 +57,7 @@ the control file will have their files compressed. 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. +apply to. (This works for the first binary package too.) .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_installcron b/dh_installcron index 6ea5daa3..9cd7cb5e 100755 --- a/dh_installcron +++ b/dh_installcron @@ -7,14 +7,14 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` for type in daily weekly monthly; do - if [ -e debian/${EXT}cron.$type ]; then + cron=`pkgfile $PACKAGE cron.$type` + if [ "$cron" ]; then if [ ! -d $TMP/etc/cron.$type ]; then doit "install -o root -g root -d $TMP/etc/cron.$type" fi - doit "install debian/${EXT}cron.$type $TMP/etc/cron.$type/$PACKAGE" + doit "install "$cron" $TMP/etc/cron.$type/$PACKAGE" fi done done diff --git a/dh_installcron.1 b/dh_installcron.1 index ff76760b..3407a62f 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -8,9 +8,10 @@ dh_installcron \- install cron scripts into etc/cron.* 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, and debian/cron.monthly are -installed. If your package generates multiple binary packages, 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. +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 \-v diff --git a/dh_installdeb b/dh_installdeb index d9e1e7b3..dd1a23fb 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -16,15 +16,16 @@ for PACKAGE in $DH_DOPACKAGES; do # Install debian install scripts. # If any .debhelper files exist, add them into the scripts. for file in postinst preinst prerm postrm; do - if [ -f debian/$EXT$file ]; then + f=`pkgfile $PACKAGE $file` + if [ "$f" ]; then if [ -f debian/$EXT$file.debhelper ]; then # Add this into the script, where it has # #DEBHELPER# - complex_doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < debian/$EXT$file > $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 #DEBHELOPER# in the + # Just get rid of any #DEBHELPER# in the # script. - complex_doit "sed s/#DEBHELPER#// < debian/$EXT$file > $TMP/DEBIAN/$file" + complex_doit "sed s/#DEBHELPER#// < $f > $TMP/DEBIAN/$file" fi doit "chown root.root $TMP/DEBIAN/$file" doit "chmod 755 $TMP/DEBIAN/$file" @@ -42,8 +43,9 @@ for PACKAGE in $DH_DOPACKAGES; do # Install non-executable files for file in shlibs conffiles; do - if [ -f debian/$EXT$file ]; then - doit "install -o root -g root -m 644 -p debian/$EXT$file $TMP/DEBIAN/$file" + f=`pkgfile $PACKAGE $file` + if [ "$f" ]; then + doit "install -o root -g root -m 644 -p $f $TMP/DEBIAN/$file" fi done done diff --git a/dh_installdeb.1 b/dh_installdeb.1 index 08b6cbae..acb1a7f0 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -11,16 +11,17 @@ correct permissions. .P dh_installdeb automatically installs the following files from debian/ into the DEBIAN directory: -.IP postinst -.IP preinst -.IP postrm -.IP prerm -.IP shlibs -.IP conffiles + postinst + preinst + postrm + prerm + shlibs + conffiles .P (For packages other than the first binary package listed in debian/control, -prefix these filenames with then name of the "package.", for example, -"foo.postinst".) +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 @@ -30,7 +31,7 @@ inserted. If the script does not exist, then a script is generated from the .debhelper file. The .debhelper files are created by other debhelper programs, such as .BR dh_installmenu (1) -, and are shell scripts. +, and are shell script fragments. .SH OPTIONS .TP .B \-v diff --git a/dh_installdocs b/dh_installdocs index f345a282..1b3a95cb 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -8,7 +8,7 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + file=`pkgfile $PACKAGE docs` if [ ! -d $TMP/usr/doc/$PACKAGE ]; then doit "install -d $TMP/usr/doc/$PACKAGE" @@ -16,8 +16,8 @@ for PACKAGE in $DH_DOPACKAGES; do docs="" - if [ -e debian/${EXT}docs ]; then - docs=`tr "\n" " " < debian/${EXT}docs` + if [ "$file" ]; then + docs=`tr "\n" " " < $file` fi if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ @@ -47,7 +47,14 @@ for PACKAGE in $DH_DOPACKAGES; do fi fi - if [ -f debian/copyright ]; then - doit "install -m 644 -p debian/copyright $TMP/usr/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` + if [ ! "$copyright" -a -e debian/copyright ]; then + copyright=debian/copyright + fi + if [ "$copyright" ]; then + doit "install -m 644 -p $copyright $TMP/usr/doc/$PACKAGE/copyright" fi done diff --git a/dh_installinit b/dh_installinit index 857e2793..207131cd 100755 --- a/dh_installinit +++ b/dh_installinit @@ -14,9 +14,9 @@ fi for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + init=`pkgfile $PACKAGE init` - if [ -e debian/${EXT}init ]; then + if [ "$init" ]; then if [ ! -d $TMP/etc/init.d ]; then doit "install -d $TMP/etc/init.d" fi @@ -34,7 +34,7 @@ for PACKAGE in $DH_DOPACKAGES; do else script=$PACKAGE fi - doit "install -p -m755 debian/${EXT}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, diff --git a/dh_lib b/dh_lib index 39dae2a5..06a4666b 100644 --- a/dh_lib +++ b/dh_lib @@ -44,11 +44,25 @@ tmpdir() { fi } +# 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, it will look for +# debian/foo, and if found, return that. Failing that, it will return +# nothing. +pkgfile() { + if [ -e "debian/$1.$2" ]; then + echo "debian/$1.$2" + elif [ "$1" = "$MAINPACKAGE" -a -e "debian/$2" ]; then + echo "debian/$2" + fi +} + # Pass it a name of a binary package, it returns the name to prefix to files # in debian for this package. pkgext() { if [ "$1" != "$MAINPACKAGE" ]; then - echo "$PACKAGE." + echo "$PACKAGE." fi } diff --git a/dh_movefiles b/dh_movefiles new file mode 100755 index 00000000..9190853c --- /dev/null +++ b/dh_movefiles @@ -0,0 +1,27 @@ +#!/bin/sh -e +# +# Move files out of debian/tmp, into subpackages. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + files=`pkgfile $PACKAGE files` + + move="" + + # debian/files has a different purpose, so ignore it. + if [ "$files" -a "$files" != "debian/files" ]; then + if [ "$PACKAGE" = "$MAINPACKAGE" ]; then + error "I was asked to move some files from $PACKAGE into itself." + fi + + if [ ! -d "$TMP" ]; then + doit "install -d $TMP" + fi + + files=`pwd`/$files + complex_doit "(cd debian/tmp;tar --create --remove-files --file - "`cat $files`") | (cd $TMP;tar xpf -)" + fi +done -- cgit v1.2.3 From 30dd5e818aa3d41683f3d20815ed0ad41ca1f469 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:23 +0000 Subject: r87: Initial Import --- debian/changelog | 35 ++++++++++++++++++++++++++++++++++- debian/control | 2 +- dh_compress.1 | 4 ++-- dh_fixperms.1 | 7 ++++++- dh_installdirs | 7 +++++-- dh_installdocs | 30 +++++++++++++++--------------- dh_installdocs.1 | 5 +++-- dh_installinit.1 | 5 +++-- dh_makeshlibs.1 | 2 +- 9 files changed, 70 insertions(+), 27 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 0b443a16..7eb8f5d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,36 @@ +debhelper (0.90) unstable; urgency=low + + * I'd like to thank Len Pikulski and Igor Grobman at nothinbut.net for + providing me with free internet access on a moment's notice, so I could + get this package to you after hacking on it all over New England for the + past week. Thanks, guys! + . + * Added dh_debstd, which mimics the functionality of the debstd command. + It's not a complete nor an exact copy, and it's not so much intended to + be used in a debian/rules file, as it is to be run by hand when you are + converting a package from debstd to debhelper. "dh_debstd -v" will + output the sequence of debhelper commands that approximate what debstd + would do in the same situation. + * dh_debstd is completly untested, I don't have the source to any packages + that use debstd available. Once this is tested, I plan to release + debhelper 1.0! + * Added a from-debstd document that gives a recipe to convert from debstd + to debhelper. + * dh_fixperms: can now use -X to exclude files from having their + permissions changed. + * dh_testroot: test for uid == 0, instead of username == root, becuase + some people enjoy changing root's name. + * dh_installinit: handle debian/init.d as well as debian/init files, + for backwards compatability with debstd. Unlike with debstd, the two + files are treated identically. + * dh_lib, PROGRAMMING: added "warning" function. + * Minor man page fixes. + * dh_compress: don't bomb out if usr/doc/ is empty. (#23054) + * dh_compress, dh_installdirs: always cd into $TMP and back out, even if + --no-act is on. (#23054) + + -- Joey Hess Mon, 1 Jun 1998 21:57:45 -0400 + debhelper (0.88) unstable; urgency=low * I had many hours on a train to hack on debhelper... enjoy! @@ -66,7 +99,7 @@ debhelper (0.80) unstable; urgency=low Thanks to Bdale Garbee and Adam Heath for help on the implementation. * dh_installchangelogs: use debian/package.changelog files if they exist - rather than debian.changelog. It appears some people do need per-package + rather than debian/changelog. It appears some people do need per-package changelogs. * dh_gencontrol: if debian/package.changelogs files exist, use them. * Above 2 changes close #20442. diff --git a/debian/control b/debian/control index 4ec15b01..4d25b670 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.0 +Standards-Version: 2.4.1.1 Package: debhelper Architecture: all diff --git a/dh_compress.1 b/dh_compress.1 index 4f2d2d0a..c78291ee 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[-v] [-a] [-i] [-X] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" .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 @@ -50,7 +50,7 @@ Compress files for the package named "package". .B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-X=item, \--exclude=item +.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 diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 913a8c76..19f89d11 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -3,7 +3,7 @@ dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS .B dh_fixperms -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -33,6 +33,11 @@ Fix permissions for the package named "package". .TP .B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. +.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 NOTES The .B \-a diff --git a/dh_installdirs b/dh_installdirs index e733e7ce..725cdb2c 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -33,8 +33,11 @@ for PACKAGE in $DH_DOPACKAGES; do done # Create dirs. olddir=`pwd` - doit "cd $TMP" + verbose_echo "cd $TMP" + cd "$TMP" doit "install -d $dirs" - doit "cd $olddir" + verbose_echo "cd $olddir" + cd "$olddir" fi done + diff --git a/dh_installdocs b/dh_installdocs index 1b3a95cb..fcdedc50 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -29,21 +29,21 @@ for PACKAGE in $DH_DOPACKAGES; do doit "cp -a $docs $TMP/usr/doc/$PACKAGE/" fi - # Install these files only into the main package by default. - if [ "$PACKAGE" = "$MAINPACKAGE" ]; then - if [ -f debian/README.debian ]; then - # .Debian is correct according to policy. - doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/README.Debian" - fi - if [ -f debian/README.Debian ]; then - doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" - fi - if [ -f debian/TODO ]; then - if isnative; then - doit "install -m 655 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO" - else - doit "install -m 644 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO.Debian" - fi + # .Debian is correct, according to policy. + readme_debian=`pkgfile $PACKAGE README.Debian` + if [ -z "$readme_debian" ]; then + readme_debian=`pkgfile $PACKAGE README.debian` + fi + if [ "$readme_debian" ]; then + doit "install -m 644 -p $readme_debian $TMP/usr/doc/$PACKAGE/README.Debian" + fi + + todo=`pkgfile $PACKAGE TODO` + if [ "$todo" ]; then + if isnative; then + doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" + else + doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" fi fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 95d9df5a..98737606 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -19,12 +19,13 @@ package dh_installdocs is told to act on. By default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by those flags. .P -Also, debian/README.Debian (or debian/README.debian) and debian/TODO, if +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. +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. diff --git a/dh_installinit.1 b/dh_installinit.1 index 156867e5..99222bc4 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -12,7 +12,8 @@ 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 exists, then it is installed into +If a file named debian/package.init (or debian/package.init.d for backwards +compatability 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.) @@ -46,7 +47,7 @@ Do not restart daemon on upgrade. .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 named ending in "d". (Note: this takes precidence over +for daemons with names ending in "d". (Note: this takes precidence over the --init-script parameter described below.) .TP .B \-uparams, \--update-rcd-params=params diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index c39eb04c..bad72c4e 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V[dependancies]]" +.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-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. -- cgit v1.2.3 From aec37078c45ab2dc23bfb7bb9bde2c5d130d663f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:04 +0000 Subject: r102: Initial Import --- debian/changelog | 14 ++++++++++++++ dh_compress | 2 +- dh_fixperms | 6 +++--- dh_installdocs | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index cf103bd8..db56690c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.0) stable unstable; urgency=low + + * 1.0 at last! + + * This relelase is not really intended for stable. I throw a copy into + stable-updates because I want it to be available as an upgrade for + people using debian 2.0 (the current version in debian 2.0 has no + critical bugs, but this version is of course a lot nicer), and I plan + to start work on a new branch of debhelper that will fix many wishlist + bug reports, and of course introduce many new bugs, and which will go + into unstable only. + + -- Joey Hess Sat, 8 Aug 1998 17:33:20 -0700 + debhelper (0.99.4) unstable; urgency=low * dh_debstd: only warn about scripts that actually lack #DEBHELPER#. diff --git a/dh_compress b/dh_compress index 1b58f70a..7d6e4979 100755 --- a/dh_compress +++ b/dh_compress @@ -13,7 +13,7 @@ filelist () { if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - sh $olddir/$compress 2>/dev/null + sh $olddir/$compress 2>/dev/null || true else # By default fall back on what the policy manual says to compress. find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true diff --git a/dh_fixperms b/dh_fixperms index 544ee9be..0e845335 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -18,7 +18,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R u+rw $TMP" fi - FIND_OPTIONS= + FIND_OPTIONS="" else # Do it the hard way. complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ @@ -33,8 +33,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS -print0 \ - 2>/dev/null | xargs -0r chmod 644" + complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS ! -regex .\*/examples/.\* -print0 \ + 2>/dev/null | xargs -0r chmod 644" complex_doit "find $TMP/usr/doc -type d $FIND_OPTIONS -print0 \ 2>/dev/null | xargs -0r chmod 755" diff --git a/dh_installdocs b/dh_installdocs index fcdedc50..7a11b7f7 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -41,7 +41,7 @@ for PACKAGE in $DH_DOPACKAGES; do todo=`pkgfile $PACKAGE TODO` if [ "$todo" ]; then if isnative; then - doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" + doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO" else doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" fi -- cgit v1.2.3 From e348bcc96f206a25afc2ad1d4f004c74b7f8ab37 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:24 +0000 Subject: r104: Initial Import --- Dh_Getopt.pm | 148 ++++++++++++++++++++++++++ Dh_Lib.pm | 248 +++++++++++++++++++++++++++++++++++++++++++ autoscripts/postinst-emacsen | 1 + autoscripts/prerm-emacsen | 1 + debhelper.1 | 104 ++++++++++++++++++ debian/changelog | 14 +++ debian/control | 6 +- debian/cron.d | 0 debian/cron.daily | 0 debian/docs | 1 + debian/menu | 0 dh_builddeb.1 | 45 ++------ dh_clean.1 | 45 ++------ dh_compress | 2 +- dh_compress.1 | 45 ++------ dh_debstd.1 | 13 ++- dh_du.1 | 4 +- dh_fixperms | 6 +- dh_fixperms.1 | 45 ++------ dh_gencontrol.1 | 51 +++------ dh_getopt.pl | 22 +++- dh_installchangelogs.1 | 45 ++------ dh_installcron.1 | 47 ++------ dh_installdeb.1 | 45 ++------ dh_installdebfiles.1 | 8 +- dh_installdirs.1 | 49 +++------ dh_installdocs | 2 +- dh_installdocs.1 | 45 ++------ dh_installemacsen | 34 ++++++ dh_installemacsen.1 | 42 ++++++++ dh_installexamples.1 | 45 ++------ dh_installinit.1 | 45 ++------ dh_installmanpages.1 | 45 ++------ dh_installmenu.1 | 46 ++------ dh_makeshlibs.1 | 47 ++------ dh_md5sums.1 | 45 ++------ dh_movefiles.1 | 45 ++------ dh_shlibdeps.1 | 50 +++------ dh_strip.1 | 46 ++------ dh_suidregister.1 | 48 +++------ dh_testdir.1 | 19 ++-- dh_testroot.1 | 19 ++-- dh_testversion | 24 +++++ dh_testversion.1 | 29 ++--- dh_undocumented.1 | 45 ++------ doc/README | 64 +---------- doc/TODO | 63 ++++++++--- 47 files changed, 976 insertions(+), 867 deletions(-) create mode 100644 Dh_Getopt.pm create mode 100644 Dh_Lib.pm create mode 100644 autoscripts/postinst-emacsen create mode 100644 autoscripts/prerm-emacsen create mode 100644 debhelper.1 create mode 100644 debian/cron.d create mode 100644 debian/cron.daily create mode 100644 debian/docs create mode 100644 debian/menu create mode 100755 dh_installemacsen create mode 100644 dh_installemacsen.1 create mode 100755 dh_testversion (limited to 'dh_installdocs') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm new file mode 100644 index 00000000..eb6aef98 --- /dev/null +++ b/Dh_Getopt.pm @@ -0,0 +1,148 @@ +#!/usr/bin/perl -w +# +# Debhelper option processing library. +# +# Joey Hess GPL copyright 1998. + +package Dh_Getopt; +use strict; + +use Exporter; +my @ISA=qw(Exporter); +my @EXPORT=qw(&parseopts); + +use Dh_Lib; +use Getopt::Long; + +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; + } + 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; +} + +sub import { + # Enable bundling of short command line options. + Getopt::Long::config("bundling"); +} + +# 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, + + "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}, + + "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}, + + "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}, + ); + + 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; + } + + # Check to see if DH_VERBOSE environment variable was set, if so, + # make sure verbose is on. + if ($ENV{DH_VERBOSE} ne undef) { + $options{VERBOSE}=1; + } + + # Check to see if DH_NO_ACT environment variable was set, if so, + # make sure no act mode is on. + if ($ENV{DH_NO_ACT} ne undef) { + $options{NO_ACT}=1; + } + + # 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; + + return %options; +} + +1 diff --git a/Dh_Lib.pm b/Dh_Lib.pm new file mode 100644 index 00000000..c9b964c1 --- /dev/null +++ b/Dh_Lib.pm @@ -0,0 +1,248 @@ +#!/usr/bin/perl -w +# +# Library functions for debhelper programs, perl version. +# +# Joey Hess, GPL copyright 1997, 1998. + +package Dh_Lib; + +use Exporter; +use vars qw(%dh); +@ISA=qw(Exporter); +@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir + &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages + %dh); + +sub init { + # 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; + foreach $arg (@ARGV) { + if ($arg=~m/^-/) { + $parseopt=1; + last; + } + } + if ($parseopt) { + eval "use Dh_Getopt"; + error($!) if $@; + %dh=Dh_Getopt::parseopts(); + } + + # 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 (! @{$dh{DOPACKAGES}}) { + if ($dh{DH_DOINDEP} || $dh{DH_DOARCH}) { + error("I have no package to build."); + } + 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."); + } + + # 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]; +} + +# 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(" ",,@_)); + + if (! $dh{NO_ACT}) { + system(@_) == 0 + || error("command returned error code"); + + } +} + +# This is an identical command to doit, except the parameters passed to it +# can include complex shell stull like redirection and compound commands. +sub complex_doit { + error("complex_doit() not yet supported"); +} + +# 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; + my $fn=$0; + $fn=~s:.*/(.*?):$1:; + print STDERR "$fn: $message\n"; +} + +# Pass it a name of a binary package, it returns the name of the tmp dir to +# use, for that package. +# This is for back-compatability with the debian/tmp tradition. +sub tmpdir { my $package=shift; + if ($dh{TMPDIR}) { + return $dh{TMPDIR}; + } + elsif ($package eq $dh{MAINPACKAGE}) { + 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 (-e "debian/$package.$filename") { + return "debian/$package.$filename"; + } + elsif ($package eq $dh{MAINPACKAGE} && -e "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 $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 ($isnative_cache eq undef) { + # 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=~s/[^|\n]Version: \(.*\)\n//m; + + # Is this a native Debian package? + if ($dh{VERSION}=~m/.*-/) { + $isnative_cache=1; + } + else { + $isnative_cache=0; + } + } + + return $isnative_cache; + } +} + +# Automatically add a shell script snippet to a debian script. +# Only works if the script has #DEBHELPER# in it. +# +# Parameters: +# 1: script to add to +# 2: filename of snippet +# 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ +sub autoscript { + error "autoscript() not yet implemented (lazy, lazy!)"; +# autoscript_script=$1 +# autoscript_filename=$2 +# autoscript_sed=$3 +# autoscript_debscript=debian/`pkgext $PACKAGE`$autoscript_script.debhelper +# +# if [ -e "$DH_AUTOSCRIPTDIR/$autoscript_filename" ]; then +# autoscript_filename="$DH_AUTOSCRIPTDIR/$autoscript_filename" +# else +# if [ -e "/usr/lib/debhelper/autoscripts/$autoscript_filename" ]; then +# autoscript_filename="/usr/lib/debhelper/autoscripts/$autoscript_filename" +# else +# error "/usr/lib/debhelper/autoscripts/$autoscript_filename does not exist" +# fi +# fi +# +# complex_doit "echo \"# Automatically added by `basename $0`\" >> $autoscript_debscript" +# complex_doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" +# complex_doit "echo '# End automatically added section' >> $autoscript_debscript" +} + +# Reads in the specified file, one word at a time, and returns an array of +# the result. +sub filearray { $file=shift; + my @ret; + open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); + while () { + push @ret,split(/\s/,$_); + } + close DH_ARRAY; + + return @ret; +} + +# Returns a list of packages in the control file. +# Must pass "arch" or "indep" to specify arch-dependant or -independant +# packages. If nothing is specified, returns all packages. +sub GetPackages { $type=shift; + my $package; + my $arch; + my @list; + open (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)) { + push @list, $package; + undef $package; + undef $arch; + } + } + } + close CONTROL; + + return @list; +} + +1 diff --git a/autoscripts/postinst-emacsen b/autoscripts/postinst-emacsen new file mode 100644 index 00000000..45f1deec --- /dev/null +++ b/autoscripts/postinst-emacsen @@ -0,0 +1 @@ +/usr/lib/emacsen-common/emacs-package-install #PACKAGE# diff --git a/autoscripts/prerm-emacsen b/autoscripts/prerm-emacsen new file mode 100644 index 00000000..d11dafab --- /dev/null +++ b/autoscripts/prerm-emacsen @@ -0,0 +1 @@ +/usr/lib/emacsen-common/emacs-package-remove #PACKAGE# diff --git a/debhelper.1 b/debhelper.1 new file mode 100644 index 00000000..f3296666 --- /dev/null +++ b/debhelper.1 @@ -0,0 +1,104 @@ +.TH DEBHELPER 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +debhelper \- overview of the debhelper commands +.SH SYNOPSIS +.B dh_* +.I "[-v] [-a] [-i] [--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" +.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 \-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 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 +, and +.B -p +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/ for each +additional 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/tmp/DEBIAN/ +before trying to put files there, dh_installmenu knows you need a +debian/tmp/usr/lib/menu/ before installing the menu files, etc. +.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/README +An introduction to debhelper. +.TP +.BR /usr/doc/debhelper/examples/ +A set of example debian/rules files that use debhelper. +.SH AUTHOR +Joey Hess diff --git a/debian/changelog b/debian/changelog index db56690c..10b81798 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.0.1) unstable; urgency=low + + * Backported bug fixes from the 1.1 tree: + * dh_installdocs: used -m 655 for a TODO file. (minor, dh_fixperms cleans + up after it) + * dh_fixperms: had a problem with removing x bits on examples files + * dh_compress: since version 0.88 or so, dh_compress has bombed out if + a debian/compress file returned an error code. This was actually + unintentional - in fact, the debian/compress example in the man page + will fail this way if usr/info or usr/X11R6 is not present. Corrected + the program to not fail. (#26214) + + -- Joey Hess Sun, 30 Aug 1998 22:21:26 -0700 + debhelper (1.0) stable unstable; urgency=low * 1.0 at last! diff --git a/debian/control b/debian/control index c4dccd95..0a97ae80 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,6 @@ Architecture: all Depends: perl (>= 5.004), fileutils (>= 3.16-4), file Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to - automate common tasks. Programs are included to install various files into - your package, compress files, fix file permissions, integrate your package - with the debian menu system, etc. + 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, etc. diff --git a/debian/cron.d b/debian/cron.d new file mode 100644 index 00000000..e69de29b diff --git a/debian/cron.daily b/debian/cron.daily new file mode 100644 index 00000000..e69de29b diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ + diff --git a/debian/menu b/debian/menu new file mode 100644 index 00000000..e69de29b diff --git a/dh_builddeb.1 b/dh_builddeb.1 index ecbbfa6c..cf492b4c 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -1,49 +1,24 @@ -.TH DH_BUILDDEB 1 +.TH DH_BUILDDEB 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) to build a .deb package or packages. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory, etc. -.TP -.B \-a, \--arch -Build all architecture dependent packages. -.TP -.B \-i, \--indep -Build all architecture independent packages. -.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. -.TP -.B -ppackage, \--package=package -Build the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be built. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_clean.1 b/dh_clean.1 index cb437e9c..333fa174 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -1,9 +1,9 @@ -.TH DH_CLEAN 1 +.TH DH_CLEAN 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[-v] [-a] [-i] [-k] [--no-act] [-ppackage] [-Ptmpdir] [file ...]" +.I "[debhelper options] [-k] [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 @@ -11,24 +11,10 @@ other files, such as debian/substvars, debian/files, DEADJOE, emacs backup files, etc. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Clean up the package build directory for all architecture dependent packages. -.TP -.B \-i, \--indep -Clean up the package build directory for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Clean up the package build directory for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -41,23 +27,12 @@ was built. .TP .B file ... Delete these files too. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their package build directories cleaned up. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them will not currently be deleted when specified as parameters. diff --git a/dh_compress b/dh_compress index 7d6e4979..1b58f70a 100755 --- a/dh_compress +++ b/dh_compress @@ -13,7 +13,7 @@ filelist () { if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - sh $olddir/$compress 2>/dev/null || true + sh $olddir/$compress 2>/dev/null else # By default fall back on what the policy manual says to compress. find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true diff --git a/dh_compress.1 b/dh_compress.1 index c78291ee..ec0def52 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -1,9 +1,9 @@ -.TH DH_COMPRESS 1 +.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 "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options] [-Xitem]" .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 @@ -31,24 +31,10 @@ customization of what files are compressed: ! -name "copyright" .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Compress files for all architecture dependent packages. -.TP -.B \-i, \--indep -Compress files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Compress files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -57,27 +43,16 @@ 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. .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their files compressed. -.P 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 -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them may not properly be compressed. .SH "CONFORMS TO" diff --git a/dh_debstd.1 b/dh_debstd.1 index e3568eb6..e47e64aa 100644 --- a/dh_debstd.1 +++ b/dh_debstd.1 @@ -5,7 +5,7 @@ dh_debstd \- mimic debstd with debhelper commands .B dh_debstd .I "[-v] [--no-act] [-m] [-c] [-u] [-s] [[changelog] file ...]" .SH "DESCRIPTION" -dh_debstd is a debhelper command that mimics the behavior of debstd, by +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 @@ -59,14 +59,17 @@ generated if dh_debstd notices scripts without "#DEBHELPER#" in them. Enables verbose mode .TP .I DH_NO_ACT -Enables no-act mode (see above). +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. With the exception of buildinfo.Debian files, everything that -is not supported will generate a warning message. +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_du.1 b/dh_du.1 index 9497a61d..670e371d 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -1,4 +1,4 @@ -.TH DH_DU 1 +.TH DH_DU 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_du \- generate DEBIAN/du file .SH SYNOPSIS @@ -11,6 +11,6 @@ This program is now depricated, 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 /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_fixperms b/dh_fixperms index 0e845335..544ee9be 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -18,7 +18,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R u+rw $TMP" fi - FIND_OPTIONS="" + FIND_OPTIONS= else # Do it the hard way. complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ @@ -33,8 +33,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS ! -regex .\*/examples/.\* -print0 \ - 2>/dev/null | xargs -0r chmod 644" + complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS -print0 \ + 2>/dev/null | xargs -0r chmod 644" complex_doit "find $TMP/usr/doc -type d $FIND_OPTIONS -print0 \ 2>/dev/null | xargs -0r chmod 755" diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 19f89d11..fd304c70 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -1,9 +1,9 @@ -.TH DH_FIXPERMS 1 +.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 "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options] [-Xitem]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -15,46 +15,21 @@ root, and it removes group and other write permission from all files. Finally, it removes execute permissions from any libraries that have it set. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Fix permissions for all architecture dependent packages. -.TP -.B \-i, \--indep -Fix permissions for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Fix permissions for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their permissions fixed. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.1 .SH AUTHOR diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index b0cc783c..2bfade49 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -1,57 +1,34 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_GENCONTROL 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_gencontrol \- generate and install control file .SH SYNOPSIS .B dh_gencontrol -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-uparams]" +.I "[debhelper options] [-uparams]" .SH "DESCRIPTION" -dh_gencontrol is a debhelper program that is responsible for generating and -installing control files, and installing them into the DEBIAN directory with -the proper permissions. +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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-uparams, \--update-rcd-params=params Pass "params" to .BR dpkg-gencontrol (1) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 diff --git a/dh_getopt.pl b/dh_getopt.pl index b7a856c4..f1aa7cec 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -58,6 +58,11 @@ sub AddPackage { my($option,$value)=@_; } } +# 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 @exclude,$value; @@ -80,7 +85,10 @@ $ret=GetOptions( "arch" => \&AddPackage, "p=s" => \&AddPackage, - "package=s" => \&AddPackage, + "package=s" => \&AddPackage, + + "N=s" => \&ExcludePackage, + "no-package=s" => \&ExcludePackage, "n" => \$noscripts, "noscripts" => \$noscripts, @@ -105,7 +113,7 @@ $ret=GetOptions( "u=s", => \$u_params, "update-rcd-params=s", => \$u_params, - "dpkg-shlibdeps-params=s", => \$u_params, + "dpkg-shlibdeps-params=s", => \$u_params, "m=s", => \$major, "major=s" => \$major, @@ -149,12 +157,20 @@ foreach (@exclude) { } $exclude_find=~s/ -or $//; +# Remove excluded packages from the list of packages to act on. +undef @package_list; +foreach $package (@packages) { + if (! $exclude_package{$package}) { + push @package_list, $package; + } +} + # Now output everything, in a format suitable for a shell to eval it. # Note the last line sets $@ in the shell to whatever arguements remain. print qq{ DH_VERBOSE='$verbose' DH_NO_ACT='$no_act' -DH_DOPACKAGES='@packages' +DH_DOPACKAGES='@package_list' DH_DOINDEP='$indep' DH_DOARCH='$arch' DH_NOSCRIPTS='$noscripts' diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 84fb6b46..70822338 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLCHANGELOGS 1 +.TH DH_INSTALLCHANGELOGS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installchangelogs \- install changelogs into package build directories .SH SYNOPSIS .B dh_installchangelogs -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [upstream]" +.I "[debhelper options] [upstream]" .SH "DESCRIPTION" dh_installchangelogs is a debhelper program that is responsible for installing changelogs into package build directories. @@ -20,47 +20,22 @@ not a native debian package, then this upstream changelog will be installed as usr/doc/package/changelog in the package build directory. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install changelogs for all architecture dependent packages. -.TP -.B \-i, \--indep -Install changelogs for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install changelogs for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B upstream Instal this file as the upstream changelog. .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have the changelogs installed into them. -.P It is an error to specify an upstream changelog file for a debian native package. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_installcron.1 b/dh_installcron.1 index 20bdc82f..adda0711 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -1,12 +1,12 @@ -.TH DH_INSTALLCRON 1 +.TH DH_INSTALLCRON 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installcron \- install cron scripts into etc/cron.* .SH SYNOPSIS .B dh_installcron -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.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 +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 @@ -14,41 +14,16 @@ debian/package.cron.daily, where "package" is replaced with the name of the binary package this cron script goes into. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install cron files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install cron files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install cron files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_installdeb.1 b/dh_installdeb.1 index fc7b8dee..03fa1068 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_INSTALLDEB 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdeb \- install files into the DEBIAN directory .SH SYNOPSIS .B dh_installdeb -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.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 @@ -34,41 +34,16 @@ programs, such as , and are shell script fragments. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index cf1580d0..ae4782d2 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_INSTALLDEBFILES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS @@ -21,9 +21,13 @@ This program will be removed at some time in the furture. Any options passed to this program will be sent to each of the 3 programs listed above. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.TP +.BR debhelper (1) +.TP .BR dh_installdeb (1) +.TP .BR dh_shlibdeps (1) +.TP .BR dh_gencontrol (1) .SH AUTHOR Joey Hess diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 8ae440c6..77c992d9 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDIRS 1 +.TH DH_INSTALLDIRS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdirs \- create subdirectories in package build directories .SH SYNOPSIS .B dh_installdirs -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [dir ...]" +.I "[debhelper options] [-A] [dir ...]" .SH "DESCRIPTION" dh_installdirs is a debhelper program that is responsible for creating subdirectories in package build directories. @@ -21,50 +21,25 @@ 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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Create directories for all architecture dependent packages. -.TP -.B \-i, \--indep -Create directories for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Create directories for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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. +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 NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS -Directories with spaces in them will not currently be installed. +Directories with spaces in them will not currently be installed properly. .SH AUTHOR Joey Hess diff --git a/dh_installdocs b/dh_installdocs index 7a11b7f7..fcdedc50 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -41,7 +41,7 @@ for PACKAGE in $DH_DOPACKAGES; do todo=`pkgfile $PACKAGE TODO` if [ "$todo" ]; then if isnative; then - doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO" + doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" else doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 98737606..ffae1623 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_INSTALLDOCS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[debhelper options] [-A] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -31,24 +31,10 @@ 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. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -58,26 +44,15 @@ acted on. Install these files as documentation into the first package acted on. (Or in all packages if -A is specified). .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.P 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 -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them will not currently be installed. .SH "CONFORMS TO" diff --git a/dh_installemacsen b/dh_installemacsen new file mode 100755 index 00000000..e87cecef --- /dev/null +++ b/dh_installemacsen @@ -0,0 +1,34 @@ +#!/bin/sh -e +# +# Registration with emacsen-common. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + emacsen_install=`pkgfile $PACKAGE emacsen-install` + emacsen_remove=`pkgfile $PACKAGE emacsen-remove` + + if [ "$emacsen_install" ]; then + if [ ! -d "$TMP/usr/lib/emacsen-common/packages/install" ]; then + doit "install -d $TMP/usr/lib/emacsen-common/packages/install" + fi + doit "install $emacsen_install $TMP/usr/lib/emacsen-common/packages/install/$PACKAGE" + fi + + if [ "$emacsen_remove" ]; then + if [ ! -d "$TMP/usr/lib/emacsen-common/packages/remove" ]; then + doit "install -d $TMP/usr/lib/emacsen-common/packages/remove" + fi + doit "install $emacsen_remove $TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE" + fi + + if [ "$emacsen_install" -o "$emacsen_remove" ]; then + if [ ! "$DH_NOSCRIPTS" ]; then + autoscript "postinst" "postinst-emacsen" + autoscript "prerm" "prerm-emacsen" + fi + fi +done diff --git a/dh_installemacsen.1 b/dh_installemacsen.1 new file mode 100644 index 00000000..15ec575a --- /dev/null +++ b/dh_installemacsen.1 @@ -0,0 +1,42 @@ +.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]" +.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 +.P +For the first first binary package listed in the control file, you may use +debian/emacsen-install and debian/emacsen-remove 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. +.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 diff --git a/dh_installexamples.1 b/dh_installexamples.1 index be0b4cc3..776aef79 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLEXAMPLES 1 +.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 "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.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. @@ -17,24 +17,10 @@ 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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -44,26 +30,15 @@ acted on. Install these files as examples into the first package acted on. (Or into all packages if -A is specified.) .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.P 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 -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them will not currently be installed. .SH "CONFORMS TO" diff --git a/dh_installinit.1 b/dh_installinit.1 index 99222bc4..f76ec917 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLINIT 1 +.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 "[-v] [-a] [-i] [--no-act] [--init-script=scriptname] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" +.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. @@ -19,24 +19,10 @@ by the packagename. (You may use debian/init for the first binary package listed in the control file.) .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install init scripts into all architecture dependent packages. -.TP -.B \-i, \--indep -Install init scripts into all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install init scripts into the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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. @@ -60,22 +46,11 @@ If not specified, "default" will be passed to 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. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index 7053dbc6..edc37c21 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLMANPAGES 1 +.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 "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [file ...]" +.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 @@ -24,50 +24,25 @@ 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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install man pages into all architecture dependent packages. -.TP -.B \-i, \--indep -Install man pages into all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install man pages into the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.P 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 -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Man pages with the extension .B .man diff --git a/dh_installmenu.1 b/dh_installmenu.1 index 7147b49f..d9d8296a 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLMENU 1 +.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 "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-n]" +.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. @@ -25,45 +25,21 @@ 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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install menu files into all architecture dependent packages. -.TP -.B \-i, \--indep -Install menu files into all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install menu files into the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README -, .BR menufile (5) .SH AUTHOR Joey Hess diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index bad72c4e..282d54fe 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -1,9 +1,9 @@ -.TH DH_MAKESHLIBS 1 +.TH DH_MAKESHLIBS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-V[dependancies]]" +.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. @@ -12,24 +12,10 @@ 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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Generate shlibs files for all architecture dependent packages. -.TP -.B \-i, \--indep -Generate shlibs files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Generate shlibs file for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -56,26 +42,15 @@ 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)" +.B dh_makeshlibs \-V "'libfoobar1 (>= 1.0)'" Generates a shlibs file that looks something like: libfoobar 1 libfoobar1 (>= 1.0) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.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 diff --git a/dh_md5sums.1 b/dh_md5sums.1 index f432fed2..22b4fe28 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -1,9 +1,9 @@ -.TH DH_MD5SUMS 1 +.TH DH_MD5SUMS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-x] [-v] [-a] [-i] [--no-act] [-Ptmpdir] [-ppackage]" +.I "[debhelper options] [-x]" .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. @@ -14,44 +14,19 @@ All files in DEBIAN/ are omitted from the md5sums file, as are all conffiles The md5sums file is installed with proper permissions and ownerships. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Generate md5sums files for all architecture dependent packages. -.TP -.B \-i, \--indep -Generate md5sums files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Generate md5sums file for the package named "package". +.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 is redundant, and included elsewhere in debian packages. -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 1c27f968..260d5069 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -1,9 +1,9 @@ -.TH DH_MOVEFILES 1 +.TH DH_MOVEFILES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_movefiles \- moves files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [file ..]" +.I "[debhelper options] [file ..]" .SH "DESCRIPTION" dh_movefiles is a debhelper program that is responsible for moving files out of debian/tmp and into other package build directories. This may be useful @@ -22,46 +22,21 @@ symlinks. This is done becuase it tends to be a good thing to have symlinks last in debian packages, particularly in shared library packages. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Move files for all architecture dependent packages. -.TP -.B \-i, \--indep -Move files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Move files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .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 NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 index b976f8c9..f9f6f3e4 100644 --- a/dh_shlibdeps.1 +++ b/dh_shlibdeps.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_SHLIBDEPS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_shlibdeps \- calculate shared library dependancies .SH SYNOPSIS .B dh_shlibdeps -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-uparams]" +.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 @@ -11,51 +11,25 @@ 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. You may -prefer to simply run -.BR dpkg-shlibdeps (1) -by hand. +that calls it once for each package listed in the control file. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 diff --git a/dh_strip.1 b/dh_strip.1 index 9ae97c60..960dc72e 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -1,9 +1,9 @@ -.TH DH_STRIP 1 +.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 "[-v] [-a] [-i] [--no-act] [-Ptmpdir] [-ppackage]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_strip is a debhelper program that is responsible for stripping executables, shared libraries, and static libraries that are not used for @@ -13,42 +13,16 @@ 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 \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Strip files in all architecture dependent packages. -.TP -.B \-i, \--indep -Strip files in all architecture independent packages (likely, this is -pointless :-). -.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. -.TP -.B \-ppackage, \--package=package -Strip files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their files stripped. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_suidregister.1 b/dh_suidregister.1 index 57694956..edce61d0 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -1,9 +1,9 @@ -.TH DH_SUIDREGISTER 1 +.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 "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.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 @@ -23,29 +23,15 @@ 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 package modifies your postinst and postrm files. See +Note that this program modifies your postinst and postrm files. See .BR dh_installdeb (1) for an explanation of how this works. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Register files for all architecture dependent packages. -.TP -.B \-i, \--indep -Register files for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Register files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -55,24 +41,14 @@ with other debhelper programs. .B file ... Register these files in the first package acted on. (Or in all packages if -A is specified.) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README -, .BR suidregister (8) .SH AUTHOR Joey Hess diff --git a/dh_testdir.1 b/dh_testdir.1 index 17561acc..309a7d94 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -1,9 +1,9 @@ -.TH DH_TESTDIR 1 +.TH DH_TESTDIR 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_testdir \- test directory before building debian package .SH SYNOPSIS .B dh_testdir -.I "[-v] [file ...]" +.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 @@ -11,18 +11,19 @@ exists, as well as any other files you specify. If not, it exits with an error. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -This currently has no effect. +.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 -.TP -.I DH_VERBOSE -Enables verbose mode +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Files with spaces in their names will not be processed correctly. .SH AUTHOR diff --git a/dh_testroot.1 b/dh_testroot.1 index 605dae4c..6fcdf4f2 100644 --- a/dh_testroot.1 +++ b/dh_testroot.1 @@ -1,9 +1,9 @@ -.TH DH_TESTROOT 1 +.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 "[-v]" +.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 @@ -11,14 +11,15 @@ error. Debian packages must be built as root, though you can use to work around this. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -This currently has no effect. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode. +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_testversion b/dh_testversion new file mode 100755 index 00000000..57c0e588 --- /dev/null +++ b/dh_testversion @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w +# +# Debhelper version check. + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +use Dh_Version; # contains the version number of debhelper. +init(); + +my($compare, $ver); + +if ($#ARGV > 0) { + $compare=shift; + $ver=shift; +} +elsif ($#ARGV eq 0) { + $compare=">="; + $ver=shift; +} + +if (defined $compare and defined $ver) { + system('dpkg','--compare-versions',$Dh_Version::version,$compare,$ver) == 0 || + error("debhelper version $Dh_Version::version is installed, but a version $compare $ver is needed to build this package."); +} diff --git a/dh_testversion.1 b/dh_testversion.1 index 5fb7332b..19ded263 100644 --- a/dh_testversion.1 +++ b/dh_testversion.1 @@ -1,8 +1,8 @@ -.TH DH_TESTROOT 1 +.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 [operator] [version] +.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. @@ -18,6 +18,11 @@ 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 @@ -28,19 +33,19 @@ Version number to compare against the current version of debhelper. If not specified, dh_testversion does nothing. .SH EXAMPLES .TP -.I dh_testversion 0.50 -Make sure debhelper version 0.50 or higher is installed. +.I dh_testversion 1.0 +Make sure debhelper version 1.0 or higher is installed. .TP -.I dh_testversion ge 0.50 -Another way to make sure debhelper version 0.50 or higher is installed. +.I dh_testversion ge 1.0 +Another way to make sure debhelper version 1.0 or higher is installed. .TP -.I dh_testversion le 0.50 -Make sure a version of debhelper less than version 0.50 is installed. +.I dh_testversion lt 1.0 +Make sure a version of debhelper less than version 1.0 is installed. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode. +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 69d2150a..25654ed5 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -1,9 +1,9 @@ -.TH DH_UNDOCUMENTED 1 +.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 "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [manpage ...]" +.I "[debhelper options [-A] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -32,24 +32,11 @@ the first binary package in debian/control) can list other man page names to set up. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. .TP -.B \-a, \--arch -Install undocumented man page symlinks for all architecture dependent packages. -.TP -.B \-i, \--indep -Install undocumented man page symlinks for all architecture independent packages. -.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. -.TP -.B \-ppackage, \--package=package -Install undocumented man page symlinks for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.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 @@ -60,24 +47,14 @@ this useful, it's here for consitency with other debhelper programs. 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 NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README -, .BR undocumented (7) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 diff --git a/doc/README b/doc/README index 986eb02c..845f94ef 100644 --- a/doc/README +++ b/doc/README @@ -1,6 +1,7 @@ Debhelper is a collection of programs that can be used in debian/rules files -to automate common tasks. For further documentation, see the man pages for -dh_* commands. +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 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/ . @@ -34,67 +35,10 @@ 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: +do that (note the tricky use of backquotes): print << `EOF` #DEBHELPER# EOF - -Notes on multiple binary packages: ---------------------------------- - -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 -following parameters: - --a Act on architecture dependent packages --i Act on architecture independent packages --ppackage Act on the package named "package" (may be repeated multiple - times) - -These parameters are cumulative. If none are given, the tools default to -affecting all packages. - -See examples/rules.multi for an example of how to use this. - -Package build directories -- debian/tmp, etc: --------------------------------------------- - -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/ for each -additional package. - -Sometimes, you might want to use some other temporary directory. This is -supported by the -P flag. The directory to use is specified after -P, 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. For example: - - dh_installdocs -pfoolib1 -Pdebian/tmp-foolib1 - dh_installdocs -pfoolib1-dev -Pdebian/tmp-foolib1-dev - dh_installdocs -pfoolib-bin -Pdebian/tmp-foolib-bin - -This uses debian/tmp- as the package build directory. - -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/tmp/DEBIAN/ - before trying to put files there, dh_installmenu knows you need a - debian/tmp/usr/lib/menu/ before installing the menu files, etc. - -- Joey Hess diff --git a/doc/TODO b/doc/TODO index 188e3c6c..dbfc2771 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,19 +1,29 @@ -* add all other functionality of debstd (??) - - add a program to generate file similar to buildinfo.Debian generated by - debmake (wishlist bug #17043). I just never saw the point of that file.. - - Make dh_movefiles remove emptied directories after it's moved all the - files out of them (wishlist bug #17111). -* 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 fragements wouldn't go into the postinst. So maybe a - new script is called for. +This is the TODO for debhelper. As more and more people use debhelper, this +list grows - I welcome patches to fix items on it! + +Bugs: + +* dh_movefiles bombs if the argument is a wildcard pattern that matches + nothing (reported by Drow). +* dh_installdocs fails if debian/docs is empty except for a blank line. + There are probably other instances of this. Debhelper should behave better + (#24686). +* all commands should print a warning message if non-cumulative parameters + are given more than once (ie, two -u's to dh_gencontrol). + +Wishlist items: + +* Add option to dh_compress to allow addition of files to compress besides + the default ones. +* Add emacsen support to debhelper. (#21401) +* 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.) (wishlist bug #15717) + 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. + 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. @@ -24,3 +34,32 @@ 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 fragements wouldn't go into the postinst. So maybe a + new script is called for. +* docbase support (#25233). Waiting for docbase to stabalize and be used + widly. +* Support /etc/X11/window-managers, by making it easy for window managers to + add themselves to it in the postinst. Not high priority because there are + few window managers. (#20971) +* 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 definied + substitutions. (#25235) + +Depricated: + +* remove dh_installdebfiles, dh_du. + - need to wait a reasonable length of time. I'm currently planning + on doing this after slink is released. -- cgit v1.2.3 From 8c9a7b69225a5dc4b97d03df01bd9f594a2870a1 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:47 +0000 Subject: r108: Initial Import --- debian/changelog | 10 +++ debian/rules | 7 +- dh_getopt.pl | 207 +++++++------------------------------------------------ dh_installdocs | 105 ++++++++++++++-------------- dh_installdocs.1 | 3 +- dh_lib | 36 ---------- doc/TODO | 19 ++--- 7 files changed, 97 insertions(+), 290 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 63e04237..9d4a6a4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.1.2) unstable; urgency=low + + * dh_strip: added -X to specify files to not strip (#25590). + * Added dh_installemacsen, for automatic registration with emacsen-common + (#21401). + * Preliminary thoughts in TODO about converting entire debhelper programs + to perl programs. + + -- Joey Hess Mon, 10 Aug 1998 13:35:17 -0700 + debhelper (1.1.1) unstable; urgency=low * dh_movefiles: try to move all files specified, and only then bomb out if diff --git a/debian/rules b/debian/rules index b2ea0bd0..8572498b 100755 --- a/debian/rules +++ b/debian/rules @@ -16,11 +16,6 @@ export DH_VERBOSE=1 test_files=dh_lib build: - # Important symlinks. - cd autoscripts && ln -sf postinst-menu postrm-menu - cd debian && ln -sf ../dh_lib dh_lib - cd debian && ln -sf ../dh_getopt.pl dh_getopt.pl - ./dh_testdir $(test_files) sed "s/#DEBHELPER_VERSION#/$(VERSION)/" < dh_testversion.in \ > dh_testversion @@ -44,7 +39,7 @@ binary-indep: build find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; - cp -a dh_lib dh_getopt.pl debian/tmp/usr/lib/debhelper + cp -a dh_lib dh_getopt.pl *.pm debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd diff --git a/dh_getopt.pl b/dh_getopt.pl index 9b97089e..4abe9160 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -2,194 +2,39 @@ # # Because the getopt() program is so horribly broken, I wrote my own argument # processer that uses the find Getopt::Long module. This is used by all -# debhelper scripts. +# debhelper shell scripts. # # Joey Hess, GPL copyright 1998. -# Returns a list of packages in the control file. -# Must pass "arch" or "indep" to specify arch-dependant or -independant -# packages. -sub GetPackages { $type=shift; - my $package; - my $arch; - my @list; - open (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'))) { - push @list, $package; - undef $package, $arch; - } - } - } - close CONTROL; - - return @list; -} - -# 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 @packages, GetPackages('indep'); - $indep=1; - } - elsif ($option eq 'a' or $option eq 'arch') { - push @packages, GetPackages('arch'); - $arch=1; - } - elsif ($option eq 'p' or $option eq 'package') { - push @packages, $value; - } - else { - $parse_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; -} +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Getopt; -# Add another item to the exclude list. -sub AddExclude { my($option,$value)=@_; - push @exclude,$value; +# This is a tricky (and nasty) bit: override the error() function, which +# comes from Dh_Lib, with one of our own so we print out the list of errors +# to the shell, which can do what it wants with them. +sub Dh_Getopt::error { my $message=shift; + print "DH_PARSE_ERROR='$message'\n"; + exit 1; } -use Getopt::Long; - -# Enable bundling of short command line options. -Getopt::Long::config("bundling"); - # Parse options. -$ret=GetOptions( - "v" => \$verbose, - "verbose" => \$verbose, - - "i" => \&AddPackage, - "indep" => \&AddPackage, - - "a" => \&AddPackage, - "arch" => \&AddPackage, - - "p=s" => \&AddPackage, - "package=s" => \&AddPackage, - - "N=s" => \&ExcludePackage, - "no-package=s" => \&ExcludePackage, - - "n" => \$noscripts, - "noscripts" => \$noscripts, - - "x" => \$include, # is -x for some unknown historical reason.. - "include-conffiles" => \$include, - - "X=s" => \&AddExclude, - "exclude=s" => \&AddExclude, - - "d" => \$d_flag, - "remove-d" => \$d_flag, - - "r" => \$r_flag, - "no-restart-on-upgrade" => \$r_flag, - - "k" => \$k_flag, - "keep" => \$k_flag, - - "P=s" => \$tmpdir, - "tmpdir=s" => \$tmpdir, - - "u=s", => \$u_params, - "update-rcd-params=s", => \$u_params, - "dpkg-shlibdeps-params=s", => \$u_params, - - "m=s", => \$major, - "major=s" => \$major, - - "V:s", => \$version_info, - "version-info:s" => \$version_info, - - "A" => \$all, - "all" => \$all, - - "no-act" => \$no_act, - - "init-script=s" => \$init_script, -); - -if (!$ret) { - $parse_error="exiting with unknown option."; -} - -# Check to see if -V was specified. If so, but no parameters were passed, -# the variable will be defined but empty. -if (defined($version_info)) { - $version_info_set=1; -} - -# Check to see if DH_VERBOSE environment variable was set, if so, make sure -# verbose is on. -if ($ENV{DH_VERBOSE} ne undef) { - $verbose=1; -} - -# Check to see if DH_NO_ACT was set, if so, make sure no act mode is on. -if ($ENV{DH_NO_ACT} ne undef) { - $no_act=1; -} - -$exclude=join ' ', @exclude; -$exclude_grep=join '|', @exclude; -foreach (@exclude) { - $exclude_find.="-regex .*".quotemeta($_).".* -or "; -} -$exclude_find=~s/ -or $//; - -$include=join ' ', @include; - -# Remove excluded packages from the list of packages to act on. -undef @package_list; -foreach $package (@packages) { - if (! $exclude_package{$package}) { - push @package_list, $package; +%options=Dh_Getopt::parseopts(); + +# Change a few lists in %options into strings, +# generate some options that only need to be visible to the +# shell scripts so Dh_Getopt doesn't bother generating. +$options{DOPACKAGES}=join " ",@{$options{DOPACKAGES}}; +if ($#{$options{EXCLUDE}} > -1) { + $options{EXCLUDE_GREP}=join '|', @{$options{EXCLUDE}}; + foreach (@{$options{EXCLUDE}}) { + $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or "; } + $options{EXCLUDE_FIND}=~s/ -or $//; } +$options{EXCLUDE}=join " ",@{$options{EXCLUDE}}; + +# Now output everything, in a format suitable for a shell to eval it. +foreach (keys(%options)) { print "DH_$_='$options{$_}'\n" }; -# Now output everything, in a format suitable for a shell to eval it. -# Note the last line sets $@ in the shell to whatever arguements remain. -print qq{ -DH_VERBOSE='$verbose' -DH_NO_ACT='$no_act' -DH_DOPACKAGES='@package_list' -DH_DOINDEP='$indep' -DH_DOARCH='$arch' -DH_NOSCRIPTS='$noscripts' -DH_INCLUDE_CONFFILES='$include' -DH_EXCLUDE='$exclude' -DH_EXCLUDE_GREP='$exclude_grep' -DH_EXCLUDE_FIND='$exclude_find' -DH_D_FLAG='$d_flag' -DH_R_FLAG='$r_flag' -DH_K_FLAG='$k_flag' -DH_TMPDIR='$tmpdir' -DH_U_PARAMS='$u_params' -DH_M_PARAMS='$major' -DH_V_FLAG='$version_info' -DH_V_FLAG_SET='$version_info_set' -DH_PARAMS_ALL='$all' -DH_INIT_SCRIPT='$init_script' -DH_PARSE_ERROR='$parse_error' -set -- @ARGV -}; +# This sets $@ in the shell to whatever arguements remain. +print "set -- @ARGV\n" diff --git a/dh_installdocs b/dh_installdocs index fcdedc50..f4662431 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -1,60 +1,61 @@ -#!/bin/sh -e +#!/usr/bin/perl # # Reads debian/docs, installs all files listed there into /usr/doc/$PACKAGE # Also installs the debian/copyright and debian/README.debian and debian/TODO -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - file=`pkgfile $PACKAGE docs` - - if [ ! -d $TMP/usr/doc/$PACKAGE ]; then - doit "install -d $TMP/usr/doc/$PACKAGE" - fi - - docs="" - - if [ "$file" ]; then - docs=`tr "\n" " " < $file` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - docs="$* $docs" - fi - - if [ "$docs" ]; then - doit "cp -a $docs $TMP/usr/doc/$PACKAGE/" - fi - - # .Debian is correct, according to policy. - readme_debian=`pkgfile $PACKAGE README.Debian` - if [ -z "$readme_debian" ]; then - readme_debian=`pkgfile $PACKAGE README.debian` - fi - if [ "$readme_debian" ]; then - doit "install -m 644 -p $readme_debian $TMP/usr/doc/$PACKAGE/README.Debian" - fi - - todo=`pkgfile $PACKAGE TODO` - if [ "$todo" ]; then - if isnative; then - doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" - else - doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" - fi - fi +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"docs"); + + if ( ! -d "$TMP/usr/doc/$PACKAGE") { + doit("install","-d","$TMP/usr/doc/$PACKAGE"); + } + + undef @docs; + + if ($file) { + @docs=filearray($file); + } + + if (($PACKAGE = $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @docs, @ARGV; + } + + if (@docs) { + doit("cp","-a",@docs,"$TMP/usr/doc/$PACKAGE/"); + } + + # .Debian is correct, according to policy, but I'm easy. + $readme_debian=pkgfile($PACKAGE,'README.Debian'); + if (! $readme_debian) { + $readme_debian=pkgfile($PACKAGE,'README.debian'); + } + if ($readme_debian) { + doit("install","-m","644","-p","$readme_debian","$TMP/usr/doc/$PACKAGE/README.Debian"); + } + + $todo=pkgfile($PACKAGE,'TODO'); + if ($todo) { + if (isnative()) { + doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO"); + } + else { + doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO.Debian"); + } + } # 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" -a -e debian/copyright ]; then - copyright=debian/copyright - fi - if [ "$copyright" ]; then - doit "install -m 644 -p $copyright $TMP/usr/doc/$PACKAGE/copyright" - fi -done + $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"); + } +} diff --git a/dh_installdocs.1 b/dh_installdocs.1 index ffae1623..72f80ecd 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -54,7 +54,8 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH BUGS -Filenames with spaces in them will not currently be installed. +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.3.0.0 .SH AUTHOR diff --git a/dh_lib b/dh_lib index 7ebc8be1..41812b8f 100644 --- a/dh_lib +++ b/dh_lib @@ -134,42 +134,6 @@ autoscript() { complex_doit "echo '# End automatically added section' >> $autoscript_debscript" } -# Sets 2 global variables, INDEP_PACKAGES is all the arch-independant -# packages, ARCH_PACKAGES is the arch-dependant packages. -get_arch_indep_packages() { - INDEP_PACKAGES="" - ARCH_PACKAGES="" - - # First, get the list of all binary packages. - # Notice we want the list in reverse order, thus the tac. - PACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tac | tr "\n" " "` - # Remove trailing space. - PACKAGES=`expr "$PACKAGES" : '\(.*\) '` - # Loop on the list of architectures. - for ARCH in `grep ^Architecture: debian/control | cut -d " " -f 2` ; do - # Pull the last package off the list. - THISPKG=`expr "$PACKAGES" : '.* \(.*\)'` || true - if [ ! "$THISPKG" ]; then - THISPKG=$PACKAGES - fi - PACKAGES=`expr "$PACKAGES" : '\(.*\) .*'` || true - - if [ ! "$THISPKG" ]; then - error "debian/control invalid - too many Architecture lines or too few Package lines" - fi - - if [ "$ARCH" = "all" ]; then - INDEP_PACKAGES="$INDEP_PACKAGES $THISPKG" - else - ARCH_PACKAGES="$ARCH_PACKAGES $THISPKG" - fi - done - - if [ "$PACKAGES" ]; then - error "debian/control invalid - too many Architecure lines or too few Package lines" - fi -} - # Argument processing and global variable initialization is below. # Check to see if an argument on the command line starts with a dash. diff --git a/doc/TODO b/doc/TODO index 83f38659..e3042fbc 100644 --- a/doc/TODO +++ b/doc/TODO @@ -11,6 +11,7 @@ Bugs: Wishlist items: +* update PROGRAMMING to cover new perl interface. * 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, @@ -61,19 +62,9 @@ Depricated: Long term goals: -Convert selected and then selected debhelper commands (dh_installmanpages?) -to be perl programs, for speed, ease of maintainence, and 8-bit cleanness. -Tricky, because of the -v option -- they'd have to call external commands -like install and cp, and log such calls if verbose was on. Maybe something -like: +Convert selected debhelper commands (dh_installmanpages?) to be perl +programs, for speed, ease of maintainence, and 8-bit cleanness. -doit { - system @_; - if ($DH_VERBOSE) { - print join " ", @_; - } -} +Fixes to backport to 1.0 tree: -However, this will output commands that are incorrect if the filenames in -them contain spaces or other weird characters. Hmm, maybe such things should -just be escaped with \'s in the output? +* dh_installdocs used -m 655 for a TODO file. -- cgit v1.2.3 From 0a47c6cde2c9bca0f650b8731bb9fd11a7797f9e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:57 +0000 Subject: r109: Initial Import --- Dh_Getopt.pm | 34 +++++---------- Dh_Lib.pm | 119 ++++++++++++++++++++++++++++++++++------------------- debian/changelog | 15 +++++++ dh_getopt.pl | 25 ++++++++++- dh_installdocs | 4 +- dh_installexamples | 48 ++++++++++----------- dh_movefiles | 4 +- doc/TODO | 17 ++++---- 8 files changed, 163 insertions(+), 103 deletions(-) (limited to 'dh_installdocs') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index eb6aef98..85f0e15b 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -7,12 +7,12 @@ package Dh_Getopt; use strict; -use Exporter; -my @ISA=qw(Exporter); -my @EXPORT=qw(&parseopts); - 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); @@ -46,11 +46,6 @@ sub AddExclude { my($option,$value)=@_; push @{$options{EXCLUDE}},$value; } -sub import { - # Enable bundling of short command line options. - Getopt::Long::config("bundling"); -} - # Parse options and return a hash of the values. sub parseopts { undef %options; @@ -72,8 +67,8 @@ sub parseopts { "no-package=s" => \&ExcludePackage, "n" => \$options{NOSCRIPTS}, -# "noscripts" => \$options(NOSCRIPTS}, - + "noscripts" => \$options{NOSCRIPTS}, + "x" => \$options{INCLUDE_CONFFILES}, # is -x for some unknown historical reason.. "include-conffiles" => \$options{INCLUDE_CONFFILES}, @@ -120,18 +115,6 @@ sub parseopts { $options{V_FLAG_SET}=1; } - # Check to see if DH_VERBOSE environment variable was set, if so, - # make sure verbose is on. - if ($ENV{DH_VERBOSE} ne undef) { - $options{VERBOSE}=1; - } - - # Check to see if DH_NO_ACT environment variable was set, if so, - # make sure no act mode is on. - if ($ENV{DH_NO_ACT} ne undef) { - $options{NO_ACT}=1; - } - # Remove excluded packages from the list of packages to act on. my @package_list; my $package; @@ -145,4 +128,9 @@ sub parseopts { 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 index c9b964c1..c58d5c08 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -5,9 +5,10 @@ # Joey Hess, GPL copyright 1997, 1998. package Dh_Lib; +use strict; use Exporter; -use vars qw(%dh); +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 @@ -18,6 +19,7 @@ sub init { # 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; @@ -30,6 +32,18 @@ sub init { %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(); @@ -37,17 +51,19 @@ sub init { # Check if packages to build have been specified, if not, fall back to # the default, doing them all. - if (! @{$dh{DOPACKAGES}}) { - if ($dh{DH_DOINDEP} || $dh{DH_DOARCH}) { - error("I have no package to build."); + if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) { + if ($dh{DOINDEP} || $dh{DOARCH}) { + # 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 @{$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."); + 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. @@ -63,7 +79,7 @@ sub init { # Note that this cannot handle complex commands, especially anything # involving redirection. Use complex_doit instead. sub doit { - verbose_print(join(" ",,@_)); + verbose_print(join(" ",@_)); if (! $dh{NO_ACT}) { system(@_) == 0 @@ -72,10 +88,18 @@ sub doit { } } -# This is an identical command to doit, except the parameters passed to it -# can include complex shell stull like redirection and compound commands. +# 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 { - error("complex_doit() not yet supported"); + 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"); + } } # Print something if the verbose flag is on. @@ -93,9 +117,14 @@ sub error { my $message=shift; # Output a warning. sub warning { my $message=shift; + print STDERR basename().": $message\n"; +} + +# Returns the basename of the program. +sub basename { my $fn=$0; $fn=~s:.*/(.*?):$1:; - print STDERR "$fn: $message\n"; + return $fn; } # Pass it a name of a binary package, it returns the name of the tmp dir to @@ -132,7 +161,7 @@ sub pkgfile { my $package=shift; my $filename=shift; # 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 $MAINPACKAGE) { + if ($package ne $dh{MAINPACKAGE}) { return "$package."; } return ""; @@ -173,40 +202,45 @@ sub pkgext { my $package=shift; # Only works if the script has #DEBHELPER# in it. # # Parameters: -# 1: script to add to -# 2: filename of snippet -# 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ -sub autoscript { +# 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; error "autoscript() not yet implemented (lazy, lazy!)"; -# autoscript_script=$1 -# autoscript_filename=$2 -# autoscript_sed=$3 -# autoscript_debscript=debian/`pkgext $PACKAGE`$autoscript_script.debhelper -# -# if [ -e "$DH_AUTOSCRIPTDIR/$autoscript_filename" ]; then -# autoscript_filename="$DH_AUTOSCRIPTDIR/$autoscript_filename" -# else -# if [ -e "/usr/lib/debhelper/autoscripts/$autoscript_filename" ]; then -# autoscript_filename="/usr/lib/debhelper/autoscripts/$autoscript_filename" -# else -# error "/usr/lib/debhelper/autoscripts/$autoscript_filename does not exist" -# fi -# fi -# -# complex_doit "echo \"# Automatically added by `basename $0`\" >> $autoscript_debscript" -# complex_doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" -# complex_doit "echo '# End automatically added section' >> $autoscript_debscript" + + # 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 ( -e "$main::ENV{DH_AUTOSCRIPTDIR}/$filename" ) { + $infile="$main::ENV{DH_AUTOSCRIPTDIR}/$filename"; + } + else { + if ( -e "/usr/lib/debhelper/autoscripts/$filename" ) { + $infile="/usr/lib/debhelper/autoscripts/$filename"; + } + else { + error("/usr/lib/debhelper/autoscripts/$filename does not exist"); + } + } + + # TODO: do this in perl, perhaps? + complex_doit("echo \"# Automatically added by ".basename().">> $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 { $file=shift; +sub filearray { my $file=shift; my @ret; open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); while () { push @ret,split(/\s/,$_); } - close DH_ARRAY; + close DH_FARRAY_IN; return @ret; } @@ -214,10 +248,11 @@ sub filearray { $file=shift; # Returns a list of packages in the control file. # Must pass "arch" or "indep" to specify arch-dependant or -independant # packages. If nothing is specified, returns all packages. -sub GetPackages { $type=shift; - my $package; - my $arch; - my @list; +sub GetPackages { my $type=shift; + $type="" if ! defined $type; + my $package=""; + my $arch=""; + my @list=(); open (CONTROL,") { @@ -235,8 +270,8 @@ sub GetPackages { $type=shift; ($type eq 'arch' && $arch ne 'all') || ! $type)) { push @list, $package; - undef $package; - undef $arch; + $package=""; + $arch=""; } } } diff --git a/debian/changelog b/debian/changelog index 9d4a6a4e..22b55879 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +debhelper (1.1.3) unstable; urgency=low + + * dh_md5sums: -x was broken since version 1.1.1 - fixed. + * dh_lib: removed get_arch_indep_packages() function that hasn't been used + at all for a long while. + * Added Dh_Lib.pm, a translation of dh_lib into perl. + * dh_getopt.pl: moved most of it into new Dh_Getopt.pm module, rewriting + large chunks in the process. + * dh_installdocs: completly rewritten in perl. Now it's faster and it can + install many oddly named files it died on before. + * dh_installdocs: fixed a bug that installed TODO files mode 655 in native + debian packages. + + -- Joey Hess Mon, 10 Aug 1998 15:01:15 -0700 + debhelper (1.1.2) unstable; urgency=low * dh_strip: added -X to specify files to not strip (#25590). diff --git a/dh_getopt.pl b/dh_getopt.pl index 4abe9160..b1dcf7b1 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -7,6 +7,7 @@ # Joey Hess, GPL copyright 1998. BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use strict; use Dh_Getopt; # This is a tricky (and nasty) bit: override the error() function, which @@ -18,7 +19,7 @@ sub Dh_Getopt::error { my $message=shift; } # Parse options. -%options=Dh_Getopt::parseopts(); +my %options=Dh_Getopt::parseopts(); # Change a few lists in %options into strings, # generate some options that only need to be visible to the @@ -33,8 +34,28 @@ if ($#{$options{EXCLUDE}} > -1) { } $options{EXCLUDE}=join " ",@{$options{EXCLUDE}}; +# Check to see if DH_VERBOSE environment variable was set, if so, +# make sure verbose is on. +if (defined $main::ENV{DH_VERBOSE}) { + if ($main::ENV{DH_VERBOSE} ne undef) { + $options{VERBOSE}=1; + } +} + +# Check to see if DH_NO_ACT environment variable was set, if so, +# make sure no act mode is on. +if (defined $main::ENV{DH_NO_ACT}) { + if ($main::ENV{DH_NO_ACT} ne undef) { + $options{NO_ACT}=1; + } +} + # Now output everything, in a format suitable for a shell to eval it. -foreach (keys(%options)) { print "DH_$_='$options{$_}'\n" }; +foreach (keys(%options)) { + if (defined $options{$_}) { + print "DH_$_='$options{$_}'\n"; + } +} # This sets $@ in the shell to whatever arguements remain. print "set -- @ARGV\n" diff --git a/dh_installdocs b/dh_installdocs index f4662431..3229cd15 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/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 @@ -21,7 +21,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { @docs=filearray($file); } - if (($PACKAGE = $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @docs, @ARGV; } diff --git a/dh_installexamples b/dh_installexamples index 623d882b..88e964ba 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -1,31 +1,31 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Reads debian/examples, installs all files listed there into # /usr/doc/$PACKAGE/examples -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - file=`pkgfile $PACKAGE examples` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"examples"); + + undef @examples; + + if ($file) { + @examples=filearray($file); + } - examples="" + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @examples, @ARGV; + } - if [ "$file" ]; then - examples=`tr "\n" " " < $file` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - examples="$* $examples" - fi - - if [ "$examples" ]; then - if [ ! -d $TMP/usr/doc/$PACKAGE/examples ]; then - doit "install -d $TMP/usr/doc/$PACKAGE/examples" - fi - - doit "cp -a $examples $TMP/usr/doc/$PACKAGE/examples/" - fi -done + if (@examples) { + if (! -d "$TMP/usr/doc/$PACKAGE/examples") { + doit("install","-d","$TMP/usr/doc/$PACKAGE/examples"); + } + + doit("cp","-a",@examples,"$TMP/usr/doc/$PACKAGE/examples"); + } +} diff --git a/dh_movefiles b/dh_movefiles index f44121c8..ba482050 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -44,13 +44,13 @@ for PACKAGE in $DH_DOPACKAGES; do # moved. doit "rm -f movelist" for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" ]; then + if [ ! -e "debian/tmp/$i" -o -L "debian/tmp/$i" ]; then fail=1 fi complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print || true) >> movelist" done for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" ]; then + if [ ! -e "debian/tmp/$i" -o -L "debian/tmp/$i" ]; then fail=1 fi complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print || true) >> movelist" diff --git a/doc/TODO b/doc/TODO index e3042fbc..756eb4bd 100644 --- a/doc/TODO +++ b/doc/TODO @@ -3,11 +3,9 @@ list grows - I welcome patches to fix items on it! Bugs: -* dh_installdocs fails if debian/docs is empty except for a blank line. - There are probably other instances of this. Debhelper should behave better - (#24686). * all commands should print a warning message if non-cumulative parameters - are given more than once (ie, two -u's to dh_gencontrol). + are given more than once (ie, two -u's to dh_gencontrol). (#22588) + (Bug currently under dispute, I think this is bogus). Wishlist items: @@ -58,13 +56,16 @@ Depricated: * remove dh_installdebfiles, dh_du. - need to wait a reasonable length of time. I'm currently planning - on doing this after slink is released. + on doing this after slink is released or one year after they were + depricated, whichever comes first. Be sure to grep whole debian + archive for alls to them before removing them, though! Long term goals: -Convert selected debhelper commands (dh_installmanpages?) to be perl -programs, for speed, ease of maintainence, and 8-bit cleanness. +* Convert selected debhelper commands to be perl programs, for speed, ease + of maintainence, and 8-bit cleanness. Fixes to backport to 1.0 tree: -* dh_installdocs used -m 655 for a TODO file. +* dh_installdocs used -m 655 for a TODO file. (minor, dh_fixperms cleans up + after it) -- cgit v1.2.3 From be64835b776e14dedc2ed4861af112d487a3bd79 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:49 +0000 Subject: r118: Initial Import --- debian/changelog | 9 +++++++++ dh_installdocs | 2 +- doc/TODO | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 314ea71e..05d39810 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.1.12) unstable; urgency=low + + * dh_installdocs: forgot to pass package name to isnative(). Any native + debian package that had a debian/TODO would have it installed with the + wrong name, and debhelper would warn of undefined values for some + packages. Fixed. + + -- Joey Hess Thu, 27 Aug 1998 12:35:42 -0700 + debhelper (1.1.11) unstable; urgency=low * dh_installchangelogs: added -k flag, that will make it install a symlink diff --git a/dh_installdocs b/dh_installdocs index 3229cd15..34fe97d1 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -40,7 +40,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $todo=pkgfile($PACKAGE,'TODO'); if ($todo) { - if (isnative()) { + if (isnative($PACKAGE)) { doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO"); } else { diff --git a/doc/TODO b/doc/TODO index 460abc63..9f184e3d 100644 --- a/doc/TODO +++ b/doc/TODO @@ -32,6 +32,10 @@ Wishlist items: to do that originally, and even worse, it is often run after dh_installdeb, so the fragements 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 inclusiuon of + directories and exclusion of files based on filname globbing. (Request from + Matthias Klose ) * docbase support (#25233). Waiting for docbase to stabalize and be used widly. * Support /etc/X11/window-managers, by making it easy for window managers to -- cgit v1.2.3 From e06e87d0aee1e09703e21b74a23f2249fcd4c6bb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:06:17 +0000 Subject: r152: Initial Import --- debian/changelog | 14 ++++++++++++++ dh_gencontrol.1 | 2 +- dh_installchangelogs | 8 +++++++- dh_installchangelogs.1 | 6 ++++-- dh_installcron.1 | 2 +- dh_installdeb.1 | 2 +- dh_installdocs | 2 ++ dh_installdocs.1 | 2 +- dh_makeshlibs | 2 +- dh_movefiles.1 | 15 +++++++++++---- dh_shlibdeps.1 | 2 +- dh_strip.1 | 2 +- 12 files changed, 45 insertions(+), 14 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 32d47370..5c2d87a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.2.16) unstable; urgency=low + + * dh_installchangelogs: now detects html changelogs and installs them as + changelog.html.gz, to comply with latest policy (which I disagree with + BTW). + * manpages: updated policy version numbers. + * dh_installdocs: behavior change: all docs are now installed mode 644. + I have looked and it doesn't seem this will actually affect any packages + in debian. This is useful only if you want to use dh_installdocs and not + dh_fixperms, and that's the only time this behavior change will have any + effect, either. (#30118) + + -- Joey Hess Thu, 3 Dec 1998 23:31:56 -0800 + debhelper (1.2.15) unstable; urgency=low * Just a re-upload, last upload failed for some obscure reason. diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 7ceb532a..79182619 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -31,6 +31,6 @@ for a list of environment variables that affect all debhelper commands. .TP .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installchangelogs b/dh_installchangelogs index 97e057b7..40a68f3d 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -42,7 +42,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-p","-m644",$changelog,"$TMP/usr/doc/$PACKAGE/$changelog_name"); if ($upstream) { - doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + if ($upstream=~m/\.html?$/i) { + # HTML changelog + doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog.html"); + } + else { + doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/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. diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 815c2dda..436ba947 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -17,7 +17,9 @@ 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. +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. .SH OPTIONS .TP .B debhelper options @@ -44,6 +46,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installcron.1 b/dh_installcron.1 index adda0711..a83f0401 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -25,6 +25,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installdeb.1 b/dh_installdeb.1 index 03fa1068..1d17b96c 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -45,6 +45,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installdocs b/dh_installdocs index 34fe97d1..97117a34 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -27,6 +27,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (@docs) { 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. diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 72f80ecd..f711492b 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -57,6 +57,6 @@ for a list of environment variables that affect all debhelper commands. 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.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_makeshlibs b/dh_makeshlibs index 68dc83eb..dbf6bfc9 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -16,7 +16,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { open (FIND, "find $TMP -type f -name '*.so.*' |"); while () { chomp; - ($library, $major)=m#.*/(.*)\.so\.(\d*)\.#; + ($library, $major)=m#.*/(.*)\.so\.(\d*)\.?#; if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { $major=$dh{M_PARAMS}; } diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 260d5069..6ec525a8 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -3,12 +3,12 @@ dh_movefiles \- moves files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles -.I "[debhelper options] [file ..]" +.I "[debhelper options] [--sourcedir=dir] [file ..]" .SH "DESCRIPTION" dh_movefiles is a debhelper program that is responsible for moving files out -of debian/tmp 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. +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 @@ -27,6 +27,13 @@ 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 diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 index f9f6f3e4..b414965f 100644 --- a/dh_shlibdeps.1 +++ b/dh_shlibdeps.1 @@ -32,6 +32,6 @@ for a list of environment variables that affect all debhelper commands. .TP .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_strip.1 b/dh_strip.1 index 6ddcde13..683de57c 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -29,6 +29,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess -- cgit v1.2.3 From 8d3f10b38de49099f20a7a0115dafdb318fbb2c0 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:14 +0000 Subject: r157: Initial Import --- autoscripts/postinst-menu | 2 +- autoscripts/postinst-menu-method | 2 +- autoscripts/postinst-suid | 2 +- autoscripts/postinst-wm | 2 +- autoscripts/postrm-menu-method | 2 +- autoscripts/postrm-suid | 2 +- autoscripts/postrm-wm | 3 ++- debian/changelog | 14 ++++++++++++++ debian/control | 3 ++- debian/rules | 2 +- dh_installdocs | 15 +++++++++++++++ dh_installdocs.1 | 16 +++++++++++++++- dh_suidregister | 2 +- 13 files changed, 56 insertions(+), 11 deletions(-) (limited to 'dh_installdocs') diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu index a73a1692..49b2c5de 100644 --- a/autoscripts/postinst-menu +++ b/autoscripts/postinst-menu @@ -1 +1 @@ -if [ -x /usr/bin/update-menus ] ; then update-menus ; fi +if command -v update-menus >/dev/null 2>&1 ; then update-menus ; fi diff --git a/autoscripts/postinst-menu-method b/autoscripts/postinst-menu-method index 0ea7959b..7f7aaa96 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 -a -f $inst -a -x /usr/sbin/install-menu ] ; then +if command -v update-menus >/dev/null 2>&1 && [ -f $inst ] ; then chmod a+x $inst update-menus fi diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid index 1294d313..de638efe 100644 --- a/autoscripts/postinst-suid +++ b/autoscripts/postinst-suid @@ -1,4 +1,4 @@ -if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]; then +if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# else chown #OWNER#.#GROUP# /#FILE# diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm index 94c052fc..925c7883 100644 --- a/autoscripts/postinst-wm +++ b/autoscripts/postinst-wm @@ -1,3 +1,3 @@ -if [ -x /usr/sbin/register-window-manager ] ; then +if command -v register-window-manager >/dev/null 2>&1; then register-window-manager --add #WM# fi diff --git a/autoscripts/postrm-menu-method b/autoscripts/postrm-menu-method index 3e63f2f4..0c2baae9 100644 --- a/autoscripts/postrm-menu-method +++ b/autoscripts/postrm-menu-method @@ -1,3 +1,3 @@ inst=/etc/menu-methods/#PACKAGE# if [ "$1" = "remove" -a -f "$inst" ]; then chmod a-x $inst ; fi -if [ -x /usr/bin/update-menus ] ; then update-menus; fi +if command -v update-menus >/dev/null 2>&1 ; then update-menus; fi diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid index 9712d256..d4a76199 100644 --- a/autoscripts/postrm-suid +++ b/autoscripts/postrm-suid @@ -1,3 +1,3 @@ -if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]; 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 index 6dc9f5da..8345aa97 100644 --- a/autoscripts/postrm-wm +++ b/autoscripts/postrm-wm @@ -1,3 +1,4 @@ -if [ "$1" == "purge" -a -x /usr/sbin/register-window-manager ] ; then +if [ "$1" == "purge" ] && command -v register-window-manager >/dev/null 2>&1 +then register-window-manager --remove #WM# fi diff --git a/debian/changelog b/debian/changelog index 3db2cd84..5cdf2f47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.2.21) unstable; urgency=low + + * dh_installdocs: Added doc-base support, if debian/.doc-base + exists, it will be installed as a doc-base control file. If you use this, + you probably want to add "dh_testversion 1.2.21" to the rules file to make + sure your package is built with a new enough debhelper. + * dh_installdocs: now supports -n to make it not modify postinst/prerm. + * dh_suidregister: turned off leading 0/1 in permissions settings, until + suidregister actually supports it. + * autoscripts/*: instead of "text -x", use "command -v" to see if various + binaries exist. This gets rid of lots of hard-coded paths. + + -- Joey Hess Wed, 30 Dec 1998 22:50:04 -0500 + debhelper (1.2.20) unstable; urgency=low * dh_compress: handle the hard link stuff properly, it was broken. Also diff --git a/debian/control b/debian/control index 8edb5aa9..7254be98 100644 --- a/debian/control +++ b/debian/control @@ -12,4 +12,5 @@ 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 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, etc. + file permissions, integrate your package with the debian menu system, + suidmanager, doc-base, etc. diff --git a/debian/rules b/debian/rules index 14b5e7f0..0d9676f2 100755 --- a/debian/rules +++ b/debian/rules @@ -73,4 +73,4 @@ dist: fi binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary localdist +.PHONY: build clean binary-indep binary-arch binary dist diff --git a/dh_installdocs b/dh_installdocs index 97117a34..347881cc 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -2,6 +2,7 @@ # # 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. BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; @@ -60,4 +61,18 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if ($copyright) { doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); } + + # Handle doc-base files. + $file=pkgfile($PACKAGE,"doc-base"); + if ($file) { + if (! -d "$TMP/usr/share/doc-base/") { + doit("install","-d","$TMP/usr/share/doc-base/"); + } + doit("install","-p","-m644",$file, + "$TMP/usr/share/doc-base/$PACKAGE"); + if (! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-doc-base"); + autoscript($PACKAGE,"postrm","postrm-doc-base") + } + } } diff --git a/dh_installdocs.1 b/dh_installdocs.1 index f711492b..abdef780 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[debhelper options] [-A] [file ...]" +.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. @@ -29,6 +29,15 @@ 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 make +dh_installdocs use that file as a doc-base control file, and will +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 package name will be +used as the doc-base document id. .SH OPTIONS .TP .B debhelper options @@ -40,6 +49,9 @@ for a list of options common to all debhelper commands. 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). @@ -53,6 +65,8 @@ See 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. diff --git a/dh_suidregister b/dh_suidregister index d5b10ebd..951984fe 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -52,7 +52,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $group=getgrgid($gid); # Note that I have to print mode in ocal, stripping file type. $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", - $mode & 07777); + $mode & 00777); autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); -- cgit v1.2.3 From 61fc7ffe47681eed509bf441fbbc9108775c5f43 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:08:10 +0000 Subject: r162: Initial Import --- debian/changelog | 7 +++++++ dh_installdocs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 33bbbe2e..cd5bdff1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.26) unstable; urgency=low + + * dh_installdocs: use prerm-doc-base script fragement. Was using + postrm-doc-base, for some weird reason. + + -- Joey Hess Mon, 18 Jan 1999 13:36:40 -0800 + debhelper (1.2.25) unstable; urgency=low * autoscripts/*menu*: It turns out that "command" is like test -w, it will diff --git a/dh_installdocs b/dh_installdocs index 347881cc..1d051819 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -72,7 +72,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { "$TMP/usr/share/doc-base/$PACKAGE"); if (! $dh{NOSCRIPTS}) { autoscript($PACKAGE,"postinst","postinst-doc-base"); - autoscript($PACKAGE,"postrm","postrm-doc-base") + autoscript($PACKAGE,"prerm","prerm-doc-base") } } } -- cgit v1.2.3 From 7e30b95a60b9197618c6223388d2c49bee13c2c6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:33 +0000 Subject: r170: Initial Import --- Dh_Getopt.pm | 1 + Dh_Lib.pm | 2 +- autoscripts/postinst-doc-base | 2 +- autoscripts/prerm-doc-base | 2 +- debian/changelog | 10 +++++++++ dh_compress | 2 +- dh_installdocs | 47 +++++++++++++++++++++++++++++++++++++------ dh_installdocs.1 | 6 ++++++ doc/README | 2 +- doc/TODO | 16 +++++---------- 10 files changed, 68 insertions(+), 22 deletions(-) (limited to 'dh_installdocs') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index e0b3896d..5f43496b 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -84,6 +84,7 @@ sub parseopts { "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}, diff --git a/Dh_Lib.pm b/Dh_Lib.pm index fb02a5dd..f20cd5db 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -261,7 +261,7 @@ sub filearray { my $file=shift; my @ret; open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); while () { - push @ret,split(/\s/,$_); + push @ret,split(' ',$_); } close DH_FARRAY_IN; diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base index a53ed7bf..c3653bed 100644 --- a/autoscripts/postinst-doc-base +++ b/autoscripts/postinst-doc-base @@ -1,3 +1,3 @@ if command -v install-docs >/dev/null 2>&1; then - install-docs -i /usr/share/doc-base/#PACKAGE# + install-docs -i /usr/share/doc-base/#DOC-ID# fi diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base index 339361a5..9678003e 100644 --- a/autoscripts/prerm-doc-base +++ b/autoscripts/prerm-doc-base @@ -1,3 +1,3 @@ if command -v install-docs >/dev/null 2>&1; then - install-docs -r #PACKAGE# + install-docs -r #DOC-ID# fi diff --git a/debian/changelog b/debian/changelog index 9e0179ca..cf51a7ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.34) unstable; urgency=low + + * dh_clean: added -d flag (also --dirs-only) that will make it clean only + tmp dirs. (closes: #30807) + * dh_installdocs: to support packages that need multiple doc-base files, + will now look for debian/.doc-base.. + * dh_compress: removed warning message (harmless). + + -- Joey Hess Sat, 6 Feb 1999 17:48:33 -0800 + debhelper (1.2.33) unstable; urgency=low * dh_compress: verbose_print() cd's. diff --git a/dh_compress b/dh_compress index 673f9102..caffc11e 100755 --- a/dh_compress +++ b/dh_compress @@ -59,7 +59,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # we can preserve the hard link across the compression and save # space in the end. my @f=(); - my %hardlinks={}; + my %hardlinks; foreach (@files) { ($dev, $inode, undef, $nlink)=stat($_); if ($nlink > 1) { diff --git a/dh_installdocs b/dh_installdocs index 1d051819..bc8fb8f5 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -62,17 +62,52 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); } - # Handle doc-base files. + # Handle doc-base files. There are two filename formats, the usual plus + # an extended format (debian/package.doc-base.). Have to + # come up with good document-id's too. + my %doc_ids; + + opendir(DEB,"debian/") || error("can't read debian directory: $!"); + foreach (grep {/^$PACKAGE\.doc-base\..*$/} readdir(DEB)) { + $id=$_; + $id=~s/\.doc-base\./-/; + $doc_ids{$id}="debian/$_"; + } + closedir(DEB); + + # These next lines handle the format debian/doc-base., + # which is in for completeness. + if ($PACKAGE eq $dh{MAINPACKAGE}) { + opendir(DEB,"debian/") || error("can't read debian directory: $!"); + foreach (grep {/^doc-base\..*$/} readdir(DEB)) { + $id=$_; + $id=~s/doc-base\./$PACKAGE-/; + $doc_ids{$id}="debian/$_"; + } + closedir(DEB); + } + + # And this handles the normal format of course. $file=pkgfile($PACKAGE,"doc-base"); - if ($file) { + if ($file ne '') { + $doc_ids{$PACKAGE}=$file; + } + + if (%doc_ids) { if (! -d "$TMP/usr/share/doc-base/") { doit("install","-d","$TMP/usr/share/doc-base/"); } - doit("install","-p","-m644",$file, - "$TMP/usr/share/doc-base/$PACKAGE"); + } + foreach $doc_id (keys %doc_ids) { + doit("install","-m644","-p",$doc_ids{$doc_id}, + "$TMP/usr/share/doc-base/$doc_id"); if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-doc-base"); - autoscript($PACKAGE,"prerm","prerm-doc-base") + autoscript($PACKAGE,"postinst","postinst-doc-base", + "s/#DOC-ID#/$doc_id/", + ); + autoscript($PACKAGE,"prerm","prerm-doc-base", + "s/#DOC-ID#/$doc_id/", + ); } } } diff --git a/dh_installdocs.1 b/dh_installdocs.1 index abdef780..50f07e1f 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -38,6 +38,12 @@ interface with the doc-base package. See .BR dh_installdeb (1) for an explanation of how this works. Note that the package name will be used as the doc-base document id. +.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.docid. The "docid" on the end is a +string that is combined with the package name to generate a unique doc-base +document id. .SH OPTIONS .TP .B debhelper options diff --git a/doc/README b/doc/README index b283af20..30f2a2cf 100644 --- a/doc/README +++ b/doc/README @@ -12,7 +12,7 @@ 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 +set up by hand, or you could try the dh-make package, which contains a "dh_make" command that is similar to debmake, and tries to automate the process. diff --git a/doc/TODO b/doc/TODO index 27b5055a..b926737c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,12 +1,6 @@ This is the TODO for debhelper. As more and more people use debhelper, this list grows - I welcome patches to fix items on it! -Bugs: - -* 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). - Wishlist items: * Make dh_* "use strict". @@ -54,8 +48,8 @@ Wishlist items: Deprecated: -* 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! +* 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! -- cgit v1.2.3 From 1c41458abe1bd9f7e267f32b8946c2ab041a62c8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:55 +0000 Subject: r173: Initial Import --- debian/changelog | 9 +++++++++ dh_installdocs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 78b10ed6..a31d5240 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.2.37) unstable; urgency=low + + * dh_installdocs: Patch from Jim Pick , fixes regexp error (Closes: #33431). + * dh_installxaw: new program by Daniel Martin + , handles xaw-wrappers integration. + * dh_installxaw.1: wrote man page. + + -- Joey Hess Thu, 18 Feb 1999 17:32:53 -0800 + debhelper (1.2.36) unstable; urgency=low * dh_compress.1: Fixed typo in man page. (Closes: #33364) diff --git a/dh_installdocs b/dh_installdocs index bc8fb8f5..54e5b8e7 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -68,7 +68,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { my %doc_ids; opendir(DEB,"debian/") || error("can't read debian directory: $!"); - foreach (grep {/^$PACKAGE\.doc-base\..*$/} readdir(DEB)) { + foreach (grep {/^\Q$PACKAGE\E\.doc-base\..*$/} readdir(DEB)) { $id=$_; $id=~s/\.doc-base\./-/; $doc_ids{$id}="debian/$_"; -- cgit v1.2.3 From 6a4c47eea5a5601f351a1fa0afd5e13aed56238b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:11 +0000 Subject: r238: Initial Import --- Dh_Lib.pm | 6 +++--- debian/changelog | 6 ++++++ dh_builddeb | 2 +- dh_clean | 2 +- dh_compress | 2 +- dh_debstd | 2 +- dh_du | 2 +- dh_fixperms | 2 +- dh_gencontrol | 2 +- dh_installchangelogs | 2 +- dh_installcron | 2 +- dh_installdeb | 2 +- dh_installdebfiles | 4 ++-- dh_installdirs | 2 +- dh_installdocs | 2 +- dh_installemacsen | 2 +- dh_installexamples | 2 +- dh_installinfo | 2 +- dh_installinit | 2 +- dh_installmanpages | 2 +- dh_installmenu | 2 +- dh_installmime | 2 +- dh_installmodules | 2 +- dh_installpam | 2 +- dh_installwm | 2 +- dh_installxaw | 6 +++--- dh_link | 2 +- dh_listpackages | 2 +- dh_makeshlibs | 2 +- dh_md5sums | 2 +- dh_movefiles | 2 +- dh_perl | 2 +- dh_shlibdeps | 2 +- dh_strip | 2 +- dh_suidregister | 2 +- dh_testdir | 2 +- dh_testroot | 2 +- dh_testversion | 2 +- dh_undocumented | 2 +- doc/PROGRAMMING | 2 +- 40 files changed, 50 insertions(+), 44 deletions(-) (limited to 'dh_installdocs') diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 73fd44ad..c5146b91 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -296,11 +296,11 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename"; } else { - if (-e "/usr/lib/debhelper/autoscripts/$filename") { - $infile="/usr/lib/debhelper/autoscripts/$filename"; + if (-e "/usr/share/debhelper/autoscripts/$filename") { + $infile="/usr/share/debhelper/autoscripts/$filename"; } else { - error("/usr/lib/debhelper/autoscripts/$filename does not exist"); + error("/usr/share/debhelper/autoscripts/$filename does not exist"); } } diff --git a/debian/changelog b/debian/changelog index ec5c5058..d8ced366 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.13) unstable; urgency=low + + * dh_fixperms: FHS fixes (#41058) + + -- Joey Hess Fri, 9 Jul 1999 13:07:49 -0700 + debhelper (2.0.12) unstable; urgency=low * dh_installinfo: fixed #SECTION# substitution. diff --git a/dh_builddeb b/dh_builddeb index 9d760b5e..04c3570a 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -2,7 +2,7 @@ # # Build the .deb package, assuming all the files are set up. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_clean b/dh_clean index a328d12e..e87688de 100755 --- a/dh_clean +++ b/dh_clean @@ -3,7 +3,7 @@ # Clean up $TMP and other tepmorary files generated by the # build process. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_compress b/dh_compress index 73b12ba6..040291fb 100755 --- a/dh_compress +++ b/dh_compress @@ -4,7 +4,7 @@ # compressed files get fixed. use Cwd; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_debstd b/dh_debstd index 1c2f1f05..89cfc182 100755 --- a/dh_debstd +++ b/dh_debstd @@ -38,7 +38,7 @@ foreach (@ARGV) { } @ARGV=@argv; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_du b/dh_du index f81b074d..d0358999 100755 --- a/dh_du +++ b/dh_du @@ -5,7 +5,7 @@ # # No longer - it was decided these files are a bad idea. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; warning("this program does nothing and is deprecated. Remove it from debian/rules."); diff --git a/dh_fixperms b/dh_fixperms index f74a269c..ba4e74d6 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -2,7 +2,7 @@ # # Do some general file permission fixups. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_gencontrol b/dh_gencontrol index cadfdc03..a2d152c4 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -2,7 +2,7 @@ # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installchangelogs b/dh_installchangelogs index 4be52020..3ebb04ec 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -7,7 +7,7 @@ # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installcron b/dh_installcron index 72872668..5b872aca 100755 --- a/dh_installcron +++ b/dh_installcron @@ -2,7 +2,7 @@ # # Install cron scripts into the appropriate places. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdeb b/dh_installdeb index f5f3055a..d3eebe76 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -2,7 +2,7 @@ # # Install files from debian/ into the package's DEBIAN directory. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdebfiles b/dh_installdebfiles index cd4562ea..72c17bcc 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -3,10 +3,10 @@ # This program is deprecated, but left in the package for backwards # compatability. It simply calls the 3 programs that replaced it. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; -$ENV{PATH}="debian:$ENV{PATH}:/usr/lib/debhelper"; +$ENV{PATH}="debian:$ENV{PATH}:/usr/share/debhelper"; warning("use of this program is deprecated, see man page."); diff --git a/dh_installdirs b/dh_installdirs index 2d12b76b..7d5e49c1 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -2,7 +2,7 @@ # # Reads debian/dirs, creates the directories listed there -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdocs b/dh_installdocs index 54e5b8e7..b82b21c2 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -4,7 +4,7 @@ # Also installs the debian/copyright and debian/README.debian and debian/TODO # and handles debian/doc-base. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installemacsen b/dh_installemacsen index 462e3f38..3fbaf8ba 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -2,7 +2,7 @@ # # Registration with emacsen-common. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installexamples b/dh_installexamples index 88e964ba..e8e5e3d6 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -3,7 +3,7 @@ # Reads debian/examples, installs all files listed there into # /usr/doc/$PACKAGE/examples -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installinfo b/dh_installinfo index 20d5e003..8ef2bab3 100755 --- a/dh_installinfo +++ b/dh_installinfo @@ -3,7 +3,7 @@ # Reads debian/info, installs all files listed there into /usr/info # and puts appropriate commands into the postinst. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installinit b/dh_installinit index 6432c513..c43d24d9 100755 --- a/dh_installinit +++ b/dh_installinit @@ -3,7 +3,7 @@ # Install debian/init[.d], and set up the postinst and postrm for init # scripts. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmanpages b/dh_installmanpages index f4dca9a3..6d615a16 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -7,7 +7,7 @@ # This is a little bit (hah!) DWIMish, but still very handy. use File::Find; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmenu b/dh_installmenu index 2db16603..c077f215 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -8,7 +8,7 @@ # # Also, add to postinst and postrm. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmime b/dh_installmime index 232ddc19..7cada574 100755 --- a/dh_installmime +++ b/dh_installmime @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmodules b/dh_installmodules index 1e111e5a..0ee00dce 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -2,7 +2,7 @@ # # Register modules with modutils. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installpam b/dh_installpam index 2262d810..897fd7d8 100755 --- a/dh_installpam +++ b/dh_installpam @@ -4,7 +4,7 @@ # # If debian/pam file exists, save it to $TMP/etc/pam.d/$PACKAGE -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installwm b/dh_installwm index 0cae9147..21ee6300 100755 --- a/dh_installwm +++ b/dh_installwm @@ -2,7 +2,7 @@ # # Add to postinst and postrm to register a window manager. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installxaw b/dh_installxaw index 849fbf00..f9980a6e 100755 --- a/dh_installxaw +++ b/dh_installxaw @@ -7,7 +7,7 @@ # # Also, add calls to postinst and postrm. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); @@ -51,8 +51,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { close IN; if ($stanza) { - $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'"; - $remove_opts.="'$data{'link-name'} $data{wrapped}'"; + $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}' "; + $remove_opts.="'$data{'link-name'} $data{wrapped}' "; } autoscript($PACKAGE,"postinst","postinst-xaw", diff --git a/dh_link b/dh_link index 919dc524..1f6299aa 100755 --- a/dh_link +++ b/dh_link @@ -3,7 +3,7 @@ # Generate symlinks in debian packages, reading debian/links. The # file contains pairs of files and symlinks. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_listpackages b/dh_listpackages index 7a764af5..3ce48e06 100755 --- a/dh_listpackages +++ b/dh_listpackages @@ -2,7 +2,7 @@ # # Output a list of all packages debhelper will act on. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); print join("\n",@{$dh{DOPACKAGES}})."\n"; diff --git a/dh_makeshlibs b/dh_makeshlibs index dbf6bfc9..41bf1614 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -2,7 +2,7 @@ # # Automatically generate shlibs files. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_md5sums b/dh_md5sums index 8015df79..80b5f479 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -4,7 +4,7 @@ # package. use Cwd; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_movefiles b/dh_movefiles index 09159d3b..7978163e 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -2,7 +2,7 @@ # # Move files out of debian/tmp, into subpackages. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_perl b/dh_perl index 0614b9b8..735711c3 100755 --- a/dh_perl +++ b/dh_perl @@ -3,7 +3,7 @@ # Find dependencies on perl stuff # Remove .packlist files -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_shlibdeps b/dh_shlibdeps index f7ac6012..69047dc0 100755 --- a/dh_shlibdeps +++ b/dh_shlibdeps @@ -2,7 +2,7 @@ # # Find dependancies. Simple dpkg-shlibdeps wrapper. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_strip b/dh_strip index ad5d40a8..9d6ab050 100755 --- a/dh_strip +++ b/dh_strip @@ -3,7 +3,7 @@ # Strip files. use File::Find; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_suidregister b/dh_suidregister index 15b1fe4d..dd01c2ce 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -6,7 +6,7 @@ # If there are parameters, or there is a debian/suid, register the files # listed there. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testdir b/dh_testdir index 0cb95c1d..6d9258db 100755 --- a/dh_testdir +++ b/dh_testdir @@ -4,7 +4,7 @@ # Tests for the existance of debian/control, and for the existance # of any other files you specify on the command line. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testroot b/dh_testroot index 629b8f84..6ce2a134 100755 --- a/dh_testroot +++ b/dh_testroot @@ -2,7 +2,7 @@ # # Checks to make sure you are root. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testversion b/dh_testversion index 57c0e588..096aa9e1 100755 --- a/dh_testversion +++ b/dh_testversion @@ -2,7 +2,7 @@ # # Debhelper version check. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; use Dh_Version; # contains the version number of debhelper. init(); diff --git a/dh_undocumented b/dh_undocumented index c4264d6b..77ee3f58 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -6,7 +6,7 @@ # Also, it looks for debian/undocumented files for more lists of # undocumented man pages. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 02b11a21..891d31b0 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -51,7 +51,7 @@ supported now, though.) Use Dh_lib.pm like this: -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); -- cgit v1.2.3 From 63e45075003b1d9fcff097b5644a81131c346653 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:50 +0000 Subject: r245: Initial Import --- debian/changelog | 9 +++++++++ dh_installdocs | 52 +++++++++++++++++++++++----------------------------- 2 files changed, 32 insertions(+), 29 deletions(-) (limited to 'dh_installdocs') diff --git a/debian/changelog b/debian/changelog index 3a2666cf..ad08e488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (2.0.21) unstable; urgency=low + + * Wow. It turns out dh_installdocs has been doing it wrong and doc-base + files have the doc-id inside them. Applied and modified a patch from + Peter Moulder to make it use those id's instead + of coming up with it's own. (Closes: #42650) + + -- Joey Hess Sun, 8 Aug 1999 10:24:10 -0700 + debhelper (2.0.20) unstable; urgency=low * dh_perl: Patch from Raphael Hertzog to allow diff --git a/dh_installdocs b/dh_installdocs index b82b21c2..101110da 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -62,51 +62,45 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { 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.doc-base.). Have to - # come up with good document-id's too. + # Handle doc-base files. There are two filename formats, the usual + # plus an extended format (debian/package.*). my %doc_ids; opendir(DEB,"debian/") || error("can't read debian directory: $!"); - foreach (grep {/^\Q$PACKAGE\E\.doc-base\..*$/} readdir(DEB)) { - $id=$_; - $id=~s/\.doc-base\./-/; - $doc_ids{$id}="debian/$_"; - } - closedir(DEB); - - # These next lines handle the format debian/doc-base., - # which is in for completeness. + # 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}) { - opendir(DEB,"debian/") || error("can't read debian directory: $!"); - foreach (grep {/^doc-base\..*$/} readdir(DEB)) { - $id=$_; - $id=~s/doc-base\./$PACKAGE-/; - $doc_ids{$id}="debian/$_"; - } - closedir(DEB); + $regexp="(|$regexp)"; } - - # And this handles the normal format of course. - $file=pkgfile($PACKAGE,"doc-base"); - if ($file ne '') { - $doc_ids{$PACKAGE}=$file; + 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 () { + if (/^Document:\s+(.*)/) { + $doc_ids{$fn}=$1; + last; + } + } + close IN; } + closedir(DEB); if (%doc_ids) { if (! -d "$TMP/usr/share/doc-base/") { doit("install","-d","$TMP/usr/share/doc-base/"); } } - foreach $doc_id (keys %doc_ids) { - doit("install","-m644","-p",$doc_ids{$doc_id}, - "$TMP/usr/share/doc-base/$doc_id"); + foreach my $fn (keys %doc_ids) { + doit("install","-m644","-p","debian/$fn", + "$TMP/usr/share/doc-base/$doc_ids{$fn}"); if (! $dh{NOSCRIPTS}) { autoscript($PACKAGE,"postinst","postinst-doc-base", - "s/#DOC-ID#/$doc_id/", + "s/#DOC-ID#/$doc_ids{$fn}/", ); autoscript($PACKAGE,"prerm","prerm-doc-base", - "s/#DOC-ID#/$doc_id/", + "s/#DOC-ID#/$doc_ids{$fn}/", ); } } -- cgit v1.2.3