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/<packagename> 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-<package> as the package build directory.
+
-- Joey Hess <joeyh@master.debian.org>
+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 <joeyh@master.debian.org> 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
for PACKAGE in $DH_DOPACKAGES; do
TMP=`tmpdir $PACKAGE`
- doit "dpkg --build debian/$TMP .."
+ doit "dpkg --build $TMP .."
done
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)
.TP
.B \-ppackage
Build the package named "package".
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
#!/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
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 $*"
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
.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
# 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
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;}'`
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
.TP
.B \-ppackage
Compress files for the package named "package".
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
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
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.
.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
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
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.
.TP
.B \-ppackage
Fix permissions for the package named "package".
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
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
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.
.TP
.B \-ppackage
Install changelogs for the package named "package".
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
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
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
.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
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.
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
# 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"
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
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
.TP
.B \-ppackage
Install files for the package named "package".
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
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=""
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
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.
.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.
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
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.
.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.
# 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
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
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
.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.
#
# 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.
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.
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/"
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.
.TP
.B \-n
Do not automatically generate code.
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
# 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.
}
# 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
}
# Argument processing and global variable initialization is below.
# Parse command line.
-set -- `getopt xvianp: $*`
+set -- `getopt xvianp:P: $*`
for i; do
case "$i"
DH_EXCLUDE=1
shift
;;
+ -P)
+ DH_TMPDIR="$2"
+ shift
+ shift
+ ;;
--)
shift
break
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
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
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.
.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
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
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.
.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
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"
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"
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
.TP
.B \-ppackage
Strip files for the package named "package".
+.TP
+.B \-Ptmpdir
+Use "tmpdir" for package build directory.
.SH NOTES
The
.B \-a
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,
# 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"
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
.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.
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
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
.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