dh_installcron
dh_installmanpages
dh_installchangelogs CHANGES
+ dh_movefiles
dh_strip
dh_compress
dh_fixperms
+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 <joeyh@master.debian.org> Tue, 6 Jan 1998 14:08:31 -0500
+
debhelper (0.51) unstable; urgency=low
* dh_fixperms: make shared libraries non-executable, in accordance with
./dh_installmenu
./dh_installmanpages
./dh_installchangelogs
+ ./dh_movefiles
./dh_compress
./dh_fixperms
./dh_suidregister
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
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=`
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
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
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
# 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"
# 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
.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
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
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"
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" \) \
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
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
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,
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
}
--- /dev/null
+#!/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