From 0c4875b3fecb5b376257e248b129537dd148e0c4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:02 +0000 Subject: [PATCH] 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(-) diff --git a/README b/README index d84add4..2f2e7c2 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 a33224d..f7d47b1 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 aea8a1b..9ddd21d 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 bfe72e7..8a51a8f 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 76522dd..874604e 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 e387c4e..651b5b0 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 347f0f5..86ab837 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 06087b8..d7e8dc5 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 a7ec6f4..5fcb141 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 98a9c80..42509a5 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 1c4fef7..0534549 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 cfba648..8ae36de 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 17ff731..7405daa 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 2371af1..8c42a01 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 f5c4f8b..6ea5daa 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 2819958..ff76760 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 403375f..ad08f8d 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 924e04b..429481f 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 3859d34..bcc2634 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 4b5f068..fc00113 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 61ceae2..bc16991 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 e7ad6c6..5c8ce8c 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 304c3b1..4a0ffb4 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 bb08181..0679404 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 c837e04..5071a2f 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 e26c84e..b5337f3 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 1cc7e30..c2dd977 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 a09e26f..f1ab889 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 51ba8fe..e4296e4 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 5400bad..f71ab52 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 a54c1c1..28f7fe4 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 77d670a..57725d7 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 2eba991..fa3c769 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 4ca72a1..e03379f 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 e15e6d5..97dcb24 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 ebde890..fe1dbf2 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 ab45baa..d6ec21b 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 -- 2.39.5