]> git.donarmstrong.com Git - debhelper.git/commitdiff
r47: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 04:42:10 +0000 (04:42 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 04:42:10 +0000 (04:42 +0000)
14 files changed:
README
debian/changelog
debian/rules
dh_clean
dh_compress
dh_compress.1
dh_installcron
dh_installcron.1
dh_installdeb
dh_installdeb.1
dh_installdocs
dh_installinit
dh_lib
dh_movefiles [new file with mode: 0755]

diff --git a/README b/README
index 5c3bf91e2b52ea8c9ca76031a234dc2beefbbd53..bb4b6f06ebb0b6632b81fac59b8d27ffa29dad67 100644 (file)
--- 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
index 15b91d4625fa4ede478a011abb61c556b5f82d11..6eab06d410fabe461aa7ab875c3aa749f975d20e 100644 (file)
@@ -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
index 6ac6d672a987e7be9218594863b002f2fd9c8536..8bbcad55e22fe0833fb6598d4c7d48e3510a04b3 100755 (executable)
@@ -47,6 +47,7 @@ binary-indep: build
        ./dh_installmenu
        ./dh_installmanpages
        ./dh_installchangelogs
+       ./dh_movefiles
        ./dh_compress
        ./dh_fixperms
        ./dh_suidregister
index 6306adda1c9ba34be40a8206337f7ee582cd0046..ba20e3ea8ad9e4c67d6edeaae1c7622142787397 100755 (executable)
--- 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
index fe16b6cbf2fe0405526a5952653e632c5f266cb5..4626ed09a180f131799986ea4bbbca7b547c14fb 100755 (executable)
@@ -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=`
index 0e6c61981a306cd6072da45cbe98c282a011288a..ce8f539a0aedcbca56df57266493f400b1be7894 100644 (file)
@@ -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
index 6ea5daa399520ecb492f920eaf2031880058843f..9cd7cb5ef4f9d56eec800466458a128b72d4a867 100755 (executable)
@@ -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
index ff76760bb9759d0921b7d17a84e32a013cc78808..3407a62f521b285c5b9cc95b6d76178553c06ea4 100644 (file)
@@ -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
index d9e1e7b37ee65a5fc8f38aa83299b3032abb4d43..dd1a23fb541f578e73b4aff5b864e437444e7555 100755 (executable)
@@ -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
index 08b6cbae1ce87c0bb7a571b6b6c257529581a7f2..acb1a7f084cfb1d194fd53c551fc6d671b08caac 100644 (file)
@@ -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
index f345a28218390426cc343c2f7f65000ac0200646..1b3a95cbf1d6acaf8777a0666b45a197023002ce 100755 (executable)
@@ -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
index 857e27930a079eb35f10917b082c7ef8573736c6..207131cdd34f19c162764f439bf2268eb1edd8cc 100755 (executable)
@@ -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 39dae2a5d6ecb4eccf553cd2bc693957b581efc1..06a4666bfe86a7c7cf4060f240c5246baf373232 100644 (file)
--- 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 (executable)
index 0000000..9190853
--- /dev/null
@@ -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