diff options
author | joey <joey> | 1999-08-17 04:42:10 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:42:10 +0000 |
commit | 151fcdd2c72ee77597124c74450d66ba2840b14b (patch) | |
tree | ff78dd56038a3c6632ab307bafbf83e9c928693a | |
parent | 94f1df06050aa3c512fd8af6e67690f482fbcd5a (diff) | |
download | debhelper-151fcdd2c72ee77597124c74450d66ba2840b14b.tar.gz |
r47: Initial Import
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rwxr-xr-x | debian/rules | 1 | ||||
-rwxr-xr-x | dh_clean | 6 | ||||
-rwxr-xr-x | dh_compress | 4 | ||||
-rw-r--r-- | dh_compress.1 | 2 | ||||
-rwxr-xr-x | dh_installcron | 6 | ||||
-rw-r--r-- | dh_installcron.1 | 7 | ||||
-rwxr-xr-x | dh_installdeb | 14 | ||||
-rw-r--r-- | dh_installdeb.1 | 19 | ||||
-rwxr-xr-x | dh_installdocs | 17 | ||||
-rwxr-xr-x | dh_installinit | 6 | ||||
-rw-r--r-- | dh_lib | 16 | ||||
-rwxr-xr-x | dh_movefiles | 27 |
14 files changed, 98 insertions, 35 deletions
@@ -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 <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 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 @@ -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, @@ -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 |