From d079e6683cfcbef6a979eb7a02780eebdf480a74 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:34:25 +0000 Subject: r12: Initial Import --- dh_installinit | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 dh_installinit (limited to 'dh_installinit') diff --git a/dh_installinit b/dh_installinit new file mode 100755 index 00000000..2ea3440f --- /dev/null +++ b/dh_installinit @@ -0,0 +1,58 @@ +#!/bin/sh -e +# +# Install debian/init[.d], and set up the postinst and postrm for init +# scripts. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ -e debian/${EXT}init ]; then + if [ ! -d $TMP/etc/init.d ]; then + doit "install -d $TMP/etc/init.d" + fi + + # Figure out what filename to install it as. + if [ "$DH_D_FLAG" ]; then + # -d on the command line sets DH_D_FLAG. We will + # remove a trailing 'd' from the package name and + # use that as the name. + script=`expr $PACKAGE : '\(.*\)d$'` || true + if [ ! "$script" ]; then + echo `basename $0`" warning: \"$PACKAGE\" has no final -d, but -d was specified." + script=$PACKAGE + fi + else + script=$PACKAGE + fi + doit "install -p -m755 debian/${EXT}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, + # we have to say "defaults". + if [ "$DH_U_PARAMS" = "" ]; then + DH_U_PARAMS="defaults" + fi + + # -r on the command line sets DH_R_FLAG. If it's set, there + # is no restart on upgrade. + if [ ! "$DH_NOSCRIPTS" ]; then + if [ "$DH_R_FLAG" ]; then + autoscript "postinst" "postinst-init-norestart" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + autoscript "postrm" "postrm-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + else + autoscript "postinst" "postinst-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + autoscript "postrm" "postrm-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + autoscript "prerm" "prerm-init" \ + "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" + fi + fi + fi +done -- cgit v1.2.3 From 2dc6b1e7754c88976aadefb20a4d387e8cf8b4ce Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:41:40 +0000 Subject: r43: Initial Import --- README | 18 ++++--- TODO | 2 - debian/changelog | 9 ++++ debian/rules | 13 +++-- dh_du | 2 +- dh_installchangelogs | 4 +- dh_installdirs.1 | 9 ++-- dh_installdocs | 2 +- dh_installinit | 6 +++ dh_lib | 140 ++++++++++++++++++++++++++++++++------------------- dh_suidregister | 2 +- 11 files changed, 134 insertions(+), 73 deletions(-) (limited to 'dh_installinit') diff --git a/README b/README index 280da781..5c3bf91e 100644 --- a/README +++ b/README @@ -2,11 +2,10 @@ Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks. For further documentation, see the man pages for dh_* commands. -To help you get started, I've included an example of a debian/rules file -that uses debhelper commands extensively. See -/usr/doc/debhelper/examples/rules . These files are also useful as they give -one good order you can run the different debhelper scripts in (though other -variations are possible). +To help you get started, I've included examples of debian/rules files +that use debhelper commands extensively. See /usr/doc/debhelper/examples/ . +These files are also useful as they give one good order you can run the +various debhelper scripts in (though other variations are possible). Converting from debstd to debhelper: @@ -76,7 +75,12 @@ All scripts that automatically generate code in this way let it be disabled by the -n parameter. Note that it will be shell code, so you cannot directly use it in a perl -script. +script. If you would like to embed it into a perl script, here is one way to +do that: + +print << `EOF` +#DEBHELPER# +EOF Notes on multiple binary packages: @@ -100,7 +104,7 @@ following parameters: times) These parameters are cumulative. If none are given, the tools default to -effecting all packages. +affecting all packages. See examples/rules.multi for an example of how to use this. diff --git a/TODO b/TODO index 3118ab95..00281d70 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,5 @@ * add all other functionality of debstd (??) * dh_fixperms: allow listing of files not to be touched (diffucult). * add a dh_debstd, which mimics debstd, but uses debhelper tools internally. -* dh_du: change it so it doesn't grep for things with tabs in them. That's - nasty. (and makes cut-and-paste from dh_du -v not work). * dh_compress: add --exclude "*.conf" type-thingy * info support for debhelper diff --git a/debian/changelog b/debian/changelog index 80d0aaa3..a1139e5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.37) unstable; urgency=low + + * dh_du: Fixed hardcoded debian/tmp. + * This change got lost by accident, redid it: Optimized out most of the + slowdown caused byusing dpkg-parsechangelog - now it's only called by + 2 dh_* programs. + + -- Joey Hess Sun, 28 Dec 1997 20:45:22 -0500 + debhelper (0.36) unstable; urgency=low * dh_undocumented: exit with an error message if the man page specified diff --git a/debian/rules b/debian/rules index b236fb1f..6ac6d672 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,5 @@ #!/usr/bin/make -f -# Note that I have to refer to debhelper programs witrh ./, to make sure +# Note that I have to refer to debhelper programs with ./, to make sure # I run the most current ones. That's also why there is a symlink to the # current dh_lib in this debian/ directory. @@ -7,17 +7,24 @@ # be sure to use the new templates from this package. export DH_AUTOSCRIPTDIR=autoscripts +# Figure out the current debhelper version. +VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null`" : \ + '.*Version: \(.*\).*Distribution:') + export DH_VERBOSE=1 test_files=dh_lib build: ./dh_testdir $(test_files) + sed "s/#DEBHELPER_VERSION#/$(VERSION)/" < dh_testversion.in \ + > dh_testversion + chmod 755 dh_testversion clean: ./dh_testdir $(test_files) ./dh_testroot - ./dh_clean + ./dh_clean dh_testversion # Build architecture-dependent files here. binary-arch: build @@ -35,7 +42,7 @@ binary-indep: build cp dh_lib debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper - ./dh_installdocs TODO README BUGS + ./dh_installdocs TODO README ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages diff --git a/dh_du b/dh_du index 39c684eb..71ce2b13 100755 --- a/dh_du +++ b/dh_du @@ -15,5 +15,5 @@ for PACKAGE in $DH_DOPACKAGES; do # Note that the tabs in this next line are important. complex_doit "du -k $TMP | sed 's: $TMP/: :' | grep -v ' DEBIAN$' | grep -v ' $TMP$' >$TMP/DEBIAN/du" - doit "chown root.root debian/tmp/DEBIAN/du" + doit "chown root.root $TMP/DEBIAN/du" done diff --git a/dh_installchangelogs b/dh_installchangelogs index 7405daae..0dd09918 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -12,11 +12,11 @@ PATH=debian:$PATH:/usr/lib/debhelper UPSTREAM=$1 -if [ "$NATIVE" -a "$UPSTREAM" ]; then +if isnative && [ "$UPSTREAM" ]; then error "Cannot specify an upstream changelog for a native debian package." fi -if [ "$NATIVE" ]; then +if isnative; then CHANGELOG_NAME=changelog else CHANGELOG_NAME=changelog.Debian diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 9f5bc351..fc5c8d62 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -9,8 +9,9 @@ dh_installdirs is a debhelper program that is responsible for creating subdirectories in package build directories. .P Any directory names specified as parameters will be created in the package -build directory of the first binary package listed in debian/control, if -dh_installdirs is acting on that package. +build directory of the first package dh_installdirs is told to act on. By +default, this is the first binary package in debian/control, but if you use +-p, -i, or -a flags, it will be the first package specified by those flags. .P A file named debian/dirs (for the first binary package in debian/control), or debian/package.dirs (for each additional package in debian/control) can @@ -37,8 +38,8 @@ Create directories for the package named "package". Use "tmpdir" for package build directory. .TP .B dir ... -Create these directories in the package build directory of the first binary -package listed in debian/control, if we are acting on that package. +Create these directories in the package build directory of the first package +acted on. .SH NOTES The .B \-a diff --git a/dh_installdocs b/dh_installdocs index 153be9a2..a1da8aa9 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -38,7 +38,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" fi if [ -f debian/TODO ]; then - if [ "$NATIVE" ]; then + if isnative; then doit "install -m 655 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO" else doit "install -m 644 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO.Debian" diff --git a/dh_installinit b/dh_installinit index 2ea3440f..857e2793 100755 --- a/dh_installinit +++ b/dh_installinit @@ -6,6 +6,12 @@ PATH=debian:$PATH:/usr/lib/debhelper . dh_lib +# This works around a bug in getopt(1), where it ignores some parameters. +# Sigh. +if [ "$*" ]; then + DH_U_PARAMS="$DH_U_PARAMS $*" +fi + for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` diff --git a/dh_lib b/dh_lib index 8347aae8..2c2b995f 100644 --- a/dh_lib +++ b/dh_lib @@ -52,19 +52,26 @@ pkgext() { } # Returns 1 if the package is a native debian package, null otherwise. +# Caches return code so it only needs to run dpkg-parsechangelog once. isnative() { - # Get the package version. - # Note that the 2>/dev/null is because a bug in dpkg-parsechangelog makes it - # output a bogus error message to stderr. - # If it actually has a real error, then the expr will fail, and this whole - # script will come crashing to a halt, which is good enough to inform - # the user something's wrong. :-) - VERSION=`expr "\`dpkg-parsechangelog 2>/dev/null\`" : \ - '.*Version: \(.*\).*Distribution:'` - # Is this a native Debian package? - if expr "$VERSION" : '.*-' >/dev/null; then - return 1 + if [ -z "$DH_ISNATIVE" ]; then + # Get the package version. + # Note that the 2>/dev/null is because a bug in dpkg-parsechangelog makes it + # output a bogus error message to stderr. + # If it actually has a real error, then the expr will fail, and this whole + # script will come crashing to a halt, which is good enough to inform + # the user something's wrong. :-) + VERSION=`expr "\`dpkg-parsechangelog 2>/dev/null\`" : \ + '.*Version: \(.*\).*Distribution:'` + # Is this a native Debian package? + if expr "$VERSION" : '.*-' >/dev/null; then + DH_ISNATIVE=1 + else + DH_ISNATIVE=0 + fi fi + + return "$DH_ISNATIVE" } # Automatically add a shell script snippet to a debian script. @@ -95,10 +102,46 @@ autoscript() { complex_doit "echo '# End automatically added section' >> $autoscript_debscript" } +# Sets 2 global variables, INDEP_PACKAGES is all the arch-independant +# packages, ARCH_PACKAGES is the arch-dependant packages. +get_arch_indep_packages() { + INDEP_PACKAGES="" + ARCH_PACKAGES="" + + # First, get the list of all binary packages. + # Notice we want the list in reverse order, thus the tac. + PACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tac | tr "\n" " "` + # Remove trailing space. + PACKAGES=`expr "$PACKAGES" : '\(.*\) '` + # Loop on the list of architectures. + for ARCH in `grep ^Architecture: debian/control | cut -d " " -f 2` ; do + # Pull the last package off the list. + THISPKG=`expr "$PACKAGES" : '.* \(.*\)'` || true + if [ ! "$THISPKG" ]; then + THISPKG=$PACKAGES + fi + PACKAGES=`expr "$PACKAGES" : '\(.*\) .*'` || true + + if [ ! "$THISPKG" ]; then + error "debian/control invalid - too many Architecture lines or too few Package lines" + fi + + if [ "$ARCH" = "all" ]; then + INDEP_PACKAGES="$INDEP_PACKAGES $THISPKG" + else + ARCH_PACKAGES="$ARCH_PACKAGES $THISPKG" + fi + done + + if [ "$PACKAGES" ]; then + error "debian/control invalid - too many Architecure lines or too few Package lines" + fi +} + # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvidrnakp:P:u: $*` +set -- `getopt xvidrnakp:P:u:m: $*` for i; do case "$i" @@ -108,10 +151,14 @@ for i; do shift ;; -i) + get_arch_indep_packages + DH_DOPACKAGES="$DH_DOPACKAGES $INDEP_PACKAGES" DH_DOINDEP=1 shift ;; -a) + get_arch_indep_packages + DH_DOPACKAGES="$DH_DOPACKAGES $ARCH_PACKAGES" DH_DOARCH=1 shift ;; @@ -150,6 +197,11 @@ for i; do shift shift ;; + -m) + DH_M_PARAMS="$2" + shift + shift + ;; --) shift break @@ -157,54 +209,22 @@ for i; do esac done -# Get the name of the main binary package. +# Get the name of the main binary package (first one listed in +# debian/control). MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1` -if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then - # Figure out all the binary packages to be produced, by looking at the - # control file. Break it into 2 lists, INDEP_PACKAGES and ARCH_PACKAGES. - # - # First, get the list of all binary packages. - PACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "` - # Remove trailing space. - PACKAGES=`expr "$PACKAGES" : '\(.*\) '` - # Loop on the list of architectures. Note that we tac the result to reverse - # it, becuase we are going through the list of packages in reverse. - for ARCH in `grep ^Architecture: debian/control | tac | cut -d " " -f 2` ; do - THISPKG=`expr "$PACKAGES" : '.* \(.*\)'` || true - if [ ! "$THISPKG" ]; then - THISPKG=$PACKAGES - fi - PACKAGES=`expr "$PACKAGES" : '\(.*\) .*'` || true - if [ ! "$THISPKG" ]; then - error "debian/control invalid - too many Architecture lines or too few Package lines" - fi - if [ "$ARCH" = "all" ]; then - INDEP_PACKAGES="$INDEP_PACKAGES $THISPKG" - else - ARCH_PACKAGES="$ARCH_PACKAGES $THISPKG" - fi - done - - if [ "$PACKAGES" ]; then - error "debian/control invalid - too many Architecure lines or too few Package lines" - fi - if [ "$DH_DOINDEP" ]; then - DH_DOPACKAGES="$DH_DOPACKAGES $INDEP_PACKAGES" - fi - if [ "$DH_DOARCH" ]; then - DH_DOPACKAGES="$DH_DOPACKAGES $ARCH_PACKAGES" - fi +# Remove leading spaces from DH_DOPACKAGES. +if expr "$DH_DOPACKAGES" : ' *.*' >/dev/null ; then + DH_DOPACKAGES_NEW=`expr "$DH_DOPACKAGES" : ' *\(.*\)'` fi # Check if packages to build have been specified, if not, fall back to -# the default, doing them all. Note that DH_DOPACKAGES may have a leading -# space and be empty otherwise. -if [ ! "$DH_DOPACKAGES" -o "$DH_DOPACKAGES" = " " ]; then +# the default, doing them all. +if [ ! "$DH_DOPACKAGES" ]; then if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then error "I have no package to build." fi - DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2` + DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "` fi # Check to see if -P was specified. If so, we can only act on a single @@ -212,3 +232,19 @@ fi if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | egrep -q '.+ .+' ; then error "-P was specified, but multiple packages would be acted on." fi + +# Figure out which package is the first one we were instructed to build. +# This package gets special treatement, files and directories specified on +# the command line may effect it. +for PACKAGE in $DH_DOPACKAGES ; do + DH_FIRSTPACKAGE="$PACKAGE" + break +done + +# Check to see if: DH_FIRSTPACKAGE is not the MAINPACKAGE, and +# some command line arguemnts are passed. Display a warning, becuase +# debhelper's behaviour has changed in this case. +if [ "$DH_FIRSTPACKAGE" != "$MAINPACKAGE" -a "$*" ]; then + echo `basename $0`": Warning: my behavior has changed, and command line" >&2 + echo `basename $0`": arguments \"$*\" will apply to package \"$DH_FIRSTPACKAGE\"" >&2 +fi diff --git a/dh_suidregister b/dh_suidregister index e03379f6..42e4d16d 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do files=`tr "\n" " " < debian/${EXT}suid` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then files="$* $files" fi -- cgit v1.2.3 From 151fcdd2c72ee77597124c74450d66ba2840b14b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:42:10 +0000 Subject: r47: Initial Import --- README | 1 + debian/changelog | 7 +++++++ debian/rules | 1 + dh_clean | 6 ++++-- dh_compress | 4 ++-- dh_compress.1 | 2 +- dh_installcron | 6 +++--- dh_installcron.1 | 7 ++++--- dh_installdeb | 14 ++++++++------ dh_installdeb.1 | 19 ++++++++++--------- dh_installdocs | 17 ++++++++++++----- dh_installinit | 6 +++--- dh_lib | 16 +++++++++++++++- dh_movefiles | 27 +++++++++++++++++++++++++++ 14 files changed, 98 insertions(+), 35 deletions(-) create mode 100755 dh_movefiles (limited to 'dh_installinit') diff --git a/README b/README index 5c3bf91e..bb4b6f06 100644 --- 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 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 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 diff --git a/dh_clean b/dh_clean index 6306adda..ba20e3ea 100755 --- 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 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, diff --git a/dh_lib b/dh_lib index 39dae2a5..06a4666b 100644 --- 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 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 -- cgit v1.2.3 From 050d55509586c51def636f895075c62877c9fae7 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:42:15 +0000 Subject: r48: Initial Import --- debian/changelog | 14 +++++++ debian/rules | 6 +-- dh_builddeb.1 | 10 ++--- dh_compress | 8 ++-- dh_fixperms | 1 - dh_gencontrol.1 | 12 +++--- dh_installchangelogs.1 | 15 +++++--- dh_installcron.1 | 10 ++--- dh_installdeb.1 | 10 ++--- dh_installdirs | 6 +-- dh_installdirs.1 | 7 ++-- dh_installdocs.1 | 5 +-- dh_installexamples | 6 +-- dh_installexamples.1 | 5 +-- dh_installinit | 6 --- dh_installinit.1 | 11 ++---- dh_installmanpages | 4 +- dh_installmanpages.1 | 3 ++ dh_installmenu | 13 ++++--- dh_installmenu.1 | 9 ++--- dh_lib | 101 ++++++++++--------------------------------------- dh_md5sums.1 | 12 +++--- dh_movefiles.1 | 10 ++--- dh_shlibdeps.1 | 12 +++--- dh_strip.1 | 10 ++--- dh_suidregister | 8 ++-- dh_suidregister.1 | 5 +-- dh_testdir.1 | 2 +- dh_testroot.1 | 2 +- dh_undocumented | 6 +-- dh_undocumented.1 | 6 +-- 31 files changed, 141 insertions(+), 194 deletions(-) (limited to 'dh_installinit') diff --git a/debian/changelog b/debian/changelog index 6eab06d4..ea45ec9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (0.53) unstable; urgency=low + + * dh_installmanpages: ignore all man pages installed into debian/tmp + type directories. (#16933) + * dh_*: set up alternative name for files like debian/dirs; you may now + use debian/.dirs too, for consistency. (#16934) + * dh_installdocs: if a debian/package.copyright file exists, use it in + preference to debian/copyright, so subpackages with varying copyrights + are supported. (#16935) + * Added dh_movefiles, which moves files out of debian/tmp into subpackages. + (#16932) + + -- Joey Hess Sat, 10 Jan 1998 11:30:12 -0500 + debhelper (0.52) unstable; urgency=low * dh_compress: compress file belongs in debian/. It was looking in ./ diff --git a/debian/rules b/debian/rules index 8bbcad55..892f7e69 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f # Note that I have to refer to debhelper programs with ./, to make sure # I run the most current ones. That's also why there is a symlink to the -# current dh_lib in this debian/ directory. +# current dh_lib and the current dh_getopt.pl in this debian/ directory. # If any automatic script generation is done in building this package, # be sure to use the new templates from this package. @@ -37,9 +37,9 @@ binary-indep: build ./dh_clean -k ./dh_installdirs usr/bin usr/lib/debhelper - find . -perm +111 -maxdepth 1 -type f \ + find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; - cp dh_lib debian/tmp/usr/lib/debhelper + cp -a dh_lib dh_getopt.pl debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs TODO README diff --git a/dh_builddeb.1 b/dh_builddeb.1 index 8a51a8f4..9d52b3ab 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -10,19 +10,19 @@ dh_builddeb simply calls to build a .deb package or packages. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory, etc. .TP -.B \-a +.B \-a, \--arch Build all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Build all architecture independent packages. .TP -.B \-ppackage +.B -ppackage, \--package=package Build the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .SH NOTES The diff --git a/dh_compress b/dh_compress index 4626ed09..58eb30f4 100755 --- a/dh_compress +++ b/dh_compress @@ -8,17 +8,17 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + compress=`pkgfile $PACKAGE compress` - # Run the file name gatering commands from within the directory + # Run the file name gathering commands from within the directory # structure that will be effected. olddir=`pwd` doit "cd $TMP" - if [ -f $olddir/debian/${EXT}compress ]; then + if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - files=`sh $olddir/debian/${EXT}compress 2>/dev/null` + files=`sh $olddir/$compress 2>/dev/null` else # By default fall back on what the policy manual says to compress. files=` diff --git a/dh_fixperms b/dh_fixperms index 32c9dbef..0d667fd3 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -7,7 +7,6 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` # General things.. if [ -d $TMP ]; then diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 7b78248f..484add0e 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -16,22 +16,22 @@ You may prefer to simply run by hand. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Install files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-uparams +.B \-uparams, \--update-rcd-params=params Pass "params" to .BR dpkg-gencontrol (1) .SH NOTES diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 8c42a011..4ec5ce91 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] [-Ptmpdir] 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. @@ -18,20 +18,23 @@ not a native debian package, then this upstream changelog will be installed as usr/doc/package/changelog in the package build directory. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Install changelogs for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install changelogs for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install changelogs for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. +.TP +.B upstream +Instal this file as the upstream changelog. .SH NOTES The .B \-a diff --git a/dh_installcron.1 b/dh_installcron.1 index 3407a62f..f090420b 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -14,19 +14,19 @@ 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 +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Install cron files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install cron files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install cron files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .SH NOTES The diff --git a/dh_installdeb.1 b/dh_installdeb.1 index acb1a7f0..bb658262 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -34,19 +34,19 @@ programs, such as , and are shell script fragments. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Install files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .SH NOTES The diff --git a/dh_installdirs b/dh_installdirs index 1ef311e7..e733e7ce 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -7,7 +7,7 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + file=`pkgfile $PACKAGE dirs` if [ ! -d $TMP ]; then doit "install -d $TMP" @@ -15,8 +15,8 @@ for PACKAGE in $DH_DOPACKAGES; do dirs="" - if [ -e debian/${EXT}dirs ]; then - dirs=`tr "\n" " " < debian/${EXT}dirs` + if [ "$file" ]; then + dirs=`tr "\n" " " < $file` fi if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 0fba87de..56c641b3 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -13,10 +13,9 @@ build directory of the first package dh_installdirs is told to act on. By default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by those flags. .P -A file named debian/dirs (for the first binary package in debian/control), -or debian/package.dirs (for each additional package in debian/control) can -list other directories to be created. Separate the directory names with -whitespace. +A file named debian/package.dirs (debian/dirs may be used for the first +binary package in debian/control) can list other directories to be created. +Separate the directory names with whitespace. .P Be sure to only use directory names relative to the package build directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead. diff --git a/dh_installdocs.1 b/dh_installdocs.1 index ab9ed476..6a0290a4 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -23,9 +23,8 @@ debian/control, if dh_installdocs is acting on that package. Note that debian/TODO will be installed named TODO.Debian, if the package is not a debian native package. .P -A file named debian/docs (for the first binary package in debian/control), -or debian/package.docs (for each additional package in debian/control) can -list other files to be installed. +A file named debian/package.docs (debian/docs may be used for the first +binary package in debian/control) can list other files to be installed. .SH OPTIONS .TP .B \-v diff --git a/dh_installexamples b/dh_installexamples index 423c647a..623d882b 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -8,12 +8,12 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + file=`pkgfile $PACKAGE examples` examples="" - if [ -e debian/${EXT}examples ]; then - examples=`tr "\n" " " < debian/${EXT}examples` + if [ "$file" ]; then + examples=`tr "\n" " " < $file` fi if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ diff --git a/dh_installexamples.1 b/dh_installexamples.1 index e46ed826..e038faf7 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -13,9 +13,8 @@ package dh_installdirs is told to act on. By default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by those flags. .P -A file named debian/examples (for the first binary package in debian/control), -or debian/package.examples (for each additional package in debian/control) can -list other files to be installed. +A file named debian/package.examples (debian/examples may be used for the +first binary package in debian/control) can list other files to be installed. .SH OPTIONS .TP .B \-v diff --git a/dh_installinit b/dh_installinit index 207131cd..803ef81f 100755 --- a/dh_installinit +++ b/dh_installinit @@ -6,12 +6,6 @@ PATH=debian:$PATH:/usr/lib/debhelper . dh_lib -# This works around a bug in getopt(1), where it ignores some parameters. -# Sigh. -if [ "$*" ]; then - DH_U_PARAMS="$DH_U_PARAMS $*" -fi - for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` init=`pkgfile $PACKAGE init` diff --git a/dh_installinit.1 b/dh_installinit.1 index 13f87549..6a2ab321 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -12,13 +12,10 @@ It also automatically generates the postinst and postrm and prerm commands needed to set up the symlinks in /etc/rc*.d/ and to start and stop the init scripts. .P -If a file named debian/init exists, then it is installed into -etc/init.d/package in the package build directory (with "package" replaced -by the package name, unless the -d flag is specified, see below) -.P -For packages other than the first binary package listed in -the control file, use debian/package.init instead (replace "package" with -the name of the package.) +If a file named debian/package.init exists, then it is installed into +etc/init.d/package in the package build directory, with "package" replaced +by the packagename. (You may use debian/init for the first binary package +listed in the control file.) .SH OPTIONS .TP .B \-v diff --git a/dh_installmanpages b/dh_installmanpages index 4a0ffb47..9bcd8910 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -13,7 +13,9 @@ 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 ^$TMP`; do + # We also need to exclude all debian/tmp type dirs. + EXCLUDE=`grep ^Package: debian/control | cut -d " " -f 2 | tac | tr "\n" "|"` + for file in `find * -name "*.[1-9]*" ! -name "*.ex" ! -name "*.in" | egrep -v "^debian/(${EXCLUDE}tmp)"`; do # Make sure file thinks they are man pages. if file $file|grep -q roff; then if echo $file|grep -q /; then diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index 7687ed9c..b8b580e1 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -65,6 +65,9 @@ are not automatically installed. Files specified as parameters that contain spaces in their filenames will not be processed properly. .P +By default, all man pages are installed into all binary packages, which is +almost never what you really want (use -p to work around this). +.P This is a "Do what I Mean" type program - you have been warned! .SH AUTHOR Joey Hess diff --git a/dh_installmenu b/dh_installmenu index 5071a2f3..9fbbfb21 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -13,27 +13,28 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + menu=`pkgfile $PACKAGE menu` + menu_method=`pkgfile $PACKAGE menu-method` - if [ -e debian/${EXT}menu ]; then + if [ "$menu" ]; then if [ ! -d $TMP/usr/lib/menu ]; then doit "install -d $TMP/usr/lib/menu" fi - doit "install -p -m644 debian/${EXT}menu $TMP/usr/lib/menu/$PACKAGE" + doit "install -p -m644 $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. - if [ ! -e debian/${EXT}menu-method -a ! "$DH_NOSCRIPTS" ]; then + if [ ! "$menu_method" -a ! "$DH_NOSCRIPTS" ]; then autoscript "postinst" "postinst-menu" autoscript "postrm" "postrm-menu" fi fi - if [ -e debian/${EXT}menu-method ]; then + if [ "$menu_method" ]; then if [ ! -d $TMP/etc/menu-methods ]; then doit "install -d $TMP/etc/menu-methods" fi - doit "install -p debian/${EXT}menu-method $TMP/etc/menu-methods/$PACKAGE" + doit "install -p $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 11bc71b8..320e1005 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -13,17 +13,16 @@ interface with the debian menu package. See .BR dh_installdeb (1) for an explanation of how this works. .P -If a file named debian/menu exists, then it is installed into +If a file named debian/package.menu exists, then it is installed into usr/lib/menu/package in the package build directory. This is a debian menu file. .P -If a file named debian/menu-method exits, then it is installed into +If a file named debian/package.menu-method exits, then it is installed into etc/menu-methods/package in the package build directory. This is a debian menu method file. .P -For packages other than the first binary package listed in -the control file, use debian/package.menu and debian/package.menu-method -instead (replace "package" with the name of the package.) +For the first first binary package listed in the control file, you may use +debian/menu and debian/menu-method instead. .SH OPTIONS .TP .B \-v diff --git a/dh_lib b/dh_lib index 06a4666b..020f9e6d 100644 --- a/dh_lib +++ b/dh_lib @@ -1,4 +1,6 @@ # Library functions for debhelper programs. +# +# Joey Hess, GPL copyright 1997, 1998. # Run a command, and display the command to stdout if verbose mode is on. # All commands that modifiy files in $TMP should be ran via this @@ -156,92 +158,29 @@ get_arch_indep_packages() { # Argument processing and global variable initialization is below. -# Parse command line. -set -- `getopt xvidrnakVAp:P:u:m: $*` - -for i; do - case "$i" - in - -v) - DH_VERBOSE=1 - shift - ;; - -i) - get_arch_indep_packages - DH_DOPACKAGES="$DH_DOPACKAGES $INDEP_PACKAGES" - DH_DOINDEP=1 - shift - ;; - -a) - get_arch_indep_packages - DH_DOPACKAGES="$DH_DOPACKAGES $ARCH_PACKAGES" - DH_DOARCH=1 - shift - ;; - -p) - DH_DOPACKAGES="$DH_DOPACKAGES $2" - shift - shift - ;; - -n) - DH_NOSCRIPTS=1 - shift - ;; - -x) - DH_EXCLUDE=1 - shift - ;; - -d) - DH_D_FLAG=1 - shift - ;; - -r) - DH_R_FLAG=1 - shift - ;; - -k) - DH_K_FLAG=1 - shift - ;; - -P) - DH_TMPDIR="$2" - shift - shift - ;; - -u) - DH_U_PARAMS="$2" - shift - shift - ;; - -m) - DH_M_PARAMS="$2" - shift - shift - ;; - -V) - DH_V_FLAG=1 - shift - ;; - -A) - DH_PARAMS_ALL=1 - shift - ;; - --) - shift - break - ;; - esac +# Check to see if an argument on the command line starts with a dash. +# if so, we need to pass this off to the resource intensive perl. +for arg; do + if expr "$arg" : '-' >/dev/null ; then + parseopt=1 + break + fi done +if [ "$parseopt" ]; then + parseopt="" + # Parse command line. I wrote a perl program to do this becuase + # getopt(1) is so broken. Note: the quotes around $@ are very + # important! + eval `dh_getopt.pl "$@"` + if [ "$DH_PARSE_ERROR" ]; then + error "$DH_PARSE_ERROR" + fi +fi # Get the name of the main binary package (first one listed in # debian/control). MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1` -# Remove leading spaces from DH_DOPACKAGES. -if expr "$DH_DOPACKAGES" : ' *.*' >/dev/null ; then - DH_DOPACKAGES_NEW=`expr "$DH_DOPACKAGES" : ' *\(.*\)'` -fi - # Check if packages to build have been specified, if not, fall back to # the default, doing them all. if [ ! "$DH_DOPACKAGES" ]; then @@ -266,7 +205,7 @@ for PACKAGE in $DH_DOPACKAGES ; do done # Check to see if: DH_FIRSTPACKAGE is not the MAINPACKAGE, and -# some command line arguemnts are passed. Display a warning, becuase +# some command line arguements are passed. Display a warning, becuase # debhelper's behaviour has changed in this case. if [ "$DH_FIRSTPACKAGE" != "$MAINPACKAGE" -a "$*" ]; then echo `basename $0`": Warning: my behavior has changed, and command line" >&2 diff --git a/dh_md5sums.1 b/dh_md5sums.1 index 28f7fe45..ab3c2bed 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -14,23 +14,23 @@ All files in DEBIAN/ are omitted from the md5sums file, as are all conffiles The md5sums file is installed with proper permissions and ownerships. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Generate md5sums files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Generate md5sums files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Generate md5sums file for the package named "package". .TP -.B \-x +.B \-x, \--include-conffiles Include conffiles in the md5sums list. Note that this is redundant, and included elsewhere in debian packages. .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .SH NOTES The diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 228f9401..c2b0e92a 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -14,19 +14,19 @@ Files named debian/package.files list the files to be moved, separated by whitespace. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Move files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Move files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Move files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .SH NOTES The diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 index 77d90c25..421a2215 100644 --- a/dh_shlibdeps.1 +++ b/dh_shlibdeps.1 @@ -17,22 +17,22 @@ prefer to simply run by hand. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Install files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-uparams +.B \-uparams, \--dpkg-shlibdeps-params=params Pass "params" to .BR dpkg-shlibdeps (1) .SH NOTES diff --git a/dh_strip.1 b/dh_strip.1 index fa3c7694..9cdd85a0 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -13,20 +13,20 @@ It assumes that files that have names like lib*_g.a are static libraries used in debugging, and will not strip them. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Strip files in all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Strip files in all architecture independent packages (likely, this is pointless :-). .TP -.B \-ppackage +.B \-ppackage, \--package=package Strip files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .SH NOTES The diff --git a/dh_suidregister b/dh_suidregister index 3f7622af..bc8aa5f2 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -11,12 +11,12 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + suid=`pkgfile $PACKAGE suid` files="" - if [ -e debian/${EXT}suid ]; then - files=`tr "\n" " " < debian/${EXT}suid` + if [ "$suid" ]; then + files=`tr "\n" " " < $suid` fi if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ @@ -24,7 +24,7 @@ for PACKAGE in $DH_DOPACKAGES; do files="$* $files" fi - if [ ! "$files" -a ! -e debian/${EXT}suid ]; then + if [ ! "$files" -a ! "$suid" ]; then # No files specified (and no empty debian/suid file), so # guess what files to process. files=`find $TMP -type f -perm +6000` diff --git a/dh_suidregister.1 b/dh_suidregister.1 index ef5b08dc..29fc504b 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -16,9 +16,8 @@ package dh_installdocs is told to act on. By default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by those flags. .P -The files debian/suid (for the first binary package in debian/control) or -debian/package.suid (for each additional package in debian/control) can -list other files to be registered. +Files named debian/package.suid (or debian/suid for the first binary package +in debian/control) can list other files to be registered. .P If neither of these methods is used to specify files, dh_suidregister will scan the package build directory for files that have suid permissions, and diff --git a/dh_testdir.1 b/dh_testdir.1 index c3212301..17561acc 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -11,7 +11,7 @@ exists, as well as any other files you specify. If not, it exits with an error. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. This currently has no effect. .TP diff --git a/dh_testroot.1 b/dh_testroot.1 index 78caa7e9..605dae4c 100644 --- a/dh_testroot.1 +++ b/dh_testroot.1 @@ -11,7 +11,7 @@ error. Debian packages must be built as root, though you can use to work around this. .SH OPTIONS .TP -.B \-v +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. This currently has no effect. .SH ENVIRONMENT diff --git a/dh_undocumented b/dh_undocumented index 31b2f987..edd873f7 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -11,12 +11,12 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` + undocumented=`pkgfile $PACKAGE undocumented` undoc="" - if [ -e debian/${EXT}undocumented ]; then - undoc=`tr "\n" " " < debian/${EXT}undocumented` + if [ "$undocumented" ]; then + undoc=`tr "\n" " " < $undocumented` fi if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 9df8e311..677c90f8 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -27,9 +27,9 @@ parameters will be set up in the first package dh_undocumented is told to act on. By default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by those flags. -Also, a file named debian/undocumented (for the first binary package in -debian/control), or debian/package.undocumented (for each additional package -in debian/control) can list other man page names to set up. +Also, a file named debian/package.undocumented (or debian/undocumented, for +the first binary package in debian/control) can list other man page names to +set up. .SH OPTIONS .TP .B \-v -- cgit v1.2.3 From 25f2b8ca8ec86c6a198df29927759c2644b13fe0 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:43 +0000 Subject: r69: Initial Import --- PROGRAMMING | 3 +++ debian/changelog | 10 ++++++++++ dh_getopt.pl | 3 +++ dh_installinit | 2 ++ 4 files changed, 18 insertions(+) (limited to 'dh_installinit') diff --git a/PROGRAMMING b/PROGRAMMING index 43e1554c..dcef3edf 100644 --- a/PROGRAMMING +++ b/PROGRAMMING @@ -97,6 +97,9 @@ switch variable description those processed here), will apply to all binary packages the program acts on, not just the first +--init-script DH_INIT_SCRIPT will be set to a string, which specifies an + init script name (probably only + dh_installinit will ever use this) Any additional command line parameters that do not start with "-" will be ignored, and you can access them later just as you normally would ($1, $2, diff --git a/debian/changelog b/debian/changelog index 86b7f4ac..0462cc44 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (0.71) unstable; urgency=low + + * dh_makeshlibs: -V flag was broken: if just -V was specified, + dh_makeshlibs would die. Corrected this. + * dh_lib: removed warning if the arguments passed to a debhelper command + do not apply to the main package. It's been long enough so I'm 100% sure + no packages use the old behavior. + + -- Joey Hess Mon, 9 Mar 1998 11:46:59 -0800 + debhelper (0.70) unstable; urgency=low * dh_lib: autoscript(): no longer add the modification date to the diff --git a/dh_getopt.pl b/dh_getopt.pl index e877a551..f91a42e0 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -109,6 +109,8 @@ GetOptions( "all" => \$all, "no-act" => \$no_act, + + "init-script=s" => \$init_script, ); # Check to see if -V was specified. If so, but no parameters were passed, @@ -147,6 +149,7 @@ DH_M_PARAMS='$major' DH_V_FLAG='$version_info' DH_V_FLAG_SET='$version_info_set' DH_PARAMS_ALL='$all' +DH_INIT_SCRIPT='$init_script' DH_PARSE_ERROR='$parse_error' set -- @ARGV }; diff --git a/dh_installinit b/dh_installinit index 803ef81f..66ebfc57 100755 --- a/dh_installinit +++ b/dh_installinit @@ -25,6 +25,8 @@ for PACKAGE in $DH_DOPACKAGES; do echo `basename $0`" warning: \"$PACKAGE\" has no final -d, but -d was specified." script=$PACKAGE fi + elif [ "$DH_INIT_SCRIPT" != "" ]; then + script=$DH_INIT_SCRIPT else script=$PACKAGE fi -- cgit v1.2.3 From 473b811394da493f2643d196d3ea2316b6ea034f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:51:17 +0000 Subject: r86: Initial Import --- PROGRAMMING | 3 +++ README | 53 +---------------------------------------------------- TODO | 11 +++++------ debian/changelog | 12 ++++++++++++ debian/rules | 2 +- dh_compress | 11 +++++++---- dh_fixperms | 45 ++++++++++++++++++++++++++++++++++++--------- dh_installdebfiles | 2 +- dh_installinit | 6 ++++++ dh_lib | 5 +++++ dh_movefiles | 2 +- dh_testroot | 4 +++- 12 files changed, 81 insertions(+), 75 deletions(-) (limited to 'dh_installinit') diff --git a/PROGRAMMING b/PROGRAMMING index a6078c1a..7dc0c638 100644 --- a/PROGRAMMING +++ b/PROGRAMMING @@ -143,6 +143,9 @@ verbose_echo() error() Pass this command a string, it will output it to standard error and exit. +warning() + Pass this command a string, and it will output it to standard error + as a warning message. tmpdir() Pass this command the name of a binary package, it will return the name of the tmp directory that will be used as this package's diff --git a/README b/README index f821e8c0..986eb02c 100644 --- a/README +++ b/README @@ -18,57 +18,7 @@ process. Converting from debstd to debhelper: ----------------------------------- -Debhelper is designed to be mostly backwards compatible to debstd. I say -mostly because I haven't made debhelper handle everything that debstd does -yet, and in a few cases, it does things differently (and I hope, better). - -In general, you can switch over to using debhelper as follows. In your -debian/rules, where you used to have some lines that read something like: - - debstd CHANGES TODO README - dpkg-gencontrol - dpkg --build debian/tmp .. - -Remove that and replace it with something like: - - dh_installdocs TODO README - dh_installexamples - dh_installmenu - dh_installcron - dh_installmanpages - dh_installchangelogs CHANGES - dh_movefiles - dh_strip - dh_compress - dh_fixperms - dh_suidregister - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_makeshlibs - dh_md5sums - dh_builddeb - -Notice that the parameters sent to debstd get split up among the dh_* -programs. The upstream changelog is passed to dh_installchangelogs, and the -docs are passed to dh_installdocs. - -Debstd has many switches, that turn off different parts of it. So if you -were using debstd -m to tell it not to automatically install manpages, -for example, you can just comment out the dh_installmanpages line. - -Finally, debstd automatically modified postinst, postrm, etc scripts. Some -of the debhelper apps do that too, but they do it differently. Debstd just -appends its commands to the end of the script. Debhelper requires that you -insert a tag into your scripts, that will tell debhelper where to insert -commands. So if you have postinst, postrm, etc scripts, add a line reading -"#DEBHELPER#" to the end of them. - -Once you think it's all set up properly, do a test build of your package. If -it works ok, I recommend that you compare the new package and the old -debstd-generated package very closely. Pay special attention to the postinst, -postrm, etc scripts. - +See the file "from-debstd" for documentation on how to do this. Automatic generation of debian install scripts: ---------------------------------------------- @@ -116,7 +66,6 @@ affecting all packages. See examples/rules.multi for an example of how to use this. - Package build directories -- debian/tmp, etc: -------------------------------------------- diff --git a/TODO b/TODO index 542e9887..188e3c6c 100644 --- a/TODO +++ b/TODO @@ -3,12 +3,11 @@ debmake (wishlist bug #17043). I just never saw the point of that file.. - Make dh_movefiles remove emptied directories after it's moved all the files out of them (wishlist bug #17111). -* dh_fixperms: allow listing of files not to be touched (difficult). -* add a dh_debstd, which mimics debstd, but uses debhelper tools internally. - Note that the idea here is not just another debstd. This program will have - a -v switch, that lists all the other debhelper commands it needs to run to - do what debstd had to do. The intent is to make it easy to switch from - debstd to debhelper. +* something should add ldconfig calls properly to the postinst of packages + that contain shared libraries. maybe dh_makeshlibs? But it wasn't designed + to do that originally, and even worse, it is often run after + dh_installdeb, so the fragements wouldn't go into the postinst. So maybe a + new script is called for. * info support for debhelper (currently implemented, but I hate how I did it, so it's not in the package.) (wishlist bug #15717) * enhance dh_installmanpages so it associates binaries and man pages and diff --git a/debian/changelog b/debian/changelog index 9d007f0f..0b443a16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (0.88) unstable; urgency=low + + * I had many hours on a train to hack on debhelper... enjoy! + * dh_compress: always pass -f to gzip, to force compression. + * dh_compress: added -X switch, to make it easy to specify files to + exclude, without all the bother of a debian/compress script. You can + use -X multiple times, too. + * PROGRAMMING, dh_getopt.pl: DH_EXCLUDE is now a variable set by the + --exclude (-X) switch. -x now sets DH_INCLUDE_CONFFILES. + + -- Joey Hess Sun, 17 May 1998 11:26:09 -0700 + debhelper (0.87) unstable; urgency=low * dh_strip: strip .comment and .note, not comment and note, when stripping diff --git a/debian/rules b/debian/rules index c1009b7f..44c77e07 100755 --- a/debian/rules +++ b/debian/rules @@ -47,7 +47,7 @@ binary-indep: build cp -a dh_lib dh_getopt.pl debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper - ./dh_installdocs TODO README PROGRAMMING + ./dh_installdocs TODO README PROGRAMMING from-debstd ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages diff --git a/dh_compress b/dh_compress index 1d30c65d..d24a561a 100755 --- a/dh_compress +++ b/dh_compress @@ -16,10 +16,10 @@ filelist () { sh $olddir/$compress 2>/dev/null else # By default fall back on what the policy manual says to compress. - find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null + find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ ! -name "*.htm*" ! -name "*.gif" ! -name "*.gz" \ - ! -name "copyright" 2>/dev/null + ! -name "copyright" 2>/dev/null || true fi } @@ -39,7 +39,9 @@ for PACKAGE in $DH_DOPACKAGES; do # Run the file name gathering commands from within the directory # structure that will be effected. olddir=`pwd` - doit "cd $TMP" + # Can't use doit here, that breaks --no-act mode. + verbose_echo "cd $TMP" + cd "$TMP" # Get the list of files to compress. if [ "$DH_EXCLUDE_GREP" ]; then @@ -56,7 +58,8 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Change back to old pwd. - doit "cd $olddir" + verbose_echo "cd $olddir" + cd "$olddir" # Fix up symlinks that were pointing to the uncompressed files. for file in `find $TMP -type l`; do diff --git a/dh_fixperms b/dh_fixperms index d34ffd23..b30332a1 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -5,35 +5,62 @@ PATH=debian:$PATH:/usr/lib/debhelper . dh_lib +# Pass this a list of files, one per line, it will return the list, with +# any files that need to be excluded removed. +filelist_excluded () { + IFS=" +" + if [ "$DH_EXCLUDE_GREP" ]; then + # Use grep -F so we don't have to worry about regexp's. + echo -n "$*" | grep -v -F \ + "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`" + else + echo -n "$*" + fi + unset IFS +} + for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - # General things.. - if [ -d $TMP ]; then - doit "chown -R root.root $TMP" - doit "chmod -R go=rX $TMP" - doit "chmod -R u+rw $TMP" + # General permissions fixing. + if [ ! "$DH_EXCLUDE_GREP" ]; then + # It's much faster to do it this way, but we can only do + # this if there is nothing to exclude. + if [ -d $TMP ]; then + doit "chown -R root.root $TMP" + doit "chmod -R go=rX $TMP" + doit "chmod -R u+rw $TMP" + fi + else + # Do it the hard way. + files=`filelist_excluded \`find $TMP 2>/dev/null\` | tr "\n" " "` + if [ "$files" ]; then + doit "chown root.root $files" + doit "chmod go=rX $files" + doit "chmod u+rw $files" + fi fi # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - files=`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true + files=`filelist_excluded \`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/\` | tr "\n" " "` if [ "$files" ]; then doit "chmod 644 $files" fi - files=`find $TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true + files=`filelist_excluded \`find $TMP/usr/doc -type d 2>/dev/null\` | tr "\n" " "` if [ "$files" ]; then doit "chmod 755 $files" fi # Executable man pages are a bad thing.. - files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true + files=`filelist_excluded \`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null\` | tr "\n" " "` if [ "$files" ]; then doit "chmod 644 $files" fi # ..and so are executable shared libraries (and .la files from libtool) - files=`find $TMP -perm -5 -type f \( -name "*.so*" -or -name "*.la" \) | tr "\n" " "` || true + files=`filelist_excluded \`find $TMP -perm -5 -type f \( -name "*.so*" -or -name "*.la" \)\` | tr "\n" " "` if [ "$files" ]; then doit "chmod a-X $files" fi diff --git a/dh_installdebfiles b/dh_installdebfiles index 6afdf548..0fba35a5 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -5,7 +5,7 @@ PATH=debian:$PATH:/usr/lib/debhelper -echo "* Note: dh_installdebfiles is deprecated." >&2 +warn "Note: use of this program is deprecated." dh_installdeb $* dh_shlibdeps $* diff --git a/dh_installinit b/dh_installinit index 66ebfc57..21526e2b 100755 --- a/dh_installinit +++ b/dh_installinit @@ -10,6 +10,12 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` init=`pkgfile $PACKAGE init` + # This is for backwards compatability with debstd, which used either + # name. + if [ ! "$init" ]; then + init=`pkgfile $PACKAGE init.d` + fi + if [ "$init" ]; then if [ ! -d $TMP/etc/init.d ]; then doit "install -d $TMP/etc/init.d" diff --git a/dh_lib b/dh_lib index 38f6734c..9e826499 100644 --- a/dh_lib +++ b/dh_lib @@ -37,6 +37,11 @@ error() { exit 1 } +# Output a warning. +warning() { + echo `basename $0`": $1" >&2 +} + # Pass it a name of a binary package, it returns the name of the tmp dir to # use, for that package. # This is for back-compatability with the debian/tmp tradition. diff --git a/dh_movefiles b/dh_movefiles index ab7dcd01..964d4068 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -29,7 +29,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Putting symlinks last is a nice thing to do for library # packages and doesn't affect much of anything else. # - # (The echo is in here to expand wildcards. Note that ls + # (The echo is in here to expand wildcards. Note that 'ls' # won't work properly.) tomove="" for i in `(cd debian/tmp ; echo \`cat $files\`)`; do diff --git a/dh_testroot b/dh_testroot index 36577b29..c7041094 100755 --- a/dh_testroot +++ b/dh_testroot @@ -5,6 +5,8 @@ PATH=debian:$PATH:/usr/lib/debhelper . dh_lib -if [ "`whoami`" != root ]; then +# Test for uid = 0, not username of root, becuase +# some people rename root. +if [ "`id -u`" != 0 ]; then error "You must run this as root." fi -- cgit v1.2.3 From 4a4c8d6bbb96f4cc05382018e453f76594734f97 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:12 +0000 Subject: r135: Initial Import --- debian/changelog | 6 +++ dh_installinit | 107 +++++++++++++++++++++++++++-------------------------- dh_installmanpages | 2 +- dh_strip | 105 +++++++++++++++++++++++++++++++++------------------- 4 files changed, 128 insertions(+), 92 deletions(-) (limited to 'dh_installinit') diff --git a/debian/changelog b/debian/changelog index 94c582c0..26d6963f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.1) unstable; urgency=low + + * dh_strip, dh_installinit: rewrite in perl. + + -- Joey Hess Mon, 9 Nov 1998 20:04:12 -0800 + debhelper (1.2.0) unstable; urgency=low * A new unstable dist means I'm back to converting more of debhelper to diff --git a/dh_installinit b/dh_installinit index 21526e2b..d455de4a 100755 --- a/dh_installinit +++ b/dh_installinit @@ -1,66 +1,69 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Install debian/init[.d], and set up the postinst and postrm for init # scripts. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - init=`pkgfile $PACKAGE init` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + # Debstd used either name, so do we for back-compatability. + $init=pkgfile($PACKAGE,"init") || pkgfile($PACKAGE,"init.d"); - # This is for backwards compatability with debstd, which used either - # name. - if [ ! "$init" ]; then - init=`pkgfile $PACKAGE init.d` - fi - - if [ "$init" ]; then - if [ ! -d $TMP/etc/init.d ]; then - doit "install -d $TMP/etc/init.d" - fi + if ($init ne '') { + if (! -d "$TMP/etc/init.d") { + doit("install","-d","$TMP/etc/init.d"); + } # Figure out what filename to install it as. - if [ "$DH_D_FLAG" ]; then - # -d on the command line sets DH_D_FLAG. We will + my $script; + if ($dh{D_FLAG}) { + # -d on the command line sets D_FLAG. We will # remove a trailing 'd' from the package name and # use that as the name. - script=`expr $PACKAGE : '\(.*\)d$'` || true - if [ ! "$script" ]; then - echo `basename $0`" warning: \"$PACKAGE\" has no final -d, but -d was specified." - script=$PACKAGE - fi - elif [ "$DH_INIT_SCRIPT" != "" ]; then - script=$DH_INIT_SCRIPT - else - script=$PACKAGE - fi - doit "install -p -m755 $init $TMP/etc/init.d/$script" + $script=$PACKAGE; + if ($script=~m/(.*)d$/) { + $script=$1; + } + else { + warning("\"$PACKAGE\" has no final `d' in its name, but -d was specified."); + } + } + elsif ($dh{INIT_SCRIPT}) { + $script=$dh{INIT_SCRIPT}; + } + else { + $script=$PACKAGE; + } + 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, + # the parameters to pass to update-rc.d. If not set, # we have to say "defaults". - if [ "$DH_U_PARAMS" = "" ]; then - DH_U_PARAMS="defaults" - fi + my $params=join(' ',@{$dh{U_PARAMS}}); + if ($params eq '') { + $params="defaults"; + } - # -r on the command line sets DH_R_FLAG. If it's set, there - # is no restart on upgrade. - if [ ! "$DH_NOSCRIPTS" ]; then - if [ "$DH_R_FLAG" ]; then - autoscript "postinst" "postinst-init-norestart" \ - "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" - autoscript "postrm" "postrm-init" \ - "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" - else - autoscript "postinst" "postinst-init" \ - "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" - autoscript "postrm" "postrm-init" \ - "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" - autoscript "prerm" "prerm-init" \ - "s/#SCRIPT#/$script/;s/#INITPARMS#/$DH_U_PARAMS/" - fi - fi - fi -done + if (! $dh{NOSCRIPTS}) { + # -r on the command line sets R_FLAG. If it's set, there + # is no restart on upgrade. + if ($dh{R_FLAG}) { + autoscript($PACKAGE,"postinst","postinst-init-norestart", + "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); + autoscript($PACKAGE,"postrm","postrm-init", + "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); + } + else { + autoscript($PACKAGE,"postinst","postinst-init", + "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); + autoscript($PACKAGE,"postrm","postrm-init", + "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); + autoscript($PACKAGE,"prerm","prerm-init", + "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); + } + } + } +} diff --git a/dh_installmanpages b/dh_installmanpages index dbb73cf4..1647d0a5 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -6,8 +6,8 @@ # # This is a little bit (hah!) DWIMish, but still very handy. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use File::Find; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); diff --git a/dh_strip b/dh_strip index 28e950a8..ad5d40a8 100755 --- a/dh_strip +++ b/dh_strip @@ -1,44 +1,71 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Strip files. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -# This reads in a list of files, and excludes any that match what's in -# DH_EXCLUDE_GREP. -filelist_excluded () { - if [ "$DH_EXCLUDE_GREP" ]; then - # Use grep -F so we don't have to worry about regexp's. - grep -v -F "`(cd $TMP; echo "$DH_EXCLUDE_GREP" | tr "|" "\n")`" - else - # Just pass all files through. - cat - fi +use File::Find; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +# Check if a file is an elf binary, shared library, or static library, +# for use by File::Find. It'll fill the following 3 arrays with anything +# it finds: +my (@shared_libs, @executables, @static_libs); +sub testfile { + return if -l $_ or -d $_; # Skip directories and symlinks always. + + # See if we were asked to exclude this file. + # Note that we have to test on the full filename, including directory. + $fn="$File::Find::dir/$_"; + foreach $f (@{$dh{EXCLUDE}}) { + return if ($fn=~m/\Q$f\E/); + } + + # Does its filename look like a shared library? + if (m/.*\.so.*?/) { + # Ok, do the expensive test. + my $type=`file $_`; + if ($type=~m/.*ELF.*shared.*/) { + push @shared_libs, $fn; + return; + } + } + + # Is it executable? -x isn't good enough, so we need to use stat. + (undef,undef,$mode,undef)=stat(_); + if ($mode & 0111) { + # Ok, expensive test. + my $type=`file $_`; + if ($type=~m/.*ELF.*executable.*/) { + push @executables, $fn; + return; + } + } + + # Is it a static library, and not a debug library? + if (m/lib.*\.a/ && ! m/.*_g\.a/) { + push @static_libs, $fn; + return; + } } -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - - # Handle executables and shared libraries. - for file in `(cd $TMP; find -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null) | filelist_excluded` ; do - case "`file $TMP/$file`" in - *ELF*shared*) - # Note that all calls to strip on shared libs - # *must* inclde the --strip-unneeded. - doit "strip --remove-section=.comment --remove-section=.note --strip-unneeded $TMP/$file" - ;; - *ELF*executable*) - doit "strip --remove-section=.comment --remove-section=.note $TMP/$file" - ;; - esac - done - - # Handle static libraries. - for file in `(cd $TMP; find -type f -name "lib*.a" 2>/dev/null) | filelist_excluded` ; do - # Don't strip debug libraries. - if ! expr "$file" : ".*_g\.a" >/dev/null ; then - doit "strip --strip-debug $TMP/$file" - fi - done -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + + @shared_libs=@executables=@static_libs=(); + find(\&testfile,$TMP); + + foreach (@shared_libs) { + # Note that all calls to strip on shared libs + # *must* inclde the --strip-unneeded. + doit("strip","--remove-section=.comment","--remove-section=.note","--strip-unneeded",$_); + } + + foreach (@executables) { + doit("strip","--remove-section=.comment","--remove-section=.note",$_); + } + + foreach (@static_libs) { + doit("strip","--strip-debug",$_); + } +} -- cgit v1.2.3 From 0eaafbd7e25e0d2fad5869ee65b6080b88c49c80 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:41 +0000 Subject: r137: Initial Import --- Dh_Getopt.pm | 7 ++ debian/changelog | 12 ++ dh_debstd | 360 ++++++++++++++++++++++++++--------------------------- dh_du | 5 +- dh_fixperms | 66 +++++----- dh_installdeb | 74 +++++------ dh_installdebfiles | 15 ++- dh_installinit | 5 +- dh_movefiles | 100 +++++++-------- dh_suidregister | 86 +++++++------ doc/PROGRAMMING | 2 +- 11 files changed, 381 insertions(+), 351 deletions(-) (limited to 'dh_installinit') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 1592d5d0..42ad7abf 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -145,6 +145,13 @@ sub parseopts { } @{$options{DOPACKAGES}}=@package_list; + # Generate EXCLUDE_FIND. + $options{EXCLUDE_FIND}=''; + foreach (@{$options{EXCLUDE}}) { + $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or "; + } + $options{EXCLUDE_FIND}=~s/ -or $//; + # If there are no packages to act on now, it's an error. if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) { error("I have no package to build"); diff --git a/debian/changelog b/debian/changelog index 5f3eb367..51977f18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (1.2.3) unstable; urgency=low + + * dh_fixperms, dh_installdebfiles, dh_installdeb: perlized + * dh_suidregister: perlized, with help from Che_Fox (and Tom Christianson, + indirectly..). + * dh_suidregister: include leading 0 (or 1 for sticky, etc) in file + permissions. + * Only 3 more to go and it'll be 100% perl. + * Made $dh{EXCLUDE_FIND} available to perl scripts. + + -- Joey Hess Tue, 10 Nov 1998 15:47:43 -0800 + debhelper (1.2.2) unstable; urgency=low * dh_du, dh_shlibdeps, dh_undocumented: rewrite in perl. diff --git a/dh_debstd b/dh_debstd index 6187fd31..e9e7b3ca 100755 --- a/dh_debstd +++ b/dh_debstd @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Script to be called from debian/rules to setup all the debian specifc # required files @@ -8,214 +8,212 @@ # (but doc files can also be listed in debian/docs) # # This has been gutted and extensively rewritten to function as a debhelper -# command by Joey Hess. +# command by Joey Hess. And then completly rewritten in perl. # Pre-parse command line before we load dh_lib, becuase we use a # different style of arguments. -for i;do - case "$i" in - -p) PERMS=1 - ;; - -u) UNDOC=1 - ;; - -s) SUMS=1 - ;; - -m) NOAUTOMAN=1 - ;; - -c) NOCOMPRESS=1 - ;; - *) collect="$collect$i " - ;; - esac -done -set -- $collect - -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +@argv=(); +foreach (@ARGV) { + if ($_ eq '-p') { + $ds{PERMS}=1; + } + elsif ($_ eq '-u') { + $ds{UNDOC}=1; + } + elsif ($_ eq '-s') { + $ds{SUMS}=1; + } + elsif ($_ eq '-m') { + $ds{NOAUTOMAN}=1; + } + elsif ($_ eq '-c') { + $ds{NOCOMPRESS}=1; + } + else { + push @argv,$_; + } +} +@ARGV=@argv; -# Tolerate old style debstd invocations -if [ "$DH_FIRSTPACKAGE" = "$1" ]; then - shift -fi +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -# Subroutines +# Tolerate old style debstd invocations +if ($ARGV[0] && $dh{FIRSTPACKAGE} eq $ARGV[0]) { + shift; +} # debinit handles the installation of an init.d script -# Parameters: -# $1= name in /etc/init.d -# $2 = scriptname -# $3 = package name -# $4 = extra params for debhelper -debinit() { - PPACKAGE=$3 - SCRIPT=$1 - - INITPARAMS=`grep "^FLAGS=" $2` || true - if [ "$INITPARAMS" != "" ]; then - INITPARAMS=`expr "$INITPARAMS" : 'FLAGS="\(.*\)"'` || true - if [ "$INITPARAMS" ]; then - INITPARAMS="--update-rcd-params='$INITPARAMS'" - fi - fi - - if grep -q NO_RESTART_ON_UPGRADE $2; then - doit "dh_installinit --no-restart-on-upgrade -p$PPACKAGE $INITPARAMS --init-script=$SCRIPT $4" - else - doit "dh_installinit -p$PPACKAGE $INITPARAMS --init-script=$SCRIPT $4" - fi +sub debinit { my ($script, $filename, $package, @params)=@_; + @initparams=(); + $norestart=''; + open (IN,$filename) || warn("$filename: $!"); + while () { + if (/^FLAGS=(.*)/) { + push @initparams, $1; + } + if (/NO_RESTART_ON_UPGRADE/) { + $norestart='--no-restart-on-upgrade'; + } + } + close IN; + $initparams=''; + if (@initparams) { + $initparams="--update-rcd-params='".join(" ",@initparams)."'"; + } + + doit("dh_installinit",$norestart,"-p$package",$initparams,"--init-script=$script",@params); } -# Package specific things -# -# The first parameter is the package name -# The second parameter is the directory name of the temp directory -# The third parameter is the prefix for all configuration files to be processed -package() -{ - local i - local X Y - CPACKAGE=$1 - CTEMP=$2 - +# Do package specific things for a package. +sub do_package { my ($package, $tmp, $prefix)=@_; # Deal with scripts in etc directories - if [ -f $3/rc.boot ]; then - warning "file $3/rc.boot was ignored." - fi + if (-d "$prefix/rc.boot") { + warning("file $prefix/rc.boot was ignored."); + } # etc files that could need some tweaking - for i in services inittab crontab protocols profile shells rpc shells \ - syslog.conf conf.modules modules aliases diversions inetd.conf \ - X11/Xresources X11/config X11/window-managers X11/xinit purge ; do - if [ -f $3$i ]; then - warning "file $3$i was ignored." - fi - done - - if [ -f $3init.d ]; then - debinit $1 $3init.d $1 "" - fi + foreach $f ('services','inittab','crontab','protocols','profile', + 'shells','rpc','syslog.conf','conf.modules','modules', + 'aliases','diversions','inetd.conf','X11/Xresources', + 'X11/config','X11/window-managers','X11/xinit','purge') { + if ( -f "$prefix$f") { + warning("file $prefix$f was ignored."); + } + } + + if (-f "${prefix}init.d") { + debinit($package,"${prefix}init.d",$package,""); + } # The case of a daemon without the final d - if [ -f $3init ]; then - X=`expr $1 : '\(.*\)d$'` || true - if [ "$X" ]; then - debinit $X $3init $1 "--remove-d" - fi - fi - - if [ -f $3info ]; then - warning "debhelper does not yet support info files, so $3info was ignored." - fi - - X=`find $2 -type f -perm +111 2>/dev/null | tr "\n" " "` - for i in $X; do - BINPATH="`expr "$i" : "$2/\(.*\)/.*"`" - BINNAME="`expr "$i" : "$2/.*/\(.*\)"`" - - # Check if manpages exist - case "$BINPATH" in - DEBIAN|etc/rc.boot|usr/lib/cgi-bin|etc/init.d|etc/cron.*|usr/lib/lib*|usr/lib/*) SECTION="" - ;; - sbin|usr/sbin) SECTION="8" - ;; - usr/X11R6/bin) SECTION="1x" - ;; - bin|usr/bin) SECTION="1" - ;; - usr/games) SECTION="6" - ;; - *) SECTION="" - ;; - esac - if [ "$SECTION" ]; then - Y=`find $2/usr/man $2/usr/X11R6/man -name "$BINNAME.*" 2>/dev/null` || true - if [ "$Y" = "" ]; then - if [ "$UNDOC" ]; then - doit "dh_undocumented -p$CPACKAGE $BINNAME.$SECTION" - fi - fi - fi - done + if (-f "${prefix}init") { + $p=$package; + if ($p=~s/d$//) { + debinit($p,"${prefix}init",$package,"--remove-d"); + } + } + + if (-f "${prefix}info") { + warning("debhelper does not yet support info files, so ${prefix}info was ignored."); + } + + # Set up undocumented man page symlinks. + if (defined($ds{UNDOC}) && $ds{UNDOC}) { + open (FIND,"find $tmp -type f -perm +111 2>/dev/null |") || warning("find: $!"); + while () { + chomp; + ($binpath, $binname)=m:$tmp/(.*)/(.*):; + + # Check if manpages exist + $section=''; + if ($binpath eq 'sbin' || $binpath eq 'usr/sbin') { + $section=8; + } + elsif ($binpath eq 'usr/X11R6/bin') { + $section='1x'; + } + elsif ($binpath eq 'bin' || $binpath eq 'usr/bin') { + $section=1; + } + elsif ($binpath eq 'usr/games') { + $section=6; + } + if ($section && `find $tmp/usr/man $tmp/usr/X11R6/man -name "$binname.*" 2>/dev/null` eq '') { + doit("dh_undocumented","-p$package","$binname.$section"); + } + } + close FIND; + } } -packages() { - local i - BASE=$1 - shift - for i in $*; do - package $i debian/$i "debian/$i." - if [ -x debian/$i.prebuild ]; then - warning "file debian/$i.prebuild ignored" - fi - done - - if [ -f debian/clean ]; then - warning "file debian/clean ignored" - fi - package $BASE debian/tmp "debian/" +# Special case of changelog +$changelogfile=''; +if ($ARGV[0] && $ARGV[0]=~m/change|news|history/) { + $changelogfile=shift; } -# Special case of changelog -if [ "$1" ]; then - if echo "$1" | egrep -qi "change|news|history" ; then - changelogfile=$1 - shift - fi -fi - -doit "dh_installdirs" # here just to make the debian/tmp, etc directories. -doit "dh_installdocs $*" -doit "dh_installexamples" -doit "dh_installchangelogs $changelogfile" -doit "dh_installmenu" -doit "dh_installcron" +doit("dh_installdirs"); # here just to make the debian/tmp, etc directories. +doit("dh_installdocs",@ARGV); +doit("dh_installexamples"); +if ($changelogfile) { + doit("dh_installchangelogs",$changelogfile); +} +else { + doit("dh_installchangelogs"); +} +doit("dh_installmenu"); +doit("dh_installcron"); # Manpage scan -if [ "$NOAUTOMAN" = "" ]; then - doit "dh_installmanpages -p$DH_FIRSTPACKAGE" -fi +if (! $ds{NOAUTOMAN}) { + doit("dh_installmanpages","-p$dh{FIRSTPACKAGE}"); +} -packages $DH_DOPACKAGES +# Per-package stuff: +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + if ($PACKAGE eq $dh{FIRSTPACKAGE}) { + if (-f "debian/clean") { + warning("file debian/clean ignored."); + } + do_package($PACKAGE,"debian/tmp","debian/"); + } + else { + do_package($PACKAGE,"debian/$PACKAGE","debian/$PACKAGE."); + if ( -x "debian/$PACKAGE.prebuild") { + warning("file debian/$PACKAGE.prebuild ignored."); + } + } +} -doit "dh_movefiles" -doit "dh_strip" +doit("dh_movefiles"); +doit("dh_strip"); -if [ ! "$nocompress" ]; then - doit "dh_compress" -fi +if (! $ds{NOCOMPRESS}) { + doit("dh_compress"); +} -doit "dh_fixperms" -doit "dh_suidregister" -doit "dh_shlibdeps" -doit "dh_gencontrol" -doit "dh_makeshlibs" +doit("dh_fixperms"); +doit("dh_suidregister"); +doit("dh_shlibdeps"); +doit("dh_gencontrol"); +doit("dh_makeshlibs"); # Check to see if the install scripts have #DEBHELPER# in them, if not, # warn. -for PACKAGE in $DH_DOPACKAGES; do - for file in postinst postrm preinst prerm; do - f="`pkgfile $PACKAGE $file`" - if [ "$f" ]; then - if ! grep -q "#DEBHELPER#" "$f"; then - filelist="$filelist$f " - - fi - fi - done -done -if [ "$filelist" ]; then - warning "The following scripts do not contain \"#DEBHELPER#\" in them," - warning "and so debhelper will not automatically add commands to them:" - warning "$filelist" -fi - -doit "dh_installdeb" - -if [ "$SUMS" = "" ]; then - doit "dh_md5sums" -fi +@filelist=(); +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + foreach $file (qw{postinst postrm preinst prerm}) { + $f=pkgfile($PACKAGE,$file); + if ($f) { + open (IN,$f); + $found=undef; + while () { + if (/#DEBHELPER#/) { + $found=1; + last; + } + } + if (! $found) { + push @filelist, $f; + } + } + } +} +if (@filelist) { + warning("The following scripts do not contain \"#DEBHELPER#\" in them,"); + warning("and so debhelper will not automatically add commands to them:"); + warning(join(" ",@filelist)); +} + +doit("dh_installdeb"); + +if (! $ds{SUMS}) { + doit("dh_md5sums"); +} # This causes the main binary package to be built, which # real debstd does not do. Shouldn't be a problem though, # if that package gets built twice. -doit "dh_builddeb" +doit("dh_builddeb"); diff --git a/dh_du b/dh_du index 78518f8e..f81b074d 100755 --- a/dh_du +++ b/dh_du @@ -5,4 +5,7 @@ # # No longer - it was decided these files are a bad idea. -print STDERR "dh_du: this program does nothing and is deprecated. Remove it from debian/rules.\n"; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; + +warning("this program does nothing and is deprecated. Remove it from debian/rules."); diff --git a/dh_fixperms b/dh_fixperms index 58aa1484..e7e1ec6a 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -1,50 +1,52 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Do some general file permission fixups. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); # General permissions fixing. - if [ ! "$DH_EXCLUDE_FIND" ]; then + if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') { # It's much faster to do it this way, but we can only do # this if there is nothing to exclude. - if [ -d $TMP ]; then - doit "chown -R root.root $TMP" - doit "chmod -R go=rX $TMP" - doit "chmod -R u+rw $TMP" - fi - - FIND_OPTIONS="" - else + if (-d $TMP) { + doit("chown","-R","root.root",$TMP); + doit("chmod","-R","go=rX",$TMP); + doit("chmod","-R","u+rw",$TMP); + } + + $find_options=""; + } + else { # Do it the hard way. - complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ - 2>/dev/null | xargs -0r chown root.root" - complex_doit "find $TMP ! \($DH_EXCLUDE_FIND \) -print0 \ - 2>/dev/null | xargs -0r chmod go=rX" - complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ - 2>/dev/null | xargs -0r chmod u+rw" + complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0 \ + 2>/dev/null | xargs -0r chown root.root"); + complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0 \ + 2>/dev/null | xargs -0r chmod go=rX"); + complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0 \ + 2>/dev/null | xargs -0r chmod u+rw"); - FIND_OPTIONS="! \( $DH_EXCLUDE_FIND \)" - fi + $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; + } # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS ! -regex .\*/examples/.\* -print0 \ - 2>/dev/null | xargs -0r chmod 644" - complex_doit "find $TMP/usr/doc -type d $FIND_OPTIONS -print0 \ - 2>/dev/null | xargs -0r chmod 755" + complex_doit("find $TMP/usr/doc -type f $find_options ! -regex .\*/examples/.\* -print0", + "2>/dev/null | xargs -0r chmod 644"); + complex_doit("find $TMP/usr/doc -type d $find_options -print0", + "2>/dev/null | xargs -0r chmod 755"); # Executable man pages are a bad thing.. - complex_doit "find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f \ - $FIND_OPTIONS -print0 2>/dev/null | xargs -0r chmod 644" + complex_doit("find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f", + "$find_options -print0 2>/dev/null | xargs -0r chmod 644"); # ..and so are executable shared and static libraries # (and .la files from libtool) - complex_doit "find $TMP -perm -5 -type f \ - \( -name '*.so*' -or -name '*.la' -or -name '*.a' \) $FIND_OPTIONS -print0 \ - 2>/dev/null | xargs -0r chmod a-X" -done + complex_doit("find $TMP -perm -5 -type f", + "\\( -name '*.so*' -or -name '*.la' -or -name '*.a' \\) $find_options -print0", + "2>/dev/null | xargs -0r chmod a-X"); +} diff --git a/dh_installdeb b/dh_installdeb index dd1a23fb..f5f3055a 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -1,51 +1,55 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Install files from debian/ into the package's DEBIAN directory. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); - if [ ! -d $TMP/DEBIAN ]; then - doit "install -o root -g root -d $TMP/DEBIAN" - fi + if (! -d "$TMP/DEBIAN") { + doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); + } # Install debian install scripts. # If any .debhelper files exist, add them into the scripts. - for file in postinst preinst prerm postrm; do - f=`pkgfile $PACKAGE $file` - if [ "$f" ]; then - if [ -f debian/$EXT$file.debhelper ]; then + foreach $file (qw{postinst preinst prerm postrm}) { + $f=pkgfile($PACKAGE,$file); + if ($f) { + if (-f "debian/$EXT$file.debhelper") { # Add this into the script, where it has # #DEBHELPER# - complex_doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < $f > $TMP/DEBIAN/$file" - else + # TODO: do internally, no perl fork? + complex_doit("perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < $f > $TMP/DEBIAN/$file"); + } + else { # Just get rid of any #DEBHELPER# in the # script. - complex_doit "sed s/#DEBHELPER#// < $f > $TMP/DEBIAN/$file" - fi - doit "chown root.root $TMP/DEBIAN/$file" - doit "chmod 755 $TMP/DEBIAN/$file" - else + complex_doit("sed s/#DEBHELPER#// < $f > $TMP/DEBIAN/$file"); + } + doit("chown","root.root","$TMP/DEBIAN/$file"); + doit("chmod",755,"$TMP/DEBIAN/$file"); + } + else { # Auto-generate script header and add .debhelper # content to it. - if [ -f debian/$EXT$file.debhelper ]; then - complex_doit "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" - complex_doit "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" - doit "chown root.root $TMP/DEBIAN/$file" - doit "chmod 755 $TMP/DEBIAN/$file" - fi - fi - done + if (-f "debian/$EXT$file.debhelper") { + complex_doit("echo '#!/bin/sh -e' > $TMP/DEBIAN/$file"); + complex_doit("cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file"); + doit("chown","root.root","$TMP/DEBIAN/$file"); + doit("chmod",755,"$TMP/DEBIAN/$file"); + } + } + } # Install non-executable files - for file in shlibs conffiles; do - f=`pkgfile $PACKAGE $file` - if [ "$f" ]; then - doit "install -o root -g root -m 644 -p $f $TMP/DEBIAN/$file" - fi - done -done + foreach $file (qw{shlibs conffiles}) { + $f=pkgfile($PACKAGE,$file); + if ($f) { + doit("install","-o","root","-g","root","-m",644,"-p",$f,"$TMP/DEBIAN/$file"); + } + } +} diff --git a/dh_installdebfiles b/dh_installdebfiles index d999c91b..cd4562ea 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -1,12 +1,15 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # This program is deprecated, but left in the package for backwards # compatability. It simply calls the 3 programs that replaced it. -PATH=debian:$PATH:/usr/lib/debhelper +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; -echo "dh_installdebfiles: use of this program is deprecated, see man page." >&2 +$ENV{PATH}="debian:$ENV{PATH}:/usr/lib/debhelper"; -dh_installdeb $* -dh_shlibdeps $* -dh_gencontrol $* +warning("use of this program is deprecated, see man page."); + +doit("dh_installdeb",@ARGV); +doit("dh_shlibdeps",@ARGV); +doit("dh_gencontrol",@ARGV); diff --git a/dh_installinit b/dh_installinit index d455de4a..d1de1807 100755 --- a/dh_installinit +++ b/dh_installinit @@ -42,7 +42,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # This is set by the -u "foo" command line switch, it's # the parameters to pass to update-rc.d. If not set, # we have to say "defaults". - my $params=join(' ',@{$dh{U_PARAMS}}); + my $params=''; + if (defined($dh{U_PARAMS})) { + $params=join(' ',@{$dh{U_PARAMS}}); + } if ($params eq '') { $params="defaults"; } diff --git a/dh_movefiles b/dh_movefiles index 712ed887..5967ff54 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -1,70 +1,70 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Move files out of debian/tmp, into subpackages. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - files=`pkgfile $PACKAGE files` +$ret=0; - if [ ! -d "debian/tmp" ]; then - error "debian/tmp does not exist" - fi +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $files=pkgfile($PACKAGE,"files"); - tomove="" + if (! -d "debian/tmp") { + error("debian/tmp does not exist."); + } + + @tomove=(); # debian/files has a different purpose, so ignore it. - if [ "$files" -a "$files" != "debian/files" ]; then - tomove=`cat $files` - fi + if ( $files && $files != "debian/files" ) { + @tomove=filearray($files); + } - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - tomove="$* $tomove" - fi - - if [ "$tomove" -a "$TMP" = "debian/tmp" ]; then - error "I was asked to move files from debian/tmp to debian/tmp." - fi + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @tomove, @ARGV; + } - if [ "$tomove" ]; then - if [ ! -d "$TMP" ]; then - doit "install -d $TMP" - fi + if (@tomove && $TMP eq "debian/tmp") { + error("I was asked to move files from debian/tmp to debian/tmp."); + } + if (@tomove) { + if (! -d $TMP) { + doit("install","-d",$TMP); + } + # Now we need to expand wildcards in @tomove. + @filelist=(); + foreach (@tomove) { + push @filelist, glob("debian/tmp/$_"); + } + # Order the files. First all real files, then symlinks. # Putting symlinks last is a nice thing to do for library # packages and doesn't affect much of anything else. - # - # (The echo is in here to expand wildcards. Note that 'ls' - # won't work properly.) - # The file list is used, so even very weird filenames can be - # moved. - doit "rm -f movelist" - for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" -a ! -L "debian/tmp/$i" ]; then - fail=1 - fi - complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print || true) >> movelist" - done - for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" -a ! -L "debian/tmp/$i" ]; then - fail=1 - fi - complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print || true) >> movelist" - done - complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)" - doit "rm -f movelist" - fi -done + doit("rm","-f","movelist"); + foreach (@filelist) { + $ret=1 if (! -e $_ && ! -l $_); + s:^debian/tmp/*::; + complex_doit("(cd debian/tmp ; find $_ ! -type d -and ! -type l -print || true) >> movelist"); + } + foreach (@filelist) { + $ret=1 if (! -e $_ && ! -l $_); + s:^debian/tmp/*::; + complex_doit("(cd debian/tmp ; find $_ ! -type d -and -type l -print || true) >> movelist"); + } + complex_doit("(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"); + doit("rm","-f","movelist"); + } +} -# If fail is set, we wern't actually able to find some +# If $ret is set, we wern't actually able to find some # files that were specified to be moved, and we should -# exit with the code in fail. This program puts off +# exit with the code in $ret. This program puts off # exiting with an error until all files have been tried # to be moved, because this makes it easier for some # packages that arn't always sure exactly which files need # to be moved. -exit $fail +exit $ret; diff --git a/dh_suidregister b/dh_suidregister index f6d02bc1..86188cd4 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # If no parameters are given, and no debian/suid files exists, scan for # suid/sgid files and suidregister them. @@ -6,58 +6,56 @@ # If there are parameters, or there is a debian/suid, register the files # listed there. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - suid=`pkgfile $PACKAGE suid` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $suid=pkgfile($PACKAGE,"suid"); - files="" + @files=(); + if ($suid) { + @files=filearray($suid); + } - if [ "$suid" ]; then - files=`tr "\n" " " < $suid` - fi + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @files, @ARGV; + } - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - files="$* $files" - fi - - if [ ! "$files" -a ! "$suid" ]; then + if (! @files && ! $suid) { # No files specified (and no empty debian/suid file), so # guess what files to process. - files=`find $TMP -type f -perm +6000` + @files=split(/\n/,`find $TMP -type f -perm +6000`); # We will strip the debian working directory off of the # filenames. - tostrip="$TMP/" - else + $tostrip="$TMP/"; + } + else { # We will strip leading /'s, so the user can feed this # program either absolute filenames, or relative filenames, # and it will do the right thing either way. - tostrip="/" - fi - - if [ "$files" ]; then - for file in $files; do - # Strip leading $tostrip from $file. If not there, - # leave $file untouched. - if [ `expr "$file" : "$tostrip\\(.*\\)"` ]; then - file=`expr "$file" : "$tostrip\\(.*\\)"` - fi - - # 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 $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" - - if [ -e "$TMP/$file" ]; then - doit "chmod a-s $TMP/$file" - fi - done - fi -done + $tostrip="/"; + } + + foreach $file (@files) { + # Strip leading $tostrip from $file. + $file=~s/^$tostrip//; + + # 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. + (undef,undef,$mode,undef,$uid,$gid,undef) = stat("$TMP/$file"); + # Note that I have to print mode in ocal, stripping file type. + $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$uid/;s/#GROUP#/$gid/;s/#PERMS#/%#o/", + $mode & 07777); + + autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); + autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); + + if ( -e "$TMP/$file") { + doit("chmod","a-s","$TMP/$file"); + } + } +} diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 1addc3b8..67d25d00 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -106,7 +106,7 @@ switch variable description EXCLUDE_FIND same as DH_EXCLUDE, except all items are put into a string in a way that they will make find find them. (Use ! in front to negate - that, of course) (only available to dh_lib) + that, of course) -x INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. -- cgit v1.2.3 From c56b59c6ee3779a86ab52d92d2fc0341103c23b8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:09 +0000 Subject: r222: Initial Import --- debian/changelog | 9 +++++++++ dh_installinit | 46 ++++++++++++++++++++++++---------------------- dh_perl | 8 ++++---- 3 files changed, 37 insertions(+), 26 deletions(-) (limited to 'dh_installinit') diff --git a/debian/changelog b/debian/changelog index e80107c1..04ba51a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.2.82) unstable; urgency=low + + * dh_installinit: applied patch from Yann Dirson + to make it look for init.d scripts matching the --init-script parameter. + This is only useful if, like Yann, you have packages that need to install + more than 1 init script. + + -- Joey Hess Fri, 25 Jun 1999 11:38:05 -0700 + debhelper (1.2.81) unstable; urgency=low * dh_link: fixed bug #40159 and added a regression test for it. It was diff --git a/dh_installinit b/dh_installinit index d1de1807..6432c513 100755 --- a/dh_installinit +++ b/dh_installinit @@ -9,34 +9,36 @@ init(); foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); - # Debstd used either name, so do we for back-compatability. - $init=pkgfile($PACKAGE,"init") || pkgfile($PACKAGE,"init.d"); + + # Figure out what filename to install it as. + my $script; + if ($dh{D_FLAG}) { + # -d on the command line sets D_FLAG. We will + # remove a trailing 'd' from the package name and + # use that as the name. + $script=$PACKAGE; + if ($script=~m/(.*)d$/) { + $script=$1; + } + else { + warning("\"$PACKAGE\" has no final d' in its name, but -d was specified."); + } + } + elsif ($dh{INIT_SCRIPT}) { + $script=$dh{INIT_SCRIPT}; + } + else { + $script=$PACKAGE; + } + + $init=pkgfile($PACKAGE,$script) || pkgfile($PACKAGE,"init") || + pkgfile($PACKAGE,"init.d"); if ($init ne '') { if (! -d "$TMP/etc/init.d") { doit("install","-d","$TMP/etc/init.d"); } - # Figure out what filename to install it as. - my $script; - if ($dh{D_FLAG}) { - # -d on the command line sets D_FLAG. We will - # remove a trailing 'd' from the package name and - # use that as the name. - $script=$PACKAGE; - if ($script=~m/(.*)d$/) { - $script=$1; - } - else { - warning("\"$PACKAGE\" has no final `d' in its name, but -d was specified."); - } - } - elsif ($dh{INIT_SCRIPT}) { - $script=$dh{INIT_SCRIPT}; - } - else { - $script=$PACKAGE; - } doit("install","-p","-m755",$init,"$TMP/etc/init.d/$script"); # This is set by the -u "foo" command line switch, it's diff --git a/dh_perl b/dh_perl index c8aa6a01..d66dfce5 100755 --- a/dh_perl +++ b/dh_perl @@ -74,14 +74,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { next unless $dep; - if (-e "debian/$EXT\subtsvars") { - open (IN, "; close IN; - open (OUT, ">debian/$EXT\subtsvars"); + open (OUT, ">debian/$EXT\substvars"); print OUT @lines; } else { - open (OUT, ">debian/$EXT\subtsvars"); + open (OUT, ">debian/$EXT\substvars"); } print OUT "perl:Depends=$dep\n"; close OUT; -- cgit v1.2.3 From 6a4c47eea5a5601f351a1fa0afd5e13aed56238b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:11 +0000 Subject: r238: Initial Import --- Dh_Lib.pm | 6 +++--- debian/changelog | 6 ++++++ dh_builddeb | 2 +- dh_clean | 2 +- dh_compress | 2 +- dh_debstd | 2 +- dh_du | 2 +- dh_fixperms | 2 +- dh_gencontrol | 2 +- dh_installchangelogs | 2 +- dh_installcron | 2 +- dh_installdeb | 2 +- dh_installdebfiles | 4 ++-- dh_installdirs | 2 +- dh_installdocs | 2 +- dh_installemacsen | 2 +- dh_installexamples | 2 +- dh_installinfo | 2 +- dh_installinit | 2 +- dh_installmanpages | 2 +- dh_installmenu | 2 +- dh_installmime | 2 +- dh_installmodules | 2 +- dh_installpam | 2 +- dh_installwm | 2 +- dh_installxaw | 6 +++--- dh_link | 2 +- dh_listpackages | 2 +- dh_makeshlibs | 2 +- dh_md5sums | 2 +- dh_movefiles | 2 +- dh_perl | 2 +- dh_shlibdeps | 2 +- dh_strip | 2 +- dh_suidregister | 2 +- dh_testdir | 2 +- dh_testroot | 2 +- dh_testversion | 2 +- dh_undocumented | 2 +- doc/PROGRAMMING | 2 +- 40 files changed, 50 insertions(+), 44 deletions(-) (limited to 'dh_installinit') diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 73fd44ad..c5146b91 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -296,11 +296,11 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename"; } else { - if (-e "/usr/lib/debhelper/autoscripts/$filename") { - $infile="/usr/lib/debhelper/autoscripts/$filename"; + if (-e "/usr/share/debhelper/autoscripts/$filename") { + $infile="/usr/share/debhelper/autoscripts/$filename"; } else { - error("/usr/lib/debhelper/autoscripts/$filename does not exist"); + error("/usr/share/debhelper/autoscripts/$filename does not exist"); } } diff --git a/debian/changelog b/debian/changelog index ec5c5058..d8ced366 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.13) unstable; urgency=low + + * dh_fixperms: FHS fixes (#41058) + + -- Joey Hess Fri, 9 Jul 1999 13:07:49 -0700 + debhelper (2.0.12) unstable; urgency=low * dh_installinfo: fixed #SECTION# substitution. diff --git a/dh_builddeb b/dh_builddeb index 9d760b5e..04c3570a 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -2,7 +2,7 @@ # # Build the .deb package, assuming all the files are set up. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_clean b/dh_clean index a328d12e..e87688de 100755 --- a/dh_clean +++ b/dh_clean @@ -3,7 +3,7 @@ # Clean up $TMP and other tepmorary files generated by the # build process. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_compress b/dh_compress index 73b12ba6..040291fb 100755 --- a/dh_compress +++ b/dh_compress @@ -4,7 +4,7 @@ # compressed files get fixed. use Cwd; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_debstd b/dh_debstd index 1c2f1f05..89cfc182 100755 --- a/dh_debstd +++ b/dh_debstd @@ -38,7 +38,7 @@ foreach (@ARGV) { } @ARGV=@argv; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_du b/dh_du index f81b074d..d0358999 100755 --- a/dh_du +++ b/dh_du @@ -5,7 +5,7 @@ # # No longer - it was decided these files are a bad idea. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; warning("this program does nothing and is deprecated. Remove it from debian/rules."); diff --git a/dh_fixperms b/dh_fixperms index f74a269c..ba4e74d6 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -2,7 +2,7 @@ # # Do some general file permission fixups. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_gencontrol b/dh_gencontrol index cadfdc03..a2d152c4 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -2,7 +2,7 @@ # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installchangelogs b/dh_installchangelogs index 4be52020..3ebb04ec 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -7,7 +7,7 @@ # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installcron b/dh_installcron index 72872668..5b872aca 100755 --- a/dh_installcron +++ b/dh_installcron @@ -2,7 +2,7 @@ # # Install cron scripts into the appropriate places. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdeb b/dh_installdeb index f5f3055a..d3eebe76 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -2,7 +2,7 @@ # # Install files from debian/ into the package's DEBIAN directory. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdebfiles b/dh_installdebfiles index cd4562ea..72c17bcc 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -3,10 +3,10 @@ # This program is deprecated, but left in the package for backwards # compatability. It simply calls the 3 programs that replaced it. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; -$ENV{PATH}="debian:$ENV{PATH}:/usr/lib/debhelper"; +$ENV{PATH}="debian:$ENV{PATH}:/usr/share/debhelper"; warning("use of this program is deprecated, see man page."); diff --git a/dh_installdirs b/dh_installdirs index 2d12b76b..7d5e49c1 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -2,7 +2,7 @@ # # Reads debian/dirs, creates the directories listed there -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdocs b/dh_installdocs index 54e5b8e7..b82b21c2 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -4,7 +4,7 @@ # Also installs the debian/copyright and debian/README.debian and debian/TODO # and handles debian/doc-base. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installemacsen b/dh_installemacsen index 462e3f38..3fbaf8ba 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -2,7 +2,7 @@ # # Registration with emacsen-common. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installexamples b/dh_installexamples index 88e964ba..e8e5e3d6 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -3,7 +3,7 @@ # Reads debian/examples, installs all files listed there into # /usr/doc/$PACKAGE/examples -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installinfo b/dh_installinfo index 20d5e003..8ef2bab3 100755 --- a/dh_installinfo +++ b/dh_installinfo @@ -3,7 +3,7 @@ # Reads debian/info, installs all files listed there into /usr/info # and puts appropriate commands into the postinst. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installinit b/dh_installinit index 6432c513..c43d24d9 100755 --- a/dh_installinit +++ b/dh_installinit @@ -3,7 +3,7 @@ # Install debian/init[.d], and set up the postinst and postrm for init # scripts. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmanpages b/dh_installmanpages index f4dca9a3..6d615a16 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -7,7 +7,7 @@ # This is a little bit (hah!) DWIMish, but still very handy. use File::Find; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmenu b/dh_installmenu index 2db16603..c077f215 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -8,7 +8,7 @@ # # Also, add to postinst and postrm. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmime b/dh_installmime index 232ddc19..7cada574 100755 --- a/dh_installmime +++ b/dh_installmime @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmodules b/dh_installmodules index 1e111e5a..0ee00dce 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -2,7 +2,7 @@ # # Register modules with modutils. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installpam b/dh_installpam index 2262d810..897fd7d8 100755 --- a/dh_installpam +++ b/dh_installpam @@ -4,7 +4,7 @@ # # If debian/pam file exists, save it to $TMP/etc/pam.d/$PACKAGE -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installwm b/dh_installwm index 0cae9147..21ee6300 100755 --- a/dh_installwm +++ b/dh_installwm @@ -2,7 +2,7 @@ # # Add to postinst and postrm to register a window manager. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installxaw b/dh_installxaw index 849fbf00..f9980a6e 100755 --- a/dh_installxaw +++ b/dh_installxaw @@ -7,7 +7,7 @@ # # Also, add calls to postinst and postrm. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); @@ -51,8 +51,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { close IN; if ($stanza) { - $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'"; - $remove_opts.="'$data{'link-name'} $data{wrapped}'"; + $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}' "; + $remove_opts.="'$data{'link-name'} $data{wrapped}' "; } autoscript($PACKAGE,"postinst","postinst-xaw", diff --git a/dh_link b/dh_link index 919dc524..1f6299aa 100755 --- a/dh_link +++ b/dh_link @@ -3,7 +3,7 @@ # Generate symlinks in debian packages, reading debian/links. The # file contains pairs of files and symlinks. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_listpackages b/dh_listpackages index 7a764af5..3ce48e06 100755 --- a/dh_listpackages +++ b/dh_listpackages @@ -2,7 +2,7 @@ # # Output a list of all packages debhelper will act on. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); print join("\n",@{$dh{DOPACKAGES}})."\n"; diff --git a/dh_makeshlibs b/dh_makeshlibs index dbf6bfc9..41bf1614 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -2,7 +2,7 @@ # # Automatically generate shlibs files. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_md5sums b/dh_md5sums index 8015df79..80b5f479 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -4,7 +4,7 @@ # package. use Cwd; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_movefiles b/dh_movefiles index 09159d3b..7978163e 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -2,7 +2,7 @@ # # Move files out of debian/tmp, into subpackages. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_perl b/dh_perl index 0614b9b8..735711c3 100755 --- a/dh_perl +++ b/dh_perl @@ -3,7 +3,7 @@ # Find dependencies on perl stuff # Remove .packlist files -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_shlibdeps b/dh_shlibdeps index f7ac6012..69047dc0 100755 --- a/dh_shlibdeps +++ b/dh_shlibdeps @@ -2,7 +2,7 @@ # # Find dependancies. Simple dpkg-shlibdeps wrapper. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_strip b/dh_strip index ad5d40a8..9d6ab050 100755 --- a/dh_strip +++ b/dh_strip @@ -3,7 +3,7 @@ # Strip files. use File::Find; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_suidregister b/dh_suidregister index 15b1fe4d..dd01c2ce 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -6,7 +6,7 @@ # If there are parameters, or there is a debian/suid, register the files # listed there. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testdir b/dh_testdir index 0cb95c1d..6d9258db 100755 --- a/dh_testdir +++ b/dh_testdir @@ -4,7 +4,7 @@ # Tests for the existance of debian/control, and for the existance # of any other files you specify on the command line. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testroot b/dh_testroot index 629b8f84..6ce2a134 100755 --- a/dh_testroot +++ b/dh_testroot @@ -2,7 +2,7 @@ # # Checks to make sure you are root. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testversion b/dh_testversion index 57c0e588..096aa9e1 100755 --- a/dh_testversion +++ b/dh_testversion @@ -2,7 +2,7 @@ # # Debhelper version check. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; use Dh_Version; # contains the version number of debhelper. init(); diff --git a/dh_undocumented b/dh_undocumented index c4264d6b..77ee3f58 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -6,7 +6,7 @@ # Also, it looks for debian/undocumented files for more lists of # undocumented man pages. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 02b11a21..891d31b0 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -51,7 +51,7 @@ supported now, though.) Use Dh_lib.pm like this: -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); -- cgit v1.2.3