-- cgit v1.2.3 From 4a03496417f521caa06f7f4e02592aa5f0b6a390 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:21:03 +0000 Subject: r5: Initial Import --- README | 15 +++++++++++++++ debian/changelog | 8 ++++++++ debian/control | 1 + debian/rules | 10 ++++++++-- dh_clean | 2 +- dh_installdebfiles | 24 ++++++++++++++++++++++-- dh_installdebfiles.1 | 10 ++++++++++ dh_installdocs | 2 +- dh_installexamples | 2 +- dh_installmenu | 14 ++++++++++++++ dh_installmenu.1 | 10 +++++++++- dh_lib | 46 ++++++++++++++++++++++++++++++++++++++++++---- 12 files changed, 132 insertions(+), 12 deletions(-) diff --git a/README b/README index 8fbaebe0..a13c7726 100644 --- a/README +++ b/README @@ -6,6 +6,21 @@ To help you get started, I've included an example of a debian/rules file that uses debhelper commands extensivly. See /usr/doc/debhelper/examples/rules . +Automatic generation of debian install scripts: +---------------------------------------------- + +Some debhelper commands will automatically generate parts of debian install +scripts. If you want these automatically generated things included in your +debian install scripts, then you need to add "#DEBHELPER#" to your scripts, +in the place the code should be added. "#DEBHELPER#" will be replaced by any +autogenerated code when you run dh_installdebfiles. + +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. + Notes on multiple binary packages: --------------------------------- diff --git a/debian/changelog b/debian/changelog index 7f1faa30..f9041021 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.3) unstable; urgency=low + + * Added support for automatic generation of debian install scripts to + dh_installmenu and dh_installdebfiles and dh_clean. + * Removed some pointless uses of cat. + + -- Joey Hess Fri, 26 Sep 1997 21:52:53 -0400 + debhelper (0.2) unstable; urgency=low * Moved out of unstable, it still has rough edges and incomplete bits, but diff --git a/debian/control b/debian/control index b934849f..35ad8f04 100644 --- a/debian/control +++ b/debian/control @@ -6,6 +6,7 @@ Standards-Version: 2.1.1.0 Package: debhelper Architecture: all +Depends: perl Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to automate common tasks. Programs are included to install various files into diff --git a/debian/rules b/debian/rules index 247b48b5..c6a4fa95 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,11 @@ #!/usr/bin/make -f # Note that I have to refer to debhelper programs witrh ./, to make sure -# I run the most current ones. +# I run the most current ones. That's also why there is a symlink to the +# current dh_lib 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. +export DH_AUTOSCRIPTDIR=autoscripts export DH_VERBOSE=1 @@ -29,10 +34,11 @@ binary-indep: build -exec install -p {} debian/tmp/usr/bin \; install -d debian/tmp/usr/lib/debhelper cp dh_lib debian/tmp/usr/lib/debhelper + cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs TODO README ./dh_installexamples examples/* -# ./dh_installmenu + ./dh_installmenu ./dh_installmanpages ./dh_installchangelogs ./dh_compress diff --git a/dh_clean b/dh_clean index e7bec968..cb20e973 100755 --- a/dh_clean +++ b/dh_clean @@ -12,7 +12,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "rm -rf debian/$TMP" doit "rm -f debian/${EXT}substvars" done -doit "rm -f debian/files* $*" +doit "rm -f debian/files* debian/*.debhelper $*" # Remove other temp files. I don't run this through doit becuase # I haven't figured out what I have to esacape to put it in quotes. diff --git a/dh_installdebfiles b/dh_installdebfiles index 872eacbb..a09cd128 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -14,10 +14,30 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -o root -g root -d debian/$TMP/DEBIAN" fi - # Install executable files. + # 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 - doit "install -o root -g root -p debian/$EXT$file debian/$TMP/DEBIAN" + # Add this into the script, where it has #DEBHELPER# + if [ -f debian/$EXT$file.debhelper ]; then + verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > debian/$TMP/DEBIAN/$EXT$file" + perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > debian/$TMP/DEBIAN/$EXT$file + doit "chown root.root debian/$TMP/DEBIAN/$EXT$file" + doit "chmod 755 debian/$TMP/DEBIAN/$EXT$file" + else + doit "install -o root -g root -p debian/$EXT$file debian/$TMP/DEBIAN/" + fi + else + # Auto-generate script header and add .debhelper + # content to it. + if [ -f debian/$EXT$file.debhelper ]; then + verbose_echo "echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$EXT$file" + echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$EXT$file + verbose_echo "cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$EXT$file" + cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$EXT$file + doit "chown root.root debian/$TMP/DEBIAN/$EXT$file" + doit "chmod 755 debian/$TMP/DEBIAN/$EXT$file" + fi fi done diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 1f62084a..3f639868 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -22,6 +22,16 @@ the DEBIAN directory: prefix these filenames with then name of the "package.", for example, "foo.postinst".) .P +The files postinst, preinst, postrm, and prerm are handled specially: If a +corresponding file named debian/script.debhelper exists, the contents of that +file are merged into the script as follows: If the script exists, then +anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper file is +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. +.P In addition, it will generate a DEBIAN/control file, by running .BR dpkg-shlibdeps (1) and diff --git a/dh_installdocs b/dh_installdocs index 336ed6ee..dc216288 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -17,7 +17,7 @@ for PACKAGE in $DH_DOPACKAGES; do docs="" if [ -e debian/${EXT}docs ]; then - docs=`cat debian/${EXT}docs | tr "\n" " "` + docs=`tr "\n" " " < debian/${EXT}docs` fi if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then diff --git a/dh_installexamples b/dh_installexamples index 06e28d61..f82b0004 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -13,7 +13,7 @@ for PACKAGE in $DH_DOPACKAGES; do examples="" if [ -e debian/${EXT}examples ]; then - examples=`cat debian/${EXT}examples | tr "\n" " "` + examples=`tr "\n" " " < debian/${EXT}examples` fi if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then diff --git a/dh_installmenu b/dh_installmenu index 775945aa..1180c60b 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -5,6 +5,8 @@ # If debian/menu file exists, save it to debian/$TMP/usr/lib/menu/$PACKAGE # If debian/menu-method file exists, save it to # debian/$TMP/etc/menu-methods/$PACKAGE +# +# Also, add to postinst and postrm. PATH=debian:$PATH:/usr/lib/debhelper source dh_lib @@ -18,6 +20,13 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/usr/lib/menu" fi doit "install -p -m644 debian/${EXT}menu debian/$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 + autoscript "postinst" "postinst-menu" + autoscript "postrm" "postrm-menu" + fi fi if [ -e debian/${EXT}menu-method ]; then @@ -25,5 +34,10 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/etc/menu-methods" fi doit "install -p debian/${EXT}menu-method debian/$TMP/etc/menu-methods/$PACKAGE" + + if [ ! "$DH_NOSCRIPTS" ]; then + autoscript "postinst" "postinst-menu-method" "s/#PACKAGE#/$PACKAGE/" + autoscript "postrm" "postrm-menu-method" "s/#PACKAGE#/$PACKAGE/" + fi fi done diff --git a/dh_installmenu.1 b/dh_installmenu.1 index c7fa1bf3..f3eba625 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -6,7 +6,12 @@ dh_installmenu \- install debian menu files into package build directories .I "[-v] [-a] [-i] [-ppackage]" .SH "DESCRIPTION" dh_installmenu is a debhelper program that is responsible for installing -fils used by the debian menu package into package build directories. +fils used by the debian menu package into package build directories. +.P +It also automatically generates the postinst and postrm commands needed to +interface with the debian menu package. See +.BR dh_installdebfiles (1) +for an explanation of how this works. .P If a file named debian/menu exists, then it is installed into usr/lib/menu/package in the package build directory. This is a debian menu @@ -32,6 +37,9 @@ Install menu files into all architecture independent packages. .TP .B \-ppackage Install menu files into the package named "package". +.TP +.B \-n +Do not automatically generate code. .SH NOTES The .B \-a diff --git a/dh_lib b/dh_lib index b8562cdf..b18c7e5a 100644 --- a/dh_lib +++ b/dh_lib @@ -3,15 +3,17 @@ # Run a command, and display the command to stdout if verbose mode is on. # All commands that modifiy files in debian/$TMP should be ran via this # function. +# Unfortunatly, this function doesn't work if your command uses redirection, +# you will have to call verbose_echo by hand then. function doit() { - verbose_echo "$1" - $1 + verbose_echo "$*" + $* } # Echo something if the verbose flag is on. function verbose_echo() { if [ "$DH_VERBOSE" ]; then - echo " $1" + echo " $*" fi } @@ -40,10 +42,42 @@ function pkgext() { fi } +# Automatically add a shell script snippet to a debian script. +# Only works if the script has #DEBHELPER# in it. +# +# Parameters: +# 1: script to add to +# 2: filename of snippet +# 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ +function autoscript() { + autoscript_script=$1 + autoscript_filename=$2 + autoscript_sed=$3 + autoscript_debscript=debian/`pkgext $PACKAGE`$autoscript_script.debhelper + + if [ -e "$DH_AUTOSCRIPTDIR/$autoscript_filename" ]; then + autoscript_filename="$DH_AUTOSCRIPTDIR/$autoscript_filename" + else + if [ -e "/usr/lib/debhelper/autoscripts/$autoscript_filename" ]; then + autoscript_filename="/usr/lib/debhelper/autoscripts/$autoscript_filename" + else + error "/usr/lib/debhelper/autoscripts/$autoscript_filename does not exist" + fi + fi + + # Running doit doesn't cut it here. + verbose_echo echo "# Automatically added by `basename $0` on `822-date`" ">>" $autoscript_debscript + echo "# Automatically added by `basename $0` on `822-date`" >> $autoscript_debscript + verbose_echo sed "$autoscript_sed" $autoscript_filename ">>" $autoscript_debscript + sed "$autoscript_sed" $autoscript_filename >> $autoscript_debscript + verbose_echo echo "# End automatically added section" ">>" $autoscript_debscript + echo "# End automatically added section" >> $autoscript_debscript +} + # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt viap: $*` +set -- `getopt vianp: $*` for i; do case "$i" @@ -65,6 +99,10 @@ for i; do shift shift ;; + -n) + DH_NOSCRIPTS=1 + shift + ;; --) shift break -- cgit v1.2.3 From 93a4b4298d7ec022216f403674583dd04b7f4f5e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:24:34 +0000 Subject: r8: Initial Import --- TODO | 2 +- debian/changelog | 7 +++++++ dh_fixperms.1 | 2 +- dh_installcron | 20 ++++++++++++++++++++ dh_installcron.1 | 44 ++++++++++++++++++++++++++++++++++++++++++++ dh_installdebfiles | 2 +- dh_installdebfiles.1 | 2 +- dh_installmanpages.1 | 2 +- dh_installmenu.1 | 2 +- dh_strip | 30 ++++++++++++++++++++++++++++++ dh_testdir.1 | 2 +- dh_testroot.1 | 2 +- examples/rules | 1 + examples/rules.multi | 1 + 14 files changed, 111 insertions(+), 8 deletions(-) create mode 100755 dh_installcron create mode 100644 dh_installcron.1 create mode 100755 dh_strip diff --git a/TODO b/TODO index 078a1d4e..8bf234fd 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ .so files of compressed manpages change to symlinks -edit package scripts (??) add all other functionality of debstd (??) dh_fixperms: allow listing of files not to be touched (diffucult). +add suidregister support diff --git a/debian/changelog b/debian/changelog index f9041021..27594de9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.4) unstable; urgency=low + + * Added dh_strip to strip binaries and libraries. + * Fixed several man pages. + + -- Joey Hess Sun, 28 Sep 1997 20:46:32 -0400 + debhelper (0.3) unstable; urgency=low * Added support for automatic generation of debian install scripts to diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 6722bd11..b5cb4e13 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_FIXPERMS 1 .SH NAME dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS diff --git a/dh_installcron b/dh_installcron new file mode 100755 index 00000000..7db8cdc6 --- /dev/null +++ b/dh_installcron @@ -0,0 +1,20 @@ +#!/bin/sh -e +# +# Install cron scripts into the appropriate places. + +PATH=debian:$PATH:/usr/lib/debhelper +source dh_lib + +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 + if [ ! -d debian/$TMP/etc/cron.$type ]; then + doit "install -o root -g root -d debian/$TMP/etc/cron.$type" + fi + doit "install debian/${EXT}cron.$type debian/$TMP/etc/cron.$type/$PACKAGE" + fi + done +done diff --git a/dh_installcron.1 b/dh_installcron.1 new file mode 100644 index 00000000..2819958b --- /dev/null +++ b/dh_installcron.1 @@ -0,0 +1,44 @@ +.TH DH_INSTALLCRON 1 +.SH NAME +dh_installcron \- install cron scripts into etc/cron.* +.SH SYNOPSIS +.B dh_installcron +.I "[-v] [-a] [-i] [-ppackage]" +.SH "DESCRIPTION" +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. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install cron files for all architecture dependent packages. +.TP +.B \-i +Install cron files for all architecture independent packages. +.TP +.B \-ppackage +Install cron files for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_installdebfiles b/dh_installdebfiles index a09cd128..37c63089 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -50,7 +50,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Run dpkg-shlibdeps to generate dependancies. filelist="" - for file in `find debian/$TMP -type f \( -perm +111 \) -or -name "*.so.*" | tr "\n" " "` ; do + for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do case "`file $file`" in *ELF*) filelist="$file $filelist" diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 3f639868..3a7e93c5 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_INSTALLDEBFILES 1 .SH NAME dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index 5fbad2b1..bb08181b 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_INSTALLMANPAGES 1 .SH NAME dh_installmanpages \- install man pages into package build directories .SH SYNOPSIS diff --git a/dh_installmenu.1 b/dh_installmenu.1 index f3eba625..e26c84e5 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_INSTALLMENU 1 .SH NAME dh_installmenu \- install debian menu files into package build directories .SH SYNOPSIS diff --git a/dh_strip b/dh_strip new file mode 100755 index 00000000..2ecdcd2c --- /dev/null +++ b/dh_strip @@ -0,0 +1,30 @@ +#!/bin/sh -e +# +# Strip files. + +PATH=debian:$PATH:/usr/lib/debhelper +source dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + # Handle executables and shared libraries. + for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do + case "`file $file`" in + *ELF*shared*) + doit "strip --strip-unneeded $file" + ;; + *ELF*executable*) + doit "strip --remove-section=comment --remove-section=note $file" + ;; + esac + done + + # Handle static libraries. + for file in `find debian/$TMP -type f -name "lib*.a" 2>/dev/null` ; do + # Don't strip debug libraries. + if ! expr "$file" : ".*_g\.a" >/dev/null ; then + doit "strip --strip-debug $file" + fi + done +done diff --git a/dh_testdir.1 b/dh_testdir.1 index 569a580b..da245542 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_TESTDIR 1 .SH NAME dh_testdir \- test directory before building debian package .SH SYNOPSIS diff --git a/dh_testroot.1 b/dh_testroot.1 index f4dca2e5..78caa7e9 100644 --- a/dh_testroot.1 +++ b/dh_testroot.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_TESTROOT 1 .SH NAME dh_testroot \- ensure that a package is built as root .SH SYNOPSIS diff --git a/examples/rules b/examples/rules index b18213c3..efd4b76c 100755 --- a/examples/rules +++ b/examples/rules @@ -35,6 +35,7 @@ binary-arch: build dh_installmenu dh_installmanpages dh_installchangelogs + dh_strip dh_compress dh_installdebfiles dh_fixperms diff --git a/examples/rules.multi b/examples/rules.multi index 118737cb..b31578e6 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -51,6 +51,7 @@ binary-arch: build dh_installmenu -a dh_installmanpages -a dh_installchangelogs -a + dh_strip -a dh_compress -a dh_installdebfiles -a dh_fixperms -a -- cgit v1.2.3 From dd838eee7e75da018b2722f0ce4dbccd9f6d1a5d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:24:34 +0000 Subject: r10: Initial Import --- debian/changelog | 6 ++++++ dh_installdebfiles.1 | 2 +- examples/rules | 1 + examples/rules.multi | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 27594de9..99a22f79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.5) unstable; urgency=low + + * Added dh_installcron to install cron jobs. + + -- Joey Hess Tue, 30 Sep 1997 19:37:41 -0400 + debhelper (0.4) unstable; urgency=low * Added dh_strip to strip binaries and libraries. diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 3a7e93c5..9827656a 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -7,7 +7,7 @@ dh_installdebfiles \- install files into the DEBIAN directory .SH "DESCRIPTION" dh_installdebfiles is a debhelper program that is responsible for installing files into the DEBIAN directory in package build directories with the -correct prmissions. +correct permissions. .P dh_installdocs automatically installs the following files from debian/ into the DEBIAN directory: diff --git a/examples/rules b/examples/rules index efd4b76c..65e6878e 100755 --- a/examples/rules +++ b/examples/rules @@ -33,6 +33,7 @@ binary-arch: build dh_installdocs dh_installexamples dh_installmenu + dh_installcron dh_installmanpages dh_installchangelogs dh_strip diff --git a/examples/rules.multi b/examples/rules.multi index b31578e6..f5e82597 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -32,6 +32,7 @@ binary-indep: build dh_installdocs -i dh_installexamples -i dh_installmenu -i + dh_installcron -i # dh_installmanpages -i dh_installchangelogs -i dh_compress -i @@ -49,6 +50,7 @@ binary-arch: build dh_installdocs -a dh_installexamples -a dh_installmenu -a + dh_installcron -a dh_installmanpages -a dh_installchangelogs -a dh_strip -a -- cgit v1.2.3 From d079e6683cfcbef6a979eb7a02780eebdf480a74 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:34:25 +0000 Subject: r12: Initial Import --- .foo | 0 BUGS | 3 + autoscripts/postinst-init | 2 + autoscripts/postinst-init-norestart | 1 + autoscripts/postinst-suid | 6 ++ autoscripts/postrm-init | 3 + autoscripts/postrm-suid | 3 + autoscripts/prerm-init | 1 + debian/changelog | 6 ++ dh_builddeb | 2 +- dh_clean | 2 +- dh_compress | 2 +- dh_du | 19 +++++ dh_du.1 | 42 +++++++++++ dh_fixperms | 2 +- dh_gencontrol | 19 +++++ dh_gencontrol.1 | 55 ++++++++++++++ dh_getopt.pl | 138 ++++++++++++++++++++++++++++++++++++ dh_installchangelogs | 2 +- dh_installcron | 2 +- dh_installdeb | 46 ++++++++++++ dh_installdeb.1 | 67 +++++++++++++++++ dh_installdebfiles | 2 +- dh_installdirs | 39 ++++++++++ dh_installdirs.1 | 59 +++++++++++++++ dh_installdocs | 2 +- dh_installdocs.1 | 13 ++-- dh_installexamples | 2 +- dh_installexamples.1 | 4 ++ dh_installinit | 58 +++++++++++++++ dh_installinit.1 | 70 ++++++++++++++++++ dh_installmanpages | 2 +- dh_installmenu | 2 +- dh_lib | 12 ++-- dh_makeshlibs | 30 ++++++++ dh_makeshlibs.1 | 47 ++++++++++++ dh_md5sums | 22 ++++++ dh_md5sums.1 | 45 ++++++++++++ dh_movefiles.1 | 46 ++++++++++++ dh_shlibdeps | 24 +++++++ dh_shlibdeps.1 | 56 +++++++++++++++ dh_strip | 2 +- dh_suidregister | 58 +++++++++++++++ dh_suidregister.1 | 62 ++++++++++++++++ dh_testdir | 2 +- dh_testroot | 2 +- dh_testversion.1 | 46 ++++++++++++ dh_testversion.in | 23 ++++++ dh_undocumented | 51 +++++++++++++ dh_undocumented.1 | 68 ++++++++++++++++++ examples/rules.indep | 56 +++++++++++++++ 51 files changed, 1304 insertions(+), 24 deletions(-) create mode 100644 .foo create mode 100644 BUGS create mode 100644 autoscripts/postinst-init create mode 100644 autoscripts/postinst-init-norestart create mode 100644 autoscripts/postinst-suid create mode 100644 autoscripts/postrm-init create mode 100644 autoscripts/postrm-suid create mode 100644 autoscripts/prerm-init create mode 100755 dh_du create mode 100644 dh_du.1 create mode 100755 dh_gencontrol create mode 100644 dh_gencontrol.1 create mode 100755 dh_getopt.pl create mode 100755 dh_installdeb create mode 100644 dh_installdeb.1 create mode 100755 dh_installdirs create mode 100644 dh_installdirs.1 create mode 100755 dh_installinit create mode 100644 dh_installinit.1 create mode 100755 dh_makeshlibs create mode 100644 dh_makeshlibs.1 create mode 100755 dh_md5sums create mode 100644 dh_md5sums.1 create mode 100644 dh_movefiles.1 create mode 100755 dh_shlibdeps create mode 100644 dh_shlibdeps.1 create mode 100755 dh_suidregister create mode 100644 dh_suidregister.1 create mode 100644 dh_testversion.1 create mode 100644 dh_testversion.in create mode 100755 dh_undocumented create mode 100644 dh_undocumented.1 create mode 100755 examples/rules.indep diff --git a/.foo b/.foo new file mode 100644 index 00000000..e69de29b diff --git a/BUGS b/BUGS new file mode 100644 index 00000000..3a33f32e --- /dev/null +++ b/BUGS @@ -0,0 +1,3 @@ +dh_compress: doesn't verbose echo that it's cd'd to $TMP. +dh_installdirs, dh_md5sums: uses ../.. to cd back to original location, but + we don't know that $TMP is 2 levels deep. diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init new file mode 100644 index 00000000..976c6b34 --- /dev/null +++ b/autoscripts/postinst-init @@ -0,0 +1,2 @@ +update-rc.d #SCRIPT# #INITPARMS# >/dev/null +/etc/init.d/#SCRIPT# start diff --git a/autoscripts/postinst-init-norestart b/autoscripts/postinst-init-norestart new file mode 100644 index 00000000..05357d07 --- /dev/null +++ b/autoscripts/postinst-init-norestart @@ -0,0 +1 @@ +update-rc.d #SCRIPT# #INITPARMS# >/dev/null diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid new file mode 100644 index 00000000..1294d313 --- /dev/null +++ b/autoscripts/postinst-suid @@ -0,0 +1,6 @@ +if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]; then + suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# +else + chown #OWNER#.#GROUP# /#FILE# + chmod #PERMS# /#FILE# +fi diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init new file mode 100644 index 00000000..9596dd97 --- /dev/null +++ b/autoscripts/postrm-init @@ -0,0 +1,3 @@ +if [ "$1" = "purge" ] ; then + update-rc.d #SCRIPT# remove #INITPARMS# >/dev/null +fi diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid new file mode 100644 index 00000000..9712d256 --- /dev/null +++ b/autoscripts/postrm-suid @@ -0,0 +1,3 @@ +if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]; then + suidunregister -s #PACKAGE# /#FILE# +fi diff --git a/autoscripts/prerm-init b/autoscripts/prerm-init new file mode 100644 index 00000000..64975a38 --- /dev/null +++ b/autoscripts/prerm-init @@ -0,0 +1 @@ +/etc/init.d/#SCRIPT# stop diff --git a/debian/changelog b/debian/changelog index 99a22f79..a4d47c4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.6) unstable; urgency=low + + * Got rid of bashisms - this package should work now if /bin/sh is ash. + + -- Joey Hess Fri, 10 Oct 1997 15:24:40 -0400 + debhelper (0.5) unstable; urgency=low * Added dh_installcron to install cron jobs. diff --git a/dh_builddeb b/dh_builddeb index 7bea3c06..aea8a1b1 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -3,7 +3,7 @@ # Build the .deb package, assuming all the files are set up. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_clean b/dh_clean index cb20e973..964eec3d 100755 --- a/dh_clean +++ b/dh_clean @@ -4,7 +4,7 @@ # build process. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_compress b/dh_compress index a1ff97e3..347f0f5f 100755 --- a/dh_compress +++ b/dh_compress @@ -4,7 +4,7 @@ # compressed files get fixed. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_du b/dh_du new file mode 100755 index 00000000..a7ec6f48 --- /dev/null +++ b/dh_du @@ -0,0 +1,19 @@ +#!/bin/sh -e +# +# Generate a DEBIAN/du file, that lists the disk usage of the directories in +# the package. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ ! -d "debian/$TMP/DEBIAN" ]; then + doit "install -d debian/$TMP/DEBIAN" + fi + + verbose_echo "du -k debian/$TMP | sed \"s: debian/$TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" debian/$TMP$\" > debian/$TMP/DEBIAN/du" + du -k debian/$TMP | sed "s: debian/$TMP/: :" | grep -v " DEBIAN$" | grep -v " debian/$TMP$" >debian/$TMP/DEBIAN/du + doit "chown root.root debian/tmp/DEBIAN/du" +done diff --git a/dh_du.1 b/dh_du.1 new file mode 100644 index 00000000..98a9c80a --- /dev/null +++ b/dh_du.1 @@ -0,0 +1,42 @@ +.TH DH_DU 1 +.SH NAME +dh_du \- generate DEBIAN/du file +.SH SYNOPSIS +.B dh_md5sums +.I "[-v] [-a] [-i] [-ppackage]" +.SH "DESCRIPTION" +dh_du is a debhelper program that is responsible for generating +a DEBIAN/du file, which lists the disk usage of directories in the package. +This file isn't used by anthing yet, but it could be helpful for a future +debian installer program. +.P +The du file is installed with proper permissions and ownerships. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Generate du files for all architecture dependent packages. +.TP +.B \-i +Generate du files for all architecture independent packages. +.TP +.B \-ppackage +Generate du file for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_fixperms b/dh_fixperms index 97738313..6e935a8a 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -3,7 +3,7 @@ # Do some general file permission fixups. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_gencontrol b/dh_gencontrol new file mode 100755 index 00000000..e2a4e701 --- /dev/null +++ b/dh_gencontrol @@ -0,0 +1,19 @@ +#!/bin/sh -e +# +# Generate and install the control file. Simple dpkg-gencontrol wrapper. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ ! -d $TMP/DEBIAN ]; then + doit "install -o root -g root -d $TMP/DEBIAN" + fi + + # Generate and install control file. + doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit "chown root.root $TMP/DEBIAN/control" +done diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 new file mode 100644 index 00000000..7b78248f --- /dev/null +++ b/dh_gencontrol.1 @@ -0,0 +1,55 @@ +.TH DH_INSTALLDEBFILES 1 +.SH NAME +dh_gencontrol \- generate and install control file +.SH SYNOPSIS +.B dh_gencontrol +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-uparams]" +.SH "DESCRIPTION" +dh_gencontrol is a debhelper program that is responsible for generating and +installing control files, and installing them into the DEBIAN directory with +the proper permissions. +.P +This program is merely a wrapper around +.BR dpkg-gencontrol (1) +You may prefer to simply run +.BR dpkg-gencontrol (1) +by hand. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install files for all architecture dependent packages. +.TP +.B \-i +Install files for all architecture independent packages. +.TP +.B \-ppackage +Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B \-uparams +Pass "params" to +.BR dpkg-gencontrol (1) +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.BR dpkg-shlibdeps (1) +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_getopt.pl b/dh_getopt.pl new file mode 100755 index 00000000..bb7d5133 --- /dev/null +++ b/dh_getopt.pl @@ -0,0 +1,138 @@ +#!/usr/bin/perl +# +# Because the getopt() program is so horribly broken, I wrote my own argument +# processer that uses the find Getopt::Long module. This is used by all +# debhelper scripts. +# +# Joey Hess, GPL copyright 1998. + +# Returns a list of packages in the control file. +# Must pass "arch" or "indep" to specify arch-dependant or -independant +# packages. +sub GetPackages { $type=shift; + my $package; + my $arch; + my @list; + open (CONTROL,") { + chomp; + s/\s+$//; + if (/^Package:\s+(.*)/) { + $package=$1; + } + if (/^Architecture:\s+(.*)/) { + $arch=$1; + } + if (!$_ or eof) { # end of stanza. + if ($package && + (($type eq 'indep' && $arch eq 'all') || + ($type eq 'arch' && $arch ne 'all'))) { + push @list, $package; + undef $package, $arch; + } + } + } + close CONTROL; + + return @list; +} + +# Passed an option name and an option value, adds packages to the list +# of packages. We need this so the list will be built up in the right +# order. +sub AddPackage { my($option,$value)=@_; + if ($option eq 'i' or $option eq 'indep') { + push @packages, GetPackages('indep'); + $indep=1; + } + elsif ($option eq 'a' or $option eq 'arch') { + push @packages, GetPackages('arch'); + $arch=1; + } + elsif ($option eq 'p' or $option eq 'package') { + push @packages, $value; + } + else { + $parse_error="bad option $option - should never happen!\n"; + } +} + +use Getopt::Long; + +# Enable bundling of short command line options. +Getopt::Long::config("bundling"); + +# Parse options. +GetOptions( + "v" => \$verbose, + "verbose" => \$verbose, + + "i" => \&AddPackage, + "indep" => \&AddPackage, + + "a" => \&AddPackage, + "arch" => \&AddPackage, + + "p=s" => \&AddPackage, + "package=s" => \&AddPackage, + + "n" => \$noscripts, + "noscripts" => \$noscripts, + + "x" => \$include, # is -x for some unknown historical reason.. + "include-conffiles" => \$include, + + "d" => \$d_flag, + "remove-d" => \$d_flag, + + "r" => \$r_flag, + "no-restart-on-upgrade" => \$r_flag, + + "k" => \$k_flag, + "keep" => \$k_flag, + + "P=s" => \$tmpdir, + "tmpdir=s" => \$tmpdir, + + "u=s", => \$u_params, + "update-rcd-params=s", => \$u_params, + "dpkg-shlibdeps-params=s", => \$u_params, + + "m=s", => \$major, + "major=s" => \$major, + + "V:s", => \$version_info, + "version-info:s" => \$version_info, + + "A" => \$all, + "all" => \$all, +); + +# Check to see if -V was specified. If so, but no parameters were passed, +# the variable will be defined but empty. +if (defined($version_info)) { + $version_info_set=1; +} + +# Now output everything, in a format suitable for a shell to eval it. +# Note the last line sets $@ in the shell to whatever arguements remain. +print qq{ +DH_VERBOSE='$verbose' +DH_DOPACKAGES='@packages' +DH_DOINDEP='$indep' +DH_DOARCH='$arch' +DH_NOSCRIPTS='$noscripts' +DH_EXCLUDE='$include' +DH_D_FLAG='$d_flag' +DH_R_FLAG='$r_flag' +DH_K_FLAG='$k_flag' +DH_TMPDIR='$tmpdir' +DH_U_PARAMS='$u_params' +DH_M_PARAMS='$major' +DH_V_FLAG='$version_info' +DH_V_FLAG_SET='$version_info_set' +DH_PARAMS_ALL='$all' +DH_PARSE_ERROR='$parse_error' +set -- @ARGV +}; diff --git a/dh_installchangelogs b/dh_installchangelogs index 4a93188c..17ff7312 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -8,7 +8,7 @@ # error to specify an upstream changelog on the command line. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib UPSTREAM=$1 diff --git a/dh_installcron b/dh_installcron index 7db8cdc6..f5c4f8b8 100755 --- a/dh_installcron +++ b/dh_installcron @@ -3,7 +3,7 @@ # Install cron scripts into the appropriate places. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installdeb b/dh_installdeb new file mode 100755 index 00000000..43aca902 --- /dev/null +++ b/dh_installdeb @@ -0,0 +1,46 @@ +#!/bin/sh -e +# +# Install files from debian/ into the package's DEBIAN directory. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ ! -d $TMP/DEBIAN ]; then + doit "install -o root -g root -d $TMP/DEBIAN" + fi + + # 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 + # Add this into the script, where it has #DEBHELPER# + if [ -f debian/$EXT$file.debhelper ]; then + complex_doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < debian/$EXT$file > $TMP/DEBIAN/$file" + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" + else + doit "install -o root -g root -p debian/$EXT$file $TMP/DEBIAN/$file" + fi + 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 + + # 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" + fi + done +done diff --git a/dh_installdeb.1 b/dh_installdeb.1 new file mode 100644 index 00000000..08b6cbae --- /dev/null +++ b/dh_installdeb.1 @@ -0,0 +1,67 @@ +.TH DH_INSTALLDEBFILES 1 +.SH NAME +dh_installdeb \- install files into the DEBIAN directory +.SH SYNOPSIS +.B dh_installdeb +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.SH "DESCRIPTION" +dh_installdeb is a debhelper program that is responsible for installing +files into the DEBIAN directory in package build directories with the +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 +.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".) +.P +The files postinst, preinst, postrm, and prerm are handled specially: If a +corresponding file named debian/script.debhelper exists, the contents of that +file are merged into the script as follows: If the script exists, then +anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper file is +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. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install files for all architecture dependent packages. +.TP +.B \-i +Install files for all architecture independent packages. +.TP +.B \-ppackage +Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_installdebfiles b/dh_installdebfiles index 37c63089..58aed3b3 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -4,7 +4,7 @@ # Also generates the control file. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installdirs b/dh_installdirs new file mode 100755 index 00000000..bab883d7 --- /dev/null +++ b/dh_installdirs @@ -0,0 +1,39 @@ +#!/bin/sh -e +# +# Reads debian/dirs, creates the directories listed there there + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then + doit "install -d $TMP/usr/doc/$PACKAGE" + fi + + dirs="" + + if [ -e debian/${EXT}dirs ]; then + dirs=`tr "\n" " " < debian/${EXT}dirs` + fi + + if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + dirs="$* $dirs" + fi + + if [ "$dirs" ]; then + # Check to see if any of the dirs are absolute. + for dir in "$dirs" ; do + if expr "$dir" : "/" >/dev/null ; then + error "Absolute directory name \"$dir\" specified." + fi + done + # Create dirs. + verbose_echo "cd $TMP && install -d $dirs && cd ../.." + cd $TMP + install -d $dirs + cd ../.. + fi +done diff --git a/dh_installdirs.1 b/dh_installdirs.1 new file mode 100644 index 00000000..41dd0fd8 --- /dev/null +++ b/dh_installdirs.1 @@ -0,0 +1,59 @@ +.TH DH_INSTALLDIRS 1 +.SH NAME +dh_installdirs \- create subdirectories in package build directories +.SH SYNOPSIS +.B dh_installdirs +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [dir ...]" +.SH "DESCRIPTION" +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. +.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. Seperate 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. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Create directories for all architecture dependent packages. +.TP +.B \-i +Create directories for all architecture independent packages. +.TP +.B \-ppackage +Create directories for the package named "package". +.TP +.B \-Ptmpdir +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. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH BUGS +Directories with spaces in them will not currently be installed. +.SH AUTHOR +Joey Hess diff --git a/dh_installdocs b/dh_installdocs index dc216288..90be53c7 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -4,7 +4,7 @@ # Also installs the debian/copyright and debian/README.debian and debian/TODO PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installdocs.1 b/dh_installdocs.1 index f21563ca..4b5f068e 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -12,10 +12,11 @@ dh_installdocs automatically installs debian/copyright if it exists. If dh_installdocs is acting on multiple packages, debian/copyright files will be installed into all packages. .P -Any filenames specified as parameters, as well as debian/README.debian and -debian/TODO, if they exist, will be installed into the first binary -package listed in debian/control, if dh_installdocs is acting on that -package. +Any filenames specified as parameters, as well as debian/README.debian (or +debian/README.Debian) and debian/TODO, if they exist, will be installed into +the first binary package listed in 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 @@ -45,6 +46,10 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. +.P +Note that dh_installdocs will happily copy entire directory hiearchies if +you ask it to (it uses cp -a internally). If it is asked to install a +directory, it will install the complete contents of the directory. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_installexamples b/dh_installexamples index f82b0004..23d11af8 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -4,7 +4,7 @@ # /usr/doc/$PACKAGE/examples PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 1fb5c44a..e7ad6c62 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -40,6 +40,10 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. +.P +Note that dh_examples will happily copy entire directory hiearchies if +you ask it to (it uses cp -a internally). If it is asked to install a +directory, it will install the complete contents of the directory. .SH ENVIRONMENT .TP .I DH_VERBOSE 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 diff --git a/dh_installinit.1 b/dh_installinit.1 new file mode 100644 index 00000000..4eb4ee07 --- /dev/null +++ b/dh_installinit.1 @@ -0,0 +1,70 @@ +.TH DH_INSTALLINIT 1 +.SH NAME +dh_installinit \- install init scripts into package build directories +.SH SYNOPSIS +.B dh_installinit +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-u params]" +.SH "DESCRIPTION" +dh_installmenu is a debhelper program that is responsible for installing +init scripts into package build directories. +.P +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.) +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install init scripts into all architecture dependent packages. +.TP +.B \-i +Install init scripts into all architecture independent packages. +.TP +.B \-ppackage +Install init scripts into the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B \-n +Do not modify postinst/postrm/prerm scripts. +.TP +.B \-r +Do not restart daemon on upgrade. +.TP +.B \-d +Remove trailing "d" from the name of the package, and use the result for the +filename the init script is installed as in etc/init.d/ . This may be useful +for daemons with named ending in "d". +.TP +.B \-u params +Pass "params" to +.BR update-rc.d (8) +If not specified, "default" will be passed to +.BR update-rc.d (8) +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_installmanpages b/dh_installmanpages index 7ee35a90..304c3b12 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -5,7 +5,7 @@ # This is a little bit DWIMish, but still very handy. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_installmenu b/dh_installmenu index 1180c60b..c837e04f 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -9,7 +9,7 @@ # Also, add to postinst and postrm. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_lib b/dh_lib index b18c7e5a..618953d8 100644 --- a/dh_lib +++ b/dh_lib @@ -5,20 +5,20 @@ # function. # Unfortunatly, this function doesn't work if your command uses redirection, # you will have to call verbose_echo by hand then. -function doit() { +doit() { verbose_echo "$*" $* } # Echo something if the verbose flag is on. -function verbose_echo() { +verbose_echo() { if [ "$DH_VERBOSE" ]; then echo " $*" fi } # Echo an error message and exit. -function error() { +error() { echo `basename $0`": $1" >&2 exit 1 } @@ -26,7 +26,7 @@ function error() { # Pass it a name of a binary package, it returns the name of the tmp dir to # use, for that package, relative to debian/ # This is for back-compatability with the debian/tmp tradition. -function tmpdir() { +tmpdir() { if [ "$1" = "$MAINPACKAGE" ]; then echo tmp else @@ -36,7 +36,7 @@ function tmpdir() { # Pass it a name of a binary package, it returns the name to prefix to files # in debian for this package. -function pkgext() { +pkgext() { if [ "$1" != "$MAINPACKAGE" ]; then echo "$PACKAGE." fi @@ -49,7 +49,7 @@ function pkgext() { # 1: script to add to # 2: filename of snippet # 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ -function autoscript() { +autoscript() { autoscript_script=$1 autoscript_filename=$2 autoscript_sed=$3 diff --git a/dh_makeshlibs b/dh_makeshlibs new file mode 100755 index 00000000..a09e26f6 --- /dev/null +++ b/dh_makeshlibs @@ -0,0 +1,30 @@ +#!/bin/sh -e +# +# Automatically generate shlibs files. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then + error "debian/$TMP/DEBIAN/shlibs already exists." + fi + + for file in `find debian/$TMP -type f -name "*.so*" | tr "\n" " "` ; do + LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true + VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true + MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true + LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true + if [ ! -d "debian/$TMP/DEBIAN" ] ; then + doit "install -d debian/$TMP/DEBIAN" + fi + verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>debian/$TMP/DEBIAN/shlibs" + echo "$LIBRARY $MAJOR $PACKAGE" >>debian/$TMP/DEBIAN/shlibs + done + + if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then + doit "chown root.root debian/$TMP/DEBIAN/shlibs" + fi +done diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 new file mode 100644 index 00000000..51ba8fee --- /dev/null +++ b/dh_makeshlibs.1 @@ -0,0 +1,47 @@ +.TH DH_MAKESHLIBS 1 +.SH NAME +dh_makeshlibs \- automatically create shlibs file +.SH SYNOPSIS +.B dh_makeshlibs +.I "[-v] [-a] [-i] [-ppackage]" +.SH "DESCRIPTION" +dh_makeshlibs is a debhelper program that automatically scans for shared +libraries, and generates a shlibs file for the libraries it finds. +.P +For this program to work, you cannot have already installed a DEBIAN/shlibs +file. If such a file exits, the program will exit with an error. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Generate shlibs files for all architecture dependent packages. +.TP +.B \-i +Generate shlibs files for all architecture independent packages. +.TP +.B \-ppackage +Generate shlibs file for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH BUGS +There is no guarentee that the program will get the shlibs file right. For +example, it may not correctly guess the major number of your package. In +casews like these (and perhaps in general, just to be safe), it is better to +create a debian/shlibs file by hand. +This is a "do what I Mean" type program - you have been warned! +.SH AUTHOR +Joey Hess diff --git a/dh_md5sums b/dh_md5sums new file mode 100755 index 00000000..634e2fd6 --- /dev/null +++ b/dh_md5sums @@ -0,0 +1,22 @@ +#!/bin/sh -e +# +# Generate a DEBIAN/md5sums file, that lists the md5sums of all +# non-conffiles in the package + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ ! -d "debian/$TMP/DEBIAN" ]; then + doit "install -d debian/$TMP/DEBIAN" + fi + + doit "pushd debian/$TMP" >/dev/null + # Doit isn't smart enough to hande this next command so echo by hand. (sigh) + verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums DEBIAN/md5sums /dev/null" >/dev/null +done diff --git a/dh_md5sums.1 b/dh_md5sums.1 new file mode 100644 index 00000000..422a4aa7 --- /dev/null +++ b/dh_md5sums.1 @@ -0,0 +1,45 @@ +.TH DH_MD5SUMS 1 +.SH NAME +dh_md5sums \- generate DEBIAN/md5sums file +.SH SYNOPSIS +.B dh_md5sums +.I "[-v] [-a] [-i] [-ppackage]" +.SH "DESCRIPTION" +dh_md5sums is a debhelper program that is responsible for generating +a DEBIAN/md5sums file, which lists the md5sums of each file in the package. +.P +All files in DEBIAN/ are omitted from the md5sums file. +.P +The md5sums file is installed with proper permissions and ownerships. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Generate md5sums files for all architecture dependent packages. +.TP +.B \-i +Generate md5sums files for all architecture independent packages. +.TP +.B \-ppackage +Generate md5sums file for the package named "package". +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH BUGS +It would be better if it did not include md5sums of conffiles, since this +info is duplicated elsewhere. +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_movefiles.1 b/dh_movefiles.1 new file mode 100644 index 00000000..228f9401 --- /dev/null +++ b/dh_movefiles.1 @@ -0,0 +1,46 @@ +.TH DH_MOVEFILES 1 +.SH NAME +dh_movefiles \- moves files out of debian/tmp into subpackages +.SH SYNOPSIS +.B dh_movefiles +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.SH "DESCRIPTION" +dh_movefiles is a debhelper program that is responsible for moving files out +of debian/tmp and into other package build directories. This may be useful +if your package has a Makefile that installs everything into debian/tmp, and +you need to break that up into subpackages. +.P +Files named debian/package.files list the files to be moved, separated by +whitespace. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Move files for all architecture dependent packages. +.TP +.B \-i +Move files for all architecture independent packages. +.TP +.B \-ppackage +Move files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_shlibdeps b/dh_shlibdeps new file mode 100755 index 00000000..e30c4a5b --- /dev/null +++ b/dh_shlibdeps @@ -0,0 +1,24 @@ +#!/bin/sh -e +# +# Find dependancies. Simple dpkg-shlibdeps wrapper. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + # Run dpkg-shlibdeps to generate dependancies. + filelist="" + for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do + case "`file $file`" in + *ELF*) + filelist="$file $filelist" + ;; + esac + done + if [ "$filelist" ]; then + doit "dpkg-shlibdeps -Tdebian/${EXT}substvars $DH_U_PARAMS $filelist" + fi +done diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 new file mode 100644 index 00000000..77d90c25 --- /dev/null +++ b/dh_shlibdeps.1 @@ -0,0 +1,56 @@ +.TH DH_INSTALLDEBFILES 1 +.SH NAME +dh_shlibdeps \- calculate shared library dependancies +.SH SYNOPSIS +.B dh_shlibdeps +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-uparams]" +.SH "DESCRIPTION" +dh_shlibdeps is a debhelper program that is responsible for calculating +shared library dependancies for all executables found in the package build +directory. +.P +This program is merely a wrapper around +.BR dpkg-shlibdeps (1) +that calls it once for each package listed in the control file. You may +prefer to simply run +.BR dpkg-shlibdeps (1) +by hand. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install files for all architecture dependent packages. +.TP +.B \-i +Install files for all architecture independent packages. +.TP +.B \-ppackage +Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP +.B \-uparams +Pass "params" to +.BR dpkg-shlibdeps (1) +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.BR dpkg-shlibdeps (1) +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_strip b/dh_strip index 2ecdcd2c..77d670a6 100755 --- a/dh_strip +++ b/dh_strip @@ -3,7 +3,7 @@ # Strip files. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` diff --git a/dh_suidregister b/dh_suidregister new file mode 100755 index 00000000..4ca72a1c --- /dev/null +++ b/dh_suidregister @@ -0,0 +1,58 @@ +#!/bin/sh -e +# +# If no parameters are given, and no debian/suid files exists, scan for +# suid/sgid files and suidregister them. +# +# If there are parameters, or there is a debian/suid, register the files +# listed there. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + files="" + + if [ -e debian/${EXT}suid ]; then + files=`tr "\n" " " < debian/${EXT}suid` + fi + + if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + files="$* $files" + fi + + if [ ! "$files" -a ! -e debian/${EXT}suid ]; then + # No files specified (and no empty debian/suid file), so + # guess what files to process. + files=`find debian/$TMP -type f -perm +6000` + + # We will strip the debian working directory off of the + # filenames. + tostrip="debian/$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 debian/$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" + done + fi +done diff --git a/dh_suidregister.1 b/dh_suidregister.1 new file mode 100644 index 00000000..e15e6d5f --- /dev/null +++ b/dh_suidregister.1 @@ -0,0 +1,62 @@ +.TH DH_SUIDREGISTER 1 +.SH NAME +dh_suidregister \- set up package to register files with suidregister +.SH SYNOPSIS +.B dh_suidregister +.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.SH "DESCRIPTION" +dh_suidregister is a debhelper program that is responsible for modifying the +postinst and postrm scripts of a package so the package will register files +with +.BR suidregister (1) +when it is installed. +.P +Any files specified as parameters will be registered, if dh_suidregister is +acting on the first binary package listed in debian/control. +.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. +.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 +will automatically register all files it finds. +.P +Note that this package modifies your postinst and postrm files. See +.BR dh_installdebfiles (1) +for an explination of how this works. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Register files for all architecture dependent packages. +.TP +.B \-i +Register files for all architecture independent packages. +.TP +.B \-ppackage +Register files for the package named "package". +.TP +.B file ... +Register these files in the first binary package listed in debian/control, +if we are acting on that package. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +, +.BR suidregister (1) +.SH AUTHOR +Joey Hess diff --git a/dh_testdir b/dh_testdir index 4d3c700b..4e482fce 100755 --- a/dh_testdir +++ b/dh_testdir @@ -5,7 +5,7 @@ # of any other files you specify on the command line. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib for file in debian/control $@; do if [ ! -e "$file" ] ; then diff --git a/dh_testroot b/dh_testroot index fcc9b474..36577b29 100755 --- a/dh_testroot +++ b/dh_testroot @@ -3,7 +3,7 @@ # Checks to make sure you are root. PATH=debian:$PATH:/usr/lib/debhelper -source dh_lib +. dh_lib if [ "`whoami`" != root ]; then error "You must run this as root." diff --git a/dh_testversion.1 b/dh_testversion.1 new file mode 100644 index 00000000..f385a8ca --- /dev/null +++ b/dh_testversion.1 @@ -0,0 +1,46 @@ +.TH DH_TESTROOT 1 +.SH NAME +dh_testversion \- ensure that the correct version of debhelper is installed +.SH SYNOPSIS +.B dh_testversion [operator] [version] +.SH "DESCRIPTION" +dh_testversion compares the version of debhelper against the version you +specify, and if the condition is not met, exits with an error message. +.P +You should use this in your debian/rules files if a new debhelper feature is +introduced, and your package requires that feature to build correctly. Use +debhelper's changelog to figure out the version you need. +.P +Be sure not to overuse dh_testversion. If debhelper version 9.5 +introduces a new dh_autofixbugs command, and your package uses it, then if +someone tries to build it with debhelper 1.0, the build will fail anyway when +dh_autofixbugs cannot be found, so there is no need for you to use +dh_testversion. +.SH OPTIONS +.TP +.B operator +Optional comparison operator used in comparing the versions. If not +specified, ">=" is used. For descriptions of the comparison operators, see +dpkg --help. +.TP +.B version +Version number to compare against the current version of debhelper. If not +specified, dh_testroot does nothing. +.SH EXAMPLES +.TP +.I dh_testversion 0.50 +Make sure debhelper version 0.50 or higher is installed. +.TP +.I dh_testversion ge 0.50 +Another way to make sure debhelper version 0.50 or higher is installed. +.TP +.I dh_testversion le 0.50 +Make sure a version of debhelper less than version 0.50 is installed. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode. +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +.SH AUTHOR +Joey Hess diff --git a/dh_testversion.in b/dh_testversion.in new file mode 100644 index 00000000..9e2f14ef --- /dev/null +++ b/dh_testversion.in @@ -0,0 +1,23 @@ +#!/bin/sh -e +# +# Debhelper version check. + +# Current version of debhelper is: +DH_VERSION=#DEBHELPER_VERSION# + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +if [ "$1" -a "$2" ]; then + compare=$1 + ver=$2 +elif [ "$1" ]; then + compare=">=" + ver=$1 +fi + +if [ "$compare" -a "$ver" ] ; then + if ! dpkg --compare-versions $DH_VERSION $compare $ver; then + error "debhelper version $DH_VERSION is installed, but a version $compare $ver is needed to build this package." + fi +fi diff --git a/dh_undocumented b/dh_undocumented new file mode 100755 index 00000000..ebde8904 --- /dev/null +++ b/dh_undocumented @@ -0,0 +1,51 @@ +#!/bin/sh -e +# +# Passed a list of undocumented man pages, generates symlinks to +# undocumented.7 for those man pages. +# +# Also, it looks for debian/undocumented files for more lists of +# undocumented man pages. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + EXT=`pkgext $PACKAGE` + + undoc="" + + if [ -e debian/${EXT}undocumented ]; then + undoc=`tr "\n" " " < debian/${EXT}undocumented` + fi + + if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + undoc="$* $undoc" + fi + + if [ "$undoc" ]; then + for file in $undoc; do + # Remove .gz extention from the filename, if present. + if [ `expr "$file" : '\(.*\).gz'` ]; then + file=`expr "$file" : '\(.*\).gz'` + fi + + # Determine what directory the file belongs in, + # /usr/man, or /usr/X11R6/man. + section=`expr "$file" : '.*\.\([123456789]\)'` + if [ `expr "$file" : '.*\.[123456789]\(x\)'` ] ; then + dir=usr/X11R6/man/man$section + reldir=../../../man + else + dir=usr/man/man$section + reldir=.. + fi + + if [ ! -d debian/$TMP/$dir ]; then + doit "install -d debian/$TMP/$dir" + fi + + doit ln -s $reldir/man7/undocumented.7.gz debian/$TMP/$dir/$file.gz + done + fi +done diff --git a/dh_undocumented.1 b/dh_undocumented.1 new file mode 100644 index 00000000..ab45baad --- /dev/null +++ b/dh_undocumented.1 @@ -0,0 +1,68 @@ +.TH DH_UNDOCUMENTED 1 +.SH NAME +dh_undocumented \- make symlinks to undocumented.7 man page +.SH SYNOPSIS +.B dh_undocumented +.I "[-v] [-a] [-i] [-ppackage] [manpage ...]" +.SH "DESCRIPTION" +dh_undocumented is a debhelper program that is responsible for making +symlinks to the +.BR undocumented (7) +man page for man pages that are not present in your package. +.P +The program takes a list of man pages that should be symlinked to +.BR undocumented (7) +It determines what directory the man pages should be placed in by examining +their extentions - pages ending in "x" go into /usr/X11R6/man/, while pages +that end in anything else go in /usr/man/. It also examines the extention to +see what section the man page belongs in. After figuring this out, it +generates the necessary symlinks to +.BR undocumented (7) +, placing the sylinks in the package build directory. +.P +The lists of man pages that need +.BR undocumented (7) +symlinks can be specified in two ways. Any man page names specified as +parameters will be set up in the first binary package listed in +debian/control, if dh_installdocs is acting on that package. +Also, if 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. +.SH OPTIONS +.TP +.B \-v +Verbose mode; show all commands that modify the package build directory. +.TP +.B \-a +Install undocumented man page symlinks for all architecture dependent packages. +.TP +.B \-i +Install undocumented man page symlinks for all architecture independent packages. +.TP +.B \-ppackage +Install undocumented man page symlinks for the package named "package". +.TP +.B manpage ... +Install undocumented man page symlinks for each of these man pages +into the first binary package listed in debian/control, if we are acting on +that package. +.SH NOTES +The +.B \-a +.B \-i +and +.B \-p +arguments are cumulative. If none are specified, then all packages listed in +the control file will be effected. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode +.SH "SEE ALSO" +.BR /usr/doc/debhelper/README +, +.BR undocumented (7) +.SH "CONFORMS TO" +Debian policy, version 2.3.0.0 +.SH AUTHOR +Joey Hess diff --git a/examples/rules.indep b/examples/rules.indep new file mode 100755 index 00000000..a257a197 --- /dev/null +++ b/examples/rules.indep @@ -0,0 +1,56 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# This version is for packages that are architecure independant. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp +build-stamp: + dh_testdir + # Add here commands to compile the pacckage. + #$(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + # Add here commands to clean up after the build process. + #-$(MAKE) distclean + dh_clean + +# Build architecture-independent files here. +binary-indep: build + dh_testdir + dh_testroot + dh_clean + dh_installdirs + # Add here commands to install the files into debian/tmp + #$(MAKE) PREFIX=debian/tmp install + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installinit + dh_installcron +# dh_installmanpages +# dh_undocumented + dh_installchangelogs + dh_compress + dh_fixperms + dh_suidregister + dh_installdeb + dh_gencontrol + dh_du + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build +# We have nothing to do by default. + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary -- cgit v1.2.3 From a63461740c5f769c9a11d53a8b652dfbbfee7503 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:35:41 +0000 Subject: r13: Initial Import --- README | 4 +++- debian/changelog | 17 +++++++++++++++++ debian/rules | 1 + dh_installdocs | 20 +++++++++++++------- dh_installexamples | 4 +--- examples/rules | 3 ++- examples/rules.multi | 6 ++++-- 7 files changed, 41 insertions(+), 14 deletions(-) diff --git a/README b/README index a13c7726..e43ee336 100644 --- a/README +++ b/README @@ -4,7 +4,9 @@ dh_* commands. To help you get started, I've included an example of a debian/rules file that uses debhelper commands extensivly. See -/usr/doc/debhelper/examples/rules . +/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). Automatic generation of debian install scripts: ---------------------------------------------- diff --git a/debian/changelog b/debian/changelog index a4d47c4c..e865dc67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +debhelper (0.7) unstable; urgency=low + + * Sped up some things by removing unnecesary for loops. + * dh_installdocs: behavior modifcation: if there is a debian/TODO, it is + named like a debian/changelog file: if the package is a debian native + package, it is installed as TODO. If the package is not a native package, + it is installed as TODO.Debian. + * dh_installdocs: handle debian/README.Debian as well as + debian/README.debian. + * Added dh_undocumented program, which can set up undocumented.7 symlinks. + * Moved dh_installdebfiles to come after dh_fixperms in the example rules + files. (dh_installdebfiles makes sure it installs things with the proper + permissions, and this reorganization makes the file a bit more flexable + in a few situations.) + + -- Joey Hess Mon, 13 Oct 1997 20:08:05 -0400 + debhelper (0.6) unstable; urgency=low * Got rid of bashisms - this package should work now if /bin/sh is ash. diff --git a/debian/rules b/debian/rules index c6a4fa95..55fd8e98 100755 --- a/debian/rules +++ b/debian/rules @@ -44,6 +44,7 @@ binary-indep: build ./dh_compress ./dh_installdebfiles ./dh_fixperms + ./dh_md5sums ./dh_builddeb binary: binary-indep binary-arch diff --git a/dh_installdocs b/dh_installdocs index 90be53c7..3859d34b 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -25,18 +25,24 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ "$docs" ]; then - for file in $docs; do - doit "cp -a $file debian/$TMP/usr/doc/$PACKAGE/" - done + doit "cp -a $docs debian/$TMP/usr/doc/$PACKAGE/" fi # Install these files only into the main package by default. if [ "$PACKAGE" = "$MAINPACKAGE" ]; then - for file in README.debian TODO ; do - if [ -f debian/$file ]; then - doit "install -m 644 -p debian/$file debian/$TMP/usr/doc/$PACKAGE/" + if [ -f debian/README.debian ]; then + doit "install -m 644 -p debian/README.debian debian/$TMP/usr/doc/$PACKAGE/" + fi + if [ -f debian/README.Debian ]; then + doit "install -m 644 -p debian/README.Debian debian/$TMP/usr/doc/$PACKAGE/" + fi + if [ -f debian/TODO ]; then + if [ "$NATIVE" ]; then + doit "install -m 655 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO" + else + doit "install -m 644 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO.Debian" fi - done + fi fi if [ -f debian/copyright ]; then diff --git a/dh_installexamples b/dh_installexamples index 23d11af8..61ceae20 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -25,8 +25,6 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/usr/doc/$PACKAGE/examples" fi - for file in $examples; do - doit "cp -a $file debian/$TMP/usr/doc/$PACKAGE/examples/" - done + doit "cp -a $examples debian/$TMP/usr/doc/$PACKAGE/examples/" fi done diff --git a/examples/rules b/examples/rules index 65e6878e..961ab459 100755 --- a/examples/rules +++ b/examples/rules @@ -35,11 +35,12 @@ binary-arch: build dh_installmenu dh_installcron dh_installmanpages +# dh_undocumented dh_installchangelogs dh_strip dh_compress - dh_installdebfiles dh_fixperms + dh_installdebfiles dh_builddeb binary: binary-indep binary-arch diff --git a/examples/rules.multi b/examples/rules.multi index f5e82597..fd9bf5de 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -34,10 +34,11 @@ binary-indep: build dh_installmenu -i dh_installcron -i # dh_installmanpages -i +# dh_undocumented dh_installchangelogs -i dh_compress -i - dh_installdebfiles -i dh_fixperms -i + dh_installdebfiles -i dh_builddeb -i # Build architecture-dependent files here. @@ -52,11 +53,12 @@ binary-arch: build dh_installmenu -a dh_installcron -a dh_installmanpages -a +# dh_undocumented dh_installchangelogs -a dh_strip -a dh_compress -a - dh_installdebfiles -a dh_fixperms -a + dh_installdebfiles -a dh_builddeb -a binary: binary-indep binary-arch -- cgit v1.2.3 From be3ec728c4139e5b550bcd3e8fa352f95d581891 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:18 +0000 Subject: r14: Initial Import --- TODO | 3 +-- debian/changelog | 7 +++++++ debian/rules | 3 ++- dh_clean | 7 +++---- dh_installdebfiles.1 | 6 +++--- dh_md5sums | 4 ++-- examples/rules | 1 + examples/rules.multi | 2 ++ 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/TODO b/TODO index 8bf234fd..07796f92 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ -.so files of compressed manpages change to symlinks +.so files of compressed manpages -- change to symlinks add all other functionality of debstd (??) dh_fixperms: allow listing of files not to be touched (diffucult). -add suidregister support diff --git a/debian/changelog b/debian/changelog index e865dc67..c06f0be1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.8) unstable; urgency=low + + * Added dh_md5sum, generates a md5sums file. + * dh_clean: fixed to echo all commands when verbose mode is on. + + -- Joey Hess Fri, 17 Oct 1997 14:18:26 -0400 + debhelper (0.7) unstable; urgency=low * Sped up some things by removing unnecesary for loops. diff --git a/debian/rules b/debian/rules index 55fd8e98..8b635e7b 100755 --- a/debian/rules +++ b/debian/rules @@ -42,8 +42,9 @@ binary-indep: build ./dh_installmanpages ./dh_installchangelogs ./dh_compress - ./dh_installdebfiles ./dh_fixperms + ./dh_suidregister + ./dh_installdebfiles ./dh_md5sums ./dh_builddeb diff --git a/dh_clean b/dh_clean index 964eec3d..76522dda 100755 --- a/dh_clean +++ b/dh_clean @@ -14,8 +14,7 @@ for PACKAGE in $DH_DOPACKAGES; do done doit "rm -f debian/files* debian/*.debhelper $*" -# Remove other temp files. I don't run this through doit becuase -# I haven't figured out what I have to esacape to put it in quotes. -# However, it doesn't modify debian/$TMP, so I guess it's ok to not run it -# through doit. +# Remove other temp files. doit isn't smart enough to handle this, so I echo +# by hand (sigh). +verbose_echo "find . \( -name "\#*\#" -o -name "*~" -o -name "DEADJOE" \) -exec rm -f {} \;" find . \( -name "\#*\#" -o -name "*~" -o -name "DEADJOE" \) -exec rm -f {} \; diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 9827656a..924e04b4 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -26,9 +26,9 @@ The files postinst, preinst, postrm, and prerm are handled specially: If a corresponding file named debian/script.debhelper exists, the contents of that file are merged into the script as follows: If the script exists, then anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper file is -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 +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. .P diff --git a/dh_md5sums b/dh_md5sums index 634e2fd6..8b37bc29 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -1,7 +1,7 @@ #!/bin/sh -e # -# Generate a DEBIAN/md5sums file, that lists the md5sums of all -# non-conffiles in the package +# Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the +# package. PATH=debian:$PATH:/usr/lib/debhelper . dh_lib diff --git a/examples/rules b/examples/rules index 961ab459..4b4d69d3 100755 --- a/examples/rules +++ b/examples/rules @@ -41,6 +41,7 @@ binary-arch: build dh_compress dh_fixperms dh_installdebfiles + dh_m5dsums dh_builddeb binary: binary-indep binary-arch diff --git a/examples/rules.multi b/examples/rules.multi index fd9bf5de..15ed5a4b 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -39,6 +39,7 @@ binary-indep: build dh_compress -i dh_fixperms -i dh_installdebfiles -i + dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. @@ -59,6 +60,7 @@ binary-arch: build dh_compress -a dh_fixperms -a dh_installdebfiles -a + dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch -- cgit v1.2.3 From b4a402edd5f740b8afee9b50cfb85906042a65fd Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:18 +0000 Subject: r15: Initial Import --- debian/changelog | 7 +++++++ examples/rules | 1 + examples/rules.multi | 2 ++ 3 files changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index c06f0be1..112147c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.9) unstable; urgency=low + + * Added dh_suidregister, interfaces to to the suidmanager package. + * dh_installdebfiles: fixed typo on man page. + + -- Joey Hess Sat, 18 Oct 1997 20:55:39 -0400 + debhelper (0.8) unstable; urgency=low * Added dh_md5sum, generates a md5sums file. diff --git a/examples/rules b/examples/rules index 4b4d69d3..054e33ae 100755 --- a/examples/rules +++ b/examples/rules @@ -40,6 +40,7 @@ binary-arch: build dh_strip dh_compress dh_fixperms + dh_suidregister dh_installdebfiles dh_m5dsums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index 15ed5a4b..bb0f4fec 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -38,6 +38,7 @@ binary-indep: build dh_installchangelogs -i dh_compress -i dh_fixperms -i + dh_suidregister -i dh_installdebfiles -i dh_md5sums -i dh_builddeb -i @@ -59,6 +60,7 @@ binary-arch: build dh_strip -a dh_compress -a dh_fixperms -a + dh_suidregister -a dh_installdebfiles -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 0234dbf4376b0c742ff1966ac9e7dd7eb8ef9cfd Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:40 +0000 Subject: r16: Initial Import --- debian/changelog | 12 ++++++++++++ dh_installdebfiles | 24 ++++++++++++------------ dh_md5sums | 4 ++-- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 112147c8..e70ccf07 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (0.10) unstable; urgency=medium + + * dh_installdebfiles: fixed *bad* bug that messed up the names of all + files installed into DEBIAN/ for multiple binary packages. + * dh_md5sums: fixed another serious bug if dh_md5sums was used for + multiple binary packages. + * If you have made any multiple binary packages using debhelper, you + should rebuild them with this version. + * dh_md5sums: show cd commands in verbose mode. + + -- Joey Hess Mon, 20 Oct 1997 14:44:30 -0400 + debhelper (0.9) unstable; urgency=low * Added dh_suidregister, interfaces to to the suidmanager package. diff --git a/dh_installdebfiles b/dh_installdebfiles index 58aed3b3..403375f4 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -20,23 +20,23 @@ for PACKAGE in $DH_DOPACKAGES; do if [ -f debian/$EXT$file ]; then # Add this into the script, where it has #DEBHELPER# if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > debian/$TMP/DEBIAN/$EXT$file" - perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > debian/$TMP/DEBIAN/$EXT$file - doit "chown root.root debian/$TMP/DEBIAN/$EXT$file" - doit "chmod 755 debian/$TMP/DEBIAN/$EXT$file" + verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > debian/$TMP/DEBIAN/$file" + perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > debian/$TMP/DEBIAN/$file + doit "chown root.root debian/$TMP/DEBIAN/$file" + doit "chmod 755 debian/$TMP/DEBIAN/$file" else - doit "install -o root -g root -p debian/$EXT$file debian/$TMP/DEBIAN/" + doit "install -o root -g root -p debian/$EXT$file debian/$TMP/DEBIAN/$file" fi else # Auto-generate script header and add .debhelper # content to it. if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$EXT$file" - echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$EXT$file - verbose_echo "cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$EXT$file" - cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$EXT$file - doit "chown root.root debian/$TMP/DEBIAN/$EXT$file" - doit "chmod 755 debian/$TMP/DEBIAN/$EXT$file" + verbose_echo "echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$file" + echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$file + verbose_echo "cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$file" + cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$file + doit "chown root.root debian/$TMP/DEBIAN/$file" + doit "chmod 755 debian/$TMP/DEBIAN/$file" fi fi done @@ -44,7 +44,7 @@ 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 debian/$TMP/DEBIAN" + doit "install -o root -g root -m 644 -p debian/$EXT$file debian/$TMP/DEBIAN/$file" fi done diff --git a/dh_md5sums b/dh_md5sums index 8b37bc29..273faf34 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -13,10 +13,10 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/DEBIAN" fi - doit "pushd debian/$TMP" >/dev/null + doit "cd debian/$TMP" # Doit isn't smart enough to hande this next command so echo by hand. (sigh) verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums DEBIAN/md5sums /dev/null" >/dev/null + doit "cd ../.." done -- cgit v1.2.3 From fbabb8038535361c7e4f9ab538f2b9cfa3023367 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:40 +0000 Subject: r17: Initial Import --- README | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 10 ++++++++++ debian/copyright | 10 +++++++--- debian/rules | 1 + dh_lib | 6 +++++- dh_md5sums | 17 ++++++++++++----- dh_md5sums.1 | 12 +++++++----- examples/rules | 1 + examples/rules.multi | 2 ++ 9 files changed, 98 insertions(+), 14 deletions(-) diff --git a/README b/README index e43ee336..21ecd519 100644 --- a/README +++ b/README @@ -8,6 +8,58 @@ that uses debhelper commands extensivly. See one good order you can run the different debhelper scripts in (though other variations are possible). + +Converting from debstd to debhelper: +----------------------------------- + +Debhelper is designed to be mostly backwards compatable to debstd. I say +mostly becuase 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_strip + dh_compress + dh_fixperms + dh_suidregister + dh_installdebfiles + dh_m5dsums + 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 differnt 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 dehelper apps do that too, but they do it differnently. Debstd just +appends its commands to the end of the script. Debhelper reqyires 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 reccommend that you compare the new package and the old +debstd-generated package very closely. Pay special attention to the postint, +postrm, etc scripts. + + Automatic generation of debian install scripts: ---------------------------------------------- @@ -23,6 +75,7 @@ by the -n parameter. Note that it will be shell code, so you cannot directly use it in a perl script. + Notes on multiple binary packages: --------------------------------- diff --git a/debian/changelog b/debian/changelog index e70ccf07..a1b09908 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (0.11) unstable; urgency=low + + * dh_md5sums: behavior modification: do not generate md5sums for conffiles. + (Thanks to Charles Briscoe-Smith ) #14048. + * dh_md5sums: can generate conffile md5sums with -x parameter. + * Added a "converting from debstd" section to the README. + * Added dh_du, generates a DEBIAN/du file with disk usage stats (#14048). + + -- Joey Hess Tue, 21 Oct 1997 13:17:28 -0400 + debhelper (0.10) unstable; urgency=medium * dh_installdebfiles: fixed *bad* bug that messed up the names of all diff --git a/debian/copyright b/debian/copyright index 0feed1b2..2845a267 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,9 @@ Debhelper is written by Joey Hess . -Parts of the code came from debmake, by Christoph Lameter -. -The copyright of this package is GPL. +Parts of the code (and certianly my inspiration from the whole thing) came +from debmake, by Christoph Lameter . + +Some of the dh_md5sums and dh_du commands is from a program by Charles +Briscoe-Smith . + +The copyright of this package is GPL, version 2 or later. diff --git a/debian/rules b/debian/rules index 8b635e7b..eaaeb54d 100755 --- a/debian/rules +++ b/debian/rules @@ -45,6 +45,7 @@ binary-indep: build ./dh_fixperms ./dh_suidregister ./dh_installdebfiles + ./dh_du ./dh_md5sums ./dh_builddeb diff --git a/dh_lib b/dh_lib index 618953d8..1cc7e308 100644 --- a/dh_lib +++ b/dh_lib @@ -77,7 +77,7 @@ autoscript() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt vianp: $*` +set -- `getopt xvianp: $*` for i; do case "$i" @@ -103,6 +103,10 @@ for i; do DH_NOSCRIPTS=1 shift ;; + -x) + DH_EXCLUDE=1 + shift + ;; --) shift break diff --git a/dh_md5sums b/dh_md5sums index 273faf34..5400bad9 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -13,10 +13,17 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d debian/$TMP/DEBIAN" fi - doit "cd debian/$TMP" # Doit isn't smart enough to hande this next command so echo by hand. (sigh) - verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums DEBIAN/md5sums debian/$TMP/DEBIAN/allfiles' + find debian/$TMP/* -type f ! -regex "^debian/$TMP/DEBIAN/.*" | sed s:debian/$TMP:: | sort > debian/$TMP/DEBIAN/allfiles + # Check if we should exclude conffiles. + if [ ! "$DH_EXCLUDE" -a -r debian/$TMP/DEBIAN/conffiles ]; then + verbose_echo "sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new" + sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new + doit "mv debian/$TMP/DEBIAN/allfiles.new debian/$TMP/DEBIAN/allfiles" + fi + verbose_echo "cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." + cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. + doit "chown root.root debian/$TMP/DEBIAN/md5sums" + doit "rm -f debian/$TMP/DEBIAN/allfiles" done diff --git a/dh_md5sums.1 b/dh_md5sums.1 index 422a4aa7..a54c1c15 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -3,12 +3,13 @@ dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-x] [-v] [-a] [-i] [-ppackage]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. .P -All files in DEBIAN/ are omitted from the md5sums file. +All files in DEBIAN/ are omitted from the md5sums file, as are all conffiles +(unless you use the -x switch). .P The md5sums file is installed with proper permissions and ownerships. .SH OPTIONS @@ -24,6 +25,10 @@ Generate md5sums files for all architecture independent packages. .TP .B \-ppackage Generate md5sums file for the package named "package". +.TP +.B \-x +Include conffiles in the md5sums list. Note that this is redundant, and +included elsewhere in debian packages. .SH NOTES The .B \-a @@ -36,9 +41,6 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode -.SH BUGS -It would be better if it did not include md5sums of conffiles, since this -info is duplicated elsewhere. .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/examples/rules b/examples/rules index 054e33ae..fc300e6a 100755 --- a/examples/rules +++ b/examples/rules @@ -42,6 +42,7 @@ binary-arch: build dh_fixperms dh_suidregister dh_installdebfiles + dh_du dh_m5dsums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index bb0f4fec..4e8b30ed 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -40,6 +40,7 @@ binary-indep: build dh_fixperms -i dh_suidregister -i dh_installdebfiles -i + dh_du -a dh_md5sums -i dh_builddeb -i @@ -62,6 +63,7 @@ binary-arch: build dh_fixperms -a dh_suidregister -a dh_installdebfiles -a + dh_du -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 6f0cb0d4410fedd208b0ce137684faccdef268c6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:45 +0000 Subject: r18: Initial Import --- README | 2 +- TODO | 7 ++++--- debian/changelog | 7 +++++++ examples/rules | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README b/README index 21ecd519..ba468150 100644 --- a/README +++ b/README @@ -36,7 +36,7 @@ Remove that and replace it with something like: dh_fixperms dh_suidregister dh_installdebfiles - dh_m5dsums + dh_md5sums dh_builddeb Notice that the parameters sent to debstd get split up among the dh_* diff --git a/TODO b/TODO index 07796f92..1a5f1cef 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ -.so files of compressed manpages -- change to symlinks -add all other functionality of debstd (??) -dh_fixperms: allow listing of files not to be touched (diffucult). +* .so files of compressed manpages -- change to symlinks +* 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. diff --git a/debian/changelog b/debian/changelog index a1b09908..c2130315 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.12) unstable; urgency=low + + * Fixed mispelling of dh_md5sums in examples rules files and README. + (#13990) Thanks, Adrian. + + -- Joey Hess Fri, 24 Oct 1997 14:35:30 -0400 + debhelper (0.11) unstable; urgency=low * dh_md5sums: behavior modification: do not generate md5sums for conffiles. diff --git a/examples/rules b/examples/rules index fc300e6a..a02783f7 100755 --- a/examples/rules +++ b/examples/rules @@ -43,7 +43,7 @@ binary-arch: build dh_suidregister dh_installdebfiles dh_du - dh_m5dsums + dh_md5sums dh_builddeb binary: binary-indep binary-arch -- cgit v1.2.3 From 01a4f306b02b341f777ac93178b5661df62f2193 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:51 +0000 Subject: r19: Initial Import --- README | 1 + debian/changelog | 6 ++++++ examples/rules | 1 + examples/rules.multi | 1 + 4 files changed, 9 insertions(+) diff --git a/README b/README index ba468150..d84add45 100644 --- a/README +++ b/README @@ -36,6 +36,7 @@ Remove that and replace it with something like: dh_fixperms dh_suidregister dh_installdebfiles + dh_makeshlibs dh_md5sums dh_builddeb diff --git a/debian/changelog b/debian/changelog index c2130315..e0caa2cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.13) unstable; urgency=low + + * Added dh_makeshlibs, automatically generates a shlibs file. + + -- Joey Hess Fri, 24 Oct 1997 20:33:14 -0400 + debhelper (0.12) unstable; urgency=low * Fixed mispelling of dh_md5sums in examples rules files and README. diff --git a/examples/rules b/examples/rules index a02783f7..d5170a78 100755 --- a/examples/rules +++ b/examples/rules @@ -42,6 +42,7 @@ binary-arch: build dh_fixperms dh_suidregister dh_installdebfiles +# dh_makeshlibs dh_du dh_md5sums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index 4e8b30ed..fbefadd3 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -63,6 +63,7 @@ binary-arch: build dh_fixperms -a dh_suidregister -a dh_installdebfiles -a +# dh_makeshlibs -a dh_du -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 1921f5c59e9a736db764c2cae6ef8dd092167d73 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:36:56 +0000 Subject: r20: Initial Import --- debian/changelog | 8 ++++++++ dh_fixperms | 4 ++-- dh_fixperms.1 | 8 ++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index e0caa2cc..a33224d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.14) unstable; urgency=low + + * dh_fixperms: leave permissions on files in /usr/doc/packages/examples + unchanged. + * Install examples/rules* executable. + + -- Joey Hess Mon, 27 Oct 1997 12:42:33 -0500 + debhelper (0.13) unstable; urgency=low * Added dh_makeshlibs, automatically generates a shlibs file. diff --git a/dh_fixperms b/dh_fixperms index 6e935a8a..1c4fef7c 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -16,8 +16,8 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Fix up premissions in usr/doc, setting everything to not exectable - # by default. - files=`find debian/$TMP/usr/doc -type f 2>/dev/null | tr "\n" " "` || true + # by default, but leave examples directories alone. + files=`find debian/$TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi diff --git a/dh_fixperms.1 b/dh_fixperms.1 index b5cb4e13..cfba6481 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -8,10 +8,10 @@ dh_fixperms \- fix permissions of files in package build directories dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. .P -dh_fixperms makes all files in usr/doc in the package build directory be -mode 644. It also changes the permissions of all man pages to mode 644. -It makes all files be owned by root, and it removes group and other write -permission from all files. +dh_fixperms makes all files in usr/doc in the package build directory +(excluding files in the examples/ directory) be mode 644. It also changes +the permissions of all man pages to mode 644. It makes all files be owned by +root, and it removes group and other write permission from all files. .SH OPTIONS .TP .B \-v -- cgit v1.2.3 From 0c4875b3fecb5b376257e248b129537dd148e0c4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:02 +0000 Subject: r21: Initial Import --- README | 23 +++++++++++++++++++++++ debian/changelog | 9 +++++++++ dh_builddeb | 2 +- dh_builddeb.1 | 5 ++++- dh_clean | 4 ++-- dh_clean.1 | 5 ++++- dh_compress | 4 ++-- dh_compress.1 | 5 ++++- dh_du | 8 ++++---- dh_du.1 | 5 ++++- dh_fixperms | 12 ++++++------ dh_fixperms.1 | 5 ++++- dh_installchangelogs | 8 ++++---- dh_installchangelogs.1 | 5 ++++- dh_installcron | 6 +++--- dh_installcron.1 | 5 ++++- dh_installdebfiles | 34 +++++++++++++++++----------------- dh_installdebfiles.1 | 5 ++++- dh_installdocs | 16 ++++++++-------- dh_installdocs.1 | 5 ++++- dh_installexamples | 6 +++--- dh_installexamples.1 | 5 ++++- dh_installmanpages | 12 ++++++------ dh_installmanpages.1 | 5 ++++- dh_installmenu | 16 ++++++++-------- dh_installmenu.1 | 5 ++++- dh_lib | 25 +++++++++++++++++++------ dh_makeshlibs | 18 +++++++++--------- dh_makeshlibs.1 | 5 ++++- dh_md5sums | 24 ++++++++++++------------ dh_md5sums.1 | 5 ++++- dh_strip | 4 ++-- dh_strip.1 | 5 ++++- dh_suidregister | 6 +++--- dh_suidregister.1 | 5 ++++- dh_undocumented | 6 +++--- dh_undocumented.1 | 5 ++++- 37 files changed, 212 insertions(+), 116 deletions(-) diff --git a/README b/README index d84add45..2f2e7c2c 100644 --- a/README +++ b/README @@ -102,4 +102,27 @@ effecting all packages. See examples/rules.multi for an example of how to use this. + +Package build directories -- debian/tmp, etc: +-------------------------------------------- + +By default, all debhelper programs assume that the temporary directory used +for assembling the tree of files in a package is debian/tmp for the first +package listed in debian/control, and debian/ for each +additional package. + +Sometimes, you might want to use some other temporary directory. This is +supported by the -P flag. The direcotry to use is specified after -P, for +example, "dh_installdocs -Pdebian/tmp", will use debian/tmp as the temporary +directory. Note that if you use -P, the debhelper programs can only be +acting on a single package at a time. So if you have a package that builds +many binary packages, you will need to use the -p flag to specify which +binary package the debhelper program will act on. For example: + + dh_installdocs -pfoolib1 -Pdebian/tmp-foolib1 + dh_installdocs -pfoolib1-dev -Pdebian/tmp-foolib1-dev + dh_installdocs -pfoolib-bin -Pdebian/tmp-foolib-bin + +This uses debian/tmp- as the package build directory. + -- Joey Hess diff --git a/debian/changelog b/debian/changelog index a33224d9..f7d47b17 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.15) unstable; urgency=low + + * README: documented what temporary directories are used by default for + installing package files into. + * dh_*: added -P flag, to let a different package build directory be + specified. + + -- Joey Hess Thu, 6 Nov 1997 15:51:22 -0500 + debhelper (0.14) unstable; urgency=low * dh_fixperms: leave permissions on files in /usr/doc/packages/examples diff --git a/dh_builddeb b/dh_builddeb index aea8a1b1..9ddd21dc 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -7,5 +7,5 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - doit "dpkg --build debian/$TMP .." + doit "dpkg --build $TMP .." done diff --git a/dh_builddeb.1 b/dh_builddeb.1 index bfe72e72..8a51a8f4 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -3,7 +3,7 @@ dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) @@ -21,6 +21,9 @@ Build all architecture independent packages. .TP .B \-ppackage Build the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_clean b/dh_clean index 76522dda..874604ed 100755 --- a/dh_clean +++ b/dh_clean @@ -1,6 +1,6 @@ #!/bin/sh -e # -# Clean up debian/$TMP and other tepmorary files generated by the +# Clean up $TMP and other tepmorary files generated by the # build process. PATH=debian:$PATH:/usr/lib/debhelper @@ -9,7 +9,7 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - doit "rm -rf debian/$TMP" + doit "rm -rf $TMP" doit "rm -f debian/${EXT}substvars" done doit "rm -f debian/files* debian/*.debhelper $*" diff --git a/dh_clean.1 b/dh_clean.1 index e387c4eb..651b5b08 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -3,7 +3,7 @@ dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some @@ -23,6 +23,9 @@ Clean up the package build directory for all architecture independent packages. .B \-ppackage Clean up the package build directory for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Delete these files too. .SH NOTES diff --git a/dh_compress b/dh_compress index 347f0f5f..86ab8373 100755 --- a/dh_compress +++ b/dh_compress @@ -13,7 +13,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Run the file name gatering commands from within the directory # structure that will be effected. olddir=`pwd` - cd debian/$TMP + cd $TMP if [ -f debian/${EXT}compress ]; then # The config file is a sh script that outputs the files to be compressed @@ -40,7 +40,7 @@ for PACKAGE in $DH_DOPACKAGES; do cd $olddir # Fix up symlinks that were pointing to the uncompressed files. - for file in `find debian/$TMP -type l`; do + for file in `find $TMP -type l`; do DIRECTORY=`expr $file : "\(.*\)/[^/]*"` NAME=`expr $file : ".*/\([^/]*\)"` LINKVAL=`ls -l $DIRECTORY/$NAME | awk '{ print $11;}'` diff --git a/dh_compress.1 b/dh_compress.1 index 06087b8e..d7e8dc5c 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks @@ -41,6 +41,9 @@ Compress files for all architecture independent packages. .TP .B \-ppackage Compress files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_du b/dh_du index a7ec6f48..5fcb1418 100755 --- a/dh_du +++ b/dh_du @@ -9,11 +9,11 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ ! -d "debian/$TMP/DEBIAN" ]; then - doit "install -d debian/$TMP/DEBIAN" + if [ ! -d "$TMP/DEBIAN" ]; then + doit "install -d $TMP/DEBIAN" fi - verbose_echo "du -k debian/$TMP | sed \"s: debian/$TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" debian/$TMP$\" > debian/$TMP/DEBIAN/du" - du -k debian/$TMP | sed "s: debian/$TMP/: :" | grep -v " DEBIAN$" | grep -v " debian/$TMP$" >debian/$TMP/DEBIAN/du + verbose_echo "du -k $TMP | sed \"s: $TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" $TMP$\" > $TMP/DEBIAN/du" + du -k $TMP | sed "s: $TMP/: :" | grep -v " DEBIAN$" | grep -v " $TMP$" >$TMP/DEBIAN/du doit "chown root.root debian/tmp/DEBIAN/du" done diff --git a/dh_du.1 b/dh_du.1 index 98a9c80a..42509a50 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -3,7 +3,7 @@ dh_du \- generate DEBIAN/du file .SH SYNOPSIS .B dh_md5sums -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_du is a debhelper program that is responsible for generating a DEBIAN/du file, which lists the disk usage of directories in the package. @@ -24,6 +24,9 @@ Generate du files for all architecture independent packages. .TP .B \-ppackage Generate du file for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_fixperms b/dh_fixperms index 1c4fef7c..0534549c 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -10,24 +10,24 @@ for PACKAGE in $DH_DOPACKAGES; do EXT=`pkgext $PACKAGE` # General things.. - if [ -d debian/$TMP ]; then - doit "chown -R root.root debian/$TMP" - doit "chmod -R go=rX debian/$TMP" + if [ -d $TMP ]; then + doit "chown -R root.root $TMP" + doit "chmod -R go=rX $TMP" fi # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - files=`find debian/$TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true + files=`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi - files=`find debian/$TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true + files=`find $TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 755 $files" fi # Executable man pages are a bad thing. - files=`find debian/$TMP/usr/man/ debian/$TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true + files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi diff --git a/dh_fixperms.1 b/dh_fixperms.1 index cfba6481..8ae36def 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -3,7 +3,7 @@ dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS .B dh_fixperms -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -25,6 +25,9 @@ Fix permissions for all architecture independent packages. .TP .B \-ppackage Fix permissions for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installchangelogs b/dh_installchangelogs index 17ff7312..7405daae 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -25,12 +25,12 @@ fi for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ ! -d debian/$TMP/usr/doc/$PACKAGE ]; then - doit "install -d debian/$TMP/usr/doc/$PACKAGE" + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then + doit "install -d $TMP/usr/doc/$PACKAGE" fi - doit "install -p -m644 debian/changelog debian/$TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" + doit "install -p -m644 debian/changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" if [ "$UPSTREAM" ]; then - doit "install -p -m644 $UPSTREAM debian/$TMP/usr/doc/$PACKAGE/changelog" + doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog" fi done diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 2371af17..8c42a011 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] 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. @@ -29,6 +29,9 @@ Install changelogs for all architecture independent packages. .TP .B \-ppackage Install changelogs for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installcron b/dh_installcron index f5c4f8b8..6ea5daa3 100755 --- a/dh_installcron +++ b/dh_installcron @@ -11,10 +11,10 @@ for PACKAGE in $DH_DOPACKAGES; do for type in daily weekly monthly; do if [ -e debian/${EXT}cron.$type ]; then - if [ ! -d debian/$TMP/etc/cron.$type ]; then - doit "install -o root -g root -d debian/$TMP/etc/cron.$type" + if [ ! -d $TMP/etc/cron.$type ]; then + doit "install -o root -g root -d $TMP/etc/cron.$type" fi - doit "install debian/${EXT}cron.$type debian/$TMP/etc/cron.$type/$PACKAGE" + doit "install debian/${EXT}cron.$type $TMP/etc/cron.$type/$PACKAGE" fi done done diff --git a/dh_installcron.1 b/dh_installcron.1 index 2819958b..ff76760b 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -3,7 +3,7 @@ dh_installcron \- install cron scripts into etc/cron.* .SH SYNOPSIS .B dh_installcron -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installcron is a debhelper program that is responsible for installing cron scripts into etc/cron.* in package build directories. The files @@ -24,6 +24,9 @@ Install cron files for all architecture independent packages. .TP .B \-ppackage Install cron files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installdebfiles b/dh_installdebfiles index 403375f4..ad08f8d3 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -10,8 +10,8 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - if [ ! -d debian/$TMP/DEBIAN ]; then - doit "install -o root -g root -d debian/$TMP/DEBIAN" + if [ ! -d $TMP/DEBIAN ]; then + doit "install -o root -g root -d $TMP/DEBIAN" fi # Install debian install scripts. @@ -20,23 +20,23 @@ for PACKAGE in $DH_DOPACKAGES; do if [ -f debian/$EXT$file ]; then # Add this into the script, where it has #DEBHELPER# if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > debian/$TMP/DEBIAN/$file" - perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > debian/$TMP/DEBIAN/$file - doit "chown root.root debian/$TMP/DEBIAN/$file" - doit "chmod 755 debian/$TMP/DEBIAN/$file" + verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > $TMP/DEBIAN/$file" + perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > $TMP/DEBIAN/$file + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" else - doit "install -o root -g root -p debian/$EXT$file debian/$TMP/DEBIAN/$file" + doit "install -o root -g root -p debian/$EXT$file $TMP/DEBIAN/$file" fi else # Auto-generate script header and add .debhelper # content to it. if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$file" - echo '#!/bin/sh -e' > debian/$TMP/DEBIAN/$file - verbose_echo "cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$file" - cat debian/$EXT$file.debhelper >> debian/$TMP/DEBIAN/$file - doit "chown root.root debian/$TMP/DEBIAN/$file" - doit "chmod 755 debian/$TMP/DEBIAN/$file" + verbose_echo "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" + echo '#!/bin/sh -e' > $TMP/DEBIAN/$file + verbose_echo "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" + cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" fi fi done @@ -44,13 +44,13 @@ 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 debian/$TMP/DEBIAN/$file" + doit "install -o root -g root -m 644 -p debian/$EXT$file $TMP/DEBIAN/$file" fi done # Run dpkg-shlibdeps to generate dependancies. filelist="" - for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do + for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do case "`file $file`" in *ELF*) filelist="$file $filelist" @@ -62,6 +62,6 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Generate and install control file. - doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -Pdebian/$TMP" - doit "chown root.root debian/$TMP/DEBIAN/control" + doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP" + doit "chown root.root $TMP/DEBIAN/control" done diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 924e04b4..429481f4 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -3,7 +3,7 @@ dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS .B dh_installdebfils -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installdebfiles is a debhelper program that is responsible for installing files into the DEBIAN directory in package build directories with the @@ -49,6 +49,9 @@ Install files for all architecture independent packages. .TP .B \-ppackage Install files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_installdocs b/dh_installdocs index 3859d34b..bcc26342 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -10,8 +10,8 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - if [ ! -d debian/$TMP/usr/doc/$PACKAGE ]; then - doit "install -d debian/$TMP/usr/doc/$PACKAGE" + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then + doit "install -d $TMP/usr/doc/$PACKAGE" fi docs="" @@ -25,27 +25,27 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ "$docs" ]; then - doit "cp -a $docs debian/$TMP/usr/doc/$PACKAGE/" + doit "cp -a $docs $TMP/usr/doc/$PACKAGE/" fi # Install these files only into the main package by default. if [ "$PACKAGE" = "$MAINPACKAGE" ]; then if [ -f debian/README.debian ]; then - doit "install -m 644 -p debian/README.debian debian/$TMP/usr/doc/$PACKAGE/" + doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/" fi if [ -f debian/README.Debian ]; then - doit "install -m 644 -p debian/README.Debian debian/$TMP/usr/doc/$PACKAGE/" + doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" fi if [ -f debian/TODO ]; then if [ "$NATIVE" ]; then - doit "install -m 655 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO" + doit "install -m 655 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO" else - doit "install -m 644 -p debian/TODO debian/$TMP/usr/doc/$PACKAGE/TODO.Debian" + doit "install -m 644 -p debian/TODO $TMP/usr/doc/$PACKAGE/TODO.Debian" fi fi fi if [ -f debian/copyright ]; then - doit "install -m 644 -p debian/copyright debian/$TMP/usr/doc/$PACKAGE/" + doit "install -m 644 -p debian/copyright $TMP/usr/doc/$PACKAGE/" fi done diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 4b5f068e..fc001130 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -35,6 +35,9 @@ Install files for all architecture independent packages. .B \-ppackage Install files for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Install these files as documentation into the first binary package listed in debian/control, if we are acting on that package. diff --git a/dh_installexamples b/dh_installexamples index 61ceae20..bc16991a 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -21,10 +21,10 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ "$examples" ]; then - if [ ! -d debian/$TMP/usr/doc/$PACKAGE/examples ]; then - doit "install -d debian/$TMP/usr/doc/$PACKAGE/examples" + if [ ! -d $TMP/usr/doc/$PACKAGE/examples ]; then + doit "install -d $TMP/usr/doc/$PACKAGE/examples" fi - doit "cp -a $examples debian/$TMP/usr/doc/$PACKAGE/examples/" + doit "cp -a $examples $TMP/usr/doc/$PACKAGE/examples/" fi done diff --git a/dh_installexamples.1 b/dh_installexamples.1 index e7ad6c62..5c8ce8c0 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -3,7 +3,7 @@ dh_installexamples \- install example files into package build directories .SH SYNOPSIS .B dh_installexamples -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. @@ -29,6 +29,9 @@ Install files for all architecture independent packages. .B \-ppackage Install files for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Install these files as documentation into the first binary package listed in debian/control, if we are acting on that package. diff --git a/dh_installmanpages b/dh_installmanpages index 304c3b12..4a0ffb47 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -13,7 +13,7 @@ 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 ^debian/$TMP`; do + for file in `find * -name "*.[1-9]*" ! -name "*.ex" ! -name "*.in" | grep -v ^$TMP`; do # Make sure file thinks they are man pages. if file $file|grep -q roff; then if echo $file|grep -q /; then @@ -32,12 +32,12 @@ for PACKAGE in $DH_DOPACKAGES; do done if [ "$install" ]; then SECTION=man`expr $NAME : '.*\.\([123456789]\)'` - if [ ! -e debian/$TMP/usr/man/$SECTION/$NAME -a \ - ! -e debian/$TMP/usr/X11*/man/$SECTION/$NAME ]; then - if [ ! -d debian/$TMP/usr/man/$SECTION ]; then - doit "install -d debian/$TMP/usr/man/$SECTION" + if [ ! -e $TMP/usr/man/$SECTION/$NAME -a \ + ! -e $TMP/usr/X11*/man/$SECTION/$NAME ]; then + if [ ! -d $TMP/usr/man/$SECTION ]; then + doit "install -d $TMP/usr/man/$SECTION" fi - doit "install -p -m644 $file debian/$TMP/usr/man/$SECTION/$NAME" + doit "install -p -m644 $file $TMP/usr/man/$SECTION/$NAME" fi fi fi diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index bb08181b..06794044 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -3,7 +3,7 @@ dh_installmanpages \- install man pages into package build directories .SH SYNOPSIS .B dh_installmanpages -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_installmanpages is a debhelper program that is responsible for automatically installing man pages into usr/man/ and usr/X11R6/man/ in @@ -32,6 +32,9 @@ Install man pages into all architecture independent packages. .B \-ppackage Install man pages into the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Do not install these files as man pages, even if they look like valid man pages. diff --git a/dh_installmenu b/dh_installmenu index c837e04f..5071a2f3 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -2,9 +2,9 @@ # # Integration with debian menu system: # -# If debian/menu file exists, save it to debian/$TMP/usr/lib/menu/$PACKAGE +# If debian/menu file exists, save it to $TMP/usr/lib/menu/$PACKAGE # If debian/menu-method file exists, save it to -# debian/$TMP/etc/menu-methods/$PACKAGE +# $TMP/etc/menu-methods/$PACKAGE # # Also, add to postinst and postrm. @@ -16,10 +16,10 @@ for PACKAGE in $DH_DOPACKAGES; do EXT=`pkgext $PACKAGE` if [ -e debian/${EXT}menu ]; then - if [ ! -d debian/$TMP/usr/lib/menu ]; then - doit "install -d debian/$TMP/usr/lib/menu" + if [ ! -d $TMP/usr/lib/menu ]; then + doit "install -d $TMP/usr/lib/menu" fi - doit "install -p -m644 debian/${EXT}menu debian/$TMP/usr/lib/menu/$PACKAGE" + doit "install -p -m644 debian/${EXT}menu $TMP/usr/lib/menu/$PACKAGE" # Add the scripts if a menu-method file doesn't exist. # The scripts for menu-method handle everything these do, too. @@ -30,10 +30,10 @@ for PACKAGE in $DH_DOPACKAGES; do fi if [ -e debian/${EXT}menu-method ]; then - if [ ! -d debian/$TMP/etc/menu-methods ]; then - doit "install -d debian/$TMP/etc/menu-methods" + if [ ! -d $TMP/etc/menu-methods ]; then + doit "install -d $TMP/etc/menu-methods" fi - doit "install -p debian/${EXT}menu-method debian/$TMP/etc/menu-methods/$PACKAGE" + doit "install -p debian/${EXT}menu-method $TMP/etc/menu-methods/$PACKAGE" if [ ! "$DH_NOSCRIPTS" ]; then autoscript "postinst" "postinst-menu-method" "s/#PACKAGE#/$PACKAGE/" diff --git a/dh_installmenu.1 b/dh_installmenu.1 index e26c84e5..b5337f30 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -3,7 +3,7 @@ dh_installmenu \- install debian menu files into package build directories .SH SYNOPSIS .B dh_installmenu -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installmenu is a debhelper program that is responsible for installing fils used by the debian menu package into package build directories. @@ -40,6 +40,9 @@ Install menu files into the package named "package". .TP .B \-n Do not automatically generate code. +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_lib b/dh_lib index 1cc7e308..c2dd9777 100644 --- a/dh_lib +++ b/dh_lib @@ -1,7 +1,7 @@ # Library functions for debhelper programs. # Run a command, and display the command to stdout if verbose mode is on. -# All commands that modifiy files in debian/$TMP should be ran via this +# All commands that modifiy files in $TMP should be ran via this # function. # Unfortunatly, this function doesn't work if your command uses redirection, # you will have to call verbose_echo by hand then. @@ -24,13 +24,15 @@ error() { } # Pass it a name of a binary package, it returns the name of the tmp dir to -# use, for that package, relative to debian/ +# use, for that package. # This is for back-compatability with the debian/tmp tradition. tmpdir() { - if [ "$1" = "$MAINPACKAGE" ]; then - echo tmp + if [ "$DH_TMPDIR" ]; then + echo "$DH_TMPDIR" + elif [ "$1" = "$MAINPACKAGE" ]; then + echo debian/tmp else - echo "$PACKAGE" + echo "debian/$PACKAGE" fi } @@ -77,7 +79,7 @@ autoscript() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvianp: $*` +set -- `getopt xvianp:P: $*` for i; do case "$i" @@ -107,6 +109,11 @@ for i; do DH_EXCLUDE=1 shift ;; + -P) + DH_TMPDIR="$2" + shift + shift + ;; --) shift break @@ -172,3 +179,9 @@ if [ ! "$DH_DOPACKAGES" -o "$DH_DOPACKAGES" = " " ]; then fi DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2` fi + +# Check to see if -P was specified. If so, we can only act on a single +# package. +if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | grep -q " "; then + error "-P was specified, but multiple packages would be acted on." +fi diff --git a/dh_makeshlibs b/dh_makeshlibs index a09e26f6..f1ab8899 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -8,23 +8,23 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then - error "debian/$TMP/DEBIAN/shlibs already exists." + if [ -e "$TMP/DEBIAN/shlibs" ]; then + error "$TMP/DEBIAN/shlibs already exists." fi - for file in `find debian/$TMP -type f -name "*.so*" | tr "\n" " "` ; do + for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true - if [ ! -d "debian/$TMP/DEBIAN" ] ; then - doit "install -d debian/$TMP/DEBIAN" + if [ ! -d "$TMP/DEBIAN" ] ; then + doit "install -d $TMP/DEBIAN" fi - verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>debian/$TMP/DEBIAN/shlibs" - echo "$LIBRARY $MAJOR $PACKAGE" >>debian/$TMP/DEBIAN/shlibs + verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>$TMP/DEBIAN/shlibs" + echo "$LIBRARY $MAJOR $PACKAGE" >>$TMP/DEBIAN/shlibs done - if [ -e "debian/$TMP/DEBIAN/shlibs" ]; then - doit "chown root.root debian/$TMP/DEBIAN/shlibs" + if [ -e "$TMP/DEBIAN/shlibs" ]; then + doit "chown root.root $TMP/DEBIAN/shlibs" fi done diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 51ba8fee..e4296e47 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -23,6 +23,9 @@ Generate shlibs files for all architecture independent packages. .TP .B \-ppackage Generate shlibs file for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_md5sums b/dh_md5sums index 5400bad9..f71ab529 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -9,21 +9,21 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - if [ ! -d "debian/$TMP/DEBIAN" ]; then - doit "install -d debian/$TMP/DEBIAN" + if [ ! -d "$TMP/DEBIAN" ]; then + doit "install -d $TMP/DEBIAN" fi # Doit isn't smart enough to hande this next command so echo by hand. (sigh) - verbose_echo 'find debian/$TMP/* -type f ! -regex "^debian/$TMP/DEBIAN/.*" | sed s:debian/$TMP/:: | sort > debian/$TMP/DEBIAN/allfiles' - find debian/$TMP/* -type f ! -regex "^debian/$TMP/DEBIAN/.*" | sed s:debian/$TMP:: | sort > debian/$TMP/DEBIAN/allfiles + verbose_echo 'find $TMP/* -type f ! -regex "^$TMP/DEBIAN/.*" | sed s:$TMP/:: | sort > $TMP/DEBIAN/allfiles' + find $TMP/* -type f ! -regex "^$TMP/DEBIAN/.*" | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles # Check if we should exclude conffiles. - if [ ! "$DH_EXCLUDE" -a -r debian/$TMP/DEBIAN/conffiles ]; then - verbose_echo "sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new" - sort debian/$TMP/DEBIAN/conffiles | comm -13 - debian/$TMP/DEBIAN/allfiles > debian/$TMP/DEBIAN/allfiles.new - doit "mv debian/$TMP/DEBIAN/allfiles.new debian/$TMP/DEBIAN/allfiles" + if [ ! "$DH_EXCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then + verbose_echo "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" + sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new + doit "mv $TMP/DEBIAN/allfiles.new $TMP/DEBIAN/allfiles" fi - verbose_echo "cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." - cd debian/$TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. - doit "chown root.root debian/$TMP/DEBIAN/md5sums" - doit "rm -f debian/$TMP/DEBIAN/allfiles" + verbose_echo "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." + cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. + doit "chown root.root $TMP/DEBIAN/md5sums" + doit "rm -f $TMP/DEBIAN/allfiles" done diff --git a/dh_md5sums.1 b/dh_md5sums.1 index a54c1c15..28f7fe45 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -3,7 +3,7 @@ dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-x] [-v] [-a] [-i] [-ppackage]" +.I "[-x] [-v] [-a] [-i] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. @@ -29,6 +29,9 @@ Generate md5sums file for the package named "package". .B \-x Include conffiles in the md5sums list. Note that this is redundant, and included elsewhere in debian packages. +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_strip b/dh_strip index 77d670a6..57725d70 100755 --- a/dh_strip +++ b/dh_strip @@ -9,7 +9,7 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` # Handle executables and shared libraries. - for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do + for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do case "`file $file`" in *ELF*shared*) doit "strip --strip-unneeded $file" @@ -21,7 +21,7 @@ for PACKAGE in $DH_DOPACKAGES; do done # Handle static libraries. - for file in `find debian/$TMP -type f -name "lib*.a" 2>/dev/null` ; do + for file in `find $TMP -type f -name "lib*.a" 2>/dev/null` ; do # Don't strip debug libraries. if ! expr "$file" : ".*_g\.a" >/dev/null ; then doit "strip --strip-debug $file" diff --git a/dh_strip.1 b/dh_strip.1 index 2eba9914..fa3c7694 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -3,7 +3,7 @@ dh_strip \- strip executables, shared libraries, and some static libraries. .SH SYNOPSIS .B dh_strip -.I "[-v] [-a] [-i] [-ppackage]" +.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_strip is a debhelper program that is responsible for stripping executables, shared libraries, and static libraries that are not used for @@ -25,6 +25,9 @@ pointless :-). .TP .B \-ppackage Strip files for the package named "package". +.TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. .SH NOTES The .B \-a diff --git a/dh_suidregister b/dh_suidregister index 4ca72a1c..e03379f6 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -26,11 +26,11 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! "$files" -a ! -e debian/${EXT}suid ]; then # No files specified (and no empty debian/suid file), so # guess what files to process. - files=`find debian/$TMP -type f -perm +6000` + files=`find $TMP -type f -perm +6000` # We will strip the debian working directory off of the # filenames. - tostrip="debian/$TMP/" + tostrip="$TMP/" else # We will strip leading /'s, so the user can feed this # program either absolute filenames, or relative filenames, @@ -49,7 +49,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Create the sed string that will be used to # fill in the blanks in the autoscript files. # Fill with the owner, group, and perms of the file. - sedstr=`find debian/$TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"` + sedstr=`find $TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"` autoscript "postinst" "postinst-suid" "$sedstr" autoscript "postrm" "postrm-suid" "$sedstr" diff --git a/dh_suidregister.1 b/dh_suidregister.1 index e15e6d5f..97dcb24b 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -3,7 +3,7 @@ dh_suidregister \- set up package to register files with suidregister .SH SYNOPSIS .B dh_suidregister -.I "[-v] [-a] [-i] [-ppackage] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_suidregister is a debhelper program that is responsible for modifying the postinst and postrm scripts of a package so the package will register files @@ -39,6 +39,9 @@ Register files for all architecture independent packages. .B \-ppackage Register files for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B file ... Register these files in the first binary package listed in debian/control, if we are acting on that package. diff --git a/dh_undocumented b/dh_undocumented index ebde8904..fe1dbf2d 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -41,11 +41,11 @@ for PACKAGE in $DH_DOPACKAGES; do reldir=.. fi - if [ ! -d debian/$TMP/$dir ]; then - doit "install -d debian/$TMP/$dir" + if [ ! -d $TMP/$dir ]; then + doit "install -d $TMP/$dir" fi - doit ln -s $reldir/man7/undocumented.7.gz debian/$TMP/$dir/$file.gz + doit ln -s $reldir/man7/undocumented.7.gz $TMP/$dir/$file.gz done fi done diff --git a/dh_undocumented.1 b/dh_undocumented.1 index ab45baad..d6ec21bf 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -3,7 +3,7 @@ dh_undocumented \- make symlinks to undocumented.7 man page .SH SYNOPSIS .B dh_undocumented -.I "[-v] [-a] [-i] [-ppackage] [manpage ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -42,6 +42,9 @@ Install undocumented man page symlinks for all architecture independent packages .B \-ppackage Install undocumented man page symlinks for the package named "package". .TP +.B \-Ptmpdir +Use "tmpdir" for package build directory. +.TP .B manpage ... Install undocumented man page symlinks for each of these man pages into the first binary package listed in debian/control, if we are acting on -- cgit v1.2.3 From c71c19eb874374de4b11b740af49c7d2d202dbc3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:17 +0000 Subject: r22: Initial Import --- debian/changelog | 7 +++++++ dh_compress | 2 +- dh_compress.1 | 5 +++-- examples/rules | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index f7d47b17..b6a5a496 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.16) unstable; urgency=low + + * dh_compress: always compress changelog and upstream changelog, no + matter what their size (#14604) (policy 5.8) + + -- Joey Hess Thu, 6 Nov 1997 19:50:36 -0500 + debhelper (0.15) unstable; urgency=low * README: documented what temporary directories are used by default for diff --git a/dh_compress b/dh_compress index 86ab8373..a54cd2f8 100755 --- a/dh_compress +++ b/dh_compress @@ -23,7 +23,7 @@ for PACKAGE in $DH_DOPACKAGES; do # By default fall back on what the policy manual says to compress. files=` find usr/info usr/man usr/X11*/man -type f 2>/dev/null ; - find usr/doc -type f -size +4k \ + find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ ! -name "*.htm*" ! -name "*.gif" \ ! -name "copyright" 2>/dev/null ` diff --git a/dh_compress.1 b/dh_compress.1 index d7e8dc5c..0e6c6198 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -13,7 +13,7 @@ to the new files. By default, dh_compress compresses files that debian policy mandates should be compressed, namely all files in usr/info, usr/man, usr/X11R6/man, and all files in usr/doc that are larger than 4k in size, except -the copyright file, .html files and .gif files. +the copyright file, .html files and .gif files, and all changelog files. .P If a debian/compress file exits, however, it will be ran as a shell script, and all filenames that the shell script outputs will be compressed instead @@ -25,7 +25,8 @@ the same files as it would by default. This is a good starting point for customization of what files are compressed: .PP find usr/info usr/man usr/X11*/man -type f - find usr/doc -type f -size +4k \\ + find usr/doc -type f \\ + \\( -size +4k -or -name "changelog*" \\) \\ ! -name "*.htm*" ! -name "*.gif" \\ ! -name "copyright" .SH OPTIONS diff --git a/examples/rules b/examples/rules index d5170a78..5d0f7085 100755 --- a/examples/rules +++ b/examples/rules @@ -28,6 +28,7 @@ binary-arch: build dh_testdir dh_testroot dh_clean + dh_installdirs # Add here commands to install the files into debian/tmp #$(MAKE) PREFIX=debian/tmp install dh_installdocs -- cgit v1.2.3 From ffe38a05c38d561ff59df28ed52363cf4b578f9c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:17 +0000 Subject: r23: Initial Import --- debian/changelog | 8 ++++++++ debian/rules | 5 ++--- dh_lib | 2 +- examples/rules.multi | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index b6a5a496..bbbdb268 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.17) unstable; urgency=low + + * Added dh_installdirs, automatically creates subdirectories (for + compatability with debstd's debian/dirs file. + * dh_lib: fixed problem with -P flag. + + -- Joey Hess Fri, 7 Nov 1997 16:07:11 -0500 + debhelper (0.16) unstable; urgency=low * dh_compress: always compress changelog and upstream changelog, no diff --git a/debian/rules b/debian/rules index eaaeb54d..e2d4da03 100755 --- a/debian/rules +++ b/debian/rules @@ -28,15 +28,14 @@ binary-indep: build ./dh_testdir $(test_files) ./dh_testroot ./dh_clean + ./dh_installdirs usr/bin usr/lib/debhelper - install -d debian/tmp/usr/bin find . -perm +111 -maxdepth 1 -type f \ -exec install -p {} debian/tmp/usr/bin \; - install -d debian/tmp/usr/lib/debhelper cp dh_lib debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper - ./dh_installdocs TODO README + ./dh_installdocs TODO README BUGS ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages diff --git a/dh_lib b/dh_lib index c2dd9777..8dad88c5 100644 --- a/dh_lib +++ b/dh_lib @@ -182,6 +182,6 @@ fi # Check to see if -P was specified. If so, we can only act on a single # package. -if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | grep -q " "; then +if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | egrep -q '.+ .+' ; then error "-P was specified, but multiple packages would be acted on." fi diff --git a/examples/rules.multi b/examples/rules.multi index fbefadd3..6fd70889 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -27,6 +27,7 @@ binary-indep: build dh_testdir -i dh_testroot -i dh_clean -i + dh_installdirs -i # Add here commands to install the files into debian/tmp #$(MAKE) PREFIX=debian/tmp install dh_installdocs -i @@ -49,6 +50,7 @@ binary-arch: build dh_testdir -a dh_testroot -a dh_clean -a + dh_installdirs -a # Add here commands to install the files into debian/tmp #$(MAKE) PREFIX=debian/tmp install dh_installdocs -a -- cgit v1.2.3 From 1c596507129a7022904405114e2bced37ace1cd7 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:25 +0000 Subject: r24: Initial Import --- TODO | 2 ++ debian/changelog | 11 +++++++++++ dh_clean | 6 ++++-- dh_du | 4 ++-- dh_installdebfiles | 9 +++------ dh_installdirs | 5 +---- dh_lib | 17 ++++++----------- dh_makeshlibs | 3 +-- dh_md5sums | 10 +++------- examples/rules | 3 +++ examples/rules.multi | 3 +++ 11 files changed, 39 insertions(+), 34 deletions(-) diff --git a/TODO b/TODO index 1a5f1cef..5ed6f9bb 100644 --- a/TODO +++ b/TODO @@ -2,3 +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). diff --git a/debian/changelog b/debian/changelog index bbbdb268..6f26f1ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +debhelper (0.18) unstable; urgency=low + + * examples/*: added source, diff targets that just print an error. + * dh_clean: clean up more files - *.orig, *.rej, *.bak, .*.orig, .*.rej, + .SUMS, TAGS, and empty files. + * dh_lib: doit(): use eval on parameters, instead of directly running + them. This lets me clean up several nasty areas where I had to echo the + commands once, and then run them seperatly. + + -- Joey Hess Mon, 10 Nov 1997 19:48:36 -0500 + debhelper (0.17) unstable; urgency=low * Added dh_installdirs, automatically creates subdirectories (for diff --git a/dh_clean b/dh_clean index 874604ed..73c094fe 100755 --- a/dh_clean +++ b/dh_clean @@ -16,5 +16,7 @@ doit "rm -f debian/files* debian/*.debhelper $*" # Remove other temp files. doit isn't smart enough to handle this, so I echo # by hand (sigh). -verbose_echo "find . \( -name "\#*\#" -o -name "*~" -o -name "DEADJOE" \) -exec rm -f {} \;" -find . \( -name "\#*\#" -o -name "*~" -o -name "DEADJOE" \) -exec rm -f {} \; +doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE -o -name '*.orig' \ + -o -name '*.rej' -o -name '*.bak' -o -name '.*.orig' \ + -o -name '.*.rej' -o -name .SUMS -o -name TAGS -o -name core \ + -o -size 0 \) -exec rm -f {} \;" diff --git a/dh_du b/dh_du index 5fcb1418..c06f9c27 100755 --- a/dh_du +++ b/dh_du @@ -13,7 +13,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d $TMP/DEBIAN" fi - verbose_echo "du -k $TMP | sed \"s: $TMP/: :\" | grep -v \" DEBIAN$\" | grep -v \" $TMP$\" > $TMP/DEBIAN/du" - du -k $TMP | sed "s: $TMP/: :" | grep -v " DEBIAN$" | grep -v " $TMP$" >$TMP/DEBIAN/du + # Note that the tabs in this next line are important. + doit "du -k $TMP | sed 's: $TMP/: :' | grep -v ' DEBIAN$' | grep -v ' $TMP$' >$TMP/DEBIAN/du" doit "chown root.root debian/tmp/DEBIAN/du" done diff --git a/dh_installdebfiles b/dh_installdebfiles index ad08f8d3..a9954963 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -20,8 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do if [ -f debian/$EXT$file ]; then # Add this into the script, where it has #DEBHELPER# if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "perl -pe \"s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg\" < debian/$EXT$file > $TMP/DEBIAN/$file" - perl -pe "s~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg" < debian/$EXT$file > $TMP/DEBIAN/$file + doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < debian/$EXT$file > $TMP/DEBIAN/$file" doit "chown root.root $TMP/DEBIAN/$file" doit "chmod 755 $TMP/DEBIAN/$file" else @@ -31,10 +30,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Auto-generate script header and add .debhelper # content to it. if [ -f debian/$EXT$file.debhelper ]; then - verbose_echo "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" - echo '#!/bin/sh -e' > $TMP/DEBIAN/$file - verbose_echo "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" - cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file + doit "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" + doit "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" doit "chown root.root $TMP/DEBIAN/$file" doit "chmod 755 $TMP/DEBIAN/$file" fi diff --git a/dh_installdirs b/dh_installdirs index bab883d7..a44de9ab 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -31,9 +31,6 @@ for PACKAGE in $DH_DOPACKAGES; do fi done # Create dirs. - verbose_echo "cd $TMP && install -d $dirs && cd ../.." - cd $TMP - install -d $dirs - cd ../.. + doit "cd $TMP && install -d $dirs && cd ../.." fi done diff --git a/dh_lib b/dh_lib index 8dad88c5..1b17151d 100644 --- a/dh_lib +++ b/dh_lib @@ -3,17 +3,15 @@ # 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 # function. -# Unfortunatly, this function doesn't work if your command uses redirection, -# you will have to call verbose_echo by hand then. doit() { - verbose_echo "$*" - $* + verbose_echo "$@" + eval "$@" } # Echo something if the verbose flag is on. verbose_echo() { if [ "$DH_VERBOSE" ]; then - echo " $*" + echo " $@" fi } @@ -68,12 +66,9 @@ autoscript() { fi # Running doit doesn't cut it here. - verbose_echo echo "# Automatically added by `basename $0` on `822-date`" ">>" $autoscript_debscript - echo "# Automatically added by `basename $0` on `822-date`" >> $autoscript_debscript - verbose_echo sed "$autoscript_sed" $autoscript_filename ">>" $autoscript_debscript - sed "$autoscript_sed" $autoscript_filename >> $autoscript_debscript - verbose_echo echo "# End automatically added section" ">>" $autoscript_debscript - echo "# End automatically added section" >> $autoscript_debscript + doit "echo \"# Automatically added by `basename $0` on `822-date`\" >> $autoscript_debscript" + doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" + doit "echo '# End automatically added section' >> $autoscript_debscript" } # Argument processing and global variable initialization is below. diff --git a/dh_makeshlibs b/dh_makeshlibs index f1ab8899..1f8dd92c 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -20,8 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi - verbose_echo "echo \"$LIBRARY $MAJOR $PACKAGE\" >>$TMP/DEBIAN/shlibs" - echo "$LIBRARY $MAJOR $PACKAGE" >>$TMP/DEBIAN/shlibs + doit "echo '$LIBRARY $MAJOR $PACKAGE" >>$TMP/DEBIAN/shlibs" done if [ -e "$TMP/DEBIAN/shlibs" ]; then diff --git a/dh_md5sums b/dh_md5sums index f71ab529..5278ed51 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -13,17 +13,13 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d $TMP/DEBIAN" fi - # Doit isn't smart enough to hande this next command so echo by hand. (sigh) - verbose_echo 'find $TMP/* -type f ! -regex "^$TMP/DEBIAN/.*" | sed s:$TMP/:: | sort > $TMP/DEBIAN/allfiles' - find $TMP/* -type f ! -regex "^$TMP/DEBIAN/.*" | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles + doit "find $TMP/* -type f ! -regex '^$TMP/DEBIAN/.*' | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles" # Check if we should exclude conffiles. if [ ! "$DH_EXCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then - verbose_echo "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" - sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new + doit "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" doit "mv $TMP/DEBIAN/allfiles.new $TMP/DEBIAN/allfiles" fi - verbose_echo "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." - cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.. + doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." doit "chown root.root $TMP/DEBIAN/md5sums" doit "rm -f $TMP/DEBIAN/allfiles" done diff --git a/examples/rules b/examples/rules index 5d0f7085..72ce3e66 100755 --- a/examples/rules +++ b/examples/rules @@ -48,5 +48,8 @@ binary-arch: build dh_md5sums dh_builddeb +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary diff --git a/examples/rules.multi b/examples/rules.multi index 6fd70889..c5d16183 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -70,5 +70,8 @@ binary-arch: build dh_md5sums -a dh_builddeb -a +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary -- cgit v1.2.3 From fae527d4b0eae350f5e43bd82c706bab4b8774b4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:37:41 +0000 Subject: r25: Initial Import --- debian/changelog | 6 ++++++ dh_installmenu.1 | 2 +- examples/rules | 1 + examples/rules.multi | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6f26f1ee..b66816d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.19) unstable; urgency=low + + * dh_installmenu.1: menufile is in section 5, not 1. + + -- Joey Hess Wed, 12 Nov 1997 19:54:48 -0500 + debhelper (0.18) unstable; urgency=low * examples/*: added source, diff targets that just print an error. diff --git a/dh_installmenu.1 b/dh_installmenu.1 index b5337f30..6dcffff2 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -58,6 +58,6 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README , -.BR menufile (1) +.BR menufile (5) .SH AUTHOR Joey Hess diff --git a/examples/rules b/examples/rules index 72ce3e66..86ec8a70 100755 --- a/examples/rules +++ b/examples/rules @@ -34,6 +34,7 @@ binary-arch: build dh_installdocs dh_installexamples dh_installmenu +# dh_installinit dh_installcron dh_installmanpages # dh_undocumented diff --git a/examples/rules.multi b/examples/rules.multi index c5d16183..1fce1c0b 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -33,6 +33,7 @@ binary-indep: build dh_installdocs -i dh_installexamples -i dh_installmenu -i +# dh_installinit -i dh_installcron -i # dh_installmanpages -i # dh_undocumented @@ -56,6 +57,7 @@ binary-arch: build dh_installdocs -a dh_installexamples -a dh_installmenu -a +# dh_installinit -a dh_installcron -a dh_installmanpages -a # dh_undocumented -- cgit v1.2.3 From 6a4e26df64f0529f4db0ae7acf394b553a3fc30d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:11 +0000 Subject: r26: Initial Import --- autoscripts/postrm-init | 2 +- debian/changelog | 7 +++++++ dh_installmenu.1 | 10 +++++----- dh_lib | 15 ++++++++++++++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init index 9596dd97..1c292982 100644 --- a/autoscripts/postrm-init +++ b/autoscripts/postrm-init @@ -1,3 +1,3 @@ if [ "$1" = "purge" ] ; then - update-rc.d #SCRIPT# remove #INITPARMS# >/dev/null + update-rc.d #SCRIPT# remove >/dev/null fi diff --git a/debian/changelog b/debian/changelog index b66816d8..c9a8a7c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.20) unstable; urgency=low + + * Added dh_installinit, which installs an init.d script, and edits the + postinst, postrm, etc. + + -- Joey Hess Fri, 14 Nov 1997 00:45:53 -0500 + debhelper (0.19) unstable; urgency=low * dh_installmenu.1: menufile is in section 5, not 1. diff --git a/dh_installmenu.1 b/dh_installmenu.1 index 6dcffff2..abbff8de 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -3,10 +3,10 @@ dh_installmenu \- install debian menu files into package build directories .SH SYNOPSIS .B dh_installmenu -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n]" .SH "DESCRIPTION" dh_installmenu is a debhelper program that is responsible for installing -fils used by the debian menu package into package build directories. +files used by the debian menu package into package build directories. .P It also automatically generates the postinst and postrm commands needed to interface with the debian menu package. See @@ -38,11 +38,11 @@ Install menu files into all architecture independent packages. .B \-ppackage Install menu files into the package named "package". .TP -.B \-n -Do not automatically generate code. -.TP .B \-Ptmpdir Use "tmpdir" for package build directory. +.TP +.B \-n +Do not modify postinst/postrm scripts. .SH NOTES The .B \-a diff --git a/dh_lib b/dh_lib index 1b17151d..4aace52c 100644 --- a/dh_lib +++ b/dh_lib @@ -74,7 +74,7 @@ autoscript() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvianp:P: $*` +set -- `getopt xvidrnap:P:u: $*` for i; do case "$i" @@ -104,11 +104,24 @@ for i; do DH_EXCLUDE=1 shift ;; + -d) + DH_D_FLAG=1 + shift + ;; + -r) + DH_R_FLAG=1 + shift + ;; -P) DH_TMPDIR="$2" shift shift ;; + -u) + DH_U_PARAMS="$2" + shift + shift + ;; --) shift break -- cgit v1.2.3 From e862c56c4ae3d77e02875e085fb4647cc20db0b8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:11 +0000 Subject: r27: Initial Import --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c9a8a7c1..82e193f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.21) unstable; urgency=low + + * dh_installinit: on removal, fixed how update-rc.d is called. + + -- Joey Hess Sat, 15 Nov 1997 20:43:14 -0500 + debhelper (0.20) unstable; urgency=low * Added dh_installinit, which installs an init.d script, and edits the -- cgit v1.2.3 From 15e132da65d0ce115f0b9a12ada848a06d6a195e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:16 +0000 Subject: r28: Initial Import --- debian/changelog | 7 +++++++ dh_installdocs | 3 ++- dh_installdocs.1 | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 82e193f3..ae73986f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.22) unstable; urgency=low + + * dh_installdocs: Install README.debian as README.Debian (of course, + README.Debian is installed with the same name..) + + -- Joey Hess Tue, 18 Nov 1997 01:23:53 -0500 + debhelper (0.21) unstable; urgency=low * dh_installinit: on removal, fixed how update-rc.d is called. diff --git a/dh_installdocs b/dh_installdocs index bcc26342..153be9a2 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -31,7 +31,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Install these files only into the main package by default. if [ "$PACKAGE" = "$MAINPACKAGE" ]; then if [ -f debian/README.debian ]; then - doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/" + # .Debian is correct according to policy. + doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/README.Debian" fi if [ -f debian/README.Debian ]; then doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" diff --git a/dh_installdocs.1 b/dh_installdocs.1 index fc001130..68f3808c 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -12,8 +12,8 @@ dh_installdocs automatically installs debian/copyright if it exists. If dh_installdocs is acting on multiple packages, debian/copyright files will be installed into all packages. .P -Any filenames specified as parameters, as well as debian/README.debian (or -debian/README.Debian) and debian/TODO, if they exist, will be installed into +Any filenames specified as parameters, as well as debian/README.Debian (or +debian/README.debian) and debian/TODO, if they exist, will be installed into the first binary package listed in 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. -- cgit v1.2.3 From 9d5e2e656d9cb9c00bada6c740ab9339433434d2 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:30 +0000 Subject: r29: Initial Import --- debian/changelog | 7 +++++++ debian/control | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ae73986f..d453632c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.23) unstable; urgency=low + + * Now depends on fileutils (>= 3.16-4), becuase with any earlier version + of fileutils, install -p will not work (#14680) + + -- Joey Hess Wed, 19 Nov 1997 23:59:43 -0500 + debhelper (0.22) unstable; urgency=low * dh_installdocs: Install README.debian as README.Debian (of course, diff --git a/debian/control b/debian/control index 35ad8f04..e22d969b 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 2.1.1.0 Package: debhelper Architecture: all -Depends: perl +Depends: perl, fileutils (>= 3.16-4) Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to automate common tasks. Programs are included to install various files into -- cgit v1.2.3 From e6259191673f34ae6d56f1c0b746a3cc97455dac Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:40 +0000 Subject: r30: Initial Import --- BUGS | 2 ++ debian/changelog | 6 ++++++ dh_clean | 5 ++--- examples/rules | 2 +- examples/rules.multi | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/BUGS b/BUGS index 3a33f32e..51a7b613 100644 --- a/BUGS +++ b/BUGS @@ -1,3 +1,5 @@ dh_compress: doesn't verbose echo that it's cd'd to $TMP. dh_installdirs, dh_md5sums: uses ../.. to cd back to original location, but we don't know that $TMP is 2 levels deep. +dh_compress: refers to ../compress (meaning debian/compress), but we don't +know that this will work - exp if $TMP is not under debian/. diff --git a/debian/changelog b/debian/changelog index d453632c..209cfb66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.24) unstable; urgency=low + + * dh_clean: no longer clean up empty (0 byte) files (#15240). + + -- Joey Hess Tue, 25 Nov 1997 14:29:37 -0500 + debhelper (0.23) unstable; urgency=low * Now depends on fileutils (>= 3.16-4), becuase with any earlier version diff --git a/dh_clean b/dh_clean index 73c094fe..8e92fc8d 100755 --- a/dh_clean +++ b/dh_clean @@ -14,9 +14,8 @@ for PACKAGE in $DH_DOPACKAGES; do done doit "rm -f debian/files* debian/*.debhelper $*" -# Remove other temp files. doit isn't smart enough to handle this, so I echo -# by hand (sigh). +# Remove other temp files. doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE -o -name '*.orig' \ -o -name '*.rej' -o -name '*.bak' -o -name '.*.orig' \ -o -name '.*.rej' -o -name .SUMS -o -name TAGS -o -name core \ - -o -size 0 \) -exec rm -f {} \;" + \) -exec rm -f {} \;" diff --git a/examples/rules b/examples/rules index 86ec8a70..10661223 100755 --- a/examples/rules +++ b/examples/rules @@ -15,9 +15,9 @@ clean: dh_testdir dh_testroot rm -f build-stamp - dh_clean # Add here commands to clean up after the build process. #-$(MAKE) distclean + dh_clean # Build architecture-independent files here. binary-indep: build diff --git a/examples/rules.multi b/examples/rules.multi index 1fce1c0b..496c3366 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -18,9 +18,9 @@ clean: dh_testdir dh_testroot rm -f build-stamp - dh_clean # Add here commands to clean up after the build process. #-$(MAKE) distclean + dh_clean # Build architecture-independent files here. binary-indep: build -- cgit v1.2.3 From 61499664bdeb06600a593ef98a6fe0ad9170ecd6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:40 +0000 Subject: r31: Initial Import --- debian/changelog | 7 +++++++ dh_compress | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 209cfb66..8d8f7e29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.25) unstable; urgency=low + + * dh_compress: was not reading debian/compress file - fixed. + * examples/*: moved dh_clean call to after make clean is run. + + -- Joey Hess Tue, 25 Nov 1997 15:43:58 -0500 + debhelper (0.24) unstable; urgency=low * dh_clean: no longer clean up empty (0 byte) files (#15240). diff --git a/dh_compress b/dh_compress index a54cd2f8..fd07de04 100755 --- a/dh_compress +++ b/dh_compress @@ -15,10 +15,10 @@ for PACKAGE in $DH_DOPACKAGES; do olddir=`pwd` cd $TMP - if [ -f debian/${EXT}compress ]; then + if [ -f ../${EXT}compress ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - files=`sh debian/${EXT}compress 2>/dev/null` + files=`sh ../${EXT}compress 2>/dev/null` else # By default fall back on what the policy manual says to compress. files=` -- cgit v1.2.3 From f9b969f0702e7030d34307c376ff3f0046dfdeae Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:52 +0000 Subject: r32: Initial Import --- README | 9 +++++++++ debian/changelog | 9 +++++++++ dh_du.1 | 2 +- dh_installdirs | 4 ++-- dh_installdirs.1 | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/README b/README index 2f2e7c2c..53b6c3d9 100644 --- a/README +++ b/README @@ -125,4 +125,13 @@ binary package the debhelper program will act on. For example: This uses debian/tmp- as the package build directory. +Miscellaneous notes: +------------------- + +Some of the dh_* programs (dh_installdirs in particular, I have not checked +the rest), will let you pass $PACKAGE to them and it will be expanded into +the package name they are operating on. For example: + + dh_installdirs -a 'usr/doc/$PACKAGE' + -- Joey Hess diff --git a/debian/changelog b/debian/changelog index 8d8f7e29..053ed047 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.26) unstable; urgency=low + + * dh_installdirs: Do not create usr/doc/$PACKAGE directory. Bug #15498 + * README: documented that $PACKAGE can be used in the arguments to some of + the dh_* programs (#15497). + * dh_du.1: no, this is not really the dh_md5sums man page (#15499). + + -- Joey Hess Sun, 30 Nov 1997 13:01:40 -0500 + debhelper (0.25) unstable; urgency=low * dh_compress: was not reading debian/compress file - fixed. diff --git a/dh_du.1 b/dh_du.1 index 42509a50..d7d5061c 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -2,7 +2,7 @@ .SH NAME dh_du \- generate DEBIAN/du file .SH SYNOPSIS -.B dh_md5sums +.B dh_du .I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_du is a debhelper program that is responsible for generating diff --git a/dh_installdirs b/dh_installdirs index a44de9ab..dbe1a0a8 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -9,8 +9,8 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` - if [ ! -d $TMP/usr/doc/$PACKAGE ]; then - doit "install -d $TMP/usr/doc/$PACKAGE" + if [ ! -d $TMP ]; then + doit "install -d $TMP" fi dirs="" diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 41dd0fd8..9f5bc351 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -14,7 +14,7 @@ dh_installdirs is acting on that package. .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. Seperate the directory names with +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 -- cgit v1.2.3 From 8d1bbcb775d700523862844bc41cfb8ef6a8672a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:38:52 +0000 Subject: r33: Initial Import --- README | 20 ++++++++++---------- debian/changelog | 7 +++++++ dh_clean.1 | 2 +- dh_du.1 | 2 +- dh_fixperms.1 | 2 +- dh_installdocs.1 | 2 +- dh_installexamples.1 | 4 ++-- dh_installmanpages.1 | 4 ++-- dh_makeshlibs.1 | 4 ++-- dh_suidregister.1 | 2 +- dh_testdir.1 | 2 +- dh_undocumented.1 | 2 +- 12 files changed, 30 insertions(+), 23 deletions(-) diff --git a/README b/README index 53b6c3d9..2bb9c7a5 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ 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 extensivly. See +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). @@ -12,8 +12,8 @@ variations are possible). Converting from debstd to debhelper: ----------------------------------- -Debhelper is designed to be mostly backwards compatable to debstd. I say -mostly becuase I haven't made debhelper handle everything that debstd does +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 @@ -44,19 +44,19 @@ 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 differnt parts of it. So if you +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 dehelper apps do that too, but they do it differnently. Debstd just -appends its commands to the end of the script. Debhelper reqyires that you +of the dehelper 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. +"#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 reccommend that you compare the new package and the old +it works ok, I recommend that you compare the new package and the old debstd-generated package very closely. Pay special attention to the postint, postrm, etc scripts. @@ -88,7 +88,7 @@ because you need to generate the architecture dependent packages in the binary-arch debian/rules target, and the architecture independent packages in the binary-indep debian/rules target. -To faciliatate this, as well as give you more control over which packages +To facilitate this, as well as give you more control over which packages are acted on by debhelper programs, all debhelper programs accept the following parameters: @@ -112,7 +112,7 @@ package listed in debian/control, and debian/ for each additional package. Sometimes, you might want to use some other temporary directory. This is -supported by the -P flag. The direcotry to use is specified after -P, for +supported by the -P flag. The directory to use is specified after -P, for example, "dh_installdocs -Pdebian/tmp", will use debian/tmp as the temporary directory. Note that if you use -P, the debhelper programs can only be acting on a single package at a time. So if you have a package that builds diff --git a/debian/changelog b/debian/changelog index 053ed047..b652cde1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.27) unstable; urgency=low + + * README: fixed typoes (one serious). + * Ran ispell on all the documentation. + + -- Joey Hess Sun, 30 Nov 1997 18:48:20 -0500 + debhelper (0.26) unstable; urgency=low * dh_installdirs: Do not create usr/doc/$PACKAGE directory. Bug #15498 diff --git a/dh_clean.1 b/dh_clean.1 index 651b5b08..a9f0bdfd 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -35,7 +35,7 @@ The and .B \-p arguments are cumulative. If none are specified, then all packages listed in -the control file will have thier package build directories cleaned up. +the control file will have their package build directories cleaned up. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_du.1 b/dh_du.1 index d7d5061c..315d0b98 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -7,7 +7,7 @@ dh_du \- generate DEBIAN/du file .SH "DESCRIPTION" dh_du is a debhelper program that is responsible for generating a DEBIAN/du file, which lists the disk usage of directories in the package. -This file isn't used by anthing yet, but it could be helpful for a future +This file isn't used by anything yet, but it could be helpful for a future debian installer program. .P The du file is installed with proper permissions and ownerships. diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 8ae36def..c403836c 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -35,7 +35,7 @@ The and .B \-p arguments are cumulative. If none are specified, then all packages listed in -the control file will have thier permissions fixed. +the control file will have their permissions fixed. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 68f3808c..9724635e 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -50,7 +50,7 @@ and arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. .P -Note that dh_installdocs will happily copy entire directory hiearchies if +Note that dh_installdocs will happily copy entire directory hierarchies if you ask it to (it uses cp -a internally). If it is asked to install a directory, it will install the complete contents of the directory. .SH ENVIRONMENT diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 5c8ce8c0..c940d256 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -13,7 +13,7 @@ binary package listed in debian/control, if dh_installexamples is acting on that package. .P A file named debian/examples (for the first binary package in debian/control), -or debian/package.exmaples (for each additional package in debian/control) can +or debian/package.examples (for each additional package in debian/control) can list other files to be installed. .SH OPTIONS .TP @@ -44,7 +44,7 @@ and arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. .P -Note that dh_examples will happily copy entire directory hiearchies if +Note that dh_examples will happily copy entire directory hierarchies if you ask it to (it uses cp -a internally). If it is asked to install a directory, it will install the complete contents of the directory. .SH ENVIRONMENT diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index 06794044..7687ed9c 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -13,7 +13,7 @@ dh_installmanpages scans the current directory and all subdirectories for filenames that look like man pages. It uses .BR file (1) to verify that the files are in the correct format. Then, based on the -files' extentions, it installs them into the correct man directory. +files' extensions, it installs them into the correct man directory. .P All filenames specified as parameters will be skipped by dh_installmanpages. This is useful if by default it installs some man pages that you do not want @@ -58,7 +58,7 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS -Man pages with the extention +Man pages with the extension .B .man are not automatically installed. .P diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index e4296e47..0b7df353 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -41,9 +41,9 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS -There is no guarentee that the program will get the shlibs file right. For +There is no guarantee that the program will get the shlibs file right. For example, it may not correctly guess the major number of your package. In -casews like these (and perhaps in general, just to be safe), it is better to +cases like these (and perhaps in general, just to be safe), it is better to create a debian/shlibs file by hand. This is a "do what I Mean" type program - you have been warned! .SH AUTHOR diff --git a/dh_suidregister.1 b/dh_suidregister.1 index 97dcb24b..c69f6128 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -24,7 +24,7 @@ will automatically register all files it finds. .P Note that this package modifies your postinst and postrm files. See .BR dh_installdebfiles (1) -for an explination of how this works. +for an explanation of how this works. .SH OPTIONS .TP .B \-v diff --git a/dh_testdir.1 b/dh_testdir.1 index da245542..c3212301 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -16,7 +16,7 @@ Verbose mode; show all commands that modify the package build directory. This currently has no effect. .TP .B file ... -Test for the existance of these files. +Test for the existence of these files. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_undocumented.1 b/dh_undocumented.1 index d6ec21bf..cea97516 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -13,7 +13,7 @@ man page for man pages that are not present in your package. The program takes a list of man pages that should be symlinked to .BR undocumented (7) It determines what directory the man pages should be placed in by examining -their extentions - pages ending in "x" go into /usr/X11R6/man/, while pages +their extensions - pages ending in "x" go into /usr/X11R6/man/, while pages that end in anything else go in /usr/man/. It also examines the extention to see what section the man page belongs in. After figuring this out, it generates the necessary symlinks to -- cgit v1.2.3 From b8f36e7620a7a8d6e47b5032ba1dbf0310fb894a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:02 +0000 Subject: r34: Initial Import --- README | 8 -------- debian/changelog | 6 ++++++ dh_clean | 3 ++- dh_installdebfiles | 6 +++--- dh_lib | 16 ++++++++++++---- dh_makeshlibs | 2 +- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/README b/README index 2bb9c7a5..e192504d 100644 --- a/README +++ b/README @@ -125,13 +125,5 @@ binary package the debhelper program will act on. For example: This uses debian/tmp- as the package build directory. -Miscellaneous notes: -------------------- - -Some of the dh_* programs (dh_installdirs in particular, I have not checked -the rest), will let you pass $PACKAGE to them and it will be expanded into -the package name they are operating on. For example: - - dh_installdirs -a 'usr/doc/$PACKAGE' -- Joey Hess diff --git a/debian/changelog b/debian/changelog index b652cde1..7badab5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.28) unstable; urgency=low + + * dh_makeshlibs: fixes type that caused the program to crash (#15536). + + -- Joey Hess Wed, 3 Dec 1997 13:22:48 -0500 + debhelper (0.27) unstable; urgency=low * README: fixed typoes (one serious). diff --git a/dh_clean b/dh_clean index 8e92fc8d..b170494b 100755 --- a/dh_clean +++ b/dh_clean @@ -15,7 +15,8 @@ done doit "rm -f debian/files* debian/*.debhelper $*" # Remove other temp files. -doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE -o -name '*.orig' \ +# Use complex_doit so we can properly escape things. +complex_doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE -o -name '*.orig' \ -o -name '*.rej' -o -name '*.bak' -o -name '.*.orig' \ -o -name '.*.rej' -o -name .SUMS -o -name TAGS -o -name core \ \) -exec rm -f {} \;" diff --git a/dh_installdebfiles b/dh_installdebfiles index a9954963..825c9ee5 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -20,7 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do if [ -f debian/$EXT$file ]; then # Add this into the script, where it has #DEBHELPER# if [ -f debian/$EXT$file.debhelper ]; then - 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' < debian/$EXT$file > $TMP/DEBIAN/$file" doit "chown root.root $TMP/DEBIAN/$file" doit "chmod 755 $TMP/DEBIAN/$file" else @@ -30,8 +30,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Auto-generate script header and add .debhelper # content to it. if [ -f debian/$EXT$file.debhelper ]; then - doit "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" - doit "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" + 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 diff --git a/dh_lib b/dh_lib index 4aace52c..4c8c68c6 100644 --- a/dh_lib +++ b/dh_lib @@ -3,7 +3,16 @@ # 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 # function. +# Note that this cannot handle complex commands, especially anything +# involving redirection. Use complex_doit instead. doit() { + verbose_echo "$@" + eval '$@' +} + +# This is an identical command to doit, except the parameter passed to it +# are evaled with double quotes. This version can handle compound commands. +complex_doit() { verbose_echo "$@" eval "$@" } @@ -65,10 +74,9 @@ autoscript() { fi fi - # Running doit doesn't cut it here. - doit "echo \"# Automatically added by `basename $0` on `822-date`\" >> $autoscript_debscript" - doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" - doit "echo '# End automatically added section' >> $autoscript_debscript" + complex_doit "echo \"# Automatically added by `basename $0` on `822-date`\" >> $autoscript_debscript" + complex_doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" + complex_doit "echo '# End automatically added section' >> $autoscript_debscript" } # Argument processing and global variable initialization is below. diff --git a/dh_makeshlibs b/dh_makeshlibs index 1f8dd92c..24fef4ec 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -20,7 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi - doit "echo '$LIBRARY $MAJOR $PACKAGE" >>$TMP/DEBIAN/shlibs" + doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs" done if [ -e "$TMP/DEBIAN/shlibs" ]; then -- cgit v1.2.3 From b21daac4b8ae57bc61647076774d1370827531e2 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:06 +0000 Subject: r35: Initial Import --- BUGS | 5 ----- debian/changelog | 12 ++++++++++++ dh_du | 2 +- dh_installdirs | 4 +++- dh_makeshlibs | 2 +- dh_md5sums | 6 +++--- dh_undocumented | 2 +- 7 files changed, 21 insertions(+), 12 deletions(-) diff --git a/BUGS b/BUGS index 51a7b613..e69de29b 100644 --- a/BUGS +++ b/BUGS @@ -1,5 +0,0 @@ -dh_compress: doesn't verbose echo that it's cd'd to $TMP. -dh_installdirs, dh_md5sums: uses ../.. to cd back to original location, but - we don't know that $TMP is 2 levels deep. -dh_compress: refers to ../compress (meaning debian/compress), but we don't -know that this will work - exp if $TMP is not under debian/. diff --git a/debian/changelog b/debian/changelog index 7badab5c..249f8f28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (0.29) unstable; urgency=low + + * dh_lib: don't expand text passed to doit() a second time. This fixes + #15624, and hopefully doesn't break anything else. + * A side effect of this (of interest only to the debhelper programmer) is + that doit() can no longer handle complex commands now. (ie, pipes, `;', + `&', etc separating multiple commands, or redirection) + * dh_makeshlibs, dh_md5sums, dh_installdebfiles, dh_du, dh_clean, + dh_installdirs: don't pass complex commands to doit(). + + -- Joey Hess Thu, 4 Dec 1997 13:56:14 -0500 + debhelper (0.28) unstable; urgency=low * dh_makeshlibs: fixes type that caused the program to crash (#15536). diff --git a/dh_du b/dh_du index c06f9c27..39c684eb 100755 --- a/dh_du +++ b/dh_du @@ -14,6 +14,6 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Note that the tabs in this next line are important. - doit "du -k $TMP | sed 's: $TMP/: :' | grep -v ' DEBIAN$' | grep -v ' $TMP$' >$TMP/DEBIAN/du" + 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" done diff --git a/dh_installdirs b/dh_installdirs index dbe1a0a8..cb38a4b3 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -31,6 +31,8 @@ for PACKAGE in $DH_DOPACKAGES; do fi done # Create dirs. - doit "cd $TMP && install -d $dirs && cd ../.." + doit "cd $TMP" + doit "install -d $dirs" + doit "cd ../.." fi done diff --git a/dh_makeshlibs b/dh_makeshlibs index 24fef4ec..0943ba57 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -20,7 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi - doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs" + complex_doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs" done if [ -e "$TMP/DEBIAN/shlibs" ]; then diff --git a/dh_md5sums b/dh_md5sums index 5278ed51..f19b7ed5 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -13,13 +13,13 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d $TMP/DEBIAN" fi - doit "find $TMP/* -type f ! -regex '^$TMP/DEBIAN/.*' | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles" + complex_doit "find $TMP/* -type f ! -regex '^$TMP/DEBIAN/.*' | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles" # Check if we should exclude conffiles. if [ ! "$DH_EXCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then - doit "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" + complex_doit "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" doit "mv $TMP/DEBIAN/allfiles.new $TMP/DEBIAN/allfiles" fi - doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." + complex_doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." doit "chown root.root $TMP/DEBIAN/md5sums" doit "rm -f $TMP/DEBIAN/allfiles" done diff --git a/dh_undocumented b/dh_undocumented index fe1dbf2d..60166967 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -45,7 +45,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d $TMP/$dir" fi - doit ln -s $reldir/man7/undocumented.7.gz $TMP/$dir/$file.gz + doit "ln -s $reldir/man7/undocumented.7.gz $TMP/$dir/$file.gz" done fi done -- cgit v1.2.3 From b5b83f0b397cf9403dc5a5fe9a2bfa17ffa006a8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:10 +0000 Subject: r36: Initial Import --- debian/changelog | 6 ++++++ dh_compress | 10 +++++----- dh_installdirs | 3 ++- dh_installinit.1 | 2 +- dh_md5sums | 3 ++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 249f8f28..d2f17f96 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.30) unstable; urgency=low + + * dh_md5sumes, dh_installdirs, dh_compress: fixed assorted cd bugs. + + -- Joey Hess Fri, 5 Dec 1997 15:08:36 -0500 + debhelper (0.29) unstable; urgency=low * dh_lib: don't expand text passed to doit() a second time. This fixes diff --git a/dh_compress b/dh_compress index fd07de04..fe16b6cb 100755 --- a/dh_compress +++ b/dh_compress @@ -13,12 +13,12 @@ for PACKAGE in $DH_DOPACKAGES; do # Run the file name gatering commands from within the directory # structure that will be effected. olddir=`pwd` - cd $TMP + doit "cd $TMP" - if [ -f ../${EXT}compress ]; then + if [ -f $olddir/${EXT}compress ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - files=`sh ../${EXT}compress 2>/dev/null` + files=`sh $olddir/${EXT}compress 2>/dev/null` else # By default fall back on what the policy manual says to compress. files=` @@ -26,7 +26,7 @@ for PACKAGE in $DH_DOPACKAGES; do find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ ! -name "*.htm*" ! -name "*.gif" \ ! -name "copyright" 2>/dev/null - ` + ` fi if [ "$files" ]; then @@ -37,7 +37,7 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Change back to old pwd. - cd $olddir + doit "cd $olddir" # Fix up symlinks that were pointing to the uncompressed files. for file in `find $TMP -type l`; do diff --git a/dh_installdirs b/dh_installdirs index cb38a4b3..b5480851 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -31,8 +31,9 @@ for PACKAGE in $DH_DOPACKAGES; do fi done # Create dirs. + olddir=`pwd` doit "cd $TMP" doit "install -d $dirs" - doit "cd ../.." + doit "cd $olddir" fi done diff --git a/dh_installinit.1 b/dh_installinit.1 index 4eb4ee07..f87c0c58 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -5,7 +5,7 @@ dh_installinit \- install init scripts into package build directories .B dh_installinit .I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-u params]" .SH "DESCRIPTION" -dh_installmenu is a debhelper program that is responsible for installing +dh_installinit is a debhelper program that is responsible for installing init scripts into package build directories. .P It also automatically generates the postinst and postrm and prerm commands diff --git a/dh_md5sums b/dh_md5sums index f19b7ed5..ae470926 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do complex_doit "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" doit "mv $TMP/DEBIAN/allfiles.new $TMP/DEBIAN/allfiles" fi - complex_doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd ../.." + olddir=`pwd` + complex_doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd $olddir" doit "chown root.root $TMP/DEBIAN/md5sums" doit "rm -f $TMP/DEBIAN/allfiles" done -- cgit v1.2.3 From 99b34ff691012e69828ea2167b7a3089ac4953f3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:16 +0000 Subject: r37: Initial Import --- README | 6 +++-- debian/changelog | 6 +++++ dh_installdebfiles | 64 +++++----------------------------------------------- dh_installdebfiles.1 | 2 +- dh_installinit.1 | 4 ++-- examples/rules | 4 +++- examples/rules.multi | 9 +++++--- 7 files changed, 28 insertions(+), 67 deletions(-) diff --git a/README b/README index e192504d..280da781 100644 --- a/README +++ b/README @@ -35,7 +35,9 @@ Remove that and replace it with something like: dh_compress dh_fixperms dh_suidregister - dh_installdebfiles + dh_installdeb + dh_shlibdeps + dh_gencontrol dh_makeshlibs dh_md5sums dh_builddeb @@ -68,7 +70,7 @@ Some debhelper commands will automatically generate parts of debian install scripts. If you want these automatically generated things included in your debian install scripts, then you need to add "#DEBHELPER#" to your scripts, in the place the code should be added. "#DEBHELPER#" will be replaced by any -autogenerated code when you run dh_installdebfiles. +autogenerated code when you run dh_installdeb. All scripts that automatically generate code in this way let it be disabled by the -n parameter. diff --git a/debian/changelog b/debian/changelog index d2f17f96..96c4971b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.31) unstable; urgency=low + + * Fixed man page typos #15685. + + -- Joey Hess Sat, 6 Dec 1997 21:44:58 -0500 + debhelper (0.30) unstable; urgency=low * dh_md5sumes, dh_installdirs, dh_compress: fixed assorted cd bugs. diff --git a/dh_installdebfiles b/dh_installdebfiles index 825c9ee5..8b1e0962 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -1,64 +1,12 @@ #!/bin/sh -e # -# Install files from debian/ into the package's DEBIAN directory. -# Also generates the control file. +# This program is depricated, but left in the package for backwards +# compatability. It simply calls the 3 programs that replaced it. PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` +echo "* Note: dh_installdebfiles is depricated." >&2 - if [ ! -d $TMP/DEBIAN ]; then - doit "install -o root -g root -d $TMP/DEBIAN" - fi - - # 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 - # Add this into the script, where it has #DEBHELPER# - if [ -f debian/$EXT$file.debhelper ]; then - complex_doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < debian/$EXT$file > $TMP/DEBIAN/$file" - doit "chown root.root $TMP/DEBIAN/$file" - doit "chmod 755 $TMP/DEBIAN/$file" - else - doit "install -o root -g root -p debian/$EXT$file $TMP/DEBIAN/$file" - fi - 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 - - # 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" - fi - done - - # Run dpkg-shlibdeps to generate dependancies. - filelist="" - for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do - case "`file $file`" in - *ELF*) - filelist="$file $filelist" - ;; - esac - done - if [ "$filelist" ]; then - doit "dpkg-shlibdeps -Tdebian/${EXT}substvars $filelist" - fi - - # Generate and install control file. - doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP" - doit "chown root.root $TMP/DEBIAN/control" -done +dh_installdeb $* +dh_shlibdeps $* +dh_gencontrol $* diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 429481f4..8b34b910 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -2,7 +2,7 @@ .SH NAME dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS -.B dh_installdebfils +.B dh_installdebfiles .I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installdebfiles is a debhelper program that is responsible for installing diff --git a/dh_installinit.1 b/dh_installinit.1 index f87c0c58..e0daac42 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -3,7 +3,7 @@ dh_installinit \- install init scripts into package build directories .SH SYNOPSIS .B dh_installinit -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-u params]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" .SH "DESCRIPTION" dh_installinit is a debhelper program that is responsible for installing init scripts into package build directories. @@ -47,7 +47,7 @@ Remove trailing "d" from the name of the package, and use the result for the filename the init script is installed as in etc/init.d/ . This may be useful for daemons with named ending in "d". .TP -.B \-u params +.B \-uparams Pass "params" to .BR update-rc.d (8) If not specified, "default" will be passed to diff --git a/examples/rules b/examples/rules index 10661223..87692ccd 100755 --- a/examples/rules +++ b/examples/rules @@ -43,7 +43,9 @@ binary-arch: build dh_compress dh_fixperms dh_suidregister - dh_installdebfiles + dh_installdeb + dh_shlibdeps + dh_gencontrol # dh_makeshlibs dh_du dh_md5sums diff --git a/examples/rules.multi b/examples/rules.multi index 496c3366..f0bd78a6 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -41,8 +41,9 @@ binary-indep: build dh_compress -i dh_fixperms -i dh_suidregister -i - dh_installdebfiles -i - dh_du -a + dh_installdeb -i + dh_gencontrol -i + dh_du -i dh_md5sums -i dh_builddeb -i @@ -66,7 +67,9 @@ binary-arch: build dh_compress -a dh_fixperms -a dh_suidregister -a - dh_installdebfiles -a + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a # dh_makeshlibs -a dh_du -a dh_md5sums -a -- cgit v1.2.3 From 918dbc752efd1d35a3ef667524062d4a0dcd3e3e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:21 +0000 Subject: r38: Initial Import --- TODO | 2 ++ debian/changelog | 10 ++++++++ debian/rules | 4 ++- dh_clean | 12 ++++++--- dh_installdeb | 11 +++++--- dh_installdebfiles.1 | 71 +++++++++++----------------------------------------- dh_installmenu.1 | 2 +- dh_lib | 6 ++++- dh_suidregister.1 | 2 +- examples/rules | 4 +-- examples/rules.indep | 4 +-- examples/rules.multi | 8 +++--- 12 files changed, 59 insertions(+), 77 deletions(-) diff --git a/TODO b/TODO index 5ed6f9bb..3118ab95 100644 --- a/TODO +++ b/TODO @@ -4,3 +4,5 @@ * 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 96c4971b..f739f89b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (0.32) unstable; urgency=low + + * Split dh_installdebfiles into 3 programs (dh_installdeb, dh_shlibdeps, + and dh_gencontrol). dh_installdebfiles still works, but is depricated. + * Added an examples/rules.indep file. + * examples/rules.multi: changed dh_du -a to dh_du -i in binary-indep + section. + + -- Joey Hess Wed, 10 Dec 1997 19:53:13 -0500 + debhelper (0.31) unstable; urgency=low * Fixed man page typos #15685. diff --git a/debian/rules b/debian/rules index e2d4da03..8a240f9b 100755 --- a/debian/rules +++ b/debian/rules @@ -43,7 +43,9 @@ binary-indep: build ./dh_compress ./dh_fixperms ./dh_suidregister - ./dh_installdebfiles + ./dh_installdeb + ./dh_shlibdeps + ./dh_gencontrol ./dh_du ./dh_md5sums ./dh_builddeb diff --git a/dh_clean b/dh_clean index b170494b..6306adda 100755 --- a/dh_clean +++ b/dh_clean @@ -12,11 +12,15 @@ for PACKAGE in $DH_DOPACKAGES; do doit "rm -rf $TMP" doit "rm -f debian/${EXT}substvars" done -doit "rm -f debian/files* debian/*.debhelper $*" +doit "rm -f debian/*.debhelper $*" +if [ ! "$DH_K_FLAG" ]; then + doit "rm -f debian/files*" +fi # Remove other temp files. # Use complex_doit so we can properly escape things. -complex_doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE -o -name '*.orig' \ - -o -name '*.rej' -o -name '*.bak' -o -name '.*.orig' \ - -o -name '.*.rej' -o -name .SUMS -o -name TAGS -o -name core \ +complex_doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE \ + -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \ + -o -name '.*.orig' -o -name '.*.rej' -o -name .SUMS \ + -o -name TAGS -o -name core \ \) -exec rm -f {} \;" diff --git a/dh_installdeb b/dh_installdeb index 43aca902..d9e1e7b3 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -17,14 +17,17 @@ for PACKAGE in $DH_DOPACKAGES; do # If any .debhelper files exist, add them into the scripts. for file in postinst preinst prerm postrm; do if [ -f debian/$EXT$file ]; then - # Add this into the script, where it has #DEBHELPER# 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" - doit "chown root.root $TMP/DEBIAN/$file" - doit "chmod 755 $TMP/DEBIAN/$file" else - doit "install -o root -g root -p debian/$EXT$file $TMP/DEBIAN/$file" + # Just get rid of any #DEBHELOPER# in the + # script. + complex_doit "sed s/#DEBHELPER#// < debian/$EXT$file > $TMP/DEBIAN/$file" fi + doit "chown root.root $TMP/DEBIAN/$file" + doit "chmod 755 $TMP/DEBIAN/$file" else # Auto-generate script header and add .debhelper # content to it. diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 8b34b910..0240f938 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -3,70 +3,27 @@ dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS .B dh_installdebfiles -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installdebfiles is a debhelper program that is responsible for installing files into the DEBIAN directory in package build directories with the -correct permissions. +correct permissions, canculating shared library dependancies, and creating a +control file. .P -dh_installdocs automatically installs the following files from debian/ into -the DEBIAN directory: -.IP postinst -.IP preinst -.IP postrm -.IP prerm -.IP shlibs -.IP conffiles +This program is depricated. It is now merely a wrapper around three other +programs, and you may replace any calls to this program by: .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".) -.P -The files postinst, preinst, postrm, and prerm are handled specially: If a -corresponding file named debian/script.debhelper exists, the contents of that -file are merged into the script as follows: If the script exists, then -anywhere in it that "#DEBHELPER#" appears, the text of the .debhelper file is -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. -.P -In addition, it will generate a DEBIAN/control file, by running -.BR dpkg-shlibdeps (1) -and -.BR dpkg-gencontrol (1) + dh_installdeb + dh_shlibdeps + dh_gencontrol +.SH WARNING +This program will be removed at some time in the furture. .SH OPTIONS -.TP -.B \-v -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a -Install files for all architecture dependent packages. -.TP -.B \-i -Install files for all architecture independent packages. -.TP -.B \-ppackage -Install files for the package named "package". -.TP -.B \-Ptmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode +Any options passed to this program will be sent to each of the 3 programs +listed above. .SH "SEE ALSO" .BR /usr/doc/debhelper/README -.SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +.BR dh_installdeb (1) +.BR dh_shlibdeps (1) +.BR dh_gencontrol (1) .SH AUTHOR Joey Hess diff --git a/dh_installmenu.1 b/dh_installmenu.1 index abbff8de..11bc71b8 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -10,7 +10,7 @@ files used by the debian menu package into package build directories. .P It also automatically generates the postinst and postrm commands needed to interface with the debian menu package. See -.BR dh_installdebfiles (1) +.BR dh_installdeb (1) for an explanation of how this works. .P If a file named debian/menu exists, then it is installed into diff --git a/dh_lib b/dh_lib index 4c8c68c6..388b7f72 100644 --- a/dh_lib +++ b/dh_lib @@ -82,7 +82,7 @@ autoscript() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvidrnap:P:u: $*` +set -- `getopt xvidrnakp:P:u: $*` for i; do case "$i" @@ -120,6 +120,10 @@ for i; do DH_R_FLAG=1 shift ;; + -k) + DH_K_FLAG=1 + shift + ;; -P) DH_TMPDIR="$2" shift diff --git a/dh_suidregister.1 b/dh_suidregister.1 index c69f6128..b66c2140 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -23,7 +23,7 @@ scan the package build directory for files that have suid permissions, and will automatically register all files it finds. .P Note that this package modifies your postinst and postrm files. See -.BR dh_installdebfiles (1) +.BR dh_installdeb (1) for an explanation of how this works. .SH OPTIONS .TP diff --git a/examples/rules b/examples/rules index 87692ccd..105d91c0 100755 --- a/examples/rules +++ b/examples/rules @@ -27,10 +27,10 @@ binary-indep: build binary-arch: build dh_testdir dh_testroot - dh_clean + dh_clean -k dh_installdirs # Add here commands to install the files into debian/tmp - #$(MAKE) PREFIX=debian/tmp install + #$(MAKE) prefix=`pwd`/debian/tmp install dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.indep b/examples/rules.indep index a257a197..5bd756de 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -24,10 +24,10 @@ clean: binary-indep: build dh_testdir dh_testroot - dh_clean + dh_clean -k dh_installdirs # Add here commands to install the files into debian/tmp - #$(MAKE) PREFIX=debian/tmp install + #$(MAKE) prefix=`pwd`/debian/tmp install dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.multi b/examples/rules.multi index f0bd78a6..eceee350 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -26,10 +26,10 @@ clean: binary-indep: build dh_testdir -i dh_testroot -i - dh_clean -i + dh_clean -i -k dh_installdirs -i # Add here commands to install the files into debian/tmp - #$(MAKE) PREFIX=debian/tmp install + #$(MAKE) prefix=`pwd`/debian/tmp install dh_installdocs -i dh_installexamples -i dh_installmenu -i @@ -51,10 +51,10 @@ binary-indep: build binary-arch: build dh_testdir -a dh_testroot -a - dh_clean -a + dh_clean -a -k dh_installdirs -a # Add here commands to install the files into debian/tmp - #$(MAKE) PREFIX=debian/tmp install + #$(MAKE) prefix=`pwd`/debian/tmp install dh_installdocs -a dh_installexamples -a dh_installmenu -a -- cgit v1.2.3 From 30b820a975dfc42f401a395a406f0b9f1f717fcc Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:26 +0000 Subject: r39: Initial Import --- debian/changelog | 12 ++++++++++++ debian/rules | 3 +-- dh_clean.1 | 11 ++++++++++- dh_installdebfiles | 4 ++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index f739f89b..506a35e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (0.33) unstable; urgency=low + + * examples/*: use prefix, instead of PREFIX, becuase autoconf uses that. + Also, use `pwd`/debian/tmp, instead of debian/tmp. + * Always substitute #DEBHELPER# in maintainer scripts, even if it expands + to nothing, for neatness and to save a few bytes. #15863 + * dh_clean: added -k parameter to not delete debian/files. #15789 + * examples/*: use dh_clean -k in the binary targets of all rules files, + for safety. + + -- Joey Hess Thu, 11 Dec 1997 19:05:41 -0500 + debhelper (0.32) unstable; urgency=low * Split dh_installdebfiles into 3 programs (dh_installdeb, dh_shlibdeps, diff --git a/debian/rules b/debian/rules index 8a240f9b..b236fb1f 100755 --- a/debian/rules +++ b/debian/rules @@ -27,7 +27,7 @@ binary-arch: build binary-indep: build ./dh_testdir $(test_files) ./dh_testroot - ./dh_clean + ./dh_clean -k ./dh_installdirs usr/bin usr/lib/debhelper find . -perm +111 -maxdepth 1 -type f \ @@ -44,7 +44,6 @@ binary-indep: build ./dh_fixperms ./dh_suidregister ./dh_installdeb - ./dh_shlibdeps ./dh_gencontrol ./dh_du ./dh_md5sums diff --git a/dh_clean.1 b/dh_clean.1 index a9f0bdfd..5d9180a9 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -3,7 +3,7 @@ dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-k] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some @@ -26,6 +26,15 @@ Clean up the package build directory for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-k +Do not delete debian/files. When do you want to use this? Anytime you have a +debian/rules that has 2 binary targets that build different .deb packages; +for example, one target is binary-arch, and the other is binary-indep, or +one target builds the shared library, and the other the -dev package. If you +didn't use -k in these cases, then debian/files would be deleted in the +middle, and your changes file will only contain the last binary package that +was built. +.TP .B file ... Delete these files too. .SH NOTES diff --git a/dh_installdebfiles b/dh_installdebfiles index 8b1e0962..6afdf548 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -1,11 +1,11 @@ #!/bin/sh -e # -# This program is depricated, but left in the package for backwards +# 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 -echo "* Note: dh_installdebfiles is depricated." >&2 +echo "* Note: dh_installdebfiles is deprecated." >&2 dh_installdeb $* dh_shlibdeps $* -- cgit v1.2.3 From e7b15707fd400a1775864ea61f4a2665932c7c88 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:32 +0000 Subject: r40: Initial Import --- debian/changelog | 6 ++++++ dh_installdebfiles.1 | 2 +- dh_lib | 10 +++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 506a35e5..689ff71c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.34) unstable; urgency=low + + * Fixed typo #16215. + + -- Joey Hess Mon, 22 Dec 1997 14:41:46 -0500 + debhelper (0.33) unstable; urgency=low * examples/*: use prefix, instead of PREFIX, becuase autoconf uses that. diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 0240f938..cf1580d0 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -9,7 +9,7 @@ files into the DEBIAN directory in package build directories with the correct permissions, canculating shared library dependancies, and creating a control file. .P -This program is depricated. It is now merely a wrapper around three other +This program is deprecated. It is now merely a wrapper around three other programs, and you may replace any calls to this program by: .P dh_installdeb diff --git a/dh_lib b/dh_lib index 388b7f72..7a56c156 100644 --- a/dh_lib +++ b/dh_lib @@ -141,9 +141,13 @@ for i; do esac done -# Get the package version from the changelog. -LINE=`head -1 debian/changelog` -VERSION=`expr "$LINE" : '.* (\(.*\))'` +# 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:'` # Get the name of the main binary package. MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1` -- cgit v1.2.3 From 1352476d748b5137881c467365f0ed5c34297c5d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:39:32 +0000 Subject: r41: Initial Import --- debian/changelog | 9 +++++++++ dh_undocumented | 2 +- dh_undocumented.1 | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 689ff71c..bfc05796 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.35) unstable; urgency=low + + * dh_lib: use dpkg-parsechangelog instead of parsing it by hand. This + makes a package build slower (by about 30 seconds, on average), so + I might remove it or optimize it if too many people yell at me. :-) + * dh_undocumented.1: note that it really links to undocumented.7.gz. + + -- Joey Hess Mon, 22 Dec 1997 22:19:39 -0500 + debhelper (0.34) unstable; urgency=low * Fixed typo #16215. diff --git a/dh_undocumented b/dh_undocumented index 60166967..ee161c52 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -1,7 +1,7 @@ #!/bin/sh -e # # Passed a list of undocumented man pages, generates symlinks to -# undocumented.7 for those man pages. +# undocumented.7.gz for those man pages. # # Also, it looks for debian/undocumented files for more lists of # undocumented man pages. diff --git a/dh_undocumented.1 b/dh_undocumented.1 index cea97516..3f554989 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -1,6 +1,6 @@ .TH DH_UNDOCUMENTED 1 .SH NAME -dh_undocumented \- make symlinks to undocumented.7 man page +dh_undocumented \- make symlinks to undocumented.7.gz man page .SH SYNOPSIS .B dh_undocumented .I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [manpage ...]" -- cgit v1.2.3 From 8828415f7d08350f236cc60d3c801ccd0ba199d6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:40:08 +0000 Subject: r42: Initial Import --- debian/changelog | 7 +++++++ dh_lib | 29 ++++++++++++++++------------- dh_undocumented | 3 ++- examples/rules | 2 +- examples/rules.indep | 2 +- examples/rules.multi | 2 +- 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index bfc05796..80d0aaa3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.36) unstable; urgency=low + + * dh_undocumented: exit with an error message if the man page specified + does not have a section. + + -- Joey Hess Sat, 27 Dec 1997 14:14:04 -0500 + debhelper (0.35) unstable; urgency=low * dh_lib: use dpkg-parsechangelog instead of parsing it by hand. This diff --git a/dh_lib b/dh_lib index 7a56c156..8347aae8 100644 --- a/dh_lib +++ b/dh_lib @@ -51,6 +51,22 @@ pkgext() { fi } +# Returns 1 if the package is a native debian package, null otherwise. +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 + fi +} + # Automatically add a shell script snippet to a debian script. # Only works if the script has #DEBHELPER# in it. # @@ -141,22 +157,9 @@ for i; do esac done -# 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:'` - # Get the name of the main binary package. MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1` -# Is this a native Debian package? -if ! expr "$VERSION" : '.*-' >/dev/null; then - NATIVE=1 -fi - 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. diff --git a/dh_undocumented b/dh_undocumented index ee161c52..d0a8febd 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -32,7 +32,8 @@ for PACKAGE in $DH_DOPACKAGES; do # Determine what directory the file belongs in, # /usr/man, or /usr/X11R6/man. - section=`expr "$file" : '.*\.\([123456789]\)'` + section=`expr "$file" : '.*\.\([123456789]\)'` \ + || error "\"$file\" does not have an extention." if [ `expr "$file" : '.*\.[123456789]\(x\)'` ] ; then dir=usr/X11R6/man/man$section reldir=../../../man diff --git a/examples/rules b/examples/rules index 105d91c0..29c79dee 100755 --- a/examples/rules +++ b/examples/rules @@ -7,7 +7,7 @@ build: build-stamp build-stamp: dh_testdir - # Add here commands to compile the pacckage. + # Add here commands to compile the package. #$(MAKE) touch build-stamp diff --git a/examples/rules.indep b/examples/rules.indep index 5bd756de..fb46c623 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -8,7 +8,7 @@ build: build-stamp build-stamp: dh_testdir - # Add here commands to compile the pacckage. + # Add here commands to compile the package. #$(MAKE) touch build-stamp diff --git a/examples/rules.multi b/examples/rules.multi index eceee350..205ed4c8 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -10,7 +10,7 @@ build: build-stamp build-stamp: dh_testdir - # Add here commands to compile the pacckage. + # Add here commands to compile the package. #$(MAKE) touch build-stamp -- 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(-) 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 e742573dc1696f78dacb1cf36827e9a04f6f3514 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:41:40 +0000 Subject: r44: Initial Import --- debian/changelog | 29 ++++++++++++++++++++++++++++- dh_installdirs | 2 +- dh_installdocs | 2 +- dh_installdocs.1 | 20 ++++++++++++-------- dh_installexamples | 2 +- dh_installexamples.1 | 10 +++++----- dh_installinit.1 | 7 +++++++ dh_makeshlibs | 8 ++++++-- dh_makeshlibs.1 | 10 ++++++++-- dh_suidregister.1 | 9 +++++---- dh_undocumented | 2 +- dh_undocumented.1 | 13 +++++++------ 12 files changed, 82 insertions(+), 32 deletions(-) diff --git a/debian/changelog b/debian/changelog index a1139e5b..75e03dae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,35 @@ +debhelper (0.50) unstable; urgency=low + + * dh_makeshlibs: added -m parameter, which can force the major number + of the shared library if it is guessed incorrectly. + * Added dh_testversion to let your package depend on a certian version of + debhelper to build. + * dh_{installdirs,installdocs,installexamples,suidregieter,undocumented}: + behavior modification - any files/directories specified on the command + line now apply to the first package acted on. This may not be the + first package listed in debian/control, if you use -p to make it act on + a given package, or -i or -a. + * If you take advantage of the above new behavior, I suggest you add + "dh_testversion 0.50" to your debian/rules. + * Display a warning message in cases where the above behavior is triggered, + and debhelper's behavior has altered. + * I have grepped debian's source packages, and I'm quite sure this + is not going to affect any packages currently in debian. + * dh_lib: isnative() now caches its return value, which should optimize + away several more calls to dpkg-parsechangelog. + * README: explain a way to embed debhelper generated shell script into a + perl script. + * dh_installinit: A hack to work around the problem in getopt(1) that + led to bug report #16229: Any text specified on the command line that is + not a flag will be presumed to be part of the -u flag. Yuck. + + -- Joey Hess Sat, 3 Jan 1998 14:36:15 -0500 + 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 + slowdown caused by using dpkg-parsechangelog - now it's only called by 2 dh_* programs. -- Joey Hess Sun, 28 Dec 1997 20:45:22 -0500 diff --git a/dh_installdirs b/dh_installdirs index b5480851..51ef2ce7 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do dirs=`tr "\n" " " < debian/${EXT}dirs` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then dirs="$* $dirs" fi diff --git a/dh_installdocs b/dh_installdocs index a1da8aa9..11014229 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -20,7 +20,7 @@ for PACKAGE in $DH_DOPACKAGES; do docs=`tr "\n" " " < debian/${EXT}docs` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then docs="$* $docs" fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 9724635e..86195b79 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -9,14 +9,19 @@ dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. .P dh_installdocs automatically installs debian/copyright if it exists. If -dh_installdocs is acting on multiple packages, debian/copyright files will be +dh_installdocs is acting on multiple packages, debian/copyright files will be installed into all packages. .P -Any filenames specified as parameters, as well as debian/README.Debian (or -debian/README.debian) and debian/TODO, if they exist, will be installed into -the first binary package listed in 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. +Any filenames specified as parameters will be installed into the first +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 +Also, debian/README.Debian (or debian/README.debian) and debian/TODO, if +they exist, will be installed into the first binary package listed in +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 @@ -39,8 +44,7 @@ Install files for the package named "package". Use "tmpdir" for package build directory. .TP .B file ... -Install these files as documentation into the first binary package listed in -debian/control, if we are acting on that package. +Install these files as documentation into the first package acted on. .SH NOTES The .B \-a diff --git a/dh_installexamples b/dh_installexamples index bc16991a..98a752df 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -16,7 +16,7 @@ for PACKAGE in $DH_DOPACKAGES; do examples=`tr "\n" " " < debian/${EXT}examples` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then examples="$* $examples" fi diff --git a/dh_installexamples.1 b/dh_installexamples.1 index c940d256..f70b98ce 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -8,9 +8,10 @@ dh_installexamples \- install example files into package build directories dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. .P -Any filenames specified as parameters will be installed into the first -binary package listed in debian/control, if dh_installexamples is acting on -that package. +Any file names specified as parameters will be installed into 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/examples (for the first binary package in debian/control), or debian/package.examples (for each additional package in debian/control) can @@ -33,8 +34,7 @@ Install files for the package named "package". Use "tmpdir" for package build directory. .TP .B file ... -Install these files as documentation into the first binary package listed in -debian/control, if we are acting on that package. +Install these files as examples into the first package acted on. .SH NOTES The .B \-a diff --git a/dh_installinit.1 b/dh_installinit.1 index e0daac42..13f87549 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -60,6 +60,13 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. +.P +Due to a bug in +.BR getopt (1) +, you cannot really text with spaces in it to the -u flag. However, this bug +has been worked around, and it should appear to work. What it's really doing +is looking at any parameters passed that are not known flags, and appending +that text onto the end of the text specified by the -u flag. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_makeshlibs b/dh_makeshlibs index 0943ba57..6cf9c803 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -15,8 +15,12 @@ for PACKAGE in $DH_DOPACKAGES; do for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true - MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true - LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true + if [ -z "$DH_M_PARAMS" ]; then + MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true + else + MAJOR="$DH_M_PARAMS" + fi +# LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 0b7df353..02c7ea8a 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" +.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -26,6 +26,10 @@ Generate shlibs file for the package named "package". .TP .B \-Ptmpdir Use "tmpdir" for package build directory. +.TP +.B \-mmajor +Instead of trying to guess the major number of the library from the filename +of the library, use the major number specified after the -m parameter. .SH NOTES The .B \-a @@ -44,7 +48,9 @@ Enables verbose mode There is no guarantee that the program will get the shlibs file right. For example, it may not correctly guess the major number of your package. In cases like these (and perhaps in general, just to be safe), it is better to -create a debian/shlibs file by hand. +create a debian/shlibs file by hand, or force it to use the correct major +number by specifying the -m parameter. +.P This is a "do what I Mean" type program - you have been warned! .SH AUTHOR Joey Hess diff --git a/dh_suidregister.1 b/dh_suidregister.1 index b66c2140..d374a4c1 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -11,8 +11,10 @@ with .BR suidregister (1) when it is installed. .P -Any files specified as parameters will be registered, if dh_suidregister is -acting on the first binary package listed in debian/control. +Any filenames specified as parameters will be registered in the first +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 @@ -43,8 +45,7 @@ Register files for the package named "package". Use "tmpdir" for package build directory. .TP .B file ... -Register these files in the first binary package listed in debian/control, -if we are acting on that package. +Register these files in the first package acted on. .SH NOTES The .B \-a diff --git a/dh_undocumented b/dh_undocumented index d0a8febd..e8ca0e01 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do undoc=`tr "\n" " " < debian/${EXT}undocumented` fi - if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then + if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then undoc="$* $undoc" fi diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 3f554989..2bbf24a1 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -22,10 +22,12 @@ generates the necessary symlinks to .P The lists of man pages that need .BR undocumented (7) -symlinks can be specified in two ways. Any man page names specified as -parameters will be set up in the first binary package listed in -debian/control, if dh_installdocs is acting on that package. -Also, if a file named debian/undocumented (for the first binary package in +symlinks can be specified in two ways. Any man page names specified as +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. .SH OPTIONS @@ -47,8 +49,7 @@ Use "tmpdir" for package build directory. .TP .B manpage ... Install undocumented man page symlinks for each of these man pages -into the first binary package listed in debian/control, if we are acting on -that package. +into the first package acted on. .SH NOTES The .B \-a -- cgit v1.2.3 From 94f1df06050aa3c512fd8af6e67690f482fbcd5a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:41:45 +0000 Subject: r45: Initial Import --- debian/changelog | 13 +++++++++++++ debian/control | 2 +- dh_fixperms | 8 +++++++- dh_fixperms.1 | 3 ++- dh_installdirs | 3 ++- dh_installdirs.1 | 8 ++++++-- dh_installdocs | 3 ++- dh_installdocs.1 | 9 +++++++-- dh_installexamples | 3 ++- dh_installexamples.1 | 9 +++++++-- dh_lib | 12 +++++++++++- dh_makeshlibs | 14 ++++++++++++-- dh_makeshlibs.1 | 35 ++++++++++++++++++++++++++++++++++- dh_suidregister | 3 ++- dh_suidregister.1 | 10 ++++++++-- dh_undocumented | 3 ++- dh_undocumented.1 | 10 ++++++++-- 17 files changed, 126 insertions(+), 22 deletions(-) diff --git a/debian/changelog b/debian/changelog index 75e03dae..15b91d46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (0.51) unstable; urgency=low + + * dh_fixperms: make shared libraries non-executable, in accordance with + policy. (#16644) + * dh_makeshlibs: introduced a -V flag, which allows you to specify explicit + version requirements in the shlibs file. + * dh_{installdirs,installdocs,installexamples,suidregister,undocumented}: + Added a -A flag, which makes any files/directories specified on the + command line apply to ALL packages acted on. + * Updated Standards-Version to latest. + + -- Joey Hess Mon, 5 Jan 1998 16:15:01 -0500 + debhelper (0.50) unstable; urgency=low * dh_makeshlibs: added -m parameter, which can force the major number diff --git a/debian/control b/debian/control index e22d969b..6883f628 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.1.1.0 +Standards-Version: 2.3.0.1 Package: debhelper Architecture: all diff --git a/dh_fixperms b/dh_fixperms index 0534549c..32c9dbef 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -26,9 +26,15 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod 755 $files" fi - # Executable man pages are a bad thing. + # Executable man pages are a bad thing.. files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true if [ "$files" ]; then doit "chmod 644 $files" fi + + # ..so are executable shared libraries. + files=`find $TMP -perm -5 -type f -name "*.so*" | tr "\n" " "` || true + if [ "$files" ]; then + doit "chmod a-X $files" + fi done diff --git a/dh_fixperms.1 b/dh_fixperms.1 index c403836c..1fac26c3 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -12,6 +12,7 @@ dh_fixperms makes all files in usr/doc in the package build directory (excluding files in the examples/ directory) be mode 644. It also changes the permissions of all man pages to mode 644. It makes all files be owned by root, and it removes group and other write permission from all files. +Finally, it removes execute permissions from any libraries that have it set. .SH OPTIONS .TP .B \-v @@ -43,6 +44,6 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.3.0.1 .SH AUTHOR Joey Hess diff --git a/dh_installdirs b/dh_installdirs index 51ef2ce7..1ef311e7 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do dirs=`tr "\n" " " < debian/${EXT}dirs` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then dirs="$* $dirs" fi diff --git a/dh_installdirs.1 b/dh_installdirs.1 index fc5c8d62..0fba87de 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -3,7 +3,7 @@ dh_installdirs \- create subdirectories in package build directories .SH SYNOPSIS .B dh_installdirs -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [dir ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [dir ...]" .SH "DESCRIPTION" dh_installdirs is a debhelper program that is responsible for creating subdirectories in package build directories. @@ -37,9 +37,13 @@ Create directories for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Create any directories specified by command line parameters in ALL packages +acted on. +.TP .B dir ... Create these directories in the package build directory of the first package -acted on. +acted on. (Or in all packages if -A is specified.) .SH NOTES The .B \-a diff --git a/dh_installdocs b/dh_installdocs index 11014229..f345a282 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -20,7 +20,8 @@ for PACKAGE in $DH_DOPACKAGES; do docs=`tr "\n" " " < debian/${EXT}docs` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then docs="$* $docs" fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 86195b79..ab9ed476 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -43,8 +43,13 @@ Install files for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Install all files specified by command line parameters in ALL packages +acted on. +.TP .B file ... -Install these files as documentation into the first package acted on. +Install these files as documentation into the first package acted on. (Or in +all packages if -A is specified). .SH NOTES The .B \-a diff --git a/dh_installexamples b/dh_installexamples index 98a752df..423c647a 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -16,7 +16,8 @@ for PACKAGE in $DH_DOPACKAGES; do examples=`tr "\n" " " < debian/${EXT}examples` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then examples="$* $examples" fi diff --git a/dh_installexamples.1 b/dh_installexamples.1 index f70b98ce..e46ed826 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -3,7 +3,7 @@ dh_installexamples \- install example files into package build directories .SH SYNOPSIS .B dh_installexamples -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. @@ -33,8 +33,13 @@ Install files for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Install any files specified by command line parameters in ALL packages +acted on. +.TP .B file ... -Install these files as examples into the first package acted on. +Install these files as examples into the first package acted on. (Or into all +packages if -A is specified.) .SH NOTES The .B \-a diff --git a/dh_lib b/dh_lib index 2c2b995f..39dae2a5 100644 --- a/dh_lib +++ b/dh_lib @@ -10,6 +10,7 @@ doit() { eval '$@' } + # This is an identical command to doit, except the parameter passed to it # are evaled with double quotes. This version can handle compound commands. complex_doit() { @@ -52,6 +53,7 @@ pkgext() { } # Returns 1 if the package is a native debian package, null otherwise. +# As a side effect, sets $VERSION to the version of this package. # Caches return code so it only needs to run dpkg-parsechangelog once. isnative() { if [ -z "$DH_ISNATIVE" ]; then @@ -141,7 +143,7 @@ get_arch_indep_packages() { # Argument processing and global variable initialization is below. # Parse command line. -set -- `getopt xvidrnakp:P:u:m: $*` +set -- `getopt xvidrnakVAp:P:u:m: $*` for i; do case "$i" @@ -202,6 +204,14 @@ for i; do shift shift ;; + -V) + DH_V_FLAG=1 + shift + ;; + -A) + DH_PARAMS_ALL=1 + shift + ;; --) shift break diff --git a/dh_makeshlibs b/dh_makeshlibs index 6cf9c803..f96c327f 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -14,9 +14,9 @@ for PACKAGE in $DH_DOPACKAGES; do for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true - VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true + LIB_VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true if [ -z "$DH_M_PARAMS" ]; then - MAJOR=`expr $VERSION : "\([0-9]*\)\."` || true + MAJOR=`expr $LIB_VERSION : "\([0-9]*\)\."` || true else MAJOR="$DH_M_PARAMS" fi @@ -24,6 +24,16 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi + if [ "$DH_V_FLAG" ]; then + if [ "$*" ]; then + PACKAGE="$*" + else + # Call isnative becuase it sets $VERSION + # as a side effect. + isnative + PACKAGE="$PACKAGE (>= $VERSION)" + fi + fi complex_doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs" done diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 02c7ea8a..056cc0f2 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage]" +.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V [dependancies]]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -30,6 +30,31 @@ Use "tmpdir" for package build directory. .B \-mmajor Instead of trying to guess the major number of the library from the filename of the library, use the major number specified after the -m parameter. +.TP +.B \-V [dependancies] +By default, the shlibs file generated by this program does not make packages +depend on any particular version of the package containing the shared +library. It may be necessary for you to add some version dependancy +information to the shlibs file. If -V is specified with no dependancy +information, the current version of the package is plugged into a dependancy +that looks like "packagename (>= packageversion)". If -V is specified with +parameters, the parameters can be used to specify the exact dependancy +information needed (be sure to include the package name). +.SH EXAMPLES +.TP +.B dh_makeshlibs +Assuming this is a package named libfoobar1, generates a shlibs file that +looks something like: + libfoobar 1 libfoobar1 +.TP +.B dh_makeshlibs \-V +Assuming the current version of the package is 1.0-3, generates a shlibs +file that looks something like: + libfoobar 1 libfoobar1 (>= 1.0-3) +.TP +.B dh_makeshlibs \-V "libfoobar1 (>= 1.0)" +Generates a shlibs file that looks something like: + libfoobar 1 libfoobar1 (>= 1.0) .SH NOTES The .B \-a @@ -45,6 +70,14 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS +Due to limitations in +.BR getopt (1) +, I had to fudge a bit on how the -V parameter really works. When -V is +specified, it's really examining the rest of the command line for any text +that isn't a switch, and using that for the dependancy information. This +means that the -V switch and any dependancy parameters should come last on +the command line. +.P There is no guarantee that the program will get the shlibs file right. For example, it may not correctly guess the major number of your package. In cases like these (and perhaps in general, just to be safe), it is better to diff --git a/dh_suidregister b/dh_suidregister index 42e4d16d..3f7622af 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do files=`tr "\n" " " < debian/${EXT}suid` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then files="$* $files" fi diff --git a/dh_suidregister.1 b/dh_suidregister.1 index d374a4c1..ef5b08dc 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -3,7 +3,7 @@ dh_suidregister \- set up package to register files with suidregister .SH SYNOPSIS .B dh_suidregister -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_suidregister is a debhelper program that is responsible for modifying the postinst and postrm scripts of a package so the package will register files @@ -44,8 +44,14 @@ Register files for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Register any files specified by command line parameters in ALL packages +acted on. I doubt anyone will find this useful, it's here for consitency +with other debhelper programs. +.TP .B file ... -Register these files in the first package acted on. +Register these files in the first package acted on. (Or in all packages if +-A is specified.) .SH NOTES The .B \-a diff --git a/dh_undocumented b/dh_undocumented index e8ca0e01..31b2f987 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -19,7 +19,8 @@ for PACKAGE in $DH_DOPACKAGES; do undoc=`tr "\n" " " < debian/${EXT}undocumented` fi - if [ "$PACKAGE" = "$DH_FIRSTPACKAGE" -a "$*" ]; then + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then undoc="$* $undoc" fi diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 2bbf24a1..9df8e311 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -3,7 +3,7 @@ dh_undocumented \- make symlinks to undocumented.7.gz man page .SH SYNOPSIS .B dh_undocumented -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [manpage ...]" +.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -47,9 +47,15 @@ Install undocumented man page symlinks for the package named "package". .B \-Ptmpdir Use "tmpdir" for package build directory. .TP +.B \-A +Install undocumented man page symlinks for any man pages specified by +command line parameters in ALL packages acted on. I doubt anyone will find +this useful, it's here for consitency with other debhelper programs. +.TP .B manpage ... Install undocumented man page symlinks for each of these man pages -into the first package acted on. +into the first package acted on. (Or in all packages acted on if -A is +specified.) .SH NOTES The .B \-a -- 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 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(-) 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 b8fc5a1b99da4ffb113d42f373b7c84772d1413a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:42:23 +0000 Subject: r49: Initial Import --- debian/changelog | 11 +++++++++++ dh_clean | 2 +- dh_clean.1 | 12 ++++++------ dh_compress.1 | 10 +++++----- dh_du.1 | 10 +++++----- dh_fixperms.1 | 10 +++++----- dh_installdirs.1 | 12 ++++++------ dh_installdocs.1 | 12 ++++++------ dh_installexamples.1 | 14 +++++++------- dh_installinit.1 | 25 +++++++++---------------- dh_installmanpages.1 | 10 +++++----- dh_installmenu.1 | 12 ++++++------ dh_makeshlibs | 6 +++--- dh_makeshlibs.1 | 24 ++++++++---------------- dh_suidregister.1 | 12 ++++++------ dh_undocumented.1 | 12 ++++++------ examples/rules | 7 +++++++ examples/rules.indep | 7 +++++++ examples/rules.multi | 12 ++++++++++++ 19 files changed, 121 insertions(+), 99 deletions(-) diff --git a/debian/changelog b/debian/changelog index ea45ec9d..3a5a9200 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +debhelper (0.54) unstable; urgency=low + + * dh_lib: no longer call getopt(1) to parse options. I wrote my own + argument processor in perl. + * Added long versions of all arguments. TODO: document them. + * All parameters may now be passed values that include whitespace (ie, + dh_installinit -u"defaults 10") + * Now depends on perl (needs Getopt::Long). + + -- Joey Hess Sat, 10 Jan 1998 15:44:09 -0500 + debhelper (0.53) unstable; urgency=low * dh_installmanpages: ignore all man pages installed into debian/tmp diff --git a/dh_clean b/dh_clean index ba20e3ea..73fb88f0 100755 --- a/dh_clean +++ b/dh_clean @@ -10,7 +10,7 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` substvars=`pkgfile $PACKAGE substvars` if [ "$substvars" ]; then - doit "rm -f debian/$substvars" + doit "rm -f $substvars" fi doit "rm -rf $TMP" done diff --git a/dh_clean.1 b/dh_clean.1 index 5d9180a9..f4f14c5a 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -11,22 +11,22 @@ other files, such as debian/substvars, debian/files, DEADJOE, emacs backup files, etc. .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 Clean up the package build directory for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Clean up the package build directory for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Clean up the package build directory for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-k +.B \-k, \--keep Do not delete debian/files. When do you want to use this? Anytime you have a debian/rules that has 2 binary targets that build different .deb packages; for example, one target is binary-arch, and the other is binary-indep, or diff --git a/dh_compress.1 b/dh_compress.1 index ce8f539a..9e23a8f0 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -31,19 +31,19 @@ customization of what files are compressed: ! -name "copyright" .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 Compress files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Compress files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Compress 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_du.1 b/dh_du.1 index 315d0b98..41bd1c43 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -13,19 +13,19 @@ debian installer program. The du 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 du files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Generate du files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Generate du file 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_fixperms.1 b/dh_fixperms.1 index 1fac26c3..316644d6 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -15,19 +15,19 @@ root, and it removes group and other write permission from all files. Finally, it removes execute permissions from any libraries that have it set. .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 Fix permissions for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Fix permissions for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Fix permissions 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.1 b/dh_installdirs.1 index 56c641b3..0c6aaa54 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -21,22 +21,22 @@ Be sure to only use directory names relative to the package build directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead. .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 Create directories for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Create directories for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Create directories for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-A +.B \-A, \--all Create any directories specified by command line parameters in ALL packages acted on. .TP diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 6a0290a4..6b8b33a6 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -27,22 +27,22 @@ 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 +.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 \-A +.B \-A, \--all Install all files specified by command line parameters in ALL packages acted on. .TP diff --git a/dh_installexamples.1 b/dh_installexamples.1 index e038faf7..c2997d95 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -17,22 +17,22 @@ 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 +.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 \-A +.B \-A, \--all Install any files specified by command line parameters in ALL packages acted on. .TP @@ -48,7 +48,7 @@ and arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. .P -Note that dh_examples will happily copy entire directory hierarchies if +Note that dh_installexamples will happily copy entire directory hierarchies if you ask it to (it uses cp -a internally). If it is asked to install a directory, it will install the complete contents of the directory. .SH ENVIRONMENT diff --git a/dh_installinit.1 b/dh_installinit.1 index 6a2ab321..29bb867a 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -18,33 +18,33 @@ by the packagename. (You may use debian/init for the first binary package listed in the control file.) .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 init scripts into all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install init scripts into all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install init scripts into the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-n +.B \-n, \--noscripts Do not modify postinst/postrm/prerm scripts. .TP -.B \-r +.B \-r, \--no-restart-on-upgrade Do not restart daemon on upgrade. .TP -.B \-d +.B \-d, \--remove-d Remove trailing "d" from the name of the package, and use the result for the filename the init script is installed as in etc/init.d/ . This may be useful for daemons with named ending in "d". .TP -.B \-uparams +.B \-uparams, \--update-rcd-params=params Pass "params" to .BR update-rc.d (8) If not specified, "default" will be passed to @@ -57,13 +57,6 @@ and .B \-p arguments are cumulative. If none are specified, then all packages listed in the control file will be effected. -.P -Due to a bug in -.BR getopt (1) -, you cannot really text with spaces in it to the -u flag. However, this bug -has been worked around, and it should appear to work. What it's really doing -is looking at any parameters passed that are not known flags, and appending -that text onto the end of the text specified by the -u flag. .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index b8b580e1..e44eaf22 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -20,19 +20,19 @@ This is useful if by default it installs some man pages that you do not want to be installed. .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 man pages into all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install man pages into all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install man pages into the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP .B file ... diff --git a/dh_installmenu.1 b/dh_installmenu.1 index 320e1005..cf54949c 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -25,22 +25,22 @@ 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 +.B \-v, \--verbose Verbose mode; show all commands that modify the package build directory. .TP -.B \-a +.B \-a, \--arch Install menu files into all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install menu files into all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install menu files into the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-n +.B \-n, \--noscripts Do not modify postinst/postrm scripts. .SH NOTES The diff --git a/dh_makeshlibs b/dh_makeshlibs index f96c327f..d595c3b5 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -24,9 +24,9 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi - if [ "$DH_V_FLAG" ]; then - if [ "$*" ]; then - PACKAGE="$*" + if [ "$DH_V_FLAG_SET" ]; then + if [ "$DH_V_FLAG" ]; then + PACKAGE="$DH_V_FLAG" else # Call isnative becuase it sets $VERSION # as a side effect. diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index 056cc0f2..cb2703f4 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V [dependancies]]" +.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V[dependancies]]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -12,26 +12,26 @@ For this program to work, you cannot have already installed a DEBIAN/shlibs file. If such a file exits, the program will exit with an error. .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 shlibs files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Generate shlibs files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Generate shlibs file for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-mmajor +.B \-mmajor, \--major=major Instead of trying to guess the major number of the library from the filename of the library, use the major number specified after the -m parameter. .TP -.B \-V [dependancies] +.B \-V[dependancies], \--version-info, \--version-info=dependancies By default, the shlibs file generated by this program does not make packages depend on any particular version of the package containing the shared library. It may be necessary for you to add some version dependancy @@ -70,14 +70,6 @@ Enables verbose mode .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS -Due to limitations in -.BR getopt (1) -, I had to fudge a bit on how the -V parameter really works. When -V is -specified, it's really examining the rest of the command line for any text -that isn't a switch, and using that for the dependancy information. This -means that the -V switch and any dependancy parameters should come last on -the command line. -.P There is no guarantee that the program will get the shlibs file right. For example, it may not correctly guess the major number of your package. In cases like these (and perhaps in general, just to be safe), it is better to diff --git a/dh_suidregister.1 b/dh_suidregister.1 index 29fc504b..51e08fe5 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -28,22 +28,22 @@ Note that this package modifies your postinst and postrm files. See for an explanation of how this works. .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 Register files for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Register files for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Register files for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-A +.B \-A, \--all Register any files specified by command line parameters in ALL packages acted on. I doubt anyone will find this useful, it's here for consitency with other debhelper programs. diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 677c90f8..26498934 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -32,22 +32,22 @@ the first binary package in debian/control) can list other man page names to set up. .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 undocumented man page symlinks for all architecture dependent packages. .TP -.B \-i +.B \-i, \--indep Install undocumented man page symlinks for all architecture independent packages. .TP -.B \-ppackage +.B \-ppackage, \--package=package Install undocumented man page symlinks for the package named "package". .TP -.B \-Ptmpdir +.B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-A +.B \-A, \--all Install undocumented man page symlinks for any man pages specified by command line parameters in ALL packages acted on. I doubt anyone will find this useful, it's here for consitency with other debhelper programs. diff --git a/examples/rules b/examples/rules index 29c79dee..8e6683c1 100755 --- a/examples/rules +++ b/examples/rules @@ -7,16 +7,20 @@ build: build-stamp build-stamp: dh_testdir + # Add here commands to compile the package. #$(MAKE) + touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp + # Add here commands to clean up after the build process. #-$(MAKE) distclean + dh_clean # Build architecture-independent files here. @@ -25,12 +29,15 @@ binary-indep: build # Build architecture-dependent files here. binary-arch: build +# dh_testversion dh_testdir dh_testroot dh_clean -k dh_installdirs + # Add here commands to install the files into debian/tmp #$(MAKE) prefix=`pwd`/debian/tmp install + dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.indep b/examples/rules.indep index fb46c623..601c5e3e 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -8,26 +8,33 @@ build: build-stamp build-stamp: dh_testdir + # Add here commands to compile the package. #$(MAKE) + touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp + # Add here commands to clean up after the build process. #-$(MAKE) distclean + dh_clean # Build architecture-independent files here. binary-indep: build +# dh_testversion dh_testdir dh_testroot dh_clean -k dh_installdirs + # Add here commands to install the files into debian/tmp #$(MAKE) prefix=`pwd`/debian/tmp install + dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.multi b/examples/rules.multi index 205ed4c8..a5be1efe 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -10,26 +10,34 @@ build: build-stamp build-stamp: dh_testdir + # Add here commands to compile the package. #$(MAKE) + touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp + # Add here commands to clean up after the build process. #-$(MAKE) distclean + dh_clean # Build architecture-independent files here. binary-indep: build +# dh_testversion dh_testdir -i dh_testroot -i dh_clean -i -k dh_installdirs -i + # Add here commands to install the files into debian/tmp #$(MAKE) prefix=`pwd`/debian/tmp install + + dh_movefiles -i dh_installdocs -i dh_installexamples -i dh_installmenu -i @@ -49,12 +57,16 @@ binary-indep: build # Build architecture-dependent files here. binary-arch: build +# dh_testversion dh_testdir -a dh_testroot -a dh_clean -a -k dh_installdirs -a + # Add here commands to install the files into debian/tmp #$(MAKE) prefix=`pwd`/debian/tmp install + + dh_movefiles -a dh_installdocs -a dh_installexamples -a dh_installmenu -a -- cgit v1.2.3 From 4d41759bb755a5d2ed712eca2dd433f305a2be94 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:43:55 +0000 Subject: r51: Initial Import --- debian/changelog | 8 ++++++++ dh_compress | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3a5a9200..d705d724 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.55) unstable; urgency=low + + * dh_clean: delete substvarsfiles probperly again (broken in 0.53). #17077 + * Added call to dh_movefiles, and a commented out call to dh_testversion, + to some of the sample rules files. #17076 + + -- Joey Hess Wed, 14 Jan 1998 12:48:43 -0500 + debhelper (0.54) unstable; urgency=low * dh_lib: no longer call getopt(1) to parse options. I wrote my own diff --git a/dh_compress b/dh_compress index 58eb30f4..5af172c8 100755 --- a/dh_compress +++ b/dh_compress @@ -18,14 +18,15 @@ for PACKAGE in $DH_DOPACKAGES; do if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - files=`sh $olddir/$compress 2>/dev/null` + files=`sh $olddir/$compress 2>/dev/null ; true` else # By default fall back on what the policy manual says to compress. files=` find usr/info usr/man usr/X11*/man -type f 2>/dev/null ; find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ ! -name "*.htm*" ! -name "*.gif" \ - ! -name "copyright" 2>/dev/null + ! -name "copyright" 2>/dev/null ; + true ` fi -- cgit v1.2.3 From 48af30db07c9c7502f454dec5615b5ff5f0b544b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:43:55 +0000 Subject: r52: Initial Import --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index d705d724..0f4a69a2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.56) unstable; urgency=low + + * dh_compress: Applied patch from Yann Dirson , + to make it not abort of one of the find's fails. + + -- Joey Hess Thu, 15 Jan 1998 19:16:48 -0500 + debhelper (0.55) unstable; urgency=low * dh_clean: delete substvarsfiles probperly again (broken in 0.53). #17077 -- cgit v1.2.3 From 17f711b58fbe60225ed2c63609042bcd548fc43d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:44:57 +0000 Subject: r53: Initial Import --- debian/changelog | 6 ++++++ debian/control | 2 +- dh_getopt.pl | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0f4a69a2..7ad9f034 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.57) unstable; urgency=low + + * Depend on perl 5.004 or greater (for Getopt::Long). + + -- Joey Hess Sat, 17 Jan 1998 02:12:06 -0500 + debhelper (0.56) unstable; urgency=low * dh_compress: Applied patch from Yann Dirson , diff --git a/debian/control b/debian/control index 6883f628..8d14e7b5 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 2.3.0.1 Package: debhelper Architecture: all -Depends: perl, fileutils (>= 3.16-4) +Depends: perl (>= 5.004), fileutils (>= 3.16-4) Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to automate common tasks. Programs are included to install various files into diff --git a/dh_getopt.pl b/dh_getopt.pl index bb7d5133..a9969a1e 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -115,6 +115,12 @@ if (defined($version_info)) { $version_info_set=1; } +# Check to see if DH_VERBOSE environment variable was set, if so, make sure +# verbose is on. +if ($ENV{DH_VERBOSE} ne undef) { + $verbose=1; +} + # Now output everything, in a format suitable for a shell to eval it. # Note the last line sets $@ in the shell to whatever arguements remain. print qq{ -- cgit v1.2.3 From 3486d848644af197ded8a7e8d8c533dc30a5e574 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:45:36 +0000 Subject: r54: Initial Import --- debian/changelog | 6 ++++++ dh_builddeb.1 | 9 ++++++++- dh_clean.1 | 9 ++++++++- dh_compress.1 | 9 ++++++++- dh_du.1 | 9 ++++++++- dh_fixperms.1 | 9 ++++++++- dh_gencontrol.1 | 9 ++++++++- dh_getopt.pl | 8 ++++++++ dh_installchangelogs.1 | 9 ++++++++- dh_installcron.1 | 9 ++++++++- dh_installdeb.1 | 9 ++++++++- dh_installdirs.1 | 9 ++++++++- dh_installdocs.1 | 9 ++++++++- dh_installexamples.1 | 9 ++++++++- dh_installmanpages.1 | 9 ++++++++- dh_installmenu.1 | 9 ++++++++- dh_lib | 8 ++++++-- dh_makeshlibs.1 | 9 ++++++++- dh_md5sums.1 | 9 ++++++++- dh_movefiles.1 | 9 ++++++++- dh_shlibdeps.1 | 9 ++++++++- dh_strip.1 | 9 ++++++++- dh_suidregister.1 | 9 ++++++++- dh_undocumented.1 | 9 ++++++++- 24 files changed, 188 insertions(+), 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7ad9f034..f0faff1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.58) unstable; urgency=low + + * Fixed bug #17597 - DH_VERBOSE wasn'talways taking effect. + + -- Joey Hess Wed, 28 Jan 1998 17:18:17 -0500 + debhelper (0.57) unstable; urgency=low * Depend on perl 5.004 or greater (for Getopt::Long). diff --git a/dh_builddeb.1 b/dh_builddeb.1 index 9d52b3ab..ecbbfa6c 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -3,7 +3,7 @@ dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) @@ -19,6 +19,10 @@ Build all architecture dependent packages. .B \-i, \--indep Build all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B -ppackage, \--package=package Build the package named "package". .TP @@ -36,6 +40,9 @@ the control file will be built. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/dh_clean.1 b/dh_clean.1 index f4f14c5a..cb437e9c 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -3,7 +3,7 @@ dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[-v] [-a] [-i] [-k] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [-k] [--no-act] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some @@ -20,6 +20,10 @@ Clean up the package build directory for all architecture dependent packages. .B \-i, \--indep Clean up the package build directory for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Clean up the package build directory for the package named "package". .TP @@ -49,6 +53,9 @@ the control file will have their package build directories cleaned up. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_compress.1 b/dh_compress.1 index 9e23a8f0..dbb33e6d 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks @@ -40,6 +40,10 @@ Compress files for all architecture dependent packages. .B \-i, \--indep Compress files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Compress files for the package named "package". .TP @@ -62,6 +66,9 @@ apply to. (This works for the first binary package too.) .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_du.1 b/dh_du.1 index 41bd1c43..9c04106e 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -3,7 +3,7 @@ dh_du \- generate DEBIAN/du file .SH SYNOPSIS .B dh_du -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_du is a debhelper program that is responsible for generating a DEBIAN/du file, which lists the disk usage of directories in the package. @@ -22,6 +22,10 @@ Generate du files for all architecture dependent packages. .B \-i, \--indep Generate du files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Generate du file for the package named "package". .TP @@ -39,6 +43,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 316644d6..913a8c76 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -3,7 +3,7 @@ dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS .B dh_fixperms -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -24,6 +24,10 @@ Fix permissions for all architecture dependent packages. .B \-i, \--indep Fix permissions for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Fix permissions for the package named "package". .TP @@ -41,6 +45,9 @@ the control file will have their permissions fixed. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 484add0e..70486a97 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -3,7 +3,7 @@ dh_gencontrol \- generate and install control file .SH SYNOPSIS .B dh_gencontrol -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-uparams]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-uparams]" .SH "DESCRIPTION" dh_gencontrol is a debhelper program that is responsible for generating and installing control files, and installing them into the DEBIAN directory with @@ -25,6 +25,10 @@ Install files for all architecture dependent packages. .B \-i, \--indep Install files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install files for the package named "package". .TP @@ -46,6 +50,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .BR dpkg-shlibdeps (1) diff --git a/dh_getopt.pl b/dh_getopt.pl index a9969a1e..e877a551 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -107,6 +107,8 @@ GetOptions( "A" => \$all, "all" => \$all, + + "no-act" => \$no_act, ); # Check to see if -V was specified. If so, but no parameters were passed, @@ -121,10 +123,16 @@ if ($ENV{DH_VERBOSE} ne undef) { $verbose=1; } +# Check to see if DH_NO_ACT was set, if so, make sure no act mode is on. +if ($ENV{DH_NO_ACT} ne undef) { + $no_act=1; +} + # Now output everything, in a format suitable for a shell to eval it. # Note the last line sets $@ in the shell to whatever arguements remain. print qq{ DH_VERBOSE='$verbose' +DH_NO_ACT='$no_act' DH_DOPACKAGES='@packages' DH_DOINDEP='$indep' DH_DOARCH='$arch' diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 4ec5ce91..7b9f2300 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] [--no-act] [-ppackage] [-Ptmpdir] [upstream]" .SH "DESCRIPTION" dh_installchangelogs is a debhelper program that is responsible for installing changelogs into package build directories. @@ -27,6 +27,10 @@ Install changelogs for all architecture dependent packages. .B \-i, \--indep Install changelogs for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install changelogs for the package named "package". .TP @@ -50,6 +54,9 @@ package. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" diff --git a/dh_installcron.1 b/dh_installcron.1 index f090420b..31f8d810 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -3,7 +3,7 @@ dh_installcron \- install cron scripts into etc/cron.* .SH SYNOPSIS .B dh_installcron -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installcron is a debhelper program that is responsible for installing cron scripts into etc/cron.* in package build directories. The files @@ -23,6 +23,10 @@ Install cron files for all architecture dependent packages. .B \-i, \--indep Install cron files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install cron files for the package named "package". .TP @@ -40,6 +44,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" diff --git a/dh_installdeb.1 b/dh_installdeb.1 index bb658262..fc7b8dee 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -3,7 +3,7 @@ dh_installdeb \- install files into the DEBIAN directory .SH SYNOPSIS .B dh_installdeb -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_installdeb is a debhelper program that is responsible for installing files into the DEBIAN directory in package build directories with the @@ -43,6 +43,10 @@ Install files for all architecture dependent packages. .B \-i, \--indep Install files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install files for the package named "package". .TP @@ -60,6 +64,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 0c6aaa54..8ae440c6 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -3,7 +3,7 @@ dh_installdirs \- create subdirectories in package build directories .SH SYNOPSIS .B dh_installdirs -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [dir ...]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [dir ...]" .SH "DESCRIPTION" dh_installdirs is a debhelper program that is responsible for creating subdirectories in package build directories. @@ -30,6 +30,10 @@ Create directories for all architecture dependent packages. .B \-i, \--indep Create directories for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Create directories for the package named "package". .TP @@ -55,6 +59,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 6b8b33a6..e1f2e590 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -36,6 +36,10 @@ Install files for all architecture dependent packages. .B \-i, \--indep Install files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install files for the package named "package". .TP @@ -65,6 +69,9 @@ directory, it will install the complete contents of the directory. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_installexamples.1 b/dh_installexamples.1 index c2997d95..be0b4cc3 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -3,7 +3,7 @@ dh_installexamples \- install example files into package build directories .SH SYNOPSIS .B dh_installexamples -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. @@ -26,6 +26,10 @@ Install files for all architecture dependent packages. .B \-i, \--indep Install files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install files for the package named "package". .TP @@ -55,6 +59,9 @@ directory, it will install the complete contents of the directory. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index e44eaf22..5a84d76b 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -3,7 +3,7 @@ dh_installmanpages \- install man pages into package build directories .SH SYNOPSIS .B dh_installmanpages -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [file ...]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [file ...]" .SH "DESCRIPTION" dh_installmanpages is a debhelper program that is responsible for automatically installing man pages into usr/man/ and usr/X11R6/man/ in @@ -29,6 +29,10 @@ Install man pages into all architecture dependent packages. .B \-i, \--indep Install man pages into all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install man pages into the package named "package". .TP @@ -55,6 +59,9 @@ pages belong in. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_installmenu.1 b/dh_installmenu.1 index cf54949c..7147b49f 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -3,7 +3,7 @@ dh_installmenu \- install debian menu files into package build directories .SH SYNOPSIS .B dh_installmenu -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-n]" .SH "DESCRIPTION" dh_installmenu is a debhelper program that is responsible for installing files used by the debian menu package into package build directories. @@ -34,6 +34,10 @@ Install menu files into all architecture dependent packages. .B \-i, \--indep Install menu files into all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install menu files into the package named "package". .TP @@ -54,6 +58,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README , diff --git a/dh_lib b/dh_lib index 020f9e6d..7c7c2e18 100644 --- a/dh_lib +++ b/dh_lib @@ -9,7 +9,9 @@ # involving redirection. Use complex_doit instead. doit() { verbose_echo "$@" - eval '$@' + if [ ! "$DH_NO_ACT" ]; then + eval '$@' + fi } @@ -17,7 +19,9 @@ doit() { # are evaled with double quotes. This version can handle compound commands. complex_doit() { verbose_echo "$@" - eval "$@" + if [ ! "$DH_NO_ACT" ]; then + eval "$@" + fi } # Echo something if the verbose flag is on. diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index cb2703f4..c39eb04c 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V[dependancies]]" +.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V[dependancies]]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -21,6 +21,10 @@ Generate shlibs files for all architecture dependent packages. .B \-i, \--indep Generate shlibs files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Generate shlibs file for the package named "package". .TP @@ -67,6 +71,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH BUGS diff --git a/dh_md5sums.1 b/dh_md5sums.1 index ab3c2bed..f432fed2 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -3,7 +3,7 @@ dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-x] [-v] [-a] [-i] [-Ptmpdir] [-ppackage]" +.I "[-x] [-v] [-a] [-i] [--no-act] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. @@ -23,6 +23,10 @@ Generate md5sums files for all architecture dependent packages. .B \-i, \--indep Generate md5sums files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Generate md5sums file for the package named "package". .TP @@ -44,6 +48,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/dh_movefiles.1 b/dh_movefiles.1 index c2b0e92a..5ff47bb1 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -3,7 +3,7 @@ dh_movefiles \- moves files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_movefiles is a debhelper program that is responsible for moving files out of debian/tmp and into other package build directories. This may be useful @@ -23,6 +23,10 @@ Move files for all architecture dependent packages. .B \-i, \--indep Move files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Move files for the package named "package". .TP @@ -40,6 +44,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 index 421a2215..b976f8c9 100644 --- a/dh_shlibdeps.1 +++ b/dh_shlibdeps.1 @@ -3,7 +3,7 @@ dh_shlibdeps \- calculate shared library dependancies .SH SYNOPSIS .B dh_shlibdeps -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-uparams]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-uparams]" .SH "DESCRIPTION" dh_shlibdeps is a debhelper program that is responsible for calculating shared library dependancies for all executables found in the package build @@ -26,6 +26,10 @@ Install files for all architecture dependent packages. .B \-i, \--indep Install files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install files for the package named "package". .TP @@ -47,6 +51,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .BR dpkg-shlibdeps (1) diff --git a/dh_strip.1 b/dh_strip.1 index 9cdd85a0..9ae97c60 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -3,7 +3,7 @@ dh_strip \- strip executables, shared libraries, and some static libraries. .SH SYNOPSIS .B dh_strip -.I "[-v] [-a] [-i] [-Ptmpdir] [-ppackage]" +.I "[-v] [-a] [-i] [--no-act] [-Ptmpdir] [-ppackage]" .SH "DESCRIPTION" dh_strip is a debhelper program that is responsible for stripping executables, shared libraries, and static libraries that are not used for @@ -23,6 +23,10 @@ Strip files in all architecture dependent packages. Strip files in all architecture independent packages (likely, this is pointless :-). .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Strip files for the package named "package". .TP @@ -40,6 +44,9 @@ the control file will have their files stripped. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH "CONFORMS TO" diff --git a/dh_suidregister.1 b/dh_suidregister.1 index 51e08fe5..182386b4 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -3,7 +3,7 @@ dh_suidregister \- set up package to register files with suidregister .SH SYNOPSIS .B dh_suidregister -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" .SH "DESCRIPTION" dh_suidregister is a debhelper program that is responsible for modifying the postinst and postrm scripts of a package so the package will register files @@ -37,6 +37,10 @@ Register files for all architecture dependent packages. .B \-i, \--indep Register files for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Register files for the package named "package". .TP @@ -63,6 +67,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README , diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 26498934..69d2150a 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -3,7 +3,7 @@ dh_undocumented \- make symlinks to undocumented.7.gz man page .SH SYNOPSIS .B dh_undocumented -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-A] [manpage ...]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -41,6 +41,10 @@ Install undocumented man page symlinks for all architecture dependent packages. .B \-i, \--indep Install undocumented man page symlinks for all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install undocumented man page symlinks for the package named "package". .TP @@ -68,6 +72,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README , -- cgit v1.2.3 From ad9db7389a0982057d46702f9983ed9199474195 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:45:36 +0000 Subject: r55: Initial Import --- debian/changelog | 8 ++++++++ dh_installinit.1 | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f0faff1b..cfda294e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.59) unstable; urgency=low + + * Added DH_NO_ACT and --no-act, which make debhelper commands run without + actually doing anything. (Combine with -v to see what the command would + have done.) (#17598) + + -- Joey Hess Sun, 1 Feb 1998 14:51:08 -0800 + debhelper (0.58) unstable; urgency=low * Fixed bug #17597 - DH_VERBOSE wasn'talways taking effect. diff --git a/dh_installinit.1 b/dh_installinit.1 index 29bb867a..89c34c3a 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -3,7 +3,7 @@ dh_installinit \- install init scripts into package build directories .SH SYNOPSIS .B dh_installinit -.I "[-v] [-a] [-i] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" .SH "DESCRIPTION" dh_installinit is a debhelper program that is responsible for installing init scripts into package build directories. @@ -27,6 +27,10 @@ Install init scripts into all architecture dependent packages. .B \-i, \--indep Install init scripts into all architecture independent packages. .TP +.B \--no-act +Do not really do anything. If used with -v, the result is that this command +will output a list of what it would have done. +.TP .B \-ppackage, \--package=package Install init scripts into the package named "package". .TP @@ -61,6 +65,9 @@ the control file will be effected. .TP .I DH_VERBOSE Enables verbose mode +.TP +.I DH_NO_ACT +Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR -- cgit v1.2.3 From 4885585563e09e444f422d1696fb6ad4c03800ce Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:45:41 +0000 Subject: r56: Initial Import --- debian/changelog | 8 ++++++++ dh_fixperms | 1 + 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index cfda294e..d1fea537 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.60) unstable; urgency=low + + * dh_fixperms: make all files readable and writable by owner + (policy 3.3.8 paragraph 2). + Lintian found lots of bugs that will be fixed by this change. + + -- Joey Hess Mon, 9 Feb 1998 12:26:13 -0800 + debhelper (0.59) unstable; urgency=low * Added DH_NO_ACT and --no-act, which make debhelper commands run without diff --git a/dh_fixperms b/dh_fixperms index 0d667fd3..9bd452fb 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -12,6 +12,7 @@ for PACKAGE in $DH_DOPACKAGES; do if [ -d $TMP ]; then doit "chown -R root.root $TMP" doit "chmod -R go=rX $TMP" + doit "chmod -R u+rw $TMP" fi # Fix up premissions in usr/doc, setting everything to not exectable -- cgit v1.2.3 From 68d066bb56e569f842c85dca04641a3676a15623 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:45:46 +0000 Subject: r57: Initial Import --- debian/changelog | 7 +++++++ dh_installmanpages | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d1fea537..6e72b1c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.61) unstable; urgency=low + + * dh_installmanpages: Add / to end of egrep -v regexp, fixes it so + debian/icewm.1 can be found. + + -- Joey Hess Wed, 11 Feb 1998 09:09:28 -0800 + debhelper (0.60) unstable; urgency=low * dh_fixperms: make all files readable and writable by owner diff --git a/dh_installmanpages b/dh_installmanpages index 9bcd8910..a2bcfc10 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -15,7 +15,7 @@ for PACKAGE in $DH_DOPACKAGES; do # .in files, which are from configure. # 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 + 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 -- cgit v1.2.3 From fbfd7d1a61ebb896864d9dcd6e6c06df192a3971 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:45:51 +0000 Subject: r58: Initial Import --- TODO | 25 ++++++++++++++++++++++--- debian/changelog | 10 ++++++++++ dh_installmanpages | 21 ++++++++++++++++----- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 00281d70..6683d0dd 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,25 @@ -* .so files of compressed manpages -- change to symlinks * add all other functionality of debstd (??) + - add a program to generate file similar to buildinfo.Debian generated by + 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). + - .so files of compressed manpages -- change to symlinks. Policy says we + need only do this "if it's easy". The hard bit is implementing it ;-) * dh_fixperms: allow listing of files not to be touched (diffucult). * add a dh_debstd, which mimics debstd, but uses debhelper tools internally. -* dh_compress: add --exclude "*.conf" type-thingy -* info support for debhelper + Note thatthe 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. +* dh_compress: add --exclude "*.conf" type-thingy, sincethat's the change + you most often want to make to what it does, and a debian/conpress file is + overkill in those cases. +* info support for debhelper (currently implmented, 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 + installs the man pages into the correct areas to suit the binaries they + document. I may need to make this only happen when a switch is given, to + preserve backward compatability. +* maybe make dh_installmanpages look at the .TH line of man pages whose + filenames end in .man, to figure out what section they go it. This would + require a switch to turn on, for backwards compatability. diff --git a/debian/changelog b/debian/changelog index 6e72b1c1..8d2df4b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (0.62) unstable; urgency=low + + * dh_installmanpages: if the man page filename ends in 'x', install it in + /usr/X11R6/man/. + * TODO: expanded descriptions of stuff, in the hope someone else will get + inspired to implement some of it. + * Also added all wishlist bugs to the TODO. + + -- Joey Hess Thu, 12 Feb 1998 22:38:53 -0800 + debhelper (0.61) unstable; urgency=low * dh_installmanpages: Add / to end of egrep -v regexp, fixes it so diff --git a/dh_installmanpages b/dh_installmanpages index a2bcfc10..0c968a3f 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -14,8 +14,11 @@ for PACKAGE in $DH_DOPACKAGES; do # .ex files are examples installed by deb-make, we don't want those, or # .in files, which are from configure. # 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 + 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 @@ -34,12 +37,20 @@ for PACKAGE in $DH_DOPACKAGES; do done if [ "$install" ]; then SECTION=man`expr $NAME : '.*\.\([123456789]\)'` + # Test to see if the filename ends with 'x', + # if so, this is an X man page. + echo $NAME + if expr $NAME : '.*\.[123456789]x' >/dev/null; then + EXTDIR="X11R6" + else + EXTDIR="" + fi if [ ! -e $TMP/usr/man/$SECTION/$NAME -a \ ! -e $TMP/usr/X11*/man/$SECTION/$NAME ]; then - if [ ! -d $TMP/usr/man/$SECTION ]; then - doit "install -d $TMP/usr/man/$SECTION" + if [ ! -d $TMP/usr/$EXTDIR/man/$SECTION ]; then + doit "install -d $TMP/usr/$EXTDIR/man/$SECTION" fi - doit "install -p -m644 $file $TMP/usr/man/$SECTION/$NAME" + doit "install -p -m644 $file $TMP/usr/$EXTDIR/man/$SECTION/$NAME" fi fi fi -- cgit v1.2.3 From 220da53f5dda9555b3c1ab4cf494ec539d458a9f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:45:57 +0000 Subject: r59: Initial Import --- TODO | 7 +++++++ debian/changelog | 13 +++++++++++++ debian/rules | 1 - dh_du | 24 ++++++++++++++---------- dh_du.1 | 46 +++++----------------------------------------- dh_gencontrol | 2 ++ dh_installmanpages | 1 - dh_makeshlibs | 1 + dh_md5sums | 1 + examples/rules | 1 - examples/rules.indep | 1 - examples/rules.multi | 2 -- 12 files changed, 43 insertions(+), 57 deletions(-) diff --git a/TODO b/TODO index 6683d0dd..3e34c070 100644 --- a/TODO +++ b/TODO @@ -23,3 +23,10 @@ * maybe make dh_installmanpages look at the .TH line of man pages whose filenames end in .man, to figure out what section they go it. This would require a switch to turn on, for backwards compatability. +* All debhelper programs should be checked that they output files with the + correct permissions no matter what the umask is set to. Currently, only + those programs that run after dh_fixperms have been so checked. (Checking + the rest is low priority, since dh_fixperms fixes any incorrect permissions + they might have; still it would be nice to check them too, just to make + debhelper more flexible.) One easy fix is to add umask 022 to dh_lib, + however, there may be unforseen ramifications of such a change. diff --git a/debian/changelog b/debian/changelog index 8d2df4b2..df4abff5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (0.63) unstable; urgency=low + + * Removed some debugging output from dh_installmanpages. + * du_du: no longer does anything, becuase it has been decided on + debian-policy that du control files are bad. + * examples/*: removed dh_du calls. + * debian/rules: removed dh_du call. + * Modified dh_gencontrol, dh_makeshlibs, and dh_md5sums to generate files + with the correct permissions even if the umask is set to unusual + values. (#18283) + + -- Joey Hess Mon, 16 Feb 1998 23:34:36 -0800 + debhelper (0.62) unstable; urgency=low * dh_installmanpages: if the man page filename ends in 'x', install it in diff --git a/debian/rules b/debian/rules index 892f7e69..13aaea5f 100755 --- a/debian/rules +++ b/debian/rules @@ -53,7 +53,6 @@ binary-indep: build ./dh_suidregister ./dh_installdeb ./dh_gencontrol - ./dh_du ./dh_md5sums ./dh_builddeb diff --git a/dh_du b/dh_du index 71ce2b13..73df2a0b 100755 --- a/dh_du +++ b/dh_du @@ -2,18 +2,22 @@ # # Generate a DEBIAN/du file, that lists the disk usage of the directories in # the package. +# +# No longer - it was decided these files are a bad idea. PATH=debian:$PATH:/usr/lib/debhelper . dh_lib -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - - if [ ! -d "$TMP/DEBIAN" ]; then - doit "install -d $TMP/DEBIAN" - fi +echo "* Note: dh_du does nothing and is deprecated. Remove it from debian/rules." >&2 - # 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 $TMP/DEBIAN/du" -done +#for PACKAGE in $DH_DOPACKAGES; do +# TMP=`tmpdir $PACKAGE` +# +# if [ ! -d "$TMP/DEBIAN" ]; then +# doit "install -d $TMP/DEBIAN" +# fi +# +# # 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 $TMP/DEBIAN/du" +#done diff --git a/dh_du.1 b/dh_du.1 index 9c04106e..9497a61d 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -3,49 +3,13 @@ dh_du \- generate DEBIAN/du file .SH SYNOPSIS .B dh_du -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" -dh_du is a debhelper program that is responsible for generating -a DEBIAN/du file, which lists the disk usage of directories in the package. -This file isn't used by anything yet, but it could be helpful for a future -debian installer program. +dh_du is a debhelper program that was responsible for generating +a DEBIAN/du file, which listed the disk usage of directories in the package. .P -The du file is installed with proper permissions and ownerships. -.SH OPTIONS -.TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Generate du files for all architecture dependent packages. -.TP -.B \-i, \--indep -Generate du files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Generate du file for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +This program is now depricated, and does nothing, after a decision by the +debian developers that du control files should not exit. It will simply +output a warning message now. .SH "SEE ALSO" .BR /usr/doc/debhelper/README .SH AUTHOR diff --git a/dh_gencontrol b/dh_gencontrol index e2a4e701..f30b4104 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -15,5 +15,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Generate and install control file. doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + # This chmod is only necessary if the user sets the umask to something odd. + doit "chmod 644 $TMP/DEBIAN/control" doit "chown root.root $TMP/DEBIAN/control" done diff --git a/dh_installmanpages b/dh_installmanpages index 0c968a3f..fe611389 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -39,7 +39,6 @@ for PACKAGE in $DH_DOPACKAGES; do SECTION=man`expr $NAME : '.*\.\([123456789]\)'` # Test to see if the filename ends with 'x', # if so, this is an X man page. - echo $NAME if expr $NAME : '.*\.[123456789]x' >/dev/null; then EXTDIR="X11R6" else diff --git a/dh_makeshlibs b/dh_makeshlibs index d595c3b5..28695552 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -38,6 +38,7 @@ for PACKAGE in $DH_DOPACKAGES; do done if [ -e "$TMP/DEBIAN/shlibs" ]; then + doit "chmod 644 $TMP/DEBIAN/shlibs" doit "chown root.root $TMP/DEBIAN/shlibs" fi done diff --git a/dh_md5sums b/dh_md5sums index ae470926..8db01761 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -21,6 +21,7 @@ for PACKAGE in $DH_DOPACKAGES; do fi olddir=`pwd` complex_doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd $olddir" + doit "chmod 644 $TMP/DEBIAN/md5sums" doit "chown root.root $TMP/DEBIAN/md5sums" doit "rm -f $TMP/DEBIAN/allfiles" done diff --git a/examples/rules b/examples/rules index 8e6683c1..7fbd9d99 100755 --- a/examples/rules +++ b/examples/rules @@ -54,7 +54,6 @@ binary-arch: build dh_shlibdeps dh_gencontrol # dh_makeshlibs - dh_du dh_md5sums dh_builddeb diff --git a/examples/rules.indep b/examples/rules.indep index 601c5e3e..2e74e852 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -48,7 +48,6 @@ binary-indep: build dh_suidregister dh_installdeb dh_gencontrol - dh_du dh_md5sums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index a5be1efe..1cfeb425 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -51,7 +51,6 @@ binary-indep: build dh_suidregister -i dh_installdeb -i dh_gencontrol -i - dh_du -i dh_md5sums -i dh_builddeb -i @@ -83,7 +82,6 @@ binary-arch: build dh_shlibdeps -a dh_gencontrol -a # dh_makeshlibs -a - dh_du -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 2bc3faa675643163dc374716b88c8a3a2baacc58 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:46:19 +0000 Subject: r60: Initial Import --- debian/changelog | 7 +++++++ debian/control | 2 +- dh_installdocs.1 | 4 +++- dh_movefiles.1 | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index df4abff5..a2e73ab6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.64) unstable; urgency=low + + * Removed some junk (a whole old debhelper source tree!) that had gotten + into the source package by accident. + + -- Joey Hess Mon, 23 Feb 1998 20:23:34 -0800 + debhelper (0.63) unstable; urgency=low * Removed some debugging output from dh_installmanpages. diff --git a/debian/control b/debian/control index 8d14e7b5..d35fa0ae 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.3.0.1 +Standards-Version: 2.4.0.0 Package: debhelper Architecture: all diff --git a/dh_installdocs.1 b/dh_installdocs.1 index e1f2e590..659f2727 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -10,7 +10,9 @@ documentation into usr/doc/package in package build directories. .P dh_installdocs automatically installs debian/copyright if it exists. If dh_installdocs is acting on multiple packages, debian/copyright files will be -installed into all packages. +installed into all packages. However, if you need to have seperate copyright +files for different binary packages, you can use files named +debian/package.copyright. .P Any filenames specified as parameters will be installed into the first package dh_installdocs is told to act on. By default, this is the first diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 5ff47bb1..cdda662e 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -11,7 +11,7 @@ if your package has a Makefile that installs everything into debian/tmp, and you need to break that up into subpackages. .P Files named debian/package.files list the files to be moved, separated by -whitespace. +whitespace. The filenames listed should be relative to debian/tmp/. .SH OPTIONS .TP .B \-v, \--verbose -- cgit v1.2.3 From 08bffb3bdb18c12105018f57698cc7c67b6b9d3c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:06 +0000 Subject: r61: Initial Import --- README | 8 ++++++++ debian/changelog | 6 ++++++ dh_movefiles | 4 ++-- dh_movefiles.1 | 3 ++- dh_testversion.1 | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README b/README index bb4b6f06..fc9f95db 100644 --- a/README +++ b/README @@ -132,5 +132,13 @@ binary package the debhelper program will act on. For example: This uses debian/tmp- as the package build directory. +Other notes: +----------- + +* In general, if any debhelper program needs a directory to exist under + debian/, it will create it. I haven't bothered to document this in all the + man pages, but for example, dh_installdeb knows to make debian/tmp/DEBIAN/ + before trying to put files there, dh_installmenu knows you need a + debian/tmp/usr/lib/menu/ before installing the menu files, etc. -- Joey Hess diff --git a/debian/changelog b/debian/changelog index a2e73ab6..f742500b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.65) unstable; urgency=low + + * dh_installdocs.1, dh_movefiles.1: cleaified documentation for Che. + + -- Joey Hess Mon, 2 Mar 1998 17:20:39 -0800 + debhelper (0.64) unstable; urgency=low * Removed some junk (a whole old debhelper source tree!) that had gotten diff --git a/dh_movefiles b/dh_movefiles index 9190853c..939f38c8 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -13,8 +13,8 @@ for PACKAGE in $DH_DOPACKAGES; do # 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." + if [ "$TMP" = "debian/tmp" ]; then + error "I was asked to move some files from debian/tmp to debian/tmp." fi if [ ! -d "$TMP" ]; then diff --git a/dh_movefiles.1 b/dh_movefiles.1 index cdda662e..c7e81832 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -11,7 +11,8 @@ if your package has a Makefile that installs everything into debian/tmp, and you need to break that up into subpackages. .P Files named debian/package.files list the files to be moved, separated by -whitespace. The filenames listed should be relative to debian/tmp/. +whitespace. The filenames listed should be relative to debian/tmp/. You can +also list directory names, and the whole directory will be moved. .SH OPTIONS .TP .B \-v, \--verbose diff --git a/dh_testversion.1 b/dh_testversion.1 index f385a8ca..5fb7332b 100644 --- a/dh_testversion.1 +++ b/dh_testversion.1 @@ -25,7 +25,7 @@ dpkg --help. .TP .B version Version number to compare against the current version of debhelper. If not -specified, dh_testroot does nothing. +specified, dh_testversion does nothing. .SH EXAMPLES .TP .I dh_testversion 0.50 -- cgit v1.2.3 From 5463b627a518367623cb74c8d6e771b3b4163b67 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:16 +0000 Subject: r63: Initial Import --- PROGRAMMING | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 11 +++- debian/dhelp | 1 + debian/rules | 2 +- 4 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 PROGRAMMING create mode 100644 debian/dhelp diff --git a/PROGRAMMING b/PROGRAMMING new file mode 100644 index 00000000..43e1554c --- /dev/null +++ b/PROGRAMMING @@ -0,0 +1,175 @@ +This file documents things you should know to write a new debhelper program. + +Standardization: +--------------- + +There are lots of debhelper commands. To make the learning curve shallower, +I want them all to behave in a standard manner: + +All debhelper programs have names beginning with "dh_". This is so we don't +pollute the name space too much. + +Debhelper programs should never output anything to standard output except +error messages, important warnings, and the actual commands they run that +modify files under debian/ and debian/tmp, etc (this last only if they are +passed -v, and if you output the commands, you should indent them with 1 tab). +This is so we don't have a lot of noise output when all the debhelper commands +in a debian/rules are run, so the important stuff is clearly visible. + +Debhelper programs should accept the options, -v, -i, -a, -p, --no-act, and +-P, and any long forms of these options, like --verbose . If necessary, the +options may be ignored. + +If debhelper commands need config files, they should use +debian/package.filename as the name of the confile file (replace filename +with whatever your command wants), and debian/filename should also be +checked for config information for the first binart package in +debian/control. Also, debhelper commands should accept the same sort of +information that appears in the config files, on their command lines, if +possible, and apply that information to the first package thay act on. + +Debhelper programs should never modify the debian/postinst, debian/prerm, +etc scripts, instead, they can add lines to debian/postinst.debhelper, etc. +The autoscript() function (see below) is one easy way to do this. +dh_installdeb is an exception, it will run after the other commands and +merge these modifications into the actual postinst scripts. + +There are always exceptions. Just ask me. + +Intoroducing dh_lib: +------------------- + +All debhelper programs use the dh_lib library (actually it's a shell script) +to parse their arguments and set some useful variables. It's not mandatory +that your program use dh_lib, but it will make it a lot easier to keep it in +sync with the rest of debhelper if it does, so this is highly encouraged. + +Typically, you invoke dh_lib like this: + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +The path statement is there to make your program look first in debian/ for +dh_lib (so users can install a modified version there if necessary), then the +rest of the path, then the canoical location of dh_lib, /usr/lib/debhelper. + +Argument processing: +------------------- + +All debhelper programs should respond to certian arguemnts, such as -v, -i, +-a, and -p. To help you make this work right, dh_lib handles argumeny +processing. + +As soon as dh_lib loads, it processes any arguments that have been passed to +your program. The following variables may be set during this stage; your +program can use them later: + +switch variable description +-v DH_VERBOSE should the program verbosely output what it is + doing? +--no-act DH_NO_ACT should the program not actually do anything? +-i,-a,-p DH_DOPACKAGES a space delimited list of the binary packages + to act on +-i,-p DH_DOINDEP a space delimited list of the binary independant + packages to act on +-a,-p DH_DOARCH a space delimited list of the binary dependant + packages to act on +-n DH_NOSCRIPTS if set, do not make any modifications to the + package's postinst, posrtm, etc scripts. +-x DH_EXCLUDE exclude a something from processing (you + decide what this means for your program) +-d DH_D_FLAG you decide what this means to your program +-r DH_R_FLAG you decide what this means to your program +-k DH_K_FLAG you decide what this means to your program +-P DH_TMPDIR package build directory (implies only one + package is being acted on) +-u DH_U_PARAMS will be set to a string, that is typically + parameters your program passes on to some + other program. +-m DH_M_PARAMS will be set to a string, you decide what it + means to your program +-V DH_V_FLAG will be set to a string, you decide what it + means to your program +-V DH_V_FLAG_SET will be 1 if -V was specified, even if no + parameters were passed along with the -V +-A DH_PARAMS_ALL generally means that additional command line + parameters passed to the program (other than + those processed here), will apply to all + binary packages the program acts on, not just + the first + +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, +etc). + +If you need a new command line option, just ask me, and I will add it. + +Global variables: +---------------- + +The following variables are also set, you can use any of them: + +MAINPACKAGE the name of the first binary package listed in + debian/control +DH_FIRSTPACKAGE the first package we were instructed to act on. This package + typically gets special tratment, addiiional arguments + specified on the command line may effect it. + +Functions: +--------- + +Dh_lib also contains a number of functions you may find useful. + +doit() + Pass this function a string that is a shell command. It will run the + command (unless DH_NO_ACT is set), and if DH_VERBOSE is set, it will + also output the command to stdout. You should use this function for + almost all commands your program performs that manipulate files in + the package build directories. +complex_doit() + This is the same as doit(), except you can pass more complicated + commands to it (ie, commands involving piping redirection) +verbose_echo() + Pass this command a string, and it will echo it if DH_VERBOSE is set. +error() + Pass this command a string, it will output it to standard error and + exit. +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 + package build directory. Typically, this will be "debian/tmp" or + "debian/package". +pkgfile() + Pass this command the name of a binary package, and the base name of a + file, and it will return the actual filename to use. This is used + for allowing debhelper programs to have configuration files in the + debian/ directory, so there can be one config file per binary + package. The conversion is that the files are named + debian/package.filename, and debian/filename is also allowable for + the MAINPACKAGE. If the file does not exist, nothing is returned. +pkgext() + Pass this command the name of a binary package, and it will return + the name to prefix to files in debian/ for this package. For the + MAINPACKAGE, it returns nothing (there is no prefix), for the other + packages, it returns "package.". +isnative() + Pass this command the name of a package, it returns 1 if the package + is a native debian package. + As a side effect, VERSION is set to the version number of the + package. +autoscript() + Pass 3 parameters: + 1: script to add to + 2: filename of snippet + 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ + (optional) + This command automatically adds shell script snippets to a debian + maintainer script (like the postinst or prerm). + +Notes: +----- + +Dh_lib is still evolving. +There will probably be a perl version too, in the future. + +-- Joey Hess diff --git a/debian/changelog b/debian/changelog index f742500b..368f284f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,15 @@ +debhelper (0.66) unstable; urgency=low + + * README, dh_testversion.1, dh_movefiles.1: more doc fixes. + * dh_movefiles: don't check for package names to see if files are being + moved from one package back into itself, instead, check tmp dir names. + If you use this behavior, you should use "dh_testversion 0.66". + + -- Joey Hess Mon, 2 Mar 1998 17:50:29 -0800 + debhelper (0.65) unstable; urgency=low - * dh_installdocs.1, dh_movefiles.1: cleaified documentation for Che. + * dh_installdocs.1, dh_movefiles.1: clarified documentation for Che. -- Joey Hess Mon, 2 Mar 1998 17:20:39 -0800 diff --git a/debian/dhelp b/debian/dhelp new file mode 100644 index 00000000..31e980b5 --- /dev/null +++ b/debian/dhelp @@ -0,0 +1 @@ +hhihihi diff --git a/debian/rules b/debian/rules index 13aaea5f..a8e6369e 100755 --- a/debian/rules +++ b/debian/rules @@ -42,7 +42,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 + ./dh_installdocs TODO README PROGRAMMING ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages -- cgit v1.2.3 From c21cfd707f80cf57ec07d50ae797566ba97c20ef Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:22 +0000 Subject: r64: Initial Import --- debian/changelog | 7 +++++++ dh_installdocs.1 | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 368f284f..b0c1fadb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.67) unstable; urgency=low + + * Added PROGRAMMING document that describes the interface of dh_lib, to + aid others in writing and understanding debhelper programs. + + -- Joey Hess Fri, 6 Mar 1998 12:45:08 -0800 + debhelper (0.66) unstable; urgency=low * README, dh_testversion.1, dh_movefiles.1: more doc fixes. diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 659f2727..95d9df5a 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -23,7 +23,8 @@ Also, debian/README.Debian (or debian/README.debian) and debian/TODO, if they exist, will be installed into the first binary package listed in 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. +debian native package. Also note that README.debian is installed as +README.Debian, for consitency. .P 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. -- cgit v1.2.3 From d207c591d44de3e36f9a3cd07c045f346de3208c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:28 +0000 Subject: r65: Initial Import --- debian/changelog | 6 ++++++ dh_suidregister.1 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b0c1fadb..03a50c6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.68) unstable; urgency=low + + * Document that README.debian files are installed as README.Debian (#19089). + + -- Joey Hess Fri, 6 Mar 1998 17:48:32 -0800 + debhelper (0.67) unstable; urgency=low * Added PROGRAMMING document that describes the interface of dh_lib, to diff --git a/dh_suidregister.1 b/dh_suidregister.1 index 182386b4..e9563a89 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -73,6 +73,6 @@ Enables no-act mode (see above). .SH "SEE ALSO" .BR /usr/doc/debhelper/README , -.BR suidregister (1) +.BR suidregister (8) .SH AUTHOR Joey Hess -- cgit v1.2.3 From 2d14fd1e6df600cd92ce263c65d29dbeeba80ce6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:33 +0000 Subject: r66: Initial Import --- debian/changelog | 7 +++++++ dh_lib | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 03a50c6f..282e3cd2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.69) unstable; urgency=low + + * Refer to suidregister (8), not (1). Bug #19149. + * Removed junk file from debian/ dir. + + -- Joey Hess Sun, 8 Mar 1998 13:04:36 -0800 + debhelper (0.68) unstable; urgency=low * Document that README.debian files are installed as README.Debian (#19089). diff --git a/dh_lib b/dh_lib index 7c7c2e18..ae2d32f6 100644 --- a/dh_lib +++ b/dh_lib @@ -119,7 +119,7 @@ autoscript() { fi fi - complex_doit "echo \"# Automatically added by `basename $0` on `822-date`\" >> $autoscript_debscript" + complex_doit "echo \"# Automatically added by `basename $0`\" >> $autoscript_debscript" complex_doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" complex_doit "echo '# End automatically added section' >> $autoscript_debscript" } -- cgit v1.2.3 From c44b3e7afd56249ce798aa1bf069398a1eeac5b7 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:38 +0000 Subject: r67: Initial Import --- debian/changelog | 8 ++++++++ dh_lib | 8 -------- dh_makeshlibs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 282e3cd2..86b7f4ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.70) unstable; urgency=low + + * dh_lib: autoscript(): no longer add the modification date to the + comments aurrounding debhelper-added code. I don't think this date was + gaining us anything, so let's remove it and save some disk space. + + -- Joey Hess Sun, 8 Mar 1998 21:15:13 -0800 + debhelper (0.69) unstable; urgency=low * Refer to suidregister (8), not (1). Bug #19149. diff --git a/dh_lib b/dh_lib index ae2d32f6..2e11695f 100644 --- a/dh_lib +++ b/dh_lib @@ -207,11 +207,3 @@ 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 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 - echo `basename $0`": arguments \"$*\" will apply to package \"$DH_FIRSTPACKAGE\"" >&2 -fi diff --git a/dh_makeshlibs b/dh_makeshlibs index 28695552..2f8cdaa2 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -30,7 +30,7 @@ for PACKAGE in $DH_DOPACKAGES; do else # Call isnative becuase it sets $VERSION # as a side effect. - isnative + isnative || true PACKAGE="$PACKAGE (>= $VERSION)" fi fi -- 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(+) 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 776bed9b7a4dc4d9f3873c1af4c124d5d802185a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:47 +0000 Subject: r70: Initial Import --- debian/changelog | 8 ++++++++ dh_installinit.1 | 10 ++++++++-- dh_suidregister.1 | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0462cc44..f3219bed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.72) unstable; urgency=low + + * Applied patch from Yann Dirson to add a + --init-script parameter to dh_installinit. (#19227) + * Documented this new switch. + + -- Joey Hess Mon, 9 Mar 1998 17:12:04 -0800 + debhelper (0.71) unstable; urgency=low * dh_makeshlibs: -V flag was broken: if just -V was specified, diff --git a/dh_installinit.1 b/dh_installinit.1 index 89c34c3a..156867e5 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -3,7 +3,7 @@ dh_installinit \- install init scripts into package build directories .SH SYNOPSIS .B dh_installinit -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" +.I "[-v] [-a] [-i] [--no-act] [--init-script=scriptname] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" .SH "DESCRIPTION" dh_installinit is a debhelper program that is responsible for installing init scripts into package build directories. @@ -46,13 +46,19 @@ Do not restart daemon on upgrade. .B \-d, \--remove-d Remove trailing "d" from the name of the package, and use the result for the filename the init script is installed as in etc/init.d/ . This may be useful -for daemons with named ending in "d". +for daemons with named ending in "d". (Note: this takes precidence over +the --init-script parameter described below.) .TP .B \-uparams, \--update-rcd-params=params Pass "params" to .BR update-rc.d (8) If not specified, "default" will be passed to .BR update-rc.d (8) +.TP +.B \--init-script=scriptname +Use "scriptname" as for the filename the init script is installed as in +etc/init.d/ . This is useful if you need to have an init script with a name +different from the package's name. .SH NOTES The .B \-a diff --git a/dh_suidregister.1 b/dh_suidregister.1 index e9563a89..57694956 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -12,7 +12,7 @@ with when it is installed. .P Any filenames specified as parameters will be registered in the first -package dh_installdocs is told to act on. By default, this is the first +package dh_suidregister 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 -- cgit v1.2.3 From 8c6662502a915d99f4142110b613bf616f9d0326 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:52 +0000 Subject: r71: Initial Import --- PROGRAMMING | 24 ++++++++++++------------ README | 4 ++-- TODO | 4 +--- debian/changelog | 6 ++++++ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/PROGRAMMING b/PROGRAMMING index dcef3edf..c290c34d 100644 --- a/PROGRAMMING +++ b/PROGRAMMING @@ -21,12 +21,12 @@ Debhelper programs should accept the options, -v, -i, -a, -p, --no-act, and options may be ignored. If debhelper commands need config files, they should use -debian/package.filename as the name of the confile file (replace filename +debian/package.filename as the name of the config file (replace filename with whatever your command wants), and debian/filename should also be -checked for config information for the first binart package in +checked for config information for the first binary package in debian/control. Also, debhelper commands should accept the same sort of information that appears in the config files, on their command lines, if -possible, and apply that information to the first package thay act on. +possible, and apply that information to the first package they act on. Debhelper programs should never modify the debian/postinst, debian/prerm, etc scripts, instead, they can add lines to debian/postinst.debhelper, etc. @@ -36,7 +36,7 @@ merge these modifications into the actual postinst scripts. There are always exceptions. Just ask me. -Intoroducing dh_lib: +Introducing dh_lib: ------------------- All debhelper programs use the dh_lib library (actually it's a shell script) @@ -51,13 +51,13 @@ PATH=debian:$PATH:/usr/lib/debhelper The path statement is there to make your program look first in debian/ for dh_lib (so users can install a modified version there if necessary), then the -rest of the path, then the canoical location of dh_lib, /usr/lib/debhelper. +rest of the path, then the canonical location of dh_lib, /usr/lib/debhelper. Argument processing: ------------------- -All debhelper programs should respond to certian arguemnts, such as -v, -i, --a, and -p. To help you make this work right, dh_lib handles argumeny +All debhelper programs should respond to certain arguments, such as -v, -i, +-a, and -p. To help you make this work right, dh_lib handles argument processing. As soon as dh_lib loads, it processes any arguments that have been passed to @@ -70,12 +70,12 @@ switch variable description --no-act DH_NO_ACT should the program not actually do anything? -i,-a,-p DH_DOPACKAGES a space delimited list of the binary packages to act on --i,-p DH_DOINDEP a space delimited list of the binary independant +-i,-p DH_DOINDEP a space delimited list of the binary independent packages to act on --a,-p DH_DOARCH a space delimited list of the binary dependant +-a,-p DH_DOARCH a space delimited list of the binary dependent packages to act on -n DH_NOSCRIPTS if set, do not make any modifications to the - package's postinst, posrtm, etc scripts. + package's postinst, postrm, etc scripts. -x DH_EXCLUDE exclude a something from processing (you decide what this means for your program) -d DH_D_FLAG you decide what this means to your program @@ -115,7 +115,7 @@ The following variables are also set, you can use any of them: MAINPACKAGE the name of the first binary package listed in debian/control DH_FIRSTPACKAGE the first package we were instructed to act on. This package - typically gets special tratment, addiiional arguments + typically gets special treatment, additional arguments specified on the command line may effect it. Functions: @@ -147,7 +147,7 @@ pkgfile() file, and it will return the actual filename to use. This is used for allowing debhelper programs to have configuration files in the debian/ directory, so there can be one config file per binary - package. The conversion is that the files are named + package. The convention is that the files are named debian/package.filename, and debian/filename is also allowable for the MAINPACKAGE. If the file does not exist, nothing is returned. pkgext() diff --git a/README b/README index fc9f95db..ae0e53a1 100644 --- a/README +++ b/README @@ -51,7 +51,7 @@ 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 dehelper apps do that too, but they do it differently. Debstd just +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 @@ -70,7 +70,7 @@ Some debhelper commands will automatically generate parts of debian install scripts. If you want these automatically generated things included in your debian install scripts, then you need to add "#DEBHELPER#" to your scripts, in the place the code should be added. "#DEBHELPER#" will be replaced by any -autogenerated code when you run dh_installdeb. +auto-generated code when you run dh_installdeb. All scripts that automatically generate code in this way let it be disabled by the -n parameter. diff --git a/TODO b/TODO index 3e34c070..a6646b11 100644 --- a/TODO +++ b/TODO @@ -3,15 +3,13 @@ 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). - - .so files of compressed manpages -- change to symlinks. Policy says we - need only do this "if it's easy". The hard bit is implementing it ;-) * dh_fixperms: allow listing of files not to be touched (diffucult). * add a dh_debstd, which mimics debstd, but uses debhelper tools internally. Note thatthe 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. -* dh_compress: add --exclude "*.conf" type-thingy, sincethat's the change +* dh_compress: add --exclude "*.conf" type-thingy, since that's the change you most often want to make to what it does, and a debian/conpress file is overkill in those cases. * info support for debhelper (currently implmented, but I hate how I did it, diff --git a/debian/changelog b/debian/changelog index f3219bed..db3a28fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.73) unstable; urgency=low + + * Fixed typo in dh_suidregister.1 + + -- Joey Hess Thu, 12 Mar 1998 16:30:27 -0800 + debhelper (0.72) unstable; urgency=low * Applied patch from Yann Dirson to add a -- cgit v1.2.3 From 0bbd944c8f59e3cab7c4636a54b9df8fbfc8104f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:52 +0000 Subject: r72: Initial Import --- debian/changelog | 12 ++++++++++++ dh_installmanpages | 22 ++++++++++++++++++---- dh_installmanpages.1 | 6 +++++- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index db3a28fa..11a5e95d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (0.74) unstable; urgency=low + + * dh_installmanpages: convert .so links to symlinks at last (#19829). + * dh_installmanpages.1: documented that no, dh_installmanpages never + installs symlink man pages from the source package (#19831). + * dh_installmanpages: minor speedups + * PROGRAMMING: numerous spelling fixes, thanks to Christian T. Steigies. + Life is too short for me to spell check my technical documentation, but + I always welcome corrections! + + -- Joey Hess Tue, 17 Mar 1998 22:09:07 -0800 + debhelper (0.73) unstable; urgency=low * Fixed typo in dh_suidregister.1 diff --git a/dh_installmanpages b/dh_installmanpages index fe611389..d5e9198a 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -2,7 +2,9 @@ # # Automatically find and install man pages. However, do not install any man # pages listed on the command line. -# This is a little bit DWIMish, but still very handy. +# Also change man pages with .so commands in them into symlinks. +# +# This is a little bit (hah!) DWIMish, but still very handy. PATH=debian:$PATH:/usr/lib/debhelper . dh_lib @@ -15,12 +17,12 @@ for PACKAGE in $DH_DOPACKAGES; do # .in files, which are from configure. # 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" \ + cut -d " " -f 2 | tr "\n" "|"` + for file in `find * -type f -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 file -L $file|grep -q roff; then if echo $file|grep -q /; then NAME=`expr $file : '.*/\(.*\)'` else @@ -54,4 +56,16 @@ for PACKAGE in $DH_DOPACKAGES; do fi fi done + + # Now the .so conversion. + for file in `find $TMP/usr/man $TMP/usr/X11*/man -type f -size -256c 2>/dev/null` + do + solink=expr "`head -1 $file`" : '\.so \(.*\)' + if [ "$solink" ]; then + doit "rm -f $file" + # The .so links include the subdir the page is in, + # thus the ../ + doit "ln -s ../$solink $file" + fi + done done diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index 5a84d76b..7053dbc6 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -10,7 +10,8 @@ automatically installing man pages into usr/man/ and usr/X11R6/man/ in package build directories. .P dh_installmanpages scans the current directory and all subdirectories for -filenames that look like man pages. It uses +filenames that look like man pages. (Note that only real files are looked +at; symlinks are ignored.) It uses .BR file (1) to verify that the files are in the correct format. Then, based on the files' extensions, it installs them into the correct man directory. @@ -18,6 +19,9 @@ files' extensions, it installs them into the correct man directory. All filenames specified as parameters will be skipped by dh_installmanpages. This is useful if by default it installs some man pages that you do not want to be installed. +.P +After the man page installation step, dh_installmanpages will check to see if +any of the man pages are ".so" links. If so, it changes them to symlinks. .SH OPTIONS .TP .B \-v, \--verbose -- cgit v1.2.3 From 268eabec772aee3ac6330bc99d34b4566bda5659 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:48:57 +0000 Subject: r73: Initial Import --- debian/changelog | 7 +++++++ dh_getopt.pl | 6 +++++- dh_installmanpages | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 11a5e95d..8124e62c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.75) unstable; urgency=low + + * Actually exit if there is an unknown option onthe command line (oooops!) + * Fix .so file conversion to actually work (#19933). + + -- Joey Hess Thu, 19 Mar 1998 11:54:58 -0800 + debhelper (0.74) unstable; urgency=low * dh_installmanpages: convert .so links to symlinks at last (#19829). diff --git a/dh_getopt.pl b/dh_getopt.pl index f91a42e0..0c9bba0b 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -64,7 +64,7 @@ use Getopt::Long; Getopt::Long::config("bundling"); # Parse options. -GetOptions( +$ret=GetOptions( "v" => \$verbose, "verbose" => \$verbose, @@ -113,6 +113,10 @@ GetOptions( "init-script=s" => \$init_script, ); +if (!$ret) { + $parse_error="exiting with unknown option."; +} + # Check to see if -V was specified. If so, but no parameters were passed, # the variable will be defined but empty. if (defined($version_info)) { diff --git a/dh_installmanpages b/dh_installmanpages index d5e9198a..a8fb1e99 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -60,7 +60,7 @@ for PACKAGE in $DH_DOPACKAGES; do # Now the .so conversion. for file in `find $TMP/usr/man $TMP/usr/X11*/man -type f -size -256c 2>/dev/null` do - solink=expr "`head -1 $file`" : '\.so \(.*\)' + solink=`expr "\`head -1 $file\`" : '\.so \(.*\)'` if [ "$solink" ]; then doit "rm -f $file" # The .so links include the subdir the page is in, -- cgit v1.2.3 From 5b6296acab65d26858e1255e48fe8e54f2f3abf8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:49:07 +0000 Subject: r74: Initial Import --- debian/changelog | 10 +++++++++- dh_makeshlibs | 11 +++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8124e62c..567dbb9f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,14 @@ +debhelper (0.76) frozen unstable; urgency=low + + * I intended version 0.75 to make it in before the freeze, and it did not. + This is just to get it into frozen. There are no changes except bug + fixes. + + -- Joey Hess Thu, 26 Mar 1998 12:25:47 -0800 + debhelper (0.75) unstable; urgency=low - * Actually exit if there is an unknown option onthe command line (oooops!) + * Actually exit if there is an unknown option on the command line (oooops!) * Fix .so file conversion to actually work (#19933). -- Joey Hess Thu, 19 Mar 1998 11:54:58 -0800 diff --git a/dh_makeshlibs b/dh_makeshlibs index 2f8cdaa2..eb88f448 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -12,7 +12,7 @@ for PACKAGE in $DH_DOPACKAGES; do error "$TMP/DEBIAN/shlibs already exists." fi - for file in `find $TMP -type f -name "*.so*" | tr "\n" " "` ; do + for file in `find $TMP -type f -name "*.so.*" | tr "\n" " "` ; do LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true LIB_VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true if [ -z "$DH_M_PARAMS" ]; then @@ -24,17 +24,20 @@ for PACKAGE in $DH_DOPACKAGES; do if [ ! -d "$TMP/DEBIAN" ] ; then doit "install -d $TMP/DEBIAN" fi + DEPS=$PACKAGE if [ "$DH_V_FLAG_SET" ]; then if [ "$DH_V_FLAG" ]; then - PACKAGE="$DH_V_FLAG" + DEPS="$DH_V_FLAG" else # Call isnative becuase it sets $VERSION # as a side effect. isnative || true - PACKAGE="$PACKAGE (>= $VERSION)" + DEPS="$PACKAGE (>= $VERSION)" fi fi - complex_doit "echo '$LIBRARY $MAJOR $PACKAGE' >>$TMP/DEBIAN/shlibs" + if [ "$LIBRARY" -a "$MAJOR" -a "$DEPS" ]; then + complex_doit "echo '$LIBRARY $MAJOR $DEPS' >>$TMP/DEBIAN/shlibs" + fi done if [ -e "$TMP/DEBIAN/shlibs" ]; then -- cgit v1.2.3 From 8a27e8edfd06c742fe3ff2aceda1588daf175527 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:49:12 +0000 Subject: r75: Initial Import --- PROGRAMMING | 2 +- README | 9 ++++++++- TODO | 14 +++++++------- debian/changelog | 7 +++++++ examples/rules.indep | 2 +- examples/rules.multi | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/PROGRAMMING b/PROGRAMMING index c290c34d..22e015af 100644 --- a/PROGRAMMING +++ b/PROGRAMMING @@ -37,7 +37,7 @@ merge these modifications into the actual postinst scripts. There are always exceptions. Just ask me. Introducing dh_lib: -------------------- +------------------ All debhelper programs use the dh_lib library (actually it's a shell script) to parse their arguments and set some useful variables. It's not mandatory diff --git a/README b/README index ae0e53a1..f821e8c0 100644 --- a/README +++ b/README @@ -7,6 +7,13 @@ 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). +Starting a new package: +---------------------- + +You can just use the example rules files and do the rest of the new package +set up by hand, or you could try the new dh-make package, which contains a +"dh_make" command that is similar to debmake, and tries to automate the +process. Converting from debstd to debhelper: ----------------------------------- @@ -59,7 +66,7 @@ commands. So if you have postinst, postrm, etc scripts, add a line reading 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 postint, +debstd-generated package very closely. Pay special attention to the postinst, postrm, etc scripts. diff --git a/TODO b/TODO index a6646b11..064dcbf0 100644 --- a/TODO +++ b/TODO @@ -3,28 +3,28 @@ 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 (diffucult). +* dh_fixperms: allow listing of files not to be touched (difficult). * add a dh_debstd, which mimics debstd, but uses debhelper tools internally. - Note thatthe idea here is not just another debstd. This program will have + 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. * dh_compress: add --exclude "*.conf" type-thingy, since that's the change - you most often want to make to what it does, and a debian/conpress file is + you most often want to make to what it does, and a debian/compress file is overkill in those cases. -* info support for debhelper (currently implmented, but I hate how I did it, +* 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 installs the man pages into the correct areas to suit the binaries they document. I may need to make this only happen when a switch is given, to - preserve backward compatability. + preserve backward compatibility. * maybe make dh_installmanpages look at the .TH line of man pages whose filenames end in .man, to figure out what section they go it. This would - require a switch to turn on, for backwards compatability. + require a switch to turn on, for backwards compatibility. * All debhelper programs should be checked that they output files with the correct permissions no matter what the umask is set to. Currently, only those programs that run after dh_fixperms have been so checked. (Checking the rest is low priority, since dh_fixperms fixes any incorrect permissions they might have; still it would be nice to check them too, just to make debhelper more flexible.) One easy fix is to add umask 022 to dh_lib, - however, there may be unforseen ramifications of such a change. + however, there may be unforeseen ramifications of such a change. diff --git a/debian/changelog b/debian/changelog index 567dbb9f..1ee38252 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.77) frozen unstable; urgency=low + + * Fixed a nasty bug in dh_makeshlibs when it was called with -V, but with + no version string after the -V. + + -- Joey Hess Sun, 29 Mar 1998 16:08:27 -0800 + debhelper (0.76) frozen unstable; urgency=low * I intended version 0.75 to make it in before the freeze, and it did not. diff --git a/examples/rules.indep b/examples/rules.indep index 2e74e852..7ba839ad 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -1,6 +1,6 @@ #!/usr/bin/make -f # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. -# This version is for packages that are architecure independant. +# This version is for packages that are architecture independent. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 diff --git a/examples/rules.multi b/examples/rules.multi index 1cfeb425..33a1a4ac 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -1,7 +1,7 @@ #!/usr/bin/make -f # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # This version is for a hypothetical package that builds an -# architecture-dependant package, as well as an architecture-independant +# architecture-dependant package, as well as an architecture-independent # package. # Uncomment this to turn on verbose mode. -- cgit v1.2.3 From 8e17695ae11d7baea80c69ff01b7558500cedfd9 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:49:12 +0000 Subject: r76: Initial Import --- debian/changelog | 9 +++++++++ dh_fixperms | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1ee38252..de0c2d9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.78) frozen unstable; urgency=low + + * More spelling fixes from Christian T. Steigies. (I ignored the spelling + fixes to the changelog, though - too many, and a changelog isn't meant + to be changed after the fact :-) + * dh_fixperms: remove execute bits from .la files genrated by libtool. + + -- Joey Hess Mon, 30 Mar 1998 12:44:42 -0800 + debhelper (0.77) frozen unstable; urgency=low * Fixed a nasty bug in dh_makeshlibs when it was called with -V, but with diff --git a/dh_fixperms b/dh_fixperms index 9bd452fb..d34ffd23 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -32,8 +32,8 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod 644 $files" fi - # ..so are executable shared libraries. - files=`find $TMP -perm -5 -type f -name "*.so*" | tr "\n" " "` || true + # ..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 if [ "$files" ]; then doit "chmod a-X $files" fi -- cgit v1.2.3 From 592ce7d8660a0aab5870916d6916894266632488 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:49:27 +0000 Subject: r77: Initial Import --- debian/changelog | 7 +++++++ dh_gencontrol | 7 ++++++- dh_gencontrol.1 | 3 --- dh_installchangelogs | 7 ++++++- dh_installchangelogs.1 | 4 +++- dh_lib | 6 +++--- dh_movefiles | 21 +++++++++++++++++++-- dh_movefiles.1 | 7 ++++++- 8 files changed, 50 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index de0c2d9e..30e24c99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.79) frozen; urgency=low + + * Reupload to get it into frozen. No changes since version 0.75 + except bugfixes. + + -- Joey Hess Thu, 2 Apr 1998 16:10:55 -0800 + debhelper (0.78) frozen unstable; urgency=low * More spelling fixes from Christian T. Steigies. (I ignored the spelling diff --git a/dh_gencontrol b/dh_gencontrol index f30b4104..2babfec0 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -9,12 +9,17 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` EXT=`pkgext $PACKAGE` + changelog=`pkgfile $PACKAGE changelog` + if [ ! "$changelog" ]; then + changelog=debian/changelog + fi + if [ ! -d $TMP/DEBIAN ]; then doit "install -o root -g root -d $TMP/DEBIAN" fi # Generate and install control file. - doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit "dpkg-gencontrol -l$changelog -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" # This chmod is only necessary if the user sets the umask to something odd. doit "chmod 644 $TMP/DEBIAN/control" doit "chown root.root $TMP/DEBIAN/control" diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 70486a97..b0cc783c 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -11,9 +11,6 @@ the proper permissions. .P This program is merely a wrapper around .BR dpkg-gencontrol (1) -You may prefer to simply run -.BR dpkg-gencontrol (1) -by hand. .SH OPTIONS .TP .B \-v, \--verbose diff --git a/dh_installchangelogs b/dh_installchangelogs index 0dd09918..15a42c09 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -25,10 +25,15 @@ fi for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` + changelog=`pkgfile $PACKAGE changelog` + if [ ! "$changelog" ]; then + changelog=debian/changelog + fi + if [ ! -d $TMP/usr/doc/$PACKAGE ]; then doit "install -d $TMP/usr/doc/$PACKAGE" fi - doit "install -p -m644 debian/changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" + doit "install -p -m644 $changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" if [ "$UPSTREAM" ]; then doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog" diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 7b9f2300..84fb6b46 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -11,7 +11,9 @@ changelogs into package build directories. dh_installchangelogs determines if the package is a debian native package, and if so, it installs debian/changelog into usr/doc/package/changelog in the package build directory. Otherwise, it installs debian/changelog into -usr/doc/package/changelog.Debian in the package build directory. +usr/doc/package/changelog.Debian in the package build directory. (If files +named debian/package.changelog exist, they will be used in preference to +debian/changelog.) .P If an upstream changelog file is specified as an option, and the package is not a native debian package, then this upstream changelog will be installed diff --git a/dh_lib b/dh_lib index 2e11695f..38f6734c 100644 --- a/dh_lib +++ b/dh_lib @@ -53,9 +53,9 @@ tmpdir() { # 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. +# debian/somefile, and if found return that, otherwise, if the package is +# the main package, 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" diff --git a/dh_movefiles b/dh_movefiles index 939f38c8..5d8dd90b 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -9,7 +9,9 @@ for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` files=`pkgfile $PACKAGE files` - move="" + if [ ! -d "debian/tmp" ]; then + error "debian/tmp does not exist" + fi # debian/files has a different purpose, so ignore it. if [ "$files" -a "$files" != "debian/files" ]; then @@ -22,6 +24,21 @@ for PACKAGE in $DH_DOPACKAGES; do fi files=`pwd`/$files - complex_doit "(cd debian/tmp;tar --create --remove-files --file - "`cat $files`") | (cd $TMP;tar xpf -)" + + # 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.) + for i in `(cd debian/tmp ; echo \`cat $files\`)`; do + tomove="`(cd debian/tmp ; \ + find $i ! -type d -and ! -type l -print)` \ + $tomove \ + `(cd debian/tmp ; \ + find $i ! -type d -and -type l -print)`" + done + + complex_doit "(cd debian/tmp;tar --create --remove-files --file - "$tomove") | (cd $TMP;tar xpf -)" fi done diff --git a/dh_movefiles.1 b/dh_movefiles.1 index c7e81832..4243758f 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -12,7 +12,12 @@ you need to break that up into subpackages. .P Files named debian/package.files list the files to be moved, separated by whitespace. The filenames listed should be relative to debian/tmp/. You can -also list directory names, and the whole directory will be moved. +also list directory names, and the whole directory will be moved. You can +even use wildcards if you like. +.P +The files will be moved in a special order: first all normal files, then all +symlinks. This is done becuase it tends to be a good thing to have symlinks +last in debian packages, particularly in shared library packages. .SH OPTIONS .TP .B \-v, \--verbose -- cgit v1.2.3 From 0eed709f4b9dbe92e8c71e60313bfca6f69eea2b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:49:58 +0000 Subject: r78: Initial Import --- debian/changelog | 19 +++++++++++++------ dh_movefiles | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 30e24c99..ef64f4f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,16 @@ -debhelper (0.79) frozen; urgency=low - - * Reupload to get it into frozen. No changes since version 0.75 - except bugfixes. - - -- Joey Hess Thu, 2 Apr 1998 16:10:55 -0800 +debhelper (0.80) unstable; urgency=low + + * Moved under cvs (so I can fork a stable and an unstable version). + * dh_movefiles: first move real files, then move symlinks. (#18220) + Thanks to Bdale Garbee and Adam Heath + for help on the implementation. + * dh_installchangelogs: use debian/package.changelog files if they exist + rather than debian.changelog. It appears some people do need per-package + changelogs. + * dh_gencontrol: if debian/package.changelogs files exist, use them. + * Above 2 changes close #20442. + + -- Joey Hess Mon, 30 Mar 1998 20:54:26 -0800 debhelper (0.78) frozen unstable; urgency=low diff --git a/dh_movefiles b/dh_movefiles index 5d8dd90b..ab7dcd01 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -31,6 +31,7 @@ for PACKAGE in $DH_DOPACKAGES; do # # (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 tomove="`(cd debian/tmp ; \ find $i ! -type d -and ! -type l -print)` \ -- cgit v1.2.3 From 5bf9f168207cb323b53bfb46964ec56032f7abeb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:50:10 +0000 Subject: r79: Initial Import --- debian/changelog | 6 ++++++ debian/rules | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index ef64f4f7..ce1e3814 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.81) unstable; urgency=low + + * dh_movefiles: empty $tomove (#20495). + + -- Joey Hess Tue, 31 Mar 1998 15:36:32 -0800 + debhelper (0.80) unstable; urgency=low * Moved under cvs (so I can fork a stable and an unstable version). diff --git a/debian/rules b/debian/rules index a8e6369e..c1009b7f 100755 --- a/debian/rules +++ b/debian/rules @@ -16,6 +16,11 @@ export DH_VERBOSE=1 test_files=dh_lib build: + # Important symlinks. + cd autoscripts && ln -sf postinst-menu postrm-menu + cd debian && ln -sf ../dh_lib dh_lib + cd debian && ln -sf ../dh_getopt.pl dh_getopt.pl + ./dh_testdir $(test_files) sed "s/#DEBHELPER_VERSION#/$(VERSION)/" < dh_testversion.in \ > dh_testversion -- cgit v1.2.3 From 2508377c60059fc5012d1c2304dafa12afaa0b8f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:50:15 +0000 Subject: r80: Initial Import --- debian/changelog | 8 ++++++++ examples/rules | 22 +++++++++++++++------- examples/rules.indep | 22 +++++++++++++++------- examples/rules.multi | 26 +++++++++++++++----------- 4 files changed, 53 insertions(+), 25 deletions(-) diff --git a/debian/changelog b/debian/changelog index ce1e3814..24830908 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.83) unstable; urgency=low + + * Generate symlinks in build stage of debian/rules. cvs cannot create them + properly. Note that version 0.80 and 0.81 could not build some packages + because of missing symlinks. + + -- Joey Hess Tue, 31 Mar 1998 19:27:29 -0800 + debhelper (0.81) unstable; urgency=low * dh_movefiles: empty $tomove (#20495). diff --git a/examples/rules b/examples/rules index 7fbd9d99..631e5cb7 100755 --- a/examples/rules +++ b/examples/rules @@ -16,28 +16,36 @@ build-stamp: clean: dh_testdir dh_testroot - rm -f build-stamp + rm -f build-stamp install-stamp # Add here commands to clean up after the build process. + #-$(MAKE) clean #-$(MAKE) distclean dh_clean +install: install-stamp +install-stamp: build + dh_testdir + dh_testroot + dh_clean + + # Add here commands to install the package into debian/tmp. + #$(MAKE) prefix=`pwd`/debian/tmp/usr install + + touch install-stamp + # Build architecture-independent files here. -binary-indep: build +binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. -binary-arch: build +binary-arch: build install # dh_testversion dh_testdir dh_testroot dh_clean -k dh_installdirs - - # Add here commands to install the files into debian/tmp - #$(MAKE) prefix=`pwd`/debian/tmp install - dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.indep b/examples/rules.indep index 7ba839ad..08ce4b62 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -17,24 +17,32 @@ build-stamp: clean: dh_testdir dh_testroot - rm -f build-stamp + rm -f build-stamp install-stamp # Add here commands to clean up after the build process. + #-$(MAKE) clean #-$(MAKE) distclean dh_clean +install: install-stamp +install-stamp: build + dh_testdir + dh_testroot + dh_clean + + # Add here commands to install the package into debian/tmp. + #$(MAKE) prefix=`pwd`/debian/tmp/usr install + + touch install-stamp + # Build architecture-independent files here. -binary-indep: build +binary-indep: build install # dh_testversion dh_testdir dh_testroot dh_clean -k dh_installdirs - - # Add here commands to install the files into debian/tmp - #$(MAKE) prefix=`pwd`/debian/tmp install - dh_installdocs dh_installexamples dh_installmenu @@ -52,7 +60,7 @@ binary-indep: build dh_builddeb # Build architecture-dependent files here. -binary-arch: build +binary-arch: build install # We have nothing to do by default. source diff: diff --git a/examples/rules.multi b/examples/rules.multi index 33a1a4ac..92e2e830 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -19,24 +19,32 @@ build-stamp: clean: dh_testdir dh_testroot - rm -f build-stamp + rm -f build-stamp install-stamp # Add here commands to clean up after the build process. + #-$(MAKE) clean #-$(MAKE) distclean dh_clean +install: install-stamp +install-stamp: build + dh_testdir + dh_testroot + dh_clean + + # Add here commands to install the package into debian/tmp. + #$(MAKE) prefix=`pwd`/debian/tmp/usr install + + touch install-stamp + # Build architecture-independent files here. -binary-indep: build +binary-indep: build install # dh_testversion dh_testdir -i dh_testroot -i dh_clean -i -k dh_installdirs -i - - # Add here commands to install the files into debian/tmp - #$(MAKE) prefix=`pwd`/debian/tmp install - dh_movefiles -i dh_installdocs -i dh_installexamples -i @@ -55,16 +63,12 @@ binary-indep: build dh_builddeb -i # Build architecture-dependent files here. -binary-arch: build +binary-arch: build install # dh_testversion dh_testdir -a dh_testroot -a dh_clean -a -k dh_installdirs -a - - # Add here commands to install the files into debian/tmp - #$(MAKE) prefix=`pwd`/debian/tmp install - dh_movefiles -a dh_installdocs -a dh_installexamples -a -- cgit v1.2.3 From 4a6b98a0f93fd348a316bb00d1c168be99db4a2e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:50:51 +0000 Subject: r81: Initial Import --- debian/changelog | 7 +++++++ examples/rules | 5 ++--- examples/rules.multi | 7 ++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 24830908..0ddba87b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.84) unstable; urgency=low + + * Applied Che_Fox'x patches to example rules files, which makes them use + an install target internally to move things into place in debian/tmp. + + -- Joey Hess Thu, 9 Apr 1998 12:08:45 -0700 + debhelper (0.83) unstable; urgency=low * Generate symlinks in build stage of debian/rules. cvs cannot create them diff --git a/examples/rules b/examples/rules index 631e5cb7..7f339dc9 100755 --- a/examples/rules +++ b/examples/rules @@ -28,7 +28,8 @@ install: install-stamp install-stamp: build dh_testdir dh_testroot - dh_clean + dh_clean -k + dh_installdirs # Add here commands to install the package into debian/tmp. #$(MAKE) prefix=`pwd`/debian/tmp/usr install @@ -44,8 +45,6 @@ binary-arch: build install # dh_testversion dh_testdir dh_testroot - dh_clean -k - dh_installdirs dh_installdocs dh_installexamples dh_installmenu diff --git a/examples/rules.multi b/examples/rules.multi index 92e2e830..32eeddfe 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -31,7 +31,8 @@ install: install-stamp install-stamp: build dh_testdir dh_testroot - dh_clean + dh_clean -k + dh_installdirs # Add here commands to install the package into debian/tmp. #$(MAKE) prefix=`pwd`/debian/tmp/usr install @@ -43,8 +44,6 @@ binary-indep: build install # dh_testversion dh_testdir -i dh_testroot -i - dh_clean -i -k - dh_installdirs -i dh_movefiles -i dh_installdocs -i dh_installexamples -i @@ -67,8 +66,6 @@ binary-arch: build install # dh_testversion dh_testdir -a dh_testroot -a - dh_clean -a -k - dh_installdirs -a dh_movefiles -a dh_installdocs -a dh_installexamples -a -- cgit v1.2.3 From 97f0356f8695f1830d2b3073187971b2ee3e7b21 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:50:57 +0000 Subject: r82: Initial Import --- debian/changelog | 13 +++++++++++++ debian/control | 2 +- dh_compress | 4 ++-- examples/rules.indep | 5 ++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ddba87b..0103f06e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (0.85) unstable; urgency=low + + * Moved a few things around that were broken by Che's patch: + - dh_installdirs should go in install target. + - dh_clean should not run in binary targets. + * This is just a quick fix to make it work, I'm not happy with it. I'm + going to discuss my problems with it with Che, and either make a new + version fixing them, or revert to 0.83. + * So be warned that the example rules files are not currently in good + shape if you're starting a new package. + + -- Joey Hess Sat, 18 Apr 1998 23:30:38 -0700 + debhelper (0.84) unstable; urgency=low * Applied Che_Fox'x patches to example rules files, which makes them use diff --git a/debian/control b/debian/control index d35fa0ae..4ec15b01 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.0.0 +Standards-Version: 2.4.1.0 Package: debhelper Architecture: all diff --git a/dh_compress b/dh_compress index 5af172c8..27f931f5 100755 --- a/dh_compress +++ b/dh_compress @@ -22,9 +22,9 @@ for PACKAGE in $DH_DOPACKAGES; do else # By default fall back on what the policy manual says to compress. files=` - find usr/info usr/man usr/X11*/man -type f 2>/dev/null ; + find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null ; find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ - ! -name "*.htm*" ! -name "*.gif" \ + ! -name "*.htm*" ! -name "*.gif" ! -name "*.gz" \ ! -name "copyright" 2>/dev/null ; true ` diff --git a/examples/rules.indep b/examples/rules.indep index 08ce4b62..d0cce466 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -29,7 +29,8 @@ install: install-stamp install-stamp: build dh_testdir dh_testroot - dh_clean + dh_clean -k + dh_installdirs # Add here commands to install the package into debian/tmp. #$(MAKE) prefix=`pwd`/debian/tmp/usr install @@ -41,8 +42,6 @@ binary-indep: build install # dh_testversion dh_testdir dh_testroot - dh_clean -k - dh_installdirs dh_installdocs dh_installexamples dh_installmenu -- cgit v1.2.3 From e2e6c1aa15de906802f95e2b8a6e8b702e4a026b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:51:01 +0000 Subject: r83: Initial Import --- debian/changelog | 7 +++++++ dh_strip | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0103f06e..148c6ea4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.86) unstable; urgency=low + + * dh_compress: don't try to re-compress *.gz files. Eliminates warning + messages in some cases, shouldn't actually change the result at all. + + -- Joey Hess Mon, 27 Apr 1998 15:21:33 -0700 + debhelper (0.85) unstable; urgency=low * Moved a few things around that were broken by Che's patch: diff --git a/dh_strip b/dh_strip index 57725d70..daea754c 100755 --- a/dh_strip +++ b/dh_strip @@ -15,7 +15,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "strip --strip-unneeded $file" ;; *ELF*executable*) - doit "strip --remove-section=comment --remove-section=note $file" + doit "strip --remove-section=.comment --remove-section=.note $file" ;; esac done -- 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(-) 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 30dd5e818aa3d41683f3d20815ed0ad41ca1f469 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:23 +0000 Subject: r87: Initial Import --- debian/changelog | 35 ++++++++++++++++++++++++++++++++++- debian/control | 2 +- dh_compress.1 | 4 ++-- dh_fixperms.1 | 7 ++++++- dh_installdirs | 7 +++++-- dh_installdocs | 30 +++++++++++++++--------------- dh_installdocs.1 | 5 +++-- dh_installinit.1 | 5 +++-- dh_makeshlibs.1 | 2 +- 9 files changed, 70 insertions(+), 27 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0b443a16..7eb8f5d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,36 @@ +debhelper (0.90) unstable; urgency=low + + * I'd like to thank Len Pikulski and Igor Grobman at nothinbut.net for + providing me with free internet access on a moment's notice, so I could + get this package to you after hacking on it all over New England for the + past week. Thanks, guys! + . + * Added dh_debstd, which mimics the functionality of the debstd command. + It's not a complete nor an exact copy, and it's not so much intended to + be used in a debian/rules file, as it is to be run by hand when you are + converting a package from debstd to debhelper. "dh_debstd -v" will + output the sequence of debhelper commands that approximate what debstd + would do in the same situation. + * dh_debstd is completly untested, I don't have the source to any packages + that use debstd available. Once this is tested, I plan to release + debhelper 1.0! + * Added a from-debstd document that gives a recipe to convert from debstd + to debhelper. + * dh_fixperms: can now use -X to exclude files from having their + permissions changed. + * dh_testroot: test for uid == 0, instead of username == root, becuase + some people enjoy changing root's name. + * dh_installinit: handle debian/init.d as well as debian/init files, + for backwards compatability with debstd. Unlike with debstd, the two + files are treated identically. + * dh_lib, PROGRAMMING: added "warning" function. + * Minor man page fixes. + * dh_compress: don't bomb out if usr/doc/ is empty. (#23054) + * dh_compress, dh_installdirs: always cd into $TMP and back out, even if + --no-act is on. (#23054) + + -- Joey Hess Mon, 1 Jun 1998 21:57:45 -0400 + debhelper (0.88) unstable; urgency=low * I had many hours on a train to hack on debhelper... enjoy! @@ -66,7 +99,7 @@ debhelper (0.80) unstable; urgency=low Thanks to Bdale Garbee and Adam Heath for help on the implementation. * dh_installchangelogs: use debian/package.changelog files if they exist - rather than debian.changelog. It appears some people do need per-package + rather than debian/changelog. It appears some people do need per-package changelogs. * dh_gencontrol: if debian/package.changelogs files exist, use them. * Above 2 changes close #20442. diff --git a/debian/control b/debian/control index 4ec15b01..4d25b670 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.0 +Standards-Version: 2.4.1.1 Package: debhelper Architecture: all diff --git a/dh_compress.1 b/dh_compress.1 index 4f2d2d0a..c78291ee 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[-v] [-a] [-i] [-X] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks @@ -50,7 +50,7 @@ Compress files for the package named "package". .B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. .TP -.B \-X=item, \--exclude=item +.B \-Xitem, \--exclude=item Exclude files that contain "item" anywhere in their filename from being compressed. For example, -X=.jpeg will exclude jpeg's from compression. You may use this option multiple times to build up a list of things to diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 913a8c76..19f89d11 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -3,7 +3,7 @@ dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS .B dh_fixperms -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -33,6 +33,11 @@ Fix permissions for the package named "package". .TP .B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. +.TP +.B \-Xitem, \--exclude=item +Exclude files that contain "item" anywhere in their filename from having +their permissions changed. You may use this option multiple times to build +up a list of things to exclude. .SH NOTES The .B \-a diff --git a/dh_installdirs b/dh_installdirs index e733e7ce..725cdb2c 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -33,8 +33,11 @@ for PACKAGE in $DH_DOPACKAGES; do done # Create dirs. olddir=`pwd` - doit "cd $TMP" + verbose_echo "cd $TMP" + cd "$TMP" doit "install -d $dirs" - doit "cd $olddir" + verbose_echo "cd $olddir" + cd "$olddir" fi done + diff --git a/dh_installdocs b/dh_installdocs index 1b3a95cb..fcdedc50 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -29,21 +29,21 @@ for PACKAGE in $DH_DOPACKAGES; do doit "cp -a $docs $TMP/usr/doc/$PACKAGE/" fi - # Install these files only into the main package by default. - if [ "$PACKAGE" = "$MAINPACKAGE" ]; then - if [ -f debian/README.debian ]; then - # .Debian is correct according to policy. - doit "install -m 644 -p debian/README.debian $TMP/usr/doc/$PACKAGE/README.Debian" - fi - if [ -f debian/README.Debian ]; then - doit "install -m 644 -p debian/README.Debian $TMP/usr/doc/$PACKAGE/" - fi - if [ -f debian/TODO ]; 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" - fi + # .Debian is correct, according to policy. + readme_debian=`pkgfile $PACKAGE README.Debian` + if [ -z "$readme_debian" ]; then + readme_debian=`pkgfile $PACKAGE README.debian` + fi + if [ "$readme_debian" ]; then + doit "install -m 644 -p $readme_debian $TMP/usr/doc/$PACKAGE/README.Debian" + fi + + todo=`pkgfile $PACKAGE TODO` + if [ "$todo" ]; then + if isnative; then + doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" + else + doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" fi fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 95d9df5a..98737606 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -19,12 +19,13 @@ 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 -Also, debian/README.Debian (or debian/README.debian) and debian/TODO, if +Also, debian/README.Debian (or debian/README.debian) and debian/TODO, if they exist, will be installed into the first binary package listed in 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. Also note that README.debian is installed as -README.Debian, for consitency. +README.Debian, for consitency. Note that debian/package.README.Debian and +debian/package.TODO can be used to specify files for subpackages. .P 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. diff --git a/dh_installinit.1 b/dh_installinit.1 index 156867e5..99222bc4 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -12,7 +12,8 @@ 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/package.init exists, then it is installed into +If a file named debian/package.init (or debian/package.init.d for backwards +compatability with debstd) 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.) @@ -46,7 +47,7 @@ Do not restart daemon on upgrade. .B \-d, \--remove-d Remove trailing "d" from the name of the package, and use the result for the filename the init script is installed as in etc/init.d/ . This may be useful -for daemons with named ending in "d". (Note: this takes precidence over +for daemons with names ending in "d". (Note: this takes precidence over the --init-script parameter described below.) .TP .B \-uparams, \--update-rcd-params=params diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index c39eb04c..bad72c4e 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -3,7 +3,7 @@ dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-mmajor] [-V[dependancies]]" +.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-V[dependancies]]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. -- cgit v1.2.3 From cb28f8dde1996b1479a55ebda0e5259f044a31c0 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:28 +0000 Subject: r88: Initial Import --- debian/changelog | 6 ++++++ debian/control | 2 +- dh_gencontrol | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7eb8f5d7..32add7bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.91) unstable; urgency=low + + * dh_installdocs: support debian/.{README.Debian,TODO} + + -- Joey Hess Wed, 17 Jun 1998 19:09:35 -0700 + debhelper (0.90) unstable; urgency=low * I'd like to thank Len Pikulski and Igor Grobman at nothinbut.net for diff --git a/debian/control b/debian/control index 4d25b670..393d22b8 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.1 +Standards-Version: 2.4.1.2 Package: debhelper Architecture: all diff --git a/dh_gencontrol b/dh_gencontrol index 2babfec0..c3698b56 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -19,7 +19,7 @@ for PACKAGE in $DH_DOPACKAGES; do fi # Generate and install control file. - doit "dpkg-gencontrol -l$changelog -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit "dpkg-gencontrol -l$changelog -isp -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" # This chmod is only necessary if the user sets the umask to something odd. doit "chmod 644 $TMP/DEBIAN/control" doit "chown root.root $TMP/DEBIAN/control" -- cgit v1.2.3 From 816f0bd5020040ee14c9c21c3e21269204f19ac3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:40 +0000 Subject: r89: Initial Import --- debian/changelog | 9 +++++++++ debian/control | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 32add7bd..123204f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.92) unstable; urgency=low + + * dh_gencontrol: pass -isp to dpkg-gencontrol to make it include section + and priority info in the .deb file. Back in Jan 1998, this came up, and + a consensus was reached on debian-devel that it was a good thing for + -isp to be used. + + -- Joey Hess Fri, 19 Jun 1998 16:15:24 -0700 + debhelper (0.91) unstable; urgency=low * dh_installdocs: support debian/.{README.Debian,TODO} diff --git a/debian/control b/debian/control index 393d22b8..c4dccd95 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 2.4.1.2 Package: debhelper Architecture: all -Depends: perl (>= 5.004), fileutils (>= 3.16-4) +Depends: perl (>= 5.004), fileutils (>= 3.16-4), file Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to automate common tasks. Programs are included to install various files into -- cgit v1.2.3 From c23376be4411c256f140eda7ca2587bb77704683 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:44 +0000 Subject: r90: Initial Import --- debian/changelog | 6 ++++++ dh_md5sums | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 123204f8..e37b9d76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.93) unstable; urgency=low + + * Depend on file, since several dh_*'s use it. + + -- Joey Hess Fri, 19 Jun 1998 21:43:51 -0700 + debhelper (0.92) unstable; urgency=low * dh_gencontrol: pass -isp to dpkg-gencontrol to make it include section diff --git a/dh_md5sums b/dh_md5sums index 40cb7ab8..9c47a90b 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -13,15 +13,15 @@ for PACKAGE in $DH_DOPACKAGES; do doit "install -d $TMP/DEBIAN" fi - complex_doit "find $TMP/* -type f ! -regex '^$TMP/DEBIAN/.*' | sed s:$TMP:: | sort > $TMP/DEBIAN/allfiles" # Check if we should exclude conffiles. if [ ! "$DH_INCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then - complex_doit "sort $TMP/DEBIAN/conffiles | comm -13 - $TMP/DEBIAN/allfiles > $TMP/DEBIAN/allfiles.new" - doit "mv $TMP/DEBIAN/allfiles.new $TMP/DEBIAN/allfiles" + # Generate exclude regexp. Using perl here may be overkill, + # but it does insure conffiles with spaces in them work. + exclude=`perl -ne 'chomp; s/^\///; print "! -path \"$_\" "' $TMP/DEBIAN/conffiles` fi + olddir=`pwd` - complex_doit "cd $TMP ; sed 's:^/::' < DEBIAN/allfiles | xargs md5sum > DEBIAN/md5sums ; cd $olddir" + complex_doit "cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir" doit "chmod 644 $TMP/DEBIAN/md5sums" doit "chown root.root $TMP/DEBIAN/md5sums" - doit "rm -f $TMP/DEBIAN/allfiles" done -- cgit v1.2.3 From 45c35fdc6dc8a330bae1806f5e8b826fcc9d7e3f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:52 +0000 Subject: r91: Initial Import --- debian/changelog | 9 +++++++++ dh_movefiles | 17 ++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index e37b9d76..05337cf1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (0.94) unstable; urgency=low + + * dh_md5sums: fixed so it handles spaces and other odd characters in + filenames correctly. (#23046, #23700, #22010) + * As a side effect, got rid of the nasty temporary file dh_md5sums used + before. + + -- Joey Hess Mon, 22 Jun 1998 16:14:42 -0700 + debhelper (0.93) unstable; urgency=low * Depend on file, since several dh_*'s use it. diff --git a/dh_movefiles b/dh_movefiles index 964d4068..8a365623 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -33,13 +33,16 @@ for PACKAGE in $DH_DOPACKAGES; do # won't work properly.) tomove="" for i in `(cd debian/tmp ; echo \`cat $files\`)`; do - tomove="`(cd debian/tmp ; \ - find $i ! -type d -and ! -type l -print)` \ - $tomove \ - `(cd debian/tmp ; \ - find $i ! -type d -and -type l -print)`" +tomove="`(cd debian/tmp ;\ +find $i ! -type d -and ! -type l -print)`\ +$tomove\ +`(cd debian/tmp ;\ +find $i ! -type d -and -type l -print)`" done - - complex_doit "(cd debian/tmp;tar --create --remove-files --file - "$tomove") | (cd $TMP;tar xpf -)" + + # Use a filelist, so very weird filenames can be moved. + complex_doit "echo '$tomove' > movelist" + complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)" + doit "rm -f movelist" fi done -- cgit v1.2.3 From 75c3ea7d270b1c29dcb78fcd56d75140aff76672 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:52:56 +0000 Subject: r92: Initial Import --- debian/changelog | 7 +++++++ debian/rules | 2 +- dh_movefiles | 22 ++++++++++------------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 05337cf1..b2263d29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.95) unstable; urgency=low + + * dh_movefiles: move even very strangly named files. (#23775) Unfortunatly, + I had to use a temporary file. Oh well.. + + -- Joey Hess Mon, 22 Jun 1998 17:16:17 -0700 + debhelper (0.94) unstable; urgency=low * dh_md5sums: fixed so it handles spaces and other odd characters in diff --git a/debian/rules b/debian/rules index 44c77e07..b2ea0bd0 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 from-debstd + ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages diff --git a/dh_movefiles b/dh_movefiles index 8a365623..79dc0892 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -15,9 +15,9 @@ for PACKAGE in $DH_DOPACKAGES; do # debian/files has a different purpose, so ignore it. if [ "$files" -a "$files" != "debian/files" ]; then - if [ "$TMP" = "debian/tmp" ]; then - error "I was asked to move some files from debian/tmp to debian/tmp." - fi +# if [ "$TMP" = "debian/tmp" ]; then +# error "I was asked to move some files from debian/tmp to debian/tmp." +# fi if [ ! -d "$TMP" ]; then doit "install -d $TMP" @@ -31,17 +31,15 @@ for PACKAGE in $DH_DOPACKAGES; do # # (The echo is in here to expand wildcards. Note that 'ls' # won't work properly.) - tomove="" + # The filelist is used, so even very weird filenames can be + # moved. + doit "rm -f movelist" + for i in `(cd debian/tmp ; echo \`cat $files\`)`; do + complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print) >> movelist" + done for i in `(cd debian/tmp ; echo \`cat $files\`)`; do -tomove="`(cd debian/tmp ;\ -find $i ! -type d -and ! -type l -print)`\ -$tomove\ -`(cd debian/tmp ;\ -find $i ! -type d -and -type l -print)`" + complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print) >> movelist" done - - # Use a filelist, so very weird filenames can be moved. - complex_doit "echo '$tomove' > movelist" complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)" doit "rm -f movelist" fi -- cgit v1.2.3 From 8dd0b78a876be37d3be52d7dc2e7eecd957064bb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:53:01 +0000 Subject: r93: Initial Import --- debian/changelog | 8 ++++++++ dh_fixperms | 58 +++++++++++++++++++------------------------------------- dh_getopt.pl | 5 +++++ 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/debian/changelog b/debian/changelog index b2263d29..873cfa6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.96) unstable; urgency=low + + * dh_movefiles: fixed serious breakage introduced in the last version. + * dh_movefiles: really order all symlinks last. + * some minor reorganization of the source tree. + + -- Joey Hess Sun, 28 Jun 1998 21:53:45 -0700 + debhelper (0.95) unstable; urgency=low * dh_movefiles: move even very strangly named files. (#23775) Unfortunatly, diff --git a/dh_fixperms b/dh_fixperms index b30332a1..544ee9be 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -5,26 +5,11 @@ 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 permissions fixing. - if [ ! "$DH_EXCLUDE_GREP" ]; then + if [ ! "$DH_EXCLUDE_FIND" ]; 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 @@ -32,36 +17,33 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R go=rX $TMP" doit "chmod -R u+rw $TMP" fi + + FIND_OPTIONS= 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 + 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 # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - 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=`filelist_excluded \`find $TMP/usr/doc -type d 2>/dev/null\` | tr "\n" " "` - if [ "$files" ]; then - doit "chmod 755 $files" - fi + complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS -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.. - 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 + 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 libraries (and .la files from libtool) - 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 + complex_doit "find $TMP -perm -5 -type f \ + \( -name "*.so*" -or -name "*.la" \) $FIND_OPTIONS -print0 \ + 2>/dev/null | xargs -0r chmod a-X" done diff --git a/dh_getopt.pl b/dh_getopt.pl index b5cde776..b7a856c4 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -144,6 +144,10 @@ if ($ENV{DH_NO_ACT} ne undef) { $exclude=join ' ', @exclude; $exclude_grep=join '|', @exclude; +foreach (@exclude) { + $exclude_find.="-regex .*".quotemeta($_).".* -or "; +} +$exclude_find=~s/ -or $//; # Now output everything, in a format suitable for a shell to eval it. # Note the last line sets $@ in the shell to whatever arguements remain. @@ -157,6 +161,7 @@ DH_NOSCRIPTS='$noscripts' DH_INCLUDE_CONFFILES='$include' DH_EXCLUDE='$exclude' DH_EXCLUDE_GREP='$exclude_grep' +DH_EXCLUDE_FIND='$exclude_find' DH_D_FLAG='$d_flag' DH_R_FLAG='$r_flag' DH_K_FLAG='$k_flag' -- cgit v1.2.3 From 94daae34cb1be6ed6a4591604af22c5d43542475 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:53:30 +0000 Subject: r94: Initial Import --- debian/changelog | 14 ++++++++++++++ dh_lib | 7 ++++++- doc/PROGRAMMING | 2 ++ doc/from-debstd | 8 ++++---- examples/rules | 2 +- examples/rules.indep | 2 +- examples/rules.multi | 2 +- 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 873cfa6e..180a6423 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (0.97) unstable; urgency=low + + * doc/from-debstd: fixed a typo. + * examples/*: install-stamp no longer depends on phony build targey; now + install-stamp depends on build-stamp instead (#24234). + * dh_fixperms: applied patch from Herbert Xu + to fix bad uses of the find command, so it should now work on packages + with files with spaces in them (#22005). It's also much cleaner. Thanks, + Herbert! + * dh_getopt.pl, doc/PROGRAMMING: added DH_EXCLUDE_FIND, to make the above + fix work. + + -- Joey Hess Sun, 5 Jul 1998 18:09:25 -0700 + debhelper (0.96) unstable; urgency=low * dh_movefiles: fixed serious breakage introduced in the last version. diff --git a/dh_lib b/dh_lib index 9e826499..7ebc8be1 100644 --- a/dh_lib +++ b/dh_lib @@ -82,13 +82,18 @@ pkgext() { # Caches return code so it only needs to run dpkg-parsechangelog once. isnative() { if [ -z "$DH_ISNATIVE" ]; then + # Make sure we look at the correct changelog. + isnative_changelog=`pkgfile $PACKAGE changelog` + if [ ! "$isnative_changelog" ]; then + isnative_changelog=debian/changelog + fi # 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=`expr "\`dpkg-parsechangelog -l$isnative_changelog 2>/dev/null\`" : \ '.*Version: \(.*\).*Distribution:'` # Is this a native Debian package? if expr "$VERSION" : '.*-' >/dev/null; then diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 7dc0c638..faaa9360 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -81,6 +81,8 @@ switch variable description DH_EXCLUDE_GREP same as DH_EXCLUDE, except all items are separated by '|' characters, instead of spaces, handy for egrep -v + DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are + separated by " -or " -x DH_INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. diff --git a/doc/from-debstd b/doc/from-debstd index 31fd0cdd..50bf4ffb 100644 --- a/doc/from-debstd +++ b/doc/from-debstd @@ -20,10 +20,10 @@ your package you are converting, run: dh_debstd CHANGES TODO README --verbose --no-act -Notice the parallel to the debstd command above, I just added "--verbose --act" -to the end. This will make dh_debstd output a list of commands that it thinks -will emulate what debstd would have done, without actually doing anything to -your package. The list will look similar to this: +Notice the parallel to the debstd command above, I just added +"--verbose --noact" to the end. This will make dh_debstd output a list of +commands that it thinks will emulate what debstd would have done, without +actually doing anything to your package. The list will look similar to this: dh_installdirs dh_installdocs TODO README diff --git a/examples/rules b/examples/rules index 7f339dc9..e3e6c3b5 100755 --- a/examples/rules +++ b/examples/rules @@ -25,7 +25,7 @@ clean: dh_clean install: install-stamp -install-stamp: build +install-stamp: build-stamp dh_testdir dh_testroot dh_clean -k diff --git a/examples/rules.indep b/examples/rules.indep index d0cce466..bb2e00ba 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -26,7 +26,7 @@ clean: dh_clean install: install-stamp -install-stamp: build +install-stamp: build-stamp dh_testdir dh_testroot dh_clean -k diff --git a/examples/rules.multi b/examples/rules.multi index 32eeddfe..42e4052a 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -28,7 +28,7 @@ clean: dh_clean install: install-stamp -install-stamp: build +install-stamp: build-stamp dh_testdir dh_testroot dh_clean -k -- cgit v1.2.3 From 168cfd101a2d522c0c7cbe06480f50e133ef1d40 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:53:44 +0000 Subject: r95: Initial Import --- debian/changelog | 8 ++++++++ dh_compress | 4 ++-- doc/PROGRAMMING | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 180a6423..cca97b6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.98) unstable; urgency=low + + * dh_lib: isnative: pass -l to dpkg-parsechangelog, to support + odd packages with multiple different debian changelogs. + * doc/PROGRAMMING: cleaned up the docs on DH_EXCLUDE_FIND. + + -- Joey Hess Mon, 6 Jul 1998 12:45:13 -0700 + debhelper (0.97) unstable; urgency=low * doc/from-debstd: fixed a typo. diff --git a/dh_compress b/dh_compress index d24a561a..1b58f70a 100755 --- a/dh_compress +++ b/dh_compress @@ -28,8 +28,8 @@ filelist () { # Call only if DH_EXCLUDE_GREP is non-empty. filelist_excluded () { # Use grep -F so we don't have to worry about regexp's. - filelist | grep -v -F \ - "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`" + (filelist | grep -v -F \ + "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`") || true } for PACKAGE in $DH_DOPACKAGES; do diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index faaa9360..402d5e78 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -81,8 +81,10 @@ switch variable description DH_EXCLUDE_GREP same as DH_EXCLUDE, except all items are separated by '|' characters, instead of spaces, handy for egrep -v - DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are - separated by " -or " + DH_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) -x DH_INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. -- cgit v1.2.3 From ec9c322d9ebb93d4978c7b80741a86afc18a5cf8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:53:55 +0000 Subject: r96: Initial Import --- debian/changelog | 12 ++++++++++++ dh_installcron | 2 +- dh_installcron.1 | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index cca97b6f..88d8c7f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (0.99) unstable; urgency=low + + * !!!! WARNING: Debhelper (specifically dh_compress) is broken with + !!!! libtricks. Use fakeroot instead until this is fixed. + * dh_compress: applied patch from Herbert Xu + to make it not fail if there are no candidates for compression (#24654). + * Removed a whole debhelper-0.96 tree that had crept into the source + package by accident. + * Is version 1.0 next? + + -- Joey Hess Thu, 16 Jul 1998 10:03:21 -0700 + debhelper (0.98) unstable; urgency=low * dh_lib: isnative: pass -l to dpkg-parsechangelog, to support diff --git a/dh_installcron b/dh_installcron index 9cd7cb5e..448e38a4 100755 --- a/dh_installcron +++ b/dh_installcron @@ -8,7 +8,7 @@ PATH=debian:$PATH:/usr/lib/debhelper for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - for type in daily weekly monthly; do + for type in daily weekly monthly d; do cron=`pkgfile $PACKAGE cron.$type` if [ "$cron" ]; then if [ ! -d $TMP/etc/cron.$type ]; then diff --git a/dh_installcron.1 b/dh_installcron.1 index 31f8d810..20bdc82f 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -7,8 +7,8 @@ dh_installcron \- install cron scripts into etc/cron.* .SH "DESCRIPTION" 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 (or if you +debian/cron.daily, debian/cron.weekly, debian/cron.monthly, and debian/cron.d +are 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. -- cgit v1.2.3 From 66086625c0e88fd7bda3600f13cb7b9502c2d502 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:54:19 +0000 Subject: r97: Initial Import --- debian/changelog | 6 ++++++ dh_movefiles | 25 +++++++++++++++++-------- dh_movefiles.1 | 12 ++++++++++-- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 88d8c7f8..136bf0f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (0.99.1) unstable; urgency=low + + * dh_installcron: now supports /etc/cron.d (#25112). + + -- Joey Hess Mon, 27 Jul 1998 20:18:47 -0700 + debhelper (0.99) unstable; urgency=low * !!!! WARNING: Debhelper (specifically dh_compress) is broken with diff --git a/dh_movefiles b/dh_movefiles index 79dc0892..c2aa9e02 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -13,18 +13,27 @@ for PACKAGE in $DH_DOPACKAGES; do error "debian/tmp does not exist" fi - # debian/files has a different purpose, so ignore it. + tomove="" + + # debian/files has a different purpose, so ignore it. if [ "$files" -a "$files" != "debian/files" ]; then -# if [ "$TMP" = "debian/tmp" ]; then -# error "I was asked to move some files from debian/tmp to debian/tmp." -# fi + tomove=`cat $files` + fi + + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then + tomove="$* $tomove" + fi + if [ "$tomove" -a "$PACKAGE" = "$MAINPACKAGE" ]; then + error "I was asked to move files from debian/tmp to debian/tmp." + fi + + if [ "$tomove" ]; then if [ ! -d "$TMP" ]; then doit "install -d $TMP" fi - files=`pwd`/$files - # 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. @@ -34,10 +43,10 @@ for PACKAGE in $DH_DOPACKAGES; do # The filelist is used, so even very weird filenames can be # moved. doit "rm -f movelist" - for i in `(cd debian/tmp ; echo \`cat $files\`)`; do + for i in `(cd debian/tmp; echo $tomove)`; do complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print) >> movelist" done - for i in `(cd debian/tmp ; echo \`cat $files\`)`; do + for i in `(cd debian/tmp; echo $tomove)`; do complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print) >> movelist" done complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)" diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 4243758f..b36d3dd5 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -3,7 +3,7 @@ dh_movefiles \- moves files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [file ..]" .SH "DESCRIPTION" dh_movefiles is a debhelper program that is responsible for moving files out of debian/tmp and into other package build directories. This may be useful @@ -13,7 +13,9 @@ you need to break that up into subpackages. Files named debian/package.files list the files to be moved, separated by whitespace. The filenames listed should be relative to debian/tmp/. You can also list directory names, and the whole directory will be moved. You can -even use wildcards if you like. +even use wildcards if you like. If you prefer, you can list the files to +move on the command line. However, this will only work if the first package +dh_movefiles is told to act on is a subpackage (ie, via -p). .P The files will be moved in a special order: first all normal files, then all symlinks. This is done becuase it tends to be a good thing to have symlinks @@ -38,6 +40,12 @@ Move files for the package named "package". .TP .B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. +.TP +.B file .. +Lists files to move. The filenames listed should be relative to debian/tmp/. +You can also list directory names, and the whole directory will be moved. You +can even use wildcards if you like. It is an error to list files here unless +you use -p, -i, or -a to tell dh_movefiles which subpackage to put them in. .SH NOTES The .B \-a -- cgit v1.2.3 From a3e7d077c9748a14bd01a632d0e02ef61bd2be6e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:54:26 +0000 Subject: r98: Initial Import --- debian/changelog | 7 +++++++ dh_movefiles.1 | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 136bf0f0..d0fe1b66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.99.2) unstable; urgency=low + + * dh_movefiles: allow passing of files to move on the command line. Only + rarely does this make sense. (#25197) + + -- Joey Hess Thu, 30 Jul 1998 10:38:34 -0700 + debhelper (0.99.1) unstable; urgency=low * dh_installcron: now supports /etc/cron.d (#25112). diff --git a/dh_movefiles.1 b/dh_movefiles.1 index b36d3dd5..1c27f968 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -14,8 +14,8 @@ Files named debian/package.files list the files to be moved, separated by whitespace. The filenames listed should be relative to debian/tmp/. You can also list directory names, and the whole directory will be moved. You can even use wildcards if you like. If you prefer, you can list the files to -move on the command line. However, this will only work if the first package -dh_movefiles is told to act on is a subpackage (ie, via -p). +move on the command line and this will apply to the first package +dh_movefiles is told to act on. .P The files will be moved in a special order: first all normal files, then all symlinks. This is done becuase it tends to be a good thing to have symlinks @@ -39,7 +39,7 @@ will output a list of what it would have done. Move files for the package named "package". .TP .B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +Use "tmpdir" for package build directory. .TP .B file .. Lists files to move. The filenames listed should be relative to debian/tmp/. -- cgit v1.2.3 From 4cc1c968c2cb84135de6c82084a2f775eea4dc3a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:54:35 +0000 Subject: r99: Initial Import --- debian/changelog | 7 +++++++ dh_debstd | 5 ++++- dh_movefiles | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d0fe1b66..f64479f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.99.3) unstable; urgency=low + + * dh_movefiles: Fixed a over-eager sanity check introduced in the last + version. + + -- Joey Hess Mon, 3 Aug 1998 18:31:45 -0700 + debhelper (0.99.2) unstable; urgency=low * dh_movefiles: allow passing of files to move on the command line. Only diff --git a/dh_debstd b/dh_debstd index 34ea0d46..6187fd31 100755 --- a/dh_debstd +++ b/dh_debstd @@ -196,7 +196,10 @@ for PACKAGE in $DH_DOPACKAGES; do for file in postinst postrm preinst prerm; do f="`pkgfile $PACKAGE $file`" if [ "$f" ]; then - filelist="$filelist$f " + if ! grep -q "#DEBHELPER#" "$f"; then + filelist="$filelist$f " + + fi fi done done diff --git a/dh_movefiles b/dh_movefiles index c2aa9e02..a5669bfc 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -25,7 +25,7 @@ for PACKAGE in $DH_DOPACKAGES; do tomove="$* $tomove" fi - if [ "$tomove" -a "$PACKAGE" = "$MAINPACKAGE" ]; then + if [ "$tomove" -a "$TMP" = "debian/tmp" ]; then error "I was asked to move files from debian/tmp to debian/tmp." fi -- cgit v1.2.3 From 3d432ab8bf1419af45112a17c893f0bb91daae73 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:54:35 +0000 Subject: r101: Initial Import --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index f64479f5..cf103bd8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (0.99.4) unstable; urgency=low + + * dh_debstd: only warn about scripts that actually lack #DEBHELPER#. + (#25514) + + -- Joey Hess Fri, 7 Aug 1998 12:06:28 -0700 + debhelper (0.99.3) unstable; urgency=low * dh_movefiles: Fixed a over-eager sanity check introduced in the last -- cgit v1.2.3 From aec37078c45ab2dc23bfb7bb9bde2c5d130d663f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:04 +0000 Subject: r102: Initial Import --- debian/changelog | 14 ++++++++++++++ dh_compress | 2 +- dh_fixperms | 6 +++--- dh_installdocs | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index cf103bd8..db56690c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.0) stable unstable; urgency=low + + * 1.0 at last! + + * This relelase is not really intended for stable. I throw a copy into + stable-updates because I want it to be available as an upgrade for + people using debian 2.0 (the current version in debian 2.0 has no + critical bugs, but this version is of course a lot nicer), and I plan + to start work on a new branch of debhelper that will fix many wishlist + bug reports, and of course introduce many new bugs, and which will go + into unstable only. + + -- Joey Hess Sat, 8 Aug 1998 17:33:20 -0700 + debhelper (0.99.4) unstable; urgency=low * dh_debstd: only warn about scripts that actually lack #DEBHELPER#. diff --git a/dh_compress b/dh_compress index 1b58f70a..7d6e4979 100755 --- a/dh_compress +++ b/dh_compress @@ -13,7 +13,7 @@ filelist () { if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - sh $olddir/$compress 2>/dev/null + sh $olddir/$compress 2>/dev/null || true 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 || true diff --git a/dh_fixperms b/dh_fixperms index 544ee9be..0e845335 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -18,7 +18,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R u+rw $TMP" fi - FIND_OPTIONS= + FIND_OPTIONS="" else # Do it the hard way. complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ @@ -33,8 +33,8 @@ for PACKAGE in $DH_DOPACKAGES; do # 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 -print0 \ - 2>/dev/null | xargs -0r chmod 644" + 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" diff --git a/dh_installdocs b/dh_installdocs index fcdedc50..7a11b7f7 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -41,7 +41,7 @@ for PACKAGE in $DH_DOPACKAGES; do todo=`pkgfile $PACKAGE TODO` if [ "$todo" ]; then if isnative; then - doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" + doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO" else doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" fi -- cgit v1.2.3 From e348bcc96f206a25afc2ad1d4f004c74b7f8ab37 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:24 +0000 Subject: r104: Initial Import --- Dh_Getopt.pm | 148 ++++++++++++++++++++++++++ Dh_Lib.pm | 248 +++++++++++++++++++++++++++++++++++++++++++ autoscripts/postinst-emacsen | 1 + autoscripts/prerm-emacsen | 1 + debhelper.1 | 104 ++++++++++++++++++ debian/changelog | 14 +++ debian/control | 6 +- debian/cron.d | 0 debian/cron.daily | 0 debian/docs | 1 + debian/menu | 0 dh_builddeb.1 | 45 ++------ dh_clean.1 | 45 ++------ dh_compress | 2 +- dh_compress.1 | 45 ++------ dh_debstd.1 | 13 ++- dh_du.1 | 4 +- dh_fixperms | 6 +- dh_fixperms.1 | 45 ++------ dh_gencontrol.1 | 51 +++------ dh_getopt.pl | 22 +++- dh_installchangelogs.1 | 45 ++------ dh_installcron.1 | 47 ++------ dh_installdeb.1 | 45 ++------ dh_installdebfiles.1 | 8 +- dh_installdirs.1 | 49 +++------ dh_installdocs | 2 +- dh_installdocs.1 | 45 ++------ dh_installemacsen | 34 ++++++ dh_installemacsen.1 | 42 ++++++++ dh_installexamples.1 | 45 ++------ dh_installinit.1 | 45 ++------ dh_installmanpages.1 | 45 ++------ dh_installmenu.1 | 46 ++------ dh_makeshlibs.1 | 47 ++------ dh_md5sums.1 | 45 ++------ dh_movefiles.1 | 45 ++------ dh_shlibdeps.1 | 50 +++------ dh_strip.1 | 46 ++------ dh_suidregister.1 | 48 +++------ dh_testdir.1 | 19 ++-- dh_testroot.1 | 19 ++-- dh_testversion | 24 +++++ dh_testversion.1 | 29 ++--- dh_undocumented.1 | 45 ++------ doc/README | 64 +---------- doc/TODO | 63 ++++++++--- 47 files changed, 976 insertions(+), 867 deletions(-) create mode 100644 Dh_Getopt.pm create mode 100644 Dh_Lib.pm create mode 100644 autoscripts/postinst-emacsen create mode 100644 autoscripts/prerm-emacsen create mode 100644 debhelper.1 create mode 100644 debian/cron.d create mode 100644 debian/cron.daily create mode 100644 debian/docs create mode 100644 debian/menu create mode 100755 dh_installemacsen create mode 100644 dh_installemacsen.1 create mode 100755 dh_testversion diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm new file mode 100644 index 00000000..eb6aef98 --- /dev/null +++ b/Dh_Getopt.pm @@ -0,0 +1,148 @@ +#!/usr/bin/perl -w +# +# Debhelper option processing library. +# +# Joey Hess GPL copyright 1998. + +package Dh_Getopt; +use strict; + +use Exporter; +my @ISA=qw(Exporter); +my @EXPORT=qw(&parseopts); + +use Dh_Lib; +use Getopt::Long; + +my (%options, %exclude_package); + +# Passed an option name and an option value, adds packages to the list +# of packages. We need this so the list will be built up in the right +# order. +sub AddPackage { my($option,$value)=@_; + if ($option eq 'i' or $option eq 'indep') { + push @{$options{DOPACKAGES}}, GetPackages('indep'); + $options{DOINDEP}=1; + } + elsif ($option eq 'a' or $option eq 'arch') { + push @{$options{DOPACKAGES}}, GetPackages('arch'); + $options{DOARCH}=1; + } + elsif ($option eq 'p' or $option eq 'package') { + push @{$options{DOPACKAGES}}, $value; + } + else { + error("bad option $option - should never happen!\n"); + } +} + +# Add a package to a list of packages that should not be acted on. +sub ExcludePackage { my($option,$value)=@_; + $exclude_package{$value}=1; +} + +# Add another item to the exclude list. +sub AddExclude { my($option,$value)=@_; + push @{$options{EXCLUDE}},$value; +} + +sub import { + # Enable bundling of short command line options. + Getopt::Long::config("bundling"); +} + +# Parse options and return a hash of the values. +sub parseopts { + undef %options; + + my $ret=GetOptions( + "v" => \$options{VERBOSE}, + "verbose" => \$options{VERBOSE}, + + "i" => \&AddPackage, + "indep" => \&AddPackage, + + "a" => \&AddPackage, + "arch" => \&AddPackage, + + "p=s" => \&AddPackage, + "package=s" => \&AddPackage, + + "N=s" => \&ExcludePackage, + "no-package=s" => \&ExcludePackage, + + "n" => \$options{NOSCRIPTS}, +# "noscripts" => \$options(NOSCRIPTS}, + + "x" => \$options{INCLUDE_CONFFILES}, # is -x for some unknown historical reason.. + "include-conffiles" => \$options{INCLUDE_CONFFILES}, + + "X=s" => \&AddExclude, + "exclude=s" => \&AddExclude, + + "d" => \$options{D_FLAG}, + "remove-d" => \$options{D_FLAG}, + + "r" => \$options{R_FLAG}, + "no-restart-on-upgrade" => \$options{R_FLAG}, + + "k" => \$options{K_FLAG}, + "keep" => \$options{K_FLAG}, + + "P=s" => \$options{TMPDIR}, + "tmpdir=s" => \$options{TMPDIR}, + + "u=s", => \$options{U_PARAMS}, + "update-rcd-params=s", => \$options{U_PARAMS}, + "dpkg-shlibdeps-params=s", => \$options{U_PARAMS}, + + "m=s", => \$options{M_PARAMS}, + "major=s" => \$options{M_PARAMS}, + + "V:s", => \$options{V_FLAG}, + "version-info:s" => \$options{V_FLAG}, + + "A" => \$options{PARAMS_ALL}, + "all" => \$options{PARAMS_ALL}, + + "no-act" => \$options{NO_ACT}, + + "init-script=s" => \$options{INIT_SCRIPT}, + ); + + if (!$ret) { + error("unknown option; aborting"); + } + + # Check to see if -V was specified. If so, but no parameters were + # passed, the variable will be defined but empty. + if (defined($options{V_FLAG})) { + $options{V_FLAG_SET}=1; + } + + # Check to see if DH_VERBOSE environment variable was set, if so, + # make sure verbose is on. + if ($ENV{DH_VERBOSE} ne undef) { + $options{VERBOSE}=1; + } + + # Check to see if DH_NO_ACT environment variable was set, if so, + # make sure no act mode is on. + if ($ENV{DH_NO_ACT} ne undef) { + $options{NO_ACT}=1; + } + + # Remove excluded packages from the list of packages to act on. + my @package_list; + my $package; + foreach $package (@{$options{DOPACKAGES}}) { + if (! $exclude_package{$package}) { + push @package_list, $package; + } + } + @{$options{DOPACKAGES}}=@package_list; + + return %options; +} + +1 diff --git a/Dh_Lib.pm b/Dh_Lib.pm new file mode 100644 index 00000000..c9b964c1 --- /dev/null +++ b/Dh_Lib.pm @@ -0,0 +1,248 @@ +#!/usr/bin/perl -w +# +# Library functions for debhelper programs, perl version. +# +# Joey Hess, GPL copyright 1997, 1998. + +package Dh_Lib; + +use Exporter; +use vars qw(%dh); +@ISA=qw(Exporter); +@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir + &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages + %dh); + +sub init { + # 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 Getopt::Long, + # which I'd prefer to avoid loading at all if possible. + my $parseopt=undef; + foreach $arg (@ARGV) { + if ($arg=~m/^-/) { + $parseopt=1; + last; + } + } + if ($parseopt) { + eval "use Dh_Getopt"; + error($!) if $@; + %dh=Dh_Getopt::parseopts(); + } + + # Get the name of the main binary package (first one listed in + # debian/control). + my @allpackages=GetPackages(); + $dh{MAINPACKAGE}=$allpackages[0]; + + # Check if packages to build have been specified, if not, fall back to + # the default, doing them all. + if (! @{$dh{DOPACKAGES}}) { + if ($dh{DH_DOINDEP} || $dh{DH_DOARCH}) { + error("I have no package to build."); + } + push @{$dh{DOPACKAGES}},@allpackages; + } + + # Check to see if -P was specified. If so, we can only act on a single + # package. + if ($dh{TMPDIR} || $#{$dh{DOPACKAGES}} > 0) { + error("-P was specified, but multiple packages would be acted on."); + } + + # 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 affect it. + $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; +} + +# 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 +# function. +# +# Note that this cannot handle complex commands, especially anything +# involving redirection. Use complex_doit instead. +sub doit { + verbose_print(join(" ",,@_)); + + if (! $dh{NO_ACT}) { + system(@_) == 0 + || error("command returned error code"); + + } +} + +# This is an identical command to doit, except the parameters passed to it +# can include complex shell stull like redirection and compound commands. +sub complex_doit { + error("complex_doit() not yet supported"); +} + +# Print something if the verbose flag is on. +sub verbose_print { my $message=shift; + if ($dh{VERBOSE}) { + print "\t$message\n"; + } +} + +# Output an error message and exit. +sub error { my $message=shift; + warning($message); + exit 1; +} + +# Output a warning. +sub warning { my $message=shift; + my $fn=$0; + $fn=~s:.*/(.*?):$1:; + print STDERR "$fn: $message\n"; +} + +# 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. +sub tmpdir { my $package=shift; + if ($dh{TMPDIR}) { + return $dh{TMPDIR}; + } + elsif ($package eq $dh{MAINPACKAGE}) { + return "debian/tmp"; + } + else { + return "debian/$package"; + } +} + +# 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, if the package is +# the main package, it will look for debian/foo, and if found, return that. +# Failing that, it will return nothing. +sub pkgfile { my $package=shift; my $filename=shift; + if (-e "debian/$package.$filename") { + return "debian/$package.$filename"; + } + elsif ($package eq $dh{MAINPACKAGE} && -e "debian/$filename") { + return "debian/$filename"; + } + return ""; +} + +# Pass it a name of a binary package, it returns the name to prefix to files +# in debian for this package. +sub pkgext { my $package=shift; + if ($package ne $MAINPACKAGE) { + return "$package."; + } + return ""; +} + +# Returns 1 if the package is a native debian package, null otherwise. +# As a side effect, sets $dh{VERSION} to the version of this package. +{ + # Caches return code so it only needs to run dpkg-parsechangelog once. + my $isnative_cache; + + sub isnative { my $package=shift; + if ($isnative_cache eq undef) { + # Make sure we look at the correct changelog. + my $isnative_changelog=pkgfile($package,"changelog"); + if (! $isnative_changelog) { + $isnative_changelog="debian/changelog"; + } + + # Get the package version. + my $version=`dpkg-parsechangelog -l$isnative_changelog`; + ($dh{VERSION})=$version=~s/[^|\n]Version: \(.*\)\n//m; + + # Is this a native Debian package? + if ($dh{VERSION}=~m/.*-/) { + $isnative_cache=1; + } + else { + $isnative_cache=0; + } + } + + return $isnative_cache; + } +} + +# Automatically add a shell script snippet to a debian script. +# Only works if the script has #DEBHELPER# in it. +# +# Parameters: +# 1: script to add to +# 2: filename of snippet +# 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ +sub autoscript { + error "autoscript() not yet implemented (lazy, lazy!)"; +# autoscript_script=$1 +# autoscript_filename=$2 +# autoscript_sed=$3 +# autoscript_debscript=debian/`pkgext $PACKAGE`$autoscript_script.debhelper +# +# if [ -e "$DH_AUTOSCRIPTDIR/$autoscript_filename" ]; then +# autoscript_filename="$DH_AUTOSCRIPTDIR/$autoscript_filename" +# else +# if [ -e "/usr/lib/debhelper/autoscripts/$autoscript_filename" ]; then +# autoscript_filename="/usr/lib/debhelper/autoscripts/$autoscript_filename" +# else +# error "/usr/lib/debhelper/autoscripts/$autoscript_filename does not exist" +# fi +# fi +# +# complex_doit "echo \"# Automatically added by `basename $0`\" >> $autoscript_debscript" +# complex_doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" +# complex_doit "echo '# End automatically added section' >> $autoscript_debscript" +} + +# Reads in the specified file, one word at a time, and returns an array of +# the result. +sub filearray { $file=shift; + my @ret; + open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); + while () { + push @ret,split(/\s/,$_); + } + close DH_ARRAY; + + return @ret; +} + +# Returns a list of packages in the control file. +# Must pass "arch" or "indep" to specify arch-dependant or -independant +# packages. If nothing is specified, returns all packages. +sub GetPackages { $type=shift; + my $package; + my $arch; + my @list; + open (CONTROL,") { + chomp; + s/\s+$//; + if (/^Package:\s+(.*)/) { + $package=$1; + } + if (/^Architecture:\s+(.*)/) { + $arch=$1; + } + if (!$_ or eof) { # end of stanza. + if ($package && + (($type eq 'indep' && $arch eq 'all') || + ($type eq 'arch' && $arch ne 'all') || + ! $type)) { + push @list, $package; + undef $package; + undef $arch; + } + } + } + close CONTROL; + + return @list; +} + +1 diff --git a/autoscripts/postinst-emacsen b/autoscripts/postinst-emacsen new file mode 100644 index 00000000..45f1deec --- /dev/null +++ b/autoscripts/postinst-emacsen @@ -0,0 +1 @@ +/usr/lib/emacsen-common/emacs-package-install #PACKAGE# diff --git a/autoscripts/prerm-emacsen b/autoscripts/prerm-emacsen new file mode 100644 index 00000000..d11dafab --- /dev/null +++ b/autoscripts/prerm-emacsen @@ -0,0 +1 @@ +/usr/lib/emacsen-common/emacs-package-remove #PACKAGE# diff --git a/debhelper.1 b/debhelper.1 new file mode 100644 index 00000000..f3296666 --- /dev/null +++ b/debhelper.1 @@ -0,0 +1,104 @@ +.TH DEBHELPER 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +debhelper \- overview of the debhelper commands +.SH SYNOPSIS +.B dh_* +.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]" +.SH "DESCRIPTION" +Debhelper is a collection of programs that can be used in debian/rules files +to automate common tasks related to building debian binary packages. All the +debhelper commands accept a set of options, and this man page is here to +document those options and to document debhelper as a whole. For additional +options, and documentation for each individual command, see the commands' own +man pages. +.SH "SHARED DEBHLPER OPTIONS" +.TP +.B \-v, \--verbose +Verbose mode: show all commands that modify the package build directory. +.TP +.B \--no-act +Do not really do anything. If used with -v, the result is that the command +will output a list of what it would have done. +.TP +.B \-a, \--arch +Act on all architecture dependent packages. +.TP +.B \-i, \--indep +Act on all architecture independent packages. +.TP +.B \-ppackage, \--package=package +Act on the package named "package". +.TP +.B \-Npackage, \--no-package=package +Do not act on the specified package even if an -a, -i, or -p option lists +the package as one that should be acted on. +.TP +.B \-Ptmpdir, \--tmpdir=tmpdir +Use "tmpdir" for package build directory. +.SH NOTES +.TP +.B Multiple binary package support +.RS +If your source package generates more than one binary package, debhelper +programs will default to acting on all binary packages when run. If your +source package happens to generate one architecture dependent package, and +another architecture independent package, this is not the correct behavior, +because you need to generate the architecture dependent packages in the +binary-arch debian/rules target, and the architecture independent packages +in the binary-indep debian/rules target. + +To facilitate this, as well as give you more control over which packages +are acted on by debhelper programs, all debhelper programs accept the +.B -a +, +.B -i +, and +.B -p +parameters. These parameters are cumulative. If none are given, +debhelper programs default to acting on all packages listed in the control +file. +.P +See +.BR /usr/doc/debhelper/examples/rules.multi +for an example of how to use this. +.RE +.TP +.B Package build directories +.RS +By default, all debhelper programs assume that the temporary directory used +for assembling the tree of files in a package is debian/tmp for the first +package listed in debian/control, and debian/ for each +additional package. +.P +Sometimes, you might want to use some other temporary directory. This is +supported by the +.B -P +flag. For example, "dh_installdocs -Pdebian/tmp", will use debian/tmp as the +temporary directory. Note that if you use -P, the debhelper programs can only +be acting on a single package at a time. So if you have a package that builds +many binary packages, you will need to use the -p flag to specify which +binary package the debhelper program will act on. +.RE +.TP +.B Other notes +In general, if any debhelper program needs a directory to exist under +debian/, it will create it. I haven't bothered to document this in all the +man pages, but for example, dh_installdeb knows to make debian/tmp/DEBIAN/ +before trying to put files there, dh_installmenu knows you need a +debian/tmp/usr/lib/menu/ before installing the menu files, etc. +.SH ENVIRONMENT +.TP +.I DH_VERBOSE +Enables verbose mode. +.TP +.I DH_NO_ACT +Enables no-act mode. +.SH "SEE ALSO" +.TP +.BR /usr/doc/debhelper/README +An introduction to debhelper. +.TP +.BR /usr/doc/debhelper/examples/ +A set of example debian/rules files that use debhelper. +.SH AUTHOR +Joey Hess diff --git a/debian/changelog b/debian/changelog index db56690c..10b81798 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.0.1) unstable; urgency=low + + * Backported bug fixes from the 1.1 tree: + * dh_installdocs: used -m 655 for a TODO file. (minor, dh_fixperms cleans + up after it) + * dh_fixperms: had a problem with removing x bits on examples files + * dh_compress: since version 0.88 or so, dh_compress has bombed out if + a debian/compress file returned an error code. This was actually + unintentional - in fact, the debian/compress example in the man page + will fail this way if usr/info or usr/X11R6 is not present. Corrected + the program to not fail. (#26214) + + -- Joey Hess Sun, 30 Aug 1998 22:21:26 -0700 + debhelper (1.0) stable unstable; urgency=low * 1.0 at last! diff --git a/debian/control b/debian/control index c4dccd95..0a97ae80 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,6 @@ Architecture: all Depends: perl (>= 5.004), fileutils (>= 3.16-4), file Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to - automate common tasks. Programs are included to install various files into - your package, compress files, fix file permissions, integrate your package - with the debian menu system, etc. + automate common tasks related to building binary debian packages. Programs + are included to install various files into your package, compress files, fix + file permissions, integrate your package with the debian menu system, etc. diff --git a/debian/cron.d b/debian/cron.d new file mode 100644 index 00000000..e69de29b diff --git a/debian/cron.daily b/debian/cron.daily new file mode 100644 index 00000000..e69de29b diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ + diff --git a/debian/menu b/debian/menu new file mode 100644 index 00000000..e69de29b diff --git a/dh_builddeb.1 b/dh_builddeb.1 index ecbbfa6c..cf492b4c 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -1,49 +1,24 @@ -.TH DH_BUILDDEB 1 +.TH DH_BUILDDEB 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) to build a .deb package or packages. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory, etc. -.TP -.B \-a, \--arch -Build all architecture dependent packages. -.TP -.B \-i, \--indep -Build all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B -ppackage, \--package=package -Build the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be built. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_clean.1 b/dh_clean.1 index cb437e9c..333fa174 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -1,9 +1,9 @@ -.TH DH_CLEAN 1 +.TH DH_CLEAN 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[-v] [-a] [-i] [-k] [--no-act] [-ppackage] [-Ptmpdir] [file ...]" +.I "[debhelper options] [-k] [file ...]" .SH "DESCRIPTION" dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some @@ -11,24 +11,10 @@ other files, such as debian/substvars, debian/files, DEADJOE, emacs backup files, etc. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Clean up the package build directory for all architecture dependent packages. -.TP -.B \-i, \--indep -Clean up the package build directory for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Clean up the package build directory for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-k, \--keep Do not delete debian/files. When do you want to use this? Anytime you have a @@ -41,23 +27,12 @@ was built. .TP .B file ... Delete these files too. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their package build directories cleaned up. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them will not currently be deleted when specified as parameters. diff --git a/dh_compress b/dh_compress index 7d6e4979..1b58f70a 100755 --- a/dh_compress +++ b/dh_compress @@ -13,7 +13,7 @@ filelist () { if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - sh $olddir/$compress 2>/dev/null || true + 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 || true diff --git a/dh_compress.1 b/dh_compress.1 index c78291ee..ec0def52 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -1,9 +1,9 @@ -.TH DH_COMPRESS 1 +.TH DH_COMPRESS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options] [-Xitem]" .SH "DESCRIPTION" dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks @@ -31,24 +31,10 @@ customization of what files are compressed: ! -name "copyright" .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Compress files for all architecture dependent packages. -.TP -.B \-i, \--indep -Compress files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Compress files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-Xitem, \--exclude=item Exclude files that contain "item" anywhere in their filename from being @@ -57,27 +43,16 @@ You may use this option multiple times to build up a list of things to exclude. You can accomplish the same thing by using a debian/compress file, but this is easier. .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their files compressed. -.P 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. (This works for the first binary package too.) .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them may not properly be compressed. .SH "CONFORMS TO" diff --git a/dh_debstd.1 b/dh_debstd.1 index e3568eb6..e47e64aa 100644 --- a/dh_debstd.1 +++ b/dh_debstd.1 @@ -5,7 +5,7 @@ dh_debstd \- mimic debstd with debhelper commands .B dh_debstd .I "[-v] [--no-act] [-m] [-c] [-u] [-s] [[changelog] file ...]" .SH "DESCRIPTION" -dh_debstd is a debhelper command that mimics the behavior of debstd, by +dh_debstd is a program that mimics the behavior of debstd, by calling other debhelper commands. Its behavior is not a complete nor an exact copy of what debstd does, but it should be close enough to be usable. .P @@ -59,14 +59,17 @@ generated if dh_debstd notices scripts without "#DEBHELPER#" in them. Enables verbose mode .TP .I DH_NO_ACT -Enables no-act mode (see above). +Enables no-act mode .SH "SEE ALSO" +.TP .BR /usr/doc/debhelper/from-debstd -, +.TP .BR debstd (1) +.TP +.BR debhelper (1) .SH BUGS It doesn't completly mimic debstd. Some things debstd handles are not supported -by debhelper. With the exception of buildinfo.Debian files, everything that -is not supported will generate a warning message. +by debhelper. Everything that is not supported will generate a warning +message if you try to use it. .SH AUTHOR Joey Hess diff --git a/dh_du.1 b/dh_du.1 index 9497a61d..670e371d 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -1,4 +1,4 @@ -.TH DH_DU 1 +.TH DH_DU 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_du \- generate DEBIAN/du file .SH SYNOPSIS @@ -11,6 +11,6 @@ This program is now depricated, and does nothing, after a decision by the debian developers that du control files should not exit. It will simply output a warning message now. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_fixperms b/dh_fixperms index 0e845335..544ee9be 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -18,7 +18,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R u+rw $TMP" fi - FIND_OPTIONS="" + FIND_OPTIONS= else # Do it the hard way. complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ @@ -33,8 +33,8 @@ for PACKAGE in $DH_DOPACKAGES; do # 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 f $FIND_OPTIONS -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" diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 19f89d11..fd304c70 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -1,9 +1,9 @@ -.TH DH_FIXPERMS 1 +.TH DH_FIXPERMS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_fixperms \- fix permissions of files in package build directories .SH SYNOPSIS .B dh_fixperms -.I "[-v] [-a] [-i] [-Xitem] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options] [-Xitem]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the permissions of files in package build directories to a sane state. @@ -15,46 +15,21 @@ root, and it removes group and other write permission from all files. Finally, it removes execute permissions from any libraries that have it set. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Fix permissions for all architecture dependent packages. -.TP -.B \-i, \--indep -Fix permissions for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Fix permissions for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-Xitem, \--exclude=item Exclude files that contain "item" anywhere in their filename from having their permissions changed. You may use this option multiple times to build up a list of things to exclude. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their permissions fixed. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.1 .SH AUTHOR diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index b0cc783c..2bfade49 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -1,57 +1,34 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_GENCONTROL 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_gencontrol \- generate and install control file .SH SYNOPSIS .B dh_gencontrol -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-uparams]" +.I "[debhelper options] [-uparams]" .SH "DESCRIPTION" -dh_gencontrol is a debhelper program that is responsible for generating and -installing control files, and installing them into the DEBIAN directory with -the proper permissions. +dh_gencontrol is a debhelper program that is responsible for generating +control files, and installing them into the DEBIAN directory with the proper +permissions. .P This program is merely a wrapper around .BR dpkg-gencontrol (1) .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-uparams, \--update-rcd-params=params Pass "params" to .BR dpkg-gencontrol (1) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 diff --git a/dh_getopt.pl b/dh_getopt.pl index b7a856c4..f1aa7cec 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -58,6 +58,11 @@ sub AddPackage { my($option,$value)=@_; } } +# Add a package to a list of packages that should not be acted on. +sub ExcludePackage { my($option,$value)=@_; + $exclude_package{$value}=1; +} + # Add another item to the exclude list. sub AddExclude { my($option,$value)=@_; push @exclude,$value; @@ -80,7 +85,10 @@ $ret=GetOptions( "arch" => \&AddPackage, "p=s" => \&AddPackage, - "package=s" => \&AddPackage, + "package=s" => \&AddPackage, + + "N=s" => \&ExcludePackage, + "no-package=s" => \&ExcludePackage, "n" => \$noscripts, "noscripts" => \$noscripts, @@ -105,7 +113,7 @@ $ret=GetOptions( "u=s", => \$u_params, "update-rcd-params=s", => \$u_params, - "dpkg-shlibdeps-params=s", => \$u_params, + "dpkg-shlibdeps-params=s", => \$u_params, "m=s", => \$major, "major=s" => \$major, @@ -149,12 +157,20 @@ foreach (@exclude) { } $exclude_find=~s/ -or $//; +# Remove excluded packages from the list of packages to act on. +undef @package_list; +foreach $package (@packages) { + if (! $exclude_package{$package}) { + push @package_list, $package; + } +} + # Now output everything, in a format suitable for a shell to eval it. # Note the last line sets $@ in the shell to whatever arguements remain. print qq{ DH_VERBOSE='$verbose' DH_NO_ACT='$no_act' -DH_DOPACKAGES='@packages' +DH_DOPACKAGES='@package_list' DH_DOINDEP='$indep' DH_DOARCH='$arch' DH_NOSCRIPTS='$noscripts' diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 84fb6b46..70822338 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLCHANGELOGS 1 +.TH DH_INSTALLCHANGELOGS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installchangelogs \- install changelogs into package build directories .SH SYNOPSIS .B dh_installchangelogs -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [upstream]" +.I "[debhelper options] [upstream]" .SH "DESCRIPTION" dh_installchangelogs is a debhelper program that is responsible for installing changelogs into package build directories. @@ -20,47 +20,22 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install changelogs for all architecture dependent packages. -.TP -.B \-i, \--indep -Install changelogs for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install changelogs for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B upstream Instal this file as the upstream changelog. .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have the changelogs installed into them. -.P It is an error to specify an upstream changelog file for a debian native package. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_installcron.1 b/dh_installcron.1 index 20bdc82f..adda0711 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -1,12 +1,12 @@ -.TH DH_INSTALLCRON 1 +.TH DH_INSTALLCRON 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installcron \- install cron scripts into etc/cron.* .SH SYNOPSIS .B dh_installcron -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_installcron is a debhelper program that is responsible for installing -cron scripts into etc/cron.* in package build directories. The files +cron scripts into etc/cron.* in package build directories. The files debian/cron.daily, debian/cron.weekly, debian/cron.monthly, and debian/cron.d are installed. If your package generates multiple binary packages (or if you just prefer to do it), you can also use filenames like @@ -14,41 +14,16 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install cron files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install cron files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install cron files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_installdeb.1 b/dh_installdeb.1 index fc7b8dee..03fa1068 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_INSTALLDEB 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdeb \- install files into the DEBIAN directory .SH SYNOPSIS .B dh_installdeb -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_installdeb is a debhelper program that is responsible for installing files into the DEBIAN directory in package build directories with the @@ -34,41 +34,16 @@ programs, such as , and are shell script fragments. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index cf1580d0..ae4782d2 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -1,4 +1,4 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_INSTALLDEBFILES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdebfiles \- install files into the DEBIAN directory .SH SYNOPSIS @@ -21,9 +21,13 @@ This program will be removed at some time in the furture. Any options passed to this program will be sent to each of the 3 programs listed above. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.TP +.BR debhelper (1) +.TP .BR dh_installdeb (1) +.TP .BR dh_shlibdeps (1) +.TP .BR dh_gencontrol (1) .SH AUTHOR Joey Hess diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 8ae440c6..77c992d9 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDIRS 1 +.TH DH_INSTALLDIRS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdirs \- create subdirectories in package build directories .SH SYNOPSIS .B dh_installdirs -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [dir ...]" +.I "[debhelper options] [-A] [dir ...]" .SH "DESCRIPTION" dh_installdirs is a debhelper program that is responsible for creating subdirectories in package build directories. @@ -21,50 +21,25 @@ Be sure to only use directory names relative to the package build directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Create directories for all architecture dependent packages. -.TP -.B \-i, \--indep -Create directories for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Create directories for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-A, \--all Create any directories specified by command line parameters in ALL packages -acted on. +acted on, not just the first. .TP .B dir ... Create these directories in the package build directory of the first package acted on. (Or in all packages if -A is specified.) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS -Directories with spaces in them will not currently be installed. +Directories with spaces in them will not currently be installed properly. .SH AUTHOR Joey Hess diff --git a/dh_installdocs b/dh_installdocs index 7a11b7f7..fcdedc50 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -41,7 +41,7 @@ for PACKAGE in $DH_DOPACKAGES; do todo=`pkgfile $PACKAGE TODO` if [ "$todo" ]; then if isnative; then - doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO" + doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" else doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" fi diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 98737606..ffae1623 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDOCS 1 +.TH DH_INSTALLDOCS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[debhelper options] [-A] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -31,24 +31,10 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-A, \--all Install all files specified by command line parameters in ALL packages @@ -58,26 +44,15 @@ acted on. Install these files as documentation into the first package acted on. (Or in all packages if -A is specified). .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.P Note that dh_installdocs will happily copy entire directory hierarchies if you ask it to (it uses cp -a internally). If it is asked to install a directory, it will install the complete contents of the directory. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them will not currently be installed. .SH "CONFORMS TO" diff --git a/dh_installemacsen b/dh_installemacsen new file mode 100755 index 00000000..e87cecef --- /dev/null +++ b/dh_installemacsen @@ -0,0 +1,34 @@ +#!/bin/sh -e +# +# Registration with emacsen-common. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + emacsen_install=`pkgfile $PACKAGE emacsen-install` + emacsen_remove=`pkgfile $PACKAGE emacsen-remove` + + if [ "$emacsen_install" ]; then + if [ ! -d "$TMP/usr/lib/emacsen-common/packages/install" ]; then + doit "install -d $TMP/usr/lib/emacsen-common/packages/install" + fi + doit "install $emacsen_install $TMP/usr/lib/emacsen-common/packages/install/$PACKAGE" + fi + + if [ "$emacsen_remove" ]; then + if [ ! -d "$TMP/usr/lib/emacsen-common/packages/remove" ]; then + doit "install -d $TMP/usr/lib/emacsen-common/packages/remove" + fi + doit "install $emacsen_remove $TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE" + fi + + if [ "$emacsen_install" -o "$emacsen_remove" ]; then + if [ ! "$DH_NOSCRIPTS" ]; then + autoscript "postinst" "postinst-emacsen" + autoscript "prerm" "prerm-emacsen" + fi + fi +done diff --git a/dh_installemacsen.1 b/dh_installemacsen.1 new file mode 100644 index 00000000..15ec575a --- /dev/null +++ b/dh_installemacsen.1 @@ -0,0 +1,42 @@ +.TH DH_INSTALLEMACSEN 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installemacsen \- register an emacs add on package +.SH SYNOPSIS +.B dh_installemacsen +.I "[debhelper options] [-n]" +.SH "DESCRIPTION" +dh_installemacsen is a debhelper program that is responsible for installing +files used by the debian emacsen-common package into package build directories. +.P +It also automatically generates the postinst and prerm commands needed to +register a package as an emacs add on package. See +.BR dh_installdeb (1) +for an explanation of how this works. +.P +If a file named debian/package.emacsen-install exists, then it is installed into +usr/lib/emacsen-common/packages/install/package in the package build +directory. Similarly, debian/package.emacsen-remove is installed into +usr/lib/emacsen-common/packages/remove/package +.P +For the first first binary package listed in the control file, you may use +debian/emacsen-install and debian/emacsen-remove instead. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-n, \--noscripts +Do not modify postinst/prerm scripts. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.TP +.BR /usr/doc/emacsen-common/debian-emacs-policy.gz +.SH AUTHOR +Joey Hess diff --git a/dh_installexamples.1 b/dh_installexamples.1 index be0b4cc3..776aef79 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLEXAMPLES 1 +.TH DH_INSTALLEXAMPLES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installexamples \- install example files into package build directories .SH SYNOPSIS .B dh_installexamples -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[debhelper options] [-A] [file ...]" .SH "DESCRIPTION" dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. @@ -17,24 +17,10 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-A, \--all Install any files specified by command line parameters in ALL packages @@ -44,26 +30,15 @@ acted on. Install these files as examples into the first package acted on. (Or into all packages if -A is specified.) .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.P Note that dh_installexamples will happily copy entire directory hierarchies if you ask it to (it uses cp -a internally). If it is asked to install a directory, it will install the complete contents of the directory. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Filenames with spaces in them will not currently be installed. .SH "CONFORMS TO" diff --git a/dh_installinit.1 b/dh_installinit.1 index 99222bc4..f76ec917 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLINIT 1 +.TH DH_INSTALLINIT 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installinit \- install init scripts into package build directories .SH SYNOPSIS .B dh_installinit -.I "[-v] [-a] [-i] [--no-act] [--init-script=scriptname] [-ppackage] [-Ptmpdir] [-n] [-r] [-d] [-uparams]" +.I "[debhelper options] [--init-script=scriptname] [-n] [-r] [-d] [-uparams]" .SH "DESCRIPTION" dh_installinit is a debhelper program that is responsible for installing init scripts into package build directories. @@ -19,24 +19,10 @@ by the packagename. (You may use debian/init for the first binary package listed in the control file.) .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install init scripts into all architecture dependent packages. -.TP -.B \-i, \--indep -Install init scripts into all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install init scripts into the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-n, \--noscripts Do not modify postinst/postrm/prerm scripts. @@ -60,22 +46,11 @@ If not specified, "default" will be passed to Use "scriptname" as for the filename the init script is installed as in etc/init.d/ . This is useful if you need to have an init script with a name different from the package's name. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_installmanpages.1 b/dh_installmanpages.1 index 7053dbc6..edc37c21 100644 --- a/dh_installmanpages.1 +++ b/dh_installmanpages.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLMANPAGES 1 +.TH DH_INSTALLMANPAGES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installmanpages \- install man pages into package build directories .SH SYNOPSIS .B dh_installmanpages -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [file ...]" +.I "[debhelper options] [file ...]" .SH "DESCRIPTION" dh_installmanpages is a debhelper program that is responsible for automatically installing man pages into usr/man/ and usr/X11R6/man/ in @@ -24,50 +24,25 @@ After the man page installation step, dh_installmanpages will check to see if any of the man pages are ".so" links. If so, it changes them to symlinks. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install man pages into all architecture dependent packages. -.TP -.B \-i, \--indep -Install man pages into all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install man pages into the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B file ... Do not install these files as man pages, even if they look like valid man pages. .SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. -.P dh_installmanpages will install the man pages it finds into .B all packages you tell it to act on, since it can't tell what package the man pages belong in. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Man pages with the extension .B .man diff --git a/dh_installmenu.1 b/dh_installmenu.1 index 7147b49f..d9d8296a 100644 --- a/dh_installmenu.1 +++ b/dh_installmenu.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLMENU 1 +.TH DH_INSTALLMENU 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_installmenu \- install debian menu files into package build directories .SH SYNOPSIS .B dh_installmenu -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-n]" +.I "[debhelper options] [-n]" .SH "DESCRIPTION" dh_installmenu is a debhelper program that is responsible for installing files used by the debian menu package into package build directories. @@ -25,45 +25,21 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install menu files into all architecture dependent packages. -.TP -.B \-i, \--indep -Install menu files into all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install menu files into the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-n, \--noscripts Do not modify postinst/postrm scripts. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README -, .BR menufile (5) .SH AUTHOR Joey Hess diff --git a/dh_makeshlibs.1 b/dh_makeshlibs.1 index bad72c4e..282d54fe 100644 --- a/dh_makeshlibs.1 +++ b/dh_makeshlibs.1 @@ -1,9 +1,9 @@ -.TH DH_MAKESHLIBS 1 +.TH DH_MAKESHLIBS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_makeshlibs \- automatically create shlibs file .SH SYNOPSIS .B dh_makeshlibs -.I "[-v] [-a] [-i] [--no-act] [-mmajor] [-Ptmpdir] [-ppackage] [-V[dependancies]]" +.I "[debhelper options] [-mmajor] [-V[dependancies]]" .SH "DESCRIPTION" dh_makeshlibs is a debhelper program that automatically scans for shared libraries, and generates a shlibs file for the libraries it finds. @@ -12,24 +12,10 @@ For this program to work, you cannot have already installed a DEBIAN/shlibs file. If such a file exits, the program will exit with an error. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Generate shlibs files for all architecture dependent packages. -.TP -.B \-i, \--indep -Generate shlibs files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Generate shlibs file for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-mmajor, \--major=major Instead of trying to guess the major number of the library from the filename @@ -56,26 +42,15 @@ Assuming the current version of the package is 1.0-3, generates a shlibs file that looks something like: libfoobar 1 libfoobar1 (>= 1.0-3) .TP -.B dh_makeshlibs \-V "libfoobar1 (>= 1.0)" +.B dh_makeshlibs \-V "'libfoobar1 (>= 1.0)'" Generates a shlibs file that looks something like: libfoobar 1 libfoobar1 (>= 1.0) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS There is no guarantee that the program will get the shlibs file right. For example, it may not correctly guess the major number of your package. In diff --git a/dh_md5sums.1 b/dh_md5sums.1 index f432fed2..22b4fe28 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -1,9 +1,9 @@ -.TH DH_MD5SUMS 1 +.TH DH_MD5SUMS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums -.I "[-x] [-v] [-a] [-i] [--no-act] [-Ptmpdir] [-ppackage]" +.I "[debhelper options] [-x]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. @@ -14,44 +14,19 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Generate md5sums files for all architecture dependent packages. -.TP -.B \-i, \--indep -Generate md5sums files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Generate md5sums file for the package named "package". +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-x, \--include-conffiles Include conffiles in the md5sums list. Note that this is redundant, and included elsewhere in debian packages. -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 1c27f968..260d5069 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -1,9 +1,9 @@ -.TH DH_MOVEFILES 1 +.TH DH_MOVEFILES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_movefiles \- moves files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [file ..]" +.I "[debhelper options] [file ..]" .SH "DESCRIPTION" dh_movefiles is a debhelper program that is responsible for moving files out of debian/tmp and into other package build directories. This may be useful @@ -22,46 +22,21 @@ symlinks. This is done becuase it tends to be a good thing to have symlinks last in debian packages, particularly in shared library packages. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Move files for all architecture dependent packages. -.TP -.B \-i, \--indep -Move files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Move files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B file .. Lists files to move. The filenames listed should be relative to debian/tmp/. You can also list directory names, and the whole directory will be moved. You can even use wildcards if you like. It is an error to list files here unless you use -p, -i, or -a to tell dh_movefiles which subpackage to put them in. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 index b976f8c9..f9f6f3e4 100644 --- a/dh_shlibdeps.1 +++ b/dh_shlibdeps.1 @@ -1,9 +1,9 @@ -.TH DH_INSTALLDEBFILES 1 +.TH DH_SHLIBDEPS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_shlibdeps \- calculate shared library dependancies .SH SYNOPSIS .B dh_shlibdeps -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-uparams]" +.I "[debhelper options] [-uparams]" .SH "DESCRIPTION" dh_shlibdeps is a debhelper program that is responsible for calculating shared library dependancies for all executables found in the package build @@ -11,51 +11,25 @@ directory. .P This program is merely a wrapper around .BR dpkg-shlibdeps (1) -that calls it once for each package listed in the control file. You may -prefer to simply run -.BR dpkg-shlibdeps (1) -by hand. +that calls it once for each package listed in the control file. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Install files for all architecture dependent packages. -.TP -.B \-i, \--indep -Install files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-uparams, \--dpkg-shlibdeps-params=params Pass "params" to .BR dpkg-shlibdeps (1) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 diff --git a/dh_strip.1 b/dh_strip.1 index 9ae97c60..960dc72e 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -1,9 +1,9 @@ -.TH DH_STRIP 1 +.TH DH_STRIP 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_strip \- strip executables, shared libraries, and some static libraries. .SH SYNOPSIS .B dh_strip -.I "[-v] [-a] [-i] [--no-act] [-Ptmpdir] [-ppackage]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_strip is a debhelper program that is responsible for stripping executables, shared libraries, and static libraries that are not used for @@ -13,42 +13,16 @@ 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, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Strip files in all architecture dependent packages. -.TP -.B \-i, \--indep -Strip files in all architecture independent packages (likely, this is -pointless :-). -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Strip files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will have their files stripped. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode -.TP -.I DH_NO_ACT -Enables no-act mode (see above). +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_suidregister.1 b/dh_suidregister.1 index 57694956..edce61d0 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -1,9 +1,9 @@ -.TH DH_SUIDREGISTER 1 +.TH DH_SUIDREGISTER 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_suidregister \- set up package to register files with suidregister .SH SYNOPSIS .B dh_suidregister -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [file ...]" +.I "[debhelper options] [-A] [file ...]" .SH "DESCRIPTION" dh_suidregister is a debhelper program that is responsible for modifying the postinst and postrm scripts of a package so the package will register files @@ -23,29 +23,15 @@ 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 will automatically register all files it finds. .P -Note that this package modifies your postinst and postrm files. See +Note that this program modifies your postinst and postrm files. See .BR dh_installdeb (1) for an explanation of how this works. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -.TP -.B \-a, \--arch -Register files for all architecture dependent packages. -.TP -.B \-i, \--indep -Register files for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Register files for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-A, \--all Register any files specified by command line parameters in ALL packages @@ -55,24 +41,14 @@ with other debhelper programs. .B file ... Register these files in the first package acted on. (Or in all packages if -A is specified.) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README -, .BR suidregister (8) .SH AUTHOR Joey Hess diff --git a/dh_testdir.1 b/dh_testdir.1 index 17561acc..309a7d94 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -1,9 +1,9 @@ -.TH DH_TESTDIR 1 +.TH DH_TESTDIR 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_testdir \- test directory before building debian package .SH SYNOPSIS .B dh_testdir -.I "[-v] [file ...]" +.I "[debhelper options] [file ...]" .SH "DESCRIPTION" dh_testdir tries to make sure that you are in the correct directory when building a debian package. It makes sure that the file debian/control @@ -11,18 +11,19 @@ exists, as well as any other files you specify. If not, it exits with an error. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -This currently has no effect. +.B [debhelper options] +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B file ... Test for the existence of these files. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH BUGS Files with spaces in their names will not be processed correctly. .SH AUTHOR diff --git a/dh_testroot.1 b/dh_testroot.1 index 605dae4c..6fcdf4f2 100644 --- a/dh_testroot.1 +++ b/dh_testroot.1 @@ -1,9 +1,9 @@ -.TH DH_TESTROOT 1 +.TH DH_TESTROOT 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_testroot \- ensure that a package is built as root .SH SYNOPSIS .B dh_testroot -.I "[-v]" +.I "[debhelper options]" .SH "DESCRIPTION" dh_testroot simply checks to see if you are root. If not, it exits with an error. Debian packages must be built as root, though you can use @@ -11,14 +11,15 @@ error. Debian packages must be built as root, though you can use to work around this. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. -This currently has no effect. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode. +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_testversion b/dh_testversion new file mode 100755 index 00000000..57c0e588 --- /dev/null +++ b/dh_testversion @@ -0,0 +1,24 @@ +#!/usr/bin/perl -w +# +# Debhelper version check. + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +use Dh_Version; # contains the version number of debhelper. +init(); + +my($compare, $ver); + +if ($#ARGV > 0) { + $compare=shift; + $ver=shift; +} +elsif ($#ARGV eq 0) { + $compare=">="; + $ver=shift; +} + +if (defined $compare and defined $ver) { + system('dpkg','--compare-versions',$Dh_Version::version,$compare,$ver) == 0 || + error("debhelper version $Dh_Version::version is installed, but a version $compare $ver is needed to build this package."); +} diff --git a/dh_testversion.1 b/dh_testversion.1 index 5fb7332b..19ded263 100644 --- a/dh_testversion.1 +++ b/dh_testversion.1 @@ -1,8 +1,8 @@ -.TH DH_TESTROOT 1 +.TH DH_TESTVERSION 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_testversion \- ensure that the correct version of debhelper is installed .SH SYNOPSIS -.B dh_testversion [operator] [version] +.B dh_testversion [debhelper options] [operator] [version] .SH "DESCRIPTION" dh_testversion compares the version of debhelper against the version you specify, and if the condition is not met, exits with an error message. @@ -18,6 +18,11 @@ dh_autofixbugs cannot be found, so there is no need for you to use dh_testversion. .SH OPTIONS .TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP .B operator Optional comparison operator used in comparing the versions. If not specified, ">=" is used. For descriptions of the comparison operators, see @@ -28,19 +33,19 @@ Version number to compare against the current version of debhelper. If not specified, dh_testversion does nothing. .SH EXAMPLES .TP -.I dh_testversion 0.50 -Make sure debhelper version 0.50 or higher is installed. +.I dh_testversion 1.0 +Make sure debhelper version 1.0 or higher is installed. .TP -.I dh_testversion ge 0.50 -Another way to make sure debhelper version 0.50 or higher is installed. +.I dh_testversion ge 1.0 +Another way to make sure debhelper version 1.0 or higher is installed. .TP -.I dh_testversion le 0.50 -Make sure a version of debhelper less than version 0.50 is installed. +.I dh_testversion lt 1.0 +Make sure a version of debhelper less than version 1.0 is installed. .SH ENVIRONMENT -.TP -.I DH_VERBOSE -Enables verbose mode. +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR /usr/doc/debhelper/README +.BR debhelper (1) .SH AUTHOR Joey Hess diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 69d2150a..25654ed5 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -1,9 +1,9 @@ -.TH DH_UNDOCUMENTED 1 +.TH DH_UNDOCUMENTED 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_undocumented \- make symlinks to undocumented.7.gz man page .SH SYNOPSIS .B dh_undocumented -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Ptmpdir] [-A] [manpage ...]" +.I "[debhelper options [-A] [manpage ...]" .SH "DESCRIPTION" dh_undocumented is a debhelper program that is responsible for making symlinks to the @@ -32,24 +32,11 @@ the first binary package in debian/control) can list other man page names to set up. .SH OPTIONS .TP -.B \-v, \--verbose -Verbose mode; show all commands that modify the package build directory. .TP -.B \-a, \--arch -Install undocumented man page symlinks for all architecture dependent packages. -.TP -.B \-i, \--indep -Install undocumented man page symlinks for all architecture independent packages. -.TP -.B \--no-act -Do not really do anything. If used with -v, the result is that this command -will output a list of what it would have done. -.TP -.B \-ppackage, \--package=package -Install undocumented man page symlinks for the package named "package". -.TP -.B \-Ptmpdir, \--tmpdir=tmpdir -Use "tmpdir" for package build directory. +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. .TP .B \-A, \--all Install undocumented man page symlinks for any man pages specified by @@ -60,24 +47,14 @@ this useful, it's here for consitency with other debhelper programs. Install undocumented man page symlinks for each of these man pages into the first package acted on. (Or in all packages acted on if -A is specified.) -.SH NOTES -The -.B \-a -.B \-i -and -.B \-p -arguments are cumulative. If none are specified, then all packages listed in -the control file will be effected. .SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" .TP -.I DH_VERBOSE -Enables verbose mode +.BR debhelper (1) .TP -.I DH_NO_ACT -Enables no-act mode (see above). -.SH "SEE ALSO" -.BR /usr/doc/debhelper/README -, .BR undocumented (7) .SH "CONFORMS TO" Debian policy, version 2.3.0.0 diff --git a/doc/README b/doc/README index 986eb02c..845f94ef 100644 --- a/doc/README +++ b/doc/README @@ -1,6 +1,7 @@ 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 automate common tasks related to building debian binary packages. For +further documentation, see the man pages for dh_* commands. For an overview +of debhelper, see the debhelper man page. To help you get started, I've included examples of debian/rules files that use debhelper commands extensively. See /usr/doc/debhelper/examples/ . @@ -34,67 +35,10 @@ by the -n parameter. Note that it will be shell code, so you cannot directly use it in a perl script. If you would like to embed it into a perl script, here is one way to -do that: +do that (note the tricky use of backquotes): print << `EOF` #DEBHELPER# EOF - -Notes on multiple binary packages: ---------------------------------- - -If your source package generates more than one binary package, debhelper -programs will default to acting on all binary packages when run. If your -source package happens to generate one architecture dependent package, and -another architecture independent package, this is not the correct behavior, -because you need to generate the architecture dependent packages in the -binary-arch debian/rules target, and the architecture independent packages -in the binary-indep debian/rules target. - -To facilitate this, as well as give you more control over which packages -are acted on by debhelper programs, all debhelper programs accept the -following parameters: - --a Act on architecture dependent packages --i Act on architecture independent packages --ppackage Act on the package named "package" (may be repeated multiple - times) - -These parameters are cumulative. If none are given, the tools default to -affecting all packages. - -See examples/rules.multi for an example of how to use this. - -Package build directories -- debian/tmp, etc: --------------------------------------------- - -By default, all debhelper programs assume that the temporary directory used -for assembling the tree of files in a package is debian/tmp for the first -package listed in debian/control, and debian/ for each -additional package. - -Sometimes, you might want to use some other temporary directory. This is -supported by the -P flag. The directory to use is specified after -P, for -example, "dh_installdocs -Pdebian/tmp", will use debian/tmp as the temporary -directory. Note that if you use -P, the debhelper programs can only be -acting on a single package at a time. So if you have a package that builds -many binary packages, you will need to use the -p flag to specify which -binary package the debhelper program will act on. For example: - - dh_installdocs -pfoolib1 -Pdebian/tmp-foolib1 - dh_installdocs -pfoolib1-dev -Pdebian/tmp-foolib1-dev - dh_installdocs -pfoolib-bin -Pdebian/tmp-foolib-bin - -This uses debian/tmp- as the package build directory. - -Other notes: ------------ - -* In general, if any debhelper program needs a directory to exist under - debian/, it will create it. I haven't bothered to document this in all the - man pages, but for example, dh_installdeb knows to make debian/tmp/DEBIAN/ - before trying to put files there, dh_installmenu knows you need a - debian/tmp/usr/lib/menu/ before installing the menu files, etc. - -- Joey Hess diff --git a/doc/TODO b/doc/TODO index 188e3c6c..dbfc2771 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,19 +1,29 @@ -* add all other functionality of debstd (??) - - add a program to generate file similar to buildinfo.Debian generated by - 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). -* 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. +This is the TODO for debhelper. As more and more people use debhelper, this +list grows - I welcome patches to fix items on it! + +Bugs: + +* dh_movefiles bombs if the argument is a wildcard pattern that matches + nothing (reported by Drow). +* dh_installdocs fails if debian/docs is empty except for a blank line. + There are probably other instances of this. Debhelper should behave better + (#24686). +* all commands should print a warning message if non-cumulative parameters + are given more than once (ie, two -u's to dh_gencontrol). + +Wishlist items: + +* Add option to dh_compress to allow addition of files to compress besides + the default ones. +* Add emacsen support to debhelper. (#21401) +* Make dh_movefiles remove emptied directories after it's moved all the + files out of them (#17111). * info support for debhelper (currently implemented, but I hate how I did it, - so it's not in the package.) (wishlist bug #15717) + so it's not in the package.) (#15717) * enhance dh_installmanpages so it associates binaries and man pages and installs the man pages into the correct areas to suit the binaries they document. I may need to make this only happen when a switch is given, to - preserve backward compatibility. + preserve backward compatibility. (#16933, #17061) * maybe make dh_installmanpages look at the .TH line of man pages whose filenames end in .man, to figure out what section they go it. This would require a switch to turn on, for backwards compatibility. @@ -24,3 +34,32 @@ they might have; still it would be nice to check them too, just to make debhelper more flexible.) One easy fix is to add umask 022 to dh_lib, however, there may be unforeseen ramifications of such a change. +* 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. +* docbase support (#25233). Waiting for docbase to stabalize and be used + widly. +* Support /etc/X11/window-managers, by making it easy for window managers to + add themselves to it in the postinst. Not high priority because there are + few window managers. (#20971) +* dhelp support. Currently pending on dhelp use becoming widespead (#18342) +* Support use of environment variables in data taken from user, ie, in + debian/dirs. The problem with doing this is that we really want to allow + any filenames in that input, even those that look like environment + variables. However, it may be worth adding a switch to make it parse + environment variables. (#20964) +* It's possible to speed up debhelper by having it cache some values that + multiple commands call. One way to do this would be to write dh_cache, + that generates the cache. The catch is that if the user runs that program, + they are stating that they don't do anything later to invalidate the cache, + without calling ch_cache again. (#23792) +* Add a switch to dh_installdeb to allow it to do user definied + substitutions. (#25235) + +Depricated: + +* remove dh_installdebfiles, dh_du. + - need to wait a reasonable length of time. I'm currently planning + on doing this after slink is released. -- cgit v1.2.3 From df34bdaa1381eafc3f6ecea44866849c2a80fe67 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:36 +0000 Subject: r105: Initial Import --- debian/changelog | 28 +++++++++++++++------------- dh_compress | 16 ++++++++++++---- dh_compress.1 | 9 ++++++++- dh_getopt.pl | 2 ++ dh_movefiles | 21 ++++++++++++++++++--- doc/PROGRAMMING | 6 +++--- doc/TODO | 4 ---- 7 files changed, 58 insertions(+), 28 deletions(-) diff --git a/debian/changelog b/debian/changelog index 10b81798..38ae7771 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,16 +1,18 @@ -debhelper (1.0.1) unstable; urgency=low - - * Backported bug fixes from the 1.1 tree: - * dh_installdocs: used -m 655 for a TODO file. (minor, dh_fixperms cleans - up after it) - * dh_fixperms: had a problem with removing x bits on examples files - * dh_compress: since version 0.88 or so, dh_compress has bombed out if - a debian/compress file returned an error code. This was actually - unintentional - in fact, the debian/compress example in the man page - will fail this way if usr/info or usr/X11R6 is not present. Corrected - the program to not fail. (#26214) - - -- Joey Hess Sun, 30 Aug 1998 22:21:26 -0700 +debhelper (1.1.0) unstable; urgency=low + + * New unstable branch of debhelper. + + * TODO: list all current bugs, in order I plan to tackle them. + * Added debhelper.1 man page, which groups all the debhelper options that + are common to all commands in once place so I can add new options w/o + updating 27 man pages. + * dh_*.1: updated all debheper man pages to refer to debhelper(1) where + appropriate. Also corrected a host of little errors. + * doc/README: moved a lot of this file into debhelper.1. + * dh_*: -N option now excludes a package from the list of packages the + programs act on. (#25247) + + -- Joey Hess Sat, 8 Aug 1998 17:49:56 -0700 debhelper (1.0) stable unstable; urgency=low diff --git a/dh_compress b/dh_compress index 1b58f70a..b94cfcfe 100755 --- a/dh_compress +++ b/dh_compress @@ -8,8 +8,16 @@ PATH=debian:$PATH:/usr/lib/debhelper # Returns a list of all the files that we want to compress, # (ignoring any files we were asked to exclude on the command -# line). Assummes we are already in the temp directory. +# line). Assumes we are already in the temp directory. filelist () { + # First of all, deal with any files specified right on the command line. + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then + # Convert to having each file on its own line + # so grep will work. + echo "$*" | tr " " "\n" + fi + if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). @@ -28,7 +36,7 @@ filelist () { # Call only if DH_EXCLUDE_GREP is non-empty. filelist_excluded () { # Use grep -F so we don't have to worry about regexp's. - (filelist | grep -v -F \ + (filelist "$*" | grep -v -F \ "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`") || true } @@ -45,9 +53,9 @@ for PACKAGE in $DH_DOPACKAGES; do # Get the list of files to compress. if [ "$DH_EXCLUDE_GREP" ]; then - files=`filelist_excluded` + files=`filelist_excluded $*` else - files=`filelist` + files=`filelist $*` fi if [ "$files" ]; then diff --git a/dh_compress.1 b/dh_compress.1 index ec0def52..4e5ed9e8 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[debhelper options] [-Xitem]" +.I "[debhelper options] [-Xitem] [-A] [file ...]" .SH "DESCRIPTION" dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks @@ -42,6 +42,13 @@ compressed. For example, -X=.jpeg will exclude jpeg's from compression. You may use this option multiple times to build up a list of things to exclude. You can accomplish the same thing by using a debian/compress file, but this is easier. +.TP +.B \-A, \--all +Compress all files specified by command line parameters in ALL packages +acted on. +.TP +.B file ... +Add these files to the list of files to compress. .SH NOTES The debian/compress file applies to the first binary package listed in your control file. For the other packages, you can make files named diff --git a/dh_getopt.pl b/dh_getopt.pl index f1aa7cec..9b97089e 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -157,6 +157,8 @@ foreach (@exclude) { } $exclude_find=~s/ -or $//; +$include=join ' ', @include; + # Remove excluded packages from the list of packages to act on. undef @package_list; foreach $package (@packages) { diff --git a/dh_movefiles b/dh_movefiles index a5669bfc..f44121c8 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -40,16 +40,31 @@ for PACKAGE in $DH_DOPACKAGES; do # # (The echo is in here to expand wildcards. Note that 'ls' # won't work properly.) - # The filelist is used, so even very weird filenames can be + # 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 - complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print) >> movelist" + if [ ! -e "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 - complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print) >> movelist" + if [ ! -e "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 + +# If fail 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 +# 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 diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 402d5e78..878c5a2e 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -68,11 +68,11 @@ switch variable description -v DH_VERBOSE should the program verbosely output what it is doing? --no-act DH_NO_ACT should the program not actually do anything? --i,-a,-p DH_DOPACKAGES a space delimited list of the binary packages +-i,-a,-p,-N DH_DOPACKAGES a space delimited list of the binary packages to act on --i,-p DH_DOINDEP a space delimited list of the binary independent +-i,-p,-N DH_DOINDEP a space delimited list of the binary independent packages to act on --a,-p DH_DOARCH a space delimited list of the binary dependent +-a,-p,-N DH_DOARCH a space delimited list of the binary dependent packages to act on -n DH_NOSCRIPTS if set, do not make any modifications to the package's postinst, postrm, etc scripts. diff --git a/doc/TODO b/doc/TODO index dbfc2771..0a2a5bde 100644 --- a/doc/TODO +++ b/doc/TODO @@ -3,8 +3,6 @@ list grows - I welcome patches to fix items on it! Bugs: -* dh_movefiles bombs if the argument is a wildcard pattern that matches - nothing (reported by Drow). * dh_installdocs fails if debian/docs is empty except for a blank line. There are probably other instances of this. Debhelper should behave better (#24686). @@ -13,8 +11,6 @@ Bugs: Wishlist items: -* Add option to dh_compress to allow addition of files to compress besides - the default ones. * Add emacsen support to debhelper. (#21401) * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). -- cgit v1.2.3 From 3d85a497a3d346e2e6072e31c3a12147e1521134 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:41 +0000 Subject: r106: Initial Import --- debian/changelog | 11 +++++++++++ dh_clean.1 | 2 +- dh_strip | 26 +++++++++++++++++++------- dh_strip.1 | 7 ++++++- doc/TODO | 20 +++++++++++++++++++- examples/rules | 1 + examples/rules.indep | 1 + examples/rules.multi | 2 ++ 8 files changed, 60 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 38ae7771..63e04237 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +debhelper (1.1.1) unstable; urgency=low + + * dh_movefiles: try to move all files specified, and only then bomb out if + some of the file could not be found. Makes it easier for some packages + that don't always have the same files in them. + * dh_compress: any parameters passed to it on the command line specify + additional files to be compressed in the first package acted on. + * dh_compress: recognize standard -A parameter. + + -- Joey Hess Sat, 8 Aug 1998 22:48:01 -0700 + debhelper (1.1.0) unstable; urgency=low * New unstable branch of debhelper. diff --git a/dh_clean.1 b/dh_clean.1 index 333fa174..3c1d2795 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -8,7 +8,7 @@ dh_clean \- clean up package build directories dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some other files, such as debian/substvars, debian/files, DEADJOE, emacs backup -files, etc. +files, any detritus left behind by other debhelper commands, etc. .SH OPTIONS .TP .B debhelper options diff --git a/dh_strip b/dh_strip index daea754c..385efeff 100755 --- a/dh_strip +++ b/dh_strip @@ -5,26 +5,38 @@ 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 +} + for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` - + # Handle executables and shared libraries. - for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do - case "`file $file`" in + 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*) - doit "strip --strip-unneeded $file" + doit "strip --strip-unneeded $TMP/$file" ;; *ELF*executable*) - doit "strip --remove-section=.comment --remove-section=.note $file" + doit "strip --remove-section=.comment --remove-section=.note $TMP/$file" ;; esac done # Handle static libraries. - for file in `find $TMP -type f -name "lib*.a" 2>/dev/null` ; do + 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 $file" + doit "strip --strip-debug $TMP/$file" fi done done diff --git a/dh_strip.1 b/dh_strip.1 index 960dc72e..6ddcde13 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -3,7 +3,7 @@ dh_strip \- strip executables, shared libraries, and some static libraries. .SH SYNOPSIS .B dh_strip -.I "[debhelper options]" +.I "[debhelper options] [-Xitem]" .SH "DESCRIPTION" dh_strip is a debhelper program that is responsible for stripping executables, shared libraries, and static libraries that are not used for @@ -17,6 +17,11 @@ used in debugging, and will not strip them. See .BR debhelper (1) for a list of options common to all debhelper commands. +.TP +.B \-Xitem, \--exclude=item +Exclude files that contain "item" anywhere in their filename from being +stripped. You may use this option multiple times to build up a list of +things to exclude. .SH ENVIRONMENT See .BR debhelper (1) diff --git a/doc/TODO b/doc/TODO index 0a2a5bde..83f38659 100644 --- a/doc/TODO +++ b/doc/TODO @@ -11,7 +11,6 @@ Bugs: Wishlist items: -* Add emacsen support to debhelper. (#21401) * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). * info support for debhelper (currently implemented, but I hate how I did it, @@ -59,3 +58,22 @@ Depricated: * remove dh_installdebfiles, dh_du. - need to wait a reasonable length of time. I'm currently planning on doing this after slink is released. + +Long term goals: + +Convert selected and then selected debhelper commands (dh_installmanpages?) +to be perl programs, for speed, ease of maintainence, and 8-bit cleanness. +Tricky, because of the -v option -- they'd have to call external commands +like install and cp, and log such calls if verbose was on. Maybe something +like: + +doit { + system @_; + if ($DH_VERBOSE) { + print join " ", @_; + } +} + +However, this will output commands that are incorrect if the filenames in +them contain spaces or other weird characters. Hmm, maybe such things should +just be escaped with \'s in the output? diff --git a/examples/rules b/examples/rules index e3e6c3b5..8756505e 100755 --- a/examples/rules +++ b/examples/rules @@ -48,6 +48,7 @@ binary-arch: build install dh_installdocs dh_installexamples dh_installmenu +# dh_installemacsen # dh_installinit dh_installcron dh_installmanpages diff --git a/examples/rules.indep b/examples/rules.indep index bb2e00ba..eabd4840 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -45,6 +45,7 @@ binary-indep: build install dh_installdocs dh_installexamples dh_installmenu +# dh_installemacsen # dh_installinit dh_installcron # dh_installmanpages diff --git a/examples/rules.multi b/examples/rules.multi index 42e4052a..5852751e 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -48,6 +48,7 @@ binary-indep: build install dh_installdocs -i dh_installexamples -i dh_installmenu -i +# dh_installemacsen -i # dh_installinit -i dh_installcron -i # dh_installmanpages -i @@ -70,6 +71,7 @@ binary-arch: build install dh_installdocs -a dh_installexamples -a dh_installmenu -a +# dh_installemacsen -a # dh_installinit -a dh_installcron -a dh_installmanpages -a -- cgit v1.2.3 From 8c9a7b69225a5dc4b97d03df01bd9f594a2870a1 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:47 +0000 Subject: r108: Initial Import --- debian/changelog | 10 +++ debian/rules | 7 +- dh_getopt.pl | 207 +++++++------------------------------------------------ dh_installdocs | 105 ++++++++++++++-------------- dh_installdocs.1 | 3 +- dh_lib | 36 ---------- doc/TODO | 19 ++--- 7 files changed, 97 insertions(+), 290 deletions(-) diff --git a/debian/changelog b/debian/changelog index 63e04237..9d4a6a4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.1.2) unstable; urgency=low + + * dh_strip: added -X to specify files to not strip (#25590). + * Added dh_installemacsen, for automatic registration with emacsen-common + (#21401). + * Preliminary thoughts in TODO about converting entire debhelper programs + to perl programs. + + -- Joey Hess Mon, 10 Aug 1998 13:35:17 -0700 + debhelper (1.1.1) unstable; urgency=low * dh_movefiles: try to move all files specified, and only then bomb out if diff --git a/debian/rules b/debian/rules index b2ea0bd0..8572498b 100755 --- a/debian/rules +++ b/debian/rules @@ -16,11 +16,6 @@ export DH_VERBOSE=1 test_files=dh_lib build: - # Important symlinks. - cd autoscripts && ln -sf postinst-menu postrm-menu - cd debian && ln -sf ../dh_lib dh_lib - cd debian && ln -sf ../dh_getopt.pl dh_getopt.pl - ./dh_testdir $(test_files) sed "s/#DEBHELPER_VERSION#/$(VERSION)/" < dh_testversion.in \ > dh_testversion @@ -44,7 +39,7 @@ binary-indep: build find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; - cp -a dh_lib dh_getopt.pl debian/tmp/usr/lib/debhelper + cp -a dh_lib dh_getopt.pl *.pm debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd diff --git a/dh_getopt.pl b/dh_getopt.pl index 9b97089e..4abe9160 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -2,194 +2,39 @@ # # Because the getopt() program is so horribly broken, I wrote my own argument # processer that uses the find Getopt::Long module. This is used by all -# debhelper scripts. +# debhelper shell scripts. # # Joey Hess, GPL copyright 1998. -# Returns a list of packages in the control file. -# Must pass "arch" or "indep" to specify arch-dependant or -independant -# packages. -sub GetPackages { $type=shift; - my $package; - my $arch; - my @list; - open (CONTROL,") { - chomp; - s/\s+$//; - if (/^Package:\s+(.*)/) { - $package=$1; - } - if (/^Architecture:\s+(.*)/) { - $arch=$1; - } - if (!$_ or eof) { # end of stanza. - if ($package && - (($type eq 'indep' && $arch eq 'all') || - ($type eq 'arch' && $arch ne 'all'))) { - push @list, $package; - undef $package, $arch; - } - } - } - close CONTROL; - - return @list; -} - -# Passed an option name and an option value, adds packages to the list -# of packages. We need this so the list will be built up in the right -# order. -sub AddPackage { my($option,$value)=@_; - if ($option eq 'i' or $option eq 'indep') { - push @packages, GetPackages('indep'); - $indep=1; - } - elsif ($option eq 'a' or $option eq 'arch') { - push @packages, GetPackages('arch'); - $arch=1; - } - elsif ($option eq 'p' or $option eq 'package') { - push @packages, $value; - } - else { - $parse_error="bad option $option - should never happen!\n"; - } -} - -# Add a package to a list of packages that should not be acted on. -sub ExcludePackage { my($option,$value)=@_; - $exclude_package{$value}=1; -} +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Getopt; -# Add another item to the exclude list. -sub AddExclude { my($option,$value)=@_; - push @exclude,$value; +# This is a tricky (and nasty) bit: override the error() function, which +# comes from Dh_Lib, with one of our own so we print out the list of errors +# to the shell, which can do what it wants with them. +sub Dh_Getopt::error { my $message=shift; + print "DH_PARSE_ERROR='$message'\n"; + exit 1; } -use Getopt::Long; - -# Enable bundling of short command line options. -Getopt::Long::config("bundling"); - # Parse options. -$ret=GetOptions( - "v" => \$verbose, - "verbose" => \$verbose, - - "i" => \&AddPackage, - "indep" => \&AddPackage, - - "a" => \&AddPackage, - "arch" => \&AddPackage, - - "p=s" => \&AddPackage, - "package=s" => \&AddPackage, - - "N=s" => \&ExcludePackage, - "no-package=s" => \&ExcludePackage, - - "n" => \$noscripts, - "noscripts" => \$noscripts, - - "x" => \$include, # is -x for some unknown historical reason.. - "include-conffiles" => \$include, - - "X=s" => \&AddExclude, - "exclude=s" => \&AddExclude, - - "d" => \$d_flag, - "remove-d" => \$d_flag, - - "r" => \$r_flag, - "no-restart-on-upgrade" => \$r_flag, - - "k" => \$k_flag, - "keep" => \$k_flag, - - "P=s" => \$tmpdir, - "tmpdir=s" => \$tmpdir, - - "u=s", => \$u_params, - "update-rcd-params=s", => \$u_params, - "dpkg-shlibdeps-params=s", => \$u_params, - - "m=s", => \$major, - "major=s" => \$major, - - "V:s", => \$version_info, - "version-info:s" => \$version_info, - - "A" => \$all, - "all" => \$all, - - "no-act" => \$no_act, - - "init-script=s" => \$init_script, -); - -if (!$ret) { - $parse_error="exiting with unknown option."; -} - -# Check to see if -V was specified. If so, but no parameters were passed, -# the variable will be defined but empty. -if (defined($version_info)) { - $version_info_set=1; -} - -# Check to see if DH_VERBOSE environment variable was set, if so, make sure -# verbose is on. -if ($ENV{DH_VERBOSE} ne undef) { - $verbose=1; -} - -# Check to see if DH_NO_ACT was set, if so, make sure no act mode is on. -if ($ENV{DH_NO_ACT} ne undef) { - $no_act=1; -} - -$exclude=join ' ', @exclude; -$exclude_grep=join '|', @exclude; -foreach (@exclude) { - $exclude_find.="-regex .*".quotemeta($_).".* -or "; -} -$exclude_find=~s/ -or $//; - -$include=join ' ', @include; - -# Remove excluded packages from the list of packages to act on. -undef @package_list; -foreach $package (@packages) { - if (! $exclude_package{$package}) { - push @package_list, $package; +%options=Dh_Getopt::parseopts(); + +# Change a few lists in %options into strings, +# generate some options that only need to be visible to the +# shell scripts so Dh_Getopt doesn't bother generating. +$options{DOPACKAGES}=join " ",@{$options{DOPACKAGES}}; +if ($#{$options{EXCLUDE}} > -1) { + $options{EXCLUDE_GREP}=join '|', @{$options{EXCLUDE}}; + foreach (@{$options{EXCLUDE}}) { + $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or "; } + $options{EXCLUDE_FIND}=~s/ -or $//; } +$options{EXCLUDE}=join " ",@{$options{EXCLUDE}}; + +# Now output everything, in a format suitable for a shell to eval it. +foreach (keys(%options)) { print "DH_$_='$options{$_}'\n" }; -# Now output everything, in a format suitable for a shell to eval it. -# Note the last line sets $@ in the shell to whatever arguements remain. -print qq{ -DH_VERBOSE='$verbose' -DH_NO_ACT='$no_act' -DH_DOPACKAGES='@package_list' -DH_DOINDEP='$indep' -DH_DOARCH='$arch' -DH_NOSCRIPTS='$noscripts' -DH_INCLUDE_CONFFILES='$include' -DH_EXCLUDE='$exclude' -DH_EXCLUDE_GREP='$exclude_grep' -DH_EXCLUDE_FIND='$exclude_find' -DH_D_FLAG='$d_flag' -DH_R_FLAG='$r_flag' -DH_K_FLAG='$k_flag' -DH_TMPDIR='$tmpdir' -DH_U_PARAMS='$u_params' -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 -}; +# This sets $@ in the shell to whatever arguements remain. +print "set -- @ARGV\n" diff --git a/dh_installdocs b/dh_installdocs index fcdedc50..f4662431 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -1,60 +1,61 @@ -#!/bin/sh -e +#!/usr/bin/perl # # Reads debian/docs, installs all files listed there into /usr/doc/$PACKAGE # Also installs the debian/copyright and debian/README.debian and debian/TODO -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - file=`pkgfile $PACKAGE docs` - - if [ ! -d $TMP/usr/doc/$PACKAGE ]; then - doit "install -d $TMP/usr/doc/$PACKAGE" - fi - - docs="" - - if [ "$file" ]; then - docs=`tr "\n" " " < $file` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - docs="$* $docs" - fi - - if [ "$docs" ]; then - doit "cp -a $docs $TMP/usr/doc/$PACKAGE/" - fi - - # .Debian is correct, according to policy. - readme_debian=`pkgfile $PACKAGE README.Debian` - if [ -z "$readme_debian" ]; then - readme_debian=`pkgfile $PACKAGE README.debian` - fi - if [ "$readme_debian" ]; then - doit "install -m 644 -p $readme_debian $TMP/usr/doc/$PACKAGE/README.Debian" - fi - - todo=`pkgfile $PACKAGE TODO` - if [ "$todo" ]; then - if isnative; then - doit "install -m 655 -p $todo $TMP/usr/doc/$PACKAGE/TODO" - else - doit "install -m 644 -p $todo $TMP/usr/doc/$PACKAGE/TODO.Debian" - fi - fi +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"docs"); + + if ( ! -d "$TMP/usr/doc/$PACKAGE") { + doit("install","-d","$TMP/usr/doc/$PACKAGE"); + } + + undef @docs; + + if ($file) { + @docs=filearray($file); + } + + if (($PACKAGE = $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @docs, @ARGV; + } + + if (@docs) { + doit("cp","-a",@docs,"$TMP/usr/doc/$PACKAGE/"); + } + + # .Debian is correct, according to policy, but I'm easy. + $readme_debian=pkgfile($PACKAGE,'README.Debian'); + if (! $readme_debian) { + $readme_debian=pkgfile($PACKAGE,'README.debian'); + } + if ($readme_debian) { + doit("install","-m","644","-p","$readme_debian","$TMP/usr/doc/$PACKAGE/README.Debian"); + } + + $todo=pkgfile($PACKAGE,'TODO'); + if ($todo) { + if (isnative()) { + doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO"); + } + else { + doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO.Debian"); + } + } # 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 + $copyright=pkgfile($PACKAGE,'copyright'); + if (! $copyright && -e "debian/copyright") { + $copyright="debian/copyright"; + } + if ($copyright) { + doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); + } +} diff --git a/dh_installdocs.1 b/dh_installdocs.1 index ffae1623..72f80ecd 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -54,7 +54,8 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH BUGS -Filenames with spaces in them will not currently be installed. +It's impossible to specify filenames with spaces or other whitespace in them +in debian/docs file. This is more a historical design flaw than a bug. .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/dh_lib b/dh_lib index 7ebc8be1..41812b8f 100644 --- a/dh_lib +++ b/dh_lib @@ -134,42 +134,6 @@ 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. # Check to see if an argument on the command line starts with a dash. diff --git a/doc/TODO b/doc/TODO index 83f38659..e3042fbc 100644 --- a/doc/TODO +++ b/doc/TODO @@ -11,6 +11,7 @@ Bugs: Wishlist items: +* update PROGRAMMING to cover new perl interface. * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). * info support for debhelper (currently implemented, but I hate how I did it, @@ -61,19 +62,9 @@ Depricated: Long term goals: -Convert selected and then selected debhelper commands (dh_installmanpages?) -to be perl programs, for speed, ease of maintainence, and 8-bit cleanness. -Tricky, because of the -v option -- they'd have to call external commands -like install and cp, and log such calls if verbose was on. Maybe something -like: +Convert selected debhelper commands (dh_installmanpages?) to be perl +programs, for speed, ease of maintainence, and 8-bit cleanness. -doit { - system @_; - if ($DH_VERBOSE) { - print join " ", @_; - } -} +Fixes to backport to 1.0 tree: -However, this will output commands that are incorrect if the filenames in -them contain spaces or other weird characters. Hmm, maybe such things should -just be escaped with \'s in the output? +* dh_installdocs used -m 655 for a TODO file. -- cgit v1.2.3 From 0a47c6cde2c9bca0f650b8731bb9fd11a7797f9e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:57 +0000 Subject: r109: Initial Import --- Dh_Getopt.pm | 34 +++++---------- Dh_Lib.pm | 119 ++++++++++++++++++++++++++++++++++------------------- debian/changelog | 15 +++++++ dh_getopt.pl | 25 ++++++++++- dh_installdocs | 4 +- dh_installexamples | 48 ++++++++++----------- dh_movefiles | 4 +- doc/TODO | 17 ++++---- 8 files changed, 163 insertions(+), 103 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index eb6aef98..85f0e15b 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -7,12 +7,12 @@ package Dh_Getopt; use strict; -use Exporter; -my @ISA=qw(Exporter); -my @EXPORT=qw(&parseopts); - use Dh_Lib; use Getopt::Long; +use Exporter; +#use vars qw{@ISA @EXPORT}; +#@ISA=qw(Exporter); +#@EXPORT=qw(&aparseopts); # FIXME: for some reason, this doesn't work. my (%options, %exclude_package); @@ -46,11 +46,6 @@ sub AddExclude { my($option,$value)=@_; push @{$options{EXCLUDE}},$value; } -sub import { - # Enable bundling of short command line options. - Getopt::Long::config("bundling"); -} - # Parse options and return a hash of the values. sub parseopts { undef %options; @@ -72,8 +67,8 @@ sub parseopts { "no-package=s" => \&ExcludePackage, "n" => \$options{NOSCRIPTS}, -# "noscripts" => \$options(NOSCRIPTS}, - + "noscripts" => \$options{NOSCRIPTS}, + "x" => \$options{INCLUDE_CONFFILES}, # is -x for some unknown historical reason.. "include-conffiles" => \$options{INCLUDE_CONFFILES}, @@ -120,18 +115,6 @@ sub parseopts { $options{V_FLAG_SET}=1; } - # Check to see if DH_VERBOSE environment variable was set, if so, - # make sure verbose is on. - if ($ENV{DH_VERBOSE} ne undef) { - $options{VERBOSE}=1; - } - - # Check to see if DH_NO_ACT environment variable was set, if so, - # make sure no act mode is on. - if ($ENV{DH_NO_ACT} ne undef) { - $options{NO_ACT}=1; - } - # Remove excluded packages from the list of packages to act on. my @package_list; my $package; @@ -145,4 +128,9 @@ sub parseopts { return %options; } +sub import { + # Enable bundling of short command line options. + Getopt::Long::config("bundling"); +} + 1 diff --git a/Dh_Lib.pm b/Dh_Lib.pm index c9b964c1..c58d5c08 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -5,9 +5,10 @@ # Joey Hess, GPL copyright 1997, 1998. package Dh_Lib; +use strict; use Exporter; -use vars qw(%dh); +use vars qw(@ISA @EXPORT %dh); @ISA=qw(Exporter); @EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages @@ -18,6 +19,7 @@ sub init { # if so, we need to pass this off to the resource intensive Getopt::Long, # which I'd prefer to avoid loading at all if possible. my $parseopt=undef; + my $arg; foreach $arg (@ARGV) { if ($arg=~m/^-/) { $parseopt=1; @@ -30,6 +32,18 @@ sub init { %dh=Dh_Getopt::parseopts(); } + # Check to see if DH_VERBOSE environment variable was set, if so, + # make sure verbose is on. + if (defined $ENV{DH_VERBOSE} && $ENV{DH_VERBOSE} ne "") { + $dh{VERBOSE}=1; + } + + # Check to see if DH_NO_ACT environment variable was set, if so, + # make sure no act mode is on. + if (defined $ENV{DH_NO_ACT} && $ENV{DH_NO_ACT} ne "") { + $dh{NO_ACT}=1; + } + # Get the name of the main binary package (first one listed in # debian/control). my @allpackages=GetPackages(); @@ -37,17 +51,19 @@ sub init { # Check if packages to build have been specified, if not, fall back to # the default, doing them all. - if (! @{$dh{DOPACKAGES}}) { - if ($dh{DH_DOINDEP} || $dh{DH_DOARCH}) { - error("I have no package to build."); + if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) { + if ($dh{DOINDEP} || $dh{DOARCH}) { + # User specified that all arch (in)dep package be + # built, and there are none of that type. + error("I have no package to build"); } push @{$dh{DOPACKAGES}},@allpackages; } # Check to see if -P was specified. If so, we can only act on a single # package. - if ($dh{TMPDIR} || $#{$dh{DOPACKAGES}} > 0) { - error("-P was specified, but multiple packages would be acted on."); + if ($dh{TMPDIR} && $#{$dh{DOPACKAGES}} > 0) { + error("-P was specified, but multiple packages would be acted on (".join(",",@{$dh{DOPACKAGES}}).")."); } # Figure out which package is the first one we were instructed to build. @@ -63,7 +79,7 @@ sub init { # Note that this cannot handle complex commands, especially anything # involving redirection. Use complex_doit instead. sub doit { - verbose_print(join(" ",,@_)); + verbose_print(join(" ",@_)); if (! $dh{NO_ACT}) { system(@_) == 0 @@ -72,10 +88,18 @@ sub doit { } } -# This is an identical command to doit, except the parameters passed to it -# can include complex shell stull like redirection and compound commands. +# Run a command and display the command to stdout if verbose mode is on. +# Use doit() if you can, instead of this function, because this function +# forks a shell. However, this function can handle more complicated stuff +# like redirection. sub complex_doit { - error("complex_doit() not yet supported"); + verbose_print(join(" ",@_)); + + if (! $dh{NO_ACT}) { + # The join makes system get a scalar so it forks off a shell. + system(join(" ",@_)) == 0 + || error("command returned error code"); + } } # Print something if the verbose flag is on. @@ -93,9 +117,14 @@ sub error { my $message=shift; # Output a warning. sub warning { my $message=shift; + print STDERR basename().": $message\n"; +} + +# Returns the basename of the program. +sub basename { my $fn=$0; $fn=~s:.*/(.*?):$1:; - print STDERR "$fn: $message\n"; + return $fn; } # Pass it a name of a binary package, it returns the name of the tmp dir to @@ -132,7 +161,7 @@ sub pkgfile { my $package=shift; my $filename=shift; # Pass it a name of a binary package, it returns the name to prefix to files # in debian for this package. sub pkgext { my $package=shift; - if ($package ne $MAINPACKAGE) { + if ($package ne $dh{MAINPACKAGE}) { return "$package."; } return ""; @@ -173,40 +202,45 @@ sub pkgext { my $package=shift; # Only works if the script has #DEBHELPER# in it. # # Parameters: -# 1: script to add to -# 2: filename of snippet -# 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ -sub autoscript { +# 1: package +# 2: script to add to +# 3: filename of snippet +# 4: sed to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ +sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $sed=shift; error "autoscript() not yet implemented (lazy, lazy!)"; -# autoscript_script=$1 -# autoscript_filename=$2 -# autoscript_sed=$3 -# autoscript_debscript=debian/`pkgext $PACKAGE`$autoscript_script.debhelper -# -# if [ -e "$DH_AUTOSCRIPTDIR/$autoscript_filename" ]; then -# autoscript_filename="$DH_AUTOSCRIPTDIR/$autoscript_filename" -# else -# if [ -e "/usr/lib/debhelper/autoscripts/$autoscript_filename" ]; then -# autoscript_filename="/usr/lib/debhelper/autoscripts/$autoscript_filename" -# else -# error "/usr/lib/debhelper/autoscripts/$autoscript_filename does not exist" -# fi -# fi -# -# complex_doit "echo \"# Automatically added by `basename $0`\" >> $autoscript_debscript" -# complex_doit "sed \"$autoscript_sed\" $autoscript_filename >> $autoscript_debscript" -# complex_doit "echo '# End automatically added section' >> $autoscript_debscript" + + # This is the file we will append to. + my $outfile="debian/".pkgext($package)."$script.debhelper"; + + # Figure out what shell script snippet to use. + my $infile; + if ( -e "$main::ENV{DH_AUTOSCRIPTDIR}/$filename" ) { + $infile="$main::ENV{DH_AUTOSCRIPTDIR}/$filename"; + } + else { + if ( -e "/usr/lib/debhelper/autoscripts/$filename" ) { + $infile="/usr/lib/debhelper/autoscripts/$filename"; + } + else { + error("/usr/lib/debhelper/autoscripts/$filename does not exist"); + } + } + + # TODO: do this in perl, perhaps? + complex_doit("echo \"# Automatically added by ".basename().">> $outfile"); + complex_doit("sed \"$sed\" $infile >> $outfile"); + complex_doit("echo '# End automatically added section' >> $outfile"); } # Reads in the specified file, one word at a time, and returns an array of # the result. -sub filearray { $file=shift; +sub filearray { my $file=shift; my @ret; open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); while () { push @ret,split(/\s/,$_); } - close DH_ARRAY; + close DH_FARRAY_IN; return @ret; } @@ -214,10 +248,11 @@ sub filearray { $file=shift; # Returns a list of packages in the control file. # Must pass "arch" or "indep" to specify arch-dependant or -independant # packages. If nothing is specified, returns all packages. -sub GetPackages { $type=shift; - my $package; - my $arch; - my @list; +sub GetPackages { my $type=shift; + $type="" if ! defined $type; + my $package=""; + my $arch=""; + my @list=(); open (CONTROL,") { @@ -235,8 +270,8 @@ sub GetPackages { $type=shift; ($type eq 'arch' && $arch ne 'all') || ! $type)) { push @list, $package; - undef $package; - undef $arch; + $package=""; + $arch=""; } } } diff --git a/debian/changelog b/debian/changelog index 9d4a6a4e..22b55879 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +debhelper (1.1.3) unstable; urgency=low + + * dh_md5sums: -x was broken since version 1.1.1 - fixed. + * dh_lib: removed get_arch_indep_packages() function that hasn't been used + at all for a long while. + * Added Dh_Lib.pm, a translation of dh_lib into perl. + * dh_getopt.pl: moved most of it into new Dh_Getopt.pm module, rewriting + large chunks in the process. + * dh_installdocs: completly rewritten in perl. Now it's faster and it can + install many oddly named files it died on before. + * dh_installdocs: fixed a bug that installed TODO files mode 655 in native + debian packages. + + -- Joey Hess Mon, 10 Aug 1998 15:01:15 -0700 + debhelper (1.1.2) unstable; urgency=low * dh_strip: added -X to specify files to not strip (#25590). diff --git a/dh_getopt.pl b/dh_getopt.pl index 4abe9160..b1dcf7b1 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -7,6 +7,7 @@ # Joey Hess, GPL copyright 1998. BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use strict; use Dh_Getopt; # This is a tricky (and nasty) bit: override the error() function, which @@ -18,7 +19,7 @@ sub Dh_Getopt::error { my $message=shift; } # Parse options. -%options=Dh_Getopt::parseopts(); +my %options=Dh_Getopt::parseopts(); # Change a few lists in %options into strings, # generate some options that only need to be visible to the @@ -33,8 +34,28 @@ if ($#{$options{EXCLUDE}} > -1) { } $options{EXCLUDE}=join " ",@{$options{EXCLUDE}}; +# Check to see if DH_VERBOSE environment variable was set, if so, +# make sure verbose is on. +if (defined $main::ENV{DH_VERBOSE}) { + if ($main::ENV{DH_VERBOSE} ne undef) { + $options{VERBOSE}=1; + } +} + +# Check to see if DH_NO_ACT environment variable was set, if so, +# make sure no act mode is on. +if (defined $main::ENV{DH_NO_ACT}) { + if ($main::ENV{DH_NO_ACT} ne undef) { + $options{NO_ACT}=1; + } +} + # Now output everything, in a format suitable for a shell to eval it. -foreach (keys(%options)) { print "DH_$_='$options{$_}'\n" }; +foreach (keys(%options)) { + if (defined $options{$_}) { + print "DH_$_='$options{$_}'\n"; + } +} # This sets $@ in the shell to whatever arguements remain. print "set -- @ARGV\n" diff --git a/dh_installdocs b/dh_installdocs index f4662431..3229cd15 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # Reads debian/docs, installs all files listed there into /usr/doc/$PACKAGE # Also installs the debian/copyright and debian/README.debian and debian/TODO @@ -21,7 +21,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { @docs=filearray($file); } - if (($PACKAGE = $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { push @docs, @ARGV; } diff --git a/dh_installexamples b/dh_installexamples index 623d882b..88e964ba 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -1,31 +1,31 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Reads debian/examples, installs all files listed there into # /usr/doc/$PACKAGE/examples -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` - file=`pkgfile $PACKAGE examples` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"examples"); + + undef @examples; + + if ($file) { + @examples=filearray($file); + } - examples="" + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @examples, @ARGV; + } - if [ "$file" ]; then - examples=`tr "\n" " " < $file` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - examples="$* $examples" - fi - - if [ "$examples" ]; then - if [ ! -d $TMP/usr/doc/$PACKAGE/examples ]; then - doit "install -d $TMP/usr/doc/$PACKAGE/examples" - fi - - doit "cp -a $examples $TMP/usr/doc/$PACKAGE/examples/" - fi -done + if (@examples) { + if (! -d "$TMP/usr/doc/$PACKAGE/examples") { + doit("install","-d","$TMP/usr/doc/$PACKAGE/examples"); + } + + doit("cp","-a",@examples,"$TMP/usr/doc/$PACKAGE/examples"); + } +} diff --git a/dh_movefiles b/dh_movefiles index f44121c8..ba482050 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -44,13 +44,13 @@ for PACKAGE in $DH_DOPACKAGES; do # moved. doit "rm -f movelist" for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" ]; then + if [ ! -e "debian/tmp/$i" -o -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" ]; then + if [ ! -e "debian/tmp/$i" -o -L "debian/tmp/$i" ]; then fail=1 fi complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print || true) >> movelist" diff --git a/doc/TODO b/doc/TODO index e3042fbc..756eb4bd 100644 --- a/doc/TODO +++ b/doc/TODO @@ -3,11 +3,9 @@ list grows - I welcome patches to fix items on it! Bugs: -* dh_installdocs fails if debian/docs is empty except for a blank line. - There are probably other instances of this. Debhelper should behave better - (#24686). * all commands should print a warning message if non-cumulative parameters - are given more than once (ie, two -u's to dh_gencontrol). + are given more than once (ie, two -u's to dh_gencontrol). (#22588) + (Bug currently under dispute, I think this is bogus). Wishlist items: @@ -58,13 +56,16 @@ Depricated: * remove dh_installdebfiles, dh_du. - need to wait a reasonable length of time. I'm currently planning - on doing this after slink is released. + on doing this after slink is released or one year after they were + depricated, whichever comes first. Be sure to grep whole debian + archive for alls to them before removing them, though! Long term goals: -Convert selected debhelper commands (dh_installmanpages?) to be perl -programs, for speed, ease of maintainence, and 8-bit cleanness. +* Convert selected debhelper commands to be perl programs, for speed, ease + of maintainence, and 8-bit cleanness. Fixes to backport to 1.0 tree: -* dh_installdocs used -m 655 for a TODO file. +* dh_installdocs used -m 655 for a TODO file. (minor, dh_fixperms cleans up + after it) -- cgit v1.2.3 From 03d1a2e0c10456c65fbf36e1f38619803f4f2bfd Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:57:23 +0000 Subject: r110: Initial Import --- Dh_Lib.pm | 24 +++++---- debian/changelog | 20 ++++++++ dh_builddeb | 15 +++--- dh_du | 17 +------ dh_installchangelogs | 58 +++++++++++---------- dh_installchangelogs.1 | 2 +- dh_installdebfiles | 2 +- dh_installdebfiles.1 | 2 +- dh_installdirs | 79 ++++++++++++++-------------- dh_installdirs.1 | 3 +- dh_installexamples.1 | 3 +- doc/PROGRAMMING | 136 +++++++++++++++++++++++++++++-------------------- doc/TODO | 4 +- 13 files changed, 204 insertions(+), 161 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index c58d5c08..49e337a9 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -72,6 +72,12 @@ sub init { $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; } +# Escapes out shell metacharacters in a word of shell script. +sub escape_shell { my $word=shift; + $word=~s/([\s><&!\[\]\{\}\(\)\$])/\\$1/g; + return $word; +} + # 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 # function. @@ -79,7 +85,7 @@ sub init { # Note that this cannot handle complex commands, especially anything # involving redirection. Use complex_doit instead. sub doit { - verbose_print(join(" ",@_)); + verbose_print(join(" ",map { escape_shell($_) } @_)); if (! $dh{NO_ACT}) { system(@_) == 0 @@ -171,30 +177,30 @@ sub pkgext { my $package=shift; # As a side effect, sets $dh{VERSION} to the version of this package. { # Caches return code so it only needs to run dpkg-parsechangelog once. - my $isnative_cache; + my %isnative_cache; sub isnative { my $package=shift; - if ($isnative_cache eq undef) { + if (! defined $isnative_cache{$package}) { # Make sure we look at the correct changelog. my $isnative_changelog=pkgfile($package,"changelog"); if (! $isnative_changelog) { $isnative_changelog="debian/changelog"; } - + # Get the package version. my $version=`dpkg-parsechangelog -l$isnative_changelog`; - ($dh{VERSION})=$version=~s/[^|\n]Version: \(.*\)\n//m; - + ($dh{VERSION})=$version=~m/Version: (.*)/m; + # Is this a native Debian package? if ($dh{VERSION}=~m/.*-/) { - $isnative_cache=1; + $isnative_cache{$package}=0; } else { - $isnative_cache=0; + $isnative_cache{$package}=1; } } - return $isnative_cache; + return $isnative_cache{$package}; } } diff --git a/debian/changelog b/debian/changelog index 22b55879..06f1f332 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +debhelper (1.1.4) unstable; urgency=low + + * dh_movefiles: fixed bug introduced in 1.1.1 where it would fail in some + cases if you tried to move a broken symlink. + * dh_installdocs: was only operating on the first package. + * dh_installexamples: rewritten in perl. + * Dh_Lib.pm: all multiple package operations were broken. + * Dh_Lib.pm: implemented complex_doit() and autoscript(). + * Made all perl code work with use strict and -w (well, except + dh_getopt.pl, but that's a hack that'll go away one day). + * I didn't realize, but rewriting dh_installdocs in perl fixed bug #24686, + although this same problem applies to other debhelper programs... like + dh_installexamples, which had the same bug fixed when I rewrote it in + perl just now. + * Dh_Lib.pm: accidentially didn't check DH_VERBOSE if commands were not + passed any switches. + * Dh_Getopt.pm: --noscripts was broken. + + -- Joey Hess Tue, 11 Aug 1998 12:44:04 -0700 + debhelper (1.1.3) unstable; urgency=low * dh_md5sums: -x was broken since version 1.1.1 - fixed. diff --git a/dh_builddeb b/dh_builddeb index 9ddd21dc..06cc1beb 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -1,11 +1,12 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Build the .deb package, assuming all the files are set up. -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` - doit "dpkg --build $TMP .." -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + doit("dpkg","--build",$TMP,".."); +} diff --git a/dh_du b/dh_du index 73df2a0b..9e641a27 100755 --- a/dh_du +++ b/dh_du @@ -5,19 +5,4 @@ # # No longer - it was decided these files are a bad idea. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -echo "* Note: dh_du does nothing and is deprecated. Remove it from debian/rules." >&2 - -#for PACKAGE in $DH_DOPACKAGES; do -# TMP=`tmpdir $PACKAGE` -# -# if [ ! -d "$TMP/DEBIAN" ]; then -# doit "install -d $TMP/DEBIAN" -# fi -# -# # 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 $TMP/DEBIAN/du" -#done +echo "dh_du: this program does nothing and is deprecated. Remove it from debian/rules." >&2 diff --git a/dh_installchangelogs b/dh_installchangelogs index 15a42c09..0024fc10 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Installs debian/changelog. If another filename is passed to it, installs # that file as the upstream changelog. @@ -7,35 +7,41 @@ # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -UPSTREAM=$1 +$upstream=shift; -if isnative && [ "$UPSTREAM" ]; then - error "Cannot specify an upstream changelog for a native debian package." -fi +if (isnative($dh{MAINPACKAGE}) && defined $upstream) { + error("Cannot specify an upstream changelog for a native debian package."); +} -if isnative; then - CHANGELOG_NAME=changelog -else - CHANGELOG_NAME=changelog.Debian -fi +if (isnative($dh{MAINPACKAGE})) { + $changelog_name='changelog'; +} +else { + $changelog_name='changelog.Debian'; +} -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $changelog=pkgfile($PACKAGE,"changelog"); - changelog=`pkgfile $PACKAGE changelog` - if [ ! "$changelog" ]; then - changelog=debian/changelog - fi + if (!$changelog) { + $changelog="debian/changelog"; + } - if [ ! -d $TMP/usr/doc/$PACKAGE ]; then - doit "install -d $TMP/usr/doc/$PACKAGE" - fi - doit "install -p -m644 $changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" + if (! -e $changelog) { + error("could not find changelog $changelog"); + } - if [ "$UPSTREAM" ]; then - doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog" - fi -done + if (! -d "$TMP/usr/doc/$PACKAGE") { + doit("install","-d","$TMP/usr/doc/$PACKAGE"); + } + doit("install","-p","-m644",$changelog,"$TMP/usr/doc/$PACKAGE/$changelog_name"); + + if ($upstream) { + doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + } +} diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 70822338..9a579a65 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -26,7 +26,7 @@ See for a list of options common to all debhelper commands. .TP .B upstream -Instal this file as the upstream changelog. +Install this file as the upstream changelog. .SH NOTES It is an error to specify an upstream changelog file for a debian native package. diff --git a/dh_installdebfiles b/dh_installdebfiles index 0fba35a5..d999c91b 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -5,7 +5,7 @@ PATH=debian:$PATH:/usr/lib/debhelper -warn "Note: use of this program is deprecated." +echo "dh_installdebfiles: use of this program is deprecated, see man page." >&2 dh_installdeb $* dh_shlibdeps $* diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index ae4782d2..5e41117a 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -16,7 +16,7 @@ programs, and you may replace any calls to this program by: dh_shlibdeps dh_gencontrol .SH WARNING -This program will be removed at some time in the furture. +This program will be removed at some time in the future. .SH OPTIONS Any options passed to this program will be sent to each of the 3 programs listed above. diff --git a/dh_installdirs b/dh_installdirs index 725cdb2c..2d12b76b 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -1,43 +1,42 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # -# Reads debian/dirs, creates the directories listed there there +# Reads debian/dirs, creates the directories listed there + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"dirs"); + + if (! -e $TMP) { + doit("install","-d",$TMP); + } + + undef @dirs; + + if ($file) { + @dirs=filearray($file) + } + + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @dirs, @ARGV; + } + + if (@dirs) { + # Stick the $TMP onto the front of all the dirs. + # This is necessary, for 2 reasons, one to make them + # be in the right directory, but more importantly, it + # protects against the danger of absolute dirs being + # specified. + @dirs=map { + $_="$TMP/$_"; + tr:/:/:s; # just beautification. + $_ + } @dirs; -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - file=`pkgfile $PACKAGE dirs` - - if [ ! -d $TMP ]; then - doit "install -d $TMP" - fi - - dirs="" - - if [ "$file" ]; then - dirs=`tr "\n" " " < $file` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - dirs="$* $dirs" - fi - - if [ "$dirs" ]; then - # Check to see if any of the dirs are absolute. - for dir in "$dirs" ; do - if expr "$dir" : "/" >/dev/null ; then - error "Absolute directory name \"$dir\" specified." - fi - done # Create dirs. - olddir=`pwd` - verbose_echo "cd $TMP" - cd "$TMP" - doit "install -d $dirs" - verbose_echo "cd $olddir" - cd "$olddir" - fi -done - + doit("install","-d",@dirs); + } +} diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 77c992d9..95be7151 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -40,6 +40,7 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH BUGS -Directories with spaces in them will not currently be installed properly. +It's impossible to specify filenames with spaces or other whitespace in them +in debian/dirs file. This is more a historical design flaw than a bug. .SH AUTHOR Joey Hess diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 776aef79..91d9988b 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -40,7 +40,8 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH BUGS -Filenames with spaces in them will not currently be installed. +It's impossible to specify filenames with spaces or other whitespace in them +in debian/examples file. This is more a historical design flaw than a bug. .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 878c5a2e..e514095d 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -36,15 +36,18 @@ merge these modifications into the actual postinst scripts. There are always exceptions. Just ask me. -Introducing dh_lib: ------------------- +Introducing dh_lib and Dh_Lib.pm: +-------------------------------- -All debhelper programs use the dh_lib library (actually it's a shell script) -to parse their arguments and set some useful variables. It's not mandatory -that your program use dh_lib, but it will make it a lot easier to keep it in +dh_lib/Dh_lib.pm is the library used by all debhelper programs to parse +their arguments and set some useful variables. It's not mandatory that your +program use dh_lib/Dh_lib.pm, but it will make it a lot easier to keep it in sync with the rest of debhelper if it does, so this is highly encouraged. +There are two versions of this library - dh_lib is a shell library, while +Dh_Lib.pm is a perl module. -Typically, you invoke dh_lib like this: +Typically, you invoke dh_lib like this if your debhelper program is a shell +script: PATH=debian:$PATH:/usr/lib/debhelper . dh_lib @@ -53,74 +56,93 @@ The path statement is there to make your program look first in debian/ for dh_lib (so users can install a modified version there if necessary), then the rest of the path, then the canonical location of dh_lib, /usr/lib/debhelper. +If you are writing a perl program instead, use Dh_lib.pm like this: + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +The BEGIN block is there to make perl look for the module in all the right +places. + +Notice the init() function in the perl version. dh_lib automatically parses +the command line and does some other initialization tasks. Dh_Lib.pm +requires you to run init() to accomplish the same task. + Argument processing: ------------------- All debhelper programs should respond to certain arguments, such as -v, -i, --a, and -p. To help you make this work right, dh_lib handles argument -processing. +-a, and -p. To help you make this work right, dh_lib/Dh_Lib.pm handles +argument processing. As soon as dh_lib loads, it processes any arguments that have been passed to -your program. The following variables may be set during this stage; your -program can use them later: +your program. On the other hand, you need to call init() in Dh_Lib.pm before +it will parse arguments. + +After argument processing, some global variables are used to hold the +results; program can use them later. If using dh_lib, prefix DH_ to the name +of each of these variables to get the name of the environment variable that +is set. If using Dh_lib.pm, these variables are in the %dh hash. switch variable description --v DH_VERBOSE should the program verbosely output what it is +-v VERBOSE should the program verbosely output what it is doing? ---no-act DH_NO_ACT should the program not actually do anything? --i,-a,-p,-N DH_DOPACKAGES a space delimited list of the binary packages - to act on --i,-p,-N DH_DOINDEP a space delimited list of the binary independent +--no-act NO_ACT should the program not actually do anything? +-i,-a,-p,-N DOPACKAGES a space delimited list of the binary packages + to act on (in Dh_Lib.pm, this is an array) +-i,-p,-N DOINDEP a space delimited list of the binary independent packages to act on --a,-p,-N DH_DOARCH a space delimited list of the binary dependent +-a,-p,-N DOARCH a space delimited list of the binary dependent packages to act on --n DH_NOSCRIPTS if set, do not make any modifications to the +-n NOSCRIPTS if set, do not make any modifications to the package's postinst, postrm, etc scripts. --X DH_EXCLUDE exclude a something from processing (you +-X EXCLUDE exclude a something from processing (you decide what this means for your program) - DH_EXCLUDE_GREP same as DH_EXCLUDE, except all items are + (In Dh_Lib.pm, this is an array) + EXCLUDE_GREP same as DH_EXCLUDE, except all items are separated by '|' characters, instead of spaces, - handy for egrep -v - DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are put + handy for egrep -v (only available to dh_lib) + 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) --x DH_INCLUDE_CONFFILES + that, of course) (only available to dh_lib) +-x INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. --d DH_D_FLAG you decide what this means to your program --r DH_R_FLAG you decide what this means to your program --k DH_K_FLAG you decide what this means to your program --P DH_TMPDIR package build directory (implies only one +-d D_FLAG you decide what this means to your program +-r R_FLAG you decide what this means to your program +-k K_FLAG you decide what this means to your program +-P TMPDIR package build directory (implies only one package is being acted on) --u DH_U_PARAMS will be set to a string, that is typically +-u U_PARAMS will be set to a string, that is typically parameters your program passes on to some other program. --m DH_M_PARAMS will be set to a string, you decide what it +-m M_PARAMS will be set to a string, you decide what it means to your program --V DH_V_FLAG will be set to a string, you decide what it +-V V_FLAG will be set to a string, you decide what it means to your program --V DH_V_FLAG_SET will be 1 if -V was specified, even if no +-V V_FLAG_SET will be 1 if -V was specified, even if no parameters were passed along with the -V --A DH_PARAMS_ALL generally means that additional command line +-A PARAMS_ALL generally means that additional command line parameters passed to the program (other than 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 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, -etc). +ignored, and you can access them later just as you normally would. If you need a new command line option, just ask me, and I will add it. Global variables: ---------------- -The following variables are also set, you can use any of them: +If using dh_lib, the following variables are also set as soon as you load +the library: MAINPACKAGE the name of the first binary package listed in debian/control @@ -128,21 +150,28 @@ DH_FIRSTPACKAGE the first package we were instructed to act on. This package typically gets special treatment, additional arguments specified on the command line may effect it. +If using Dh_Lib.pm, these are only set after init(), and they are named +$dh{MAINPACKAGE} and $dh{FIRSTPACKAGE}, instead. + Functions: --------- -Dh_lib also contains a number of functions you may find useful. +dh_lib/Dh_Lib.pm also contains a number of functions you may find useful. +Note that the functions calling conventions are slightly different between +the two versions of the library. doit() - Pass this function a string that is a shell command. It will run the - command (unless DH_NO_ACT is set), and if DH_VERBOSE is set, it will - also output the command to stdout. You should use this function for - almost all commands your program performs that manipulate files in - the package build directories. + Pass this function a string (dh_lib) or array (Dh_Lib.pm) that is a + shell command. It will run the command (unless DH_NO_ACT is set), and + if DH_VERBOSE is set, it will also output the command to stdout. You + should use this function for almost all commands your program performs + that manipulate files in the package build directories. complex_doit() - This is the same as doit(), except you can pass more complicated - commands to it (ie, commands involving piping redirection) -verbose_echo() + Pass this function a string that is a shell command, it will run it + similarly to how doit() does. You can pass more complicated commands + to this (ie, commands involving piping redirection) +verbose_echo() (dh_lib) +verbose_print() (Dh_Lib.pm) Pass this command a string, and it will echo it if DH_VERBOSE is set. error() Pass this command a string, it will output it to standard error and @@ -174,18 +203,13 @@ isnative() As a side effect, VERSION is set to the version number of the package. autoscript() - Pass 3 parameters: - 1: script to add to - 2: filename of snippet - 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ - (optional) + Pass parameters: + - package to be affected (Dh_Lib.pm only) + - script to add to + - filename of snippet + - sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ + (optional) This command automatically adds shell script snippets to a debian maintainer script (like the postinst or prerm). -Notes: ------ - -Dh_lib is still evolving. -There will probably be a perl version too, in the future. - -- Joey Hess diff --git a/doc/TODO b/doc/TODO index 756eb4bd..a4e4a10d 100644 --- a/doc/TODO +++ b/doc/TODO @@ -9,7 +9,6 @@ Bugs: Wishlist items: -* update PROGRAMMING to cover new perl interface. * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). * info support for debhelper (currently implemented, but I hate how I did it, @@ -50,7 +49,8 @@ Wishlist items: they are stating that they don't do anything later to invalidate the cache, without calling ch_cache again. (#23792) * Add a switch to dh_installdeb to allow it to do user definied - substitutions. (#25235) + substitutions. TOH, maybe it's better if peopld just sed + postinst.in before debhelper gets it's hands on it... (#25235) Depricated: -- cgit v1.2.3 From 146954a9f0e172517970ebf9628940df6c09c366 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:16 +0000 Subject: r111: Initial Import --- debian/changelog | 23 +++++++++++++++++++---- dh_movefiles | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 06f1f332..05caf2c9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +debhelper (1.1.5) unstable; urgency=low + + * dh_builddeb, dh_installchangelogs: converted to perl. + * dh_installdirs: converted to perl, getting rid of nasty chdir en-route. + * dh_installdirs: now you can use absolute directory names too if you + prefer. + * doc/PROGRAMMING: updated to cover new perl modules. + * Dh_Lib.pm: doit(): when printing out commands that have run, escape + metacharacters in the output. I probably don't escape out all the + characters I should, but this is just a convenience to the user anyway. + * dh_installdebfiles: it's been broken forever, I fixed it. Obviously + nobody uses it anymore, which is good, since it's deprected :-) + + -- Joey Hess Tue, 11 Aug 1998 15:23:34 -0700 + debhelper (1.1.4) unstable; urgency=low * dh_movefiles: fixed bug introduced in 1.1.1 where it would fail in some @@ -8,10 +23,10 @@ debhelper (1.1.4) unstable; urgency=low * Dh_Lib.pm: implemented complex_doit() and autoscript(). * Made all perl code work with use strict and -w (well, except dh_getopt.pl, but that's a hack that'll go away one day). - * I didn't realize, but rewriting dh_installdocs in perl fixed bug #24686, - although this same problem applies to other debhelper programs... like - dh_installexamples, which had the same bug fixed when I rewrote it in - perl just now. + * I didn't realize, but rewriting dh_installdocs in perl fixed bug #24686 + (blank lines in debian/docs file problem), although this same problem + applies to other debhelper programs... like dh_installexamples, which had + the same bug fixed when I rewrote it in perl just now. * Dh_Lib.pm: accidentially didn't check DH_VERBOSE if commands were not passed any switches. * Dh_Getopt.pm: --noscripts was broken. diff --git a/dh_movefiles b/dh_movefiles index ba482050..712ed887 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -44,13 +44,13 @@ for PACKAGE in $DH_DOPACKAGES; do # moved. doit "rm -f movelist" for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" -o -L "debian/tmp/$i" ]; then + 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" -o -L "debian/tmp/$i" ]; then + 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" -- cgit v1.2.3 From 2de581368c8b8d4edd57210dc54eade8c15f0354 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:22 +0000 Subject: r112: Initial Import --- Dh_Lib.pm | 3 ++- debian/changelog | 7 +++++++ doc/README | 10 ++++++++++ examples/rules.multi | 3 +-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 49e337a9..b4d0db53 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -74,7 +74,8 @@ sub init { # Escapes out shell metacharacters in a word of shell script. sub escape_shell { my $word=shift; - $word=~s/([\s><&!\[\]\{\}\(\)\$])/\\$1/g; + # This list is from )Unix in a Nutshell_. (except '#') + $word=~s/([-\s!"$()*+#;<>?@\[\]\\`|~])/\\$1/g; return $word; } diff --git a/debian/changelog b/debian/changelog index 05caf2c9..b96ab89d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.6) unstable; urgency=low + + * dh_movefiles: don't die on symlinks (#25642). (Hope I got the fix right + this time..) + + -- Joey Hess Tue, 11 Aug 1998 20:11:13 -0700 + debhelper (1.1.5) unstable; urgency=low * dh_builddeb, dh_installchangelogs: converted to perl. diff --git a/doc/README b/doc/README index 845f94ef..76b2263e 100644 --- a/doc/README +++ b/doc/README @@ -41,4 +41,14 @@ print << `EOF` #DEBHELPER# EOF +Other notes: +----------- + +Note that if you are generating a debian package that has arch-indep and +arch-dependant portions, and you are using dh_movefiles to move the +arch-indep files out of debian/tmp, you need to make sure that dh_movefiles +does this even if only the arch-dependant package is being built (for ports +to other architectures). I handle this in debian/rules.multi by calling +dh_movefiles in the install target. + -- Joey Hess diff --git a/examples/rules.multi b/examples/rules.multi index 5852751e..04732edb 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -37,6 +37,7 @@ install-stamp: build-stamp # Add here commands to install the package into debian/tmp. #$(MAKE) prefix=`pwd`/debian/tmp/usr install + dh_movefiles touch install-stamp # Build architecture-independent files here. @@ -44,7 +45,6 @@ binary-indep: build install # dh_testversion dh_testdir -i dh_testroot -i - dh_movefiles -i dh_installdocs -i dh_installexamples -i dh_installmenu -i @@ -67,7 +67,6 @@ binary-arch: build install # dh_testversion dh_testdir -a dh_testroot -a - dh_movefiles -a dh_installdocs -a dh_installexamples -a dh_installmenu -a -- cgit v1.2.3 From 031868f3f6f1e1ff042f6c01d350d6bd260e4c9f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:27 +0000 Subject: r113: Initial Import --- debian/changelog | 10 ++++++++++ dh_clean | 51 ++++++++++++++++++++++++++++++--------------------- dh_clean.1 | 3 --- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index b96ab89d..e1c7ee75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.1.7) unstable; urgency=low + + * examples/rules.multi: moved dh_movefiles into the install section. + * doc/README: Added a note explaining why above change was necessary. + * Dh_Lib.pm: escape_shell(): now escapes the full range of special + characters recognized by bash (and ksh). Thanks to Branden Robinson + for looking that up. + + -- Joey Hess Tue, 11 Aug 1998 23:32:05 -0700 + debhelper (1.1.6) unstable; urgency=low * dh_movefiles: don't die on symlinks (#25642). (Hope I got the fix right diff --git a/dh_clean b/dh_clean index 73fb88f0..3388f146 100755 --- a/dh_clean +++ b/dh_clean @@ -1,28 +1,37 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Clean up $TMP and other tepmorary files generated by the # build process. -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` - substvars=`pkgfile $PACKAGE substvars` - if [ "$substvars" ]; then - doit "rm -f $substvars" - fi - doit "rm -rf $TMP" -done -doit "rm -f debian/*.debhelper $*" -if [ ! "$DH_K_FLAG" ]; then - doit "rm -f debian/files*" -fi +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); + + doit("rm","-f","debian/$EXT\substvars", + "debian/$EXT\postinst.debhelper", + "debian/$EXT\postrm.debhelper", + "debian/$EXT\preinst.debhelper", + "debian/$EXT\prerm.debhelper"); + + doit ("rm","-rf",$TMP); +} + +if (@ARGV) { + doit("rm","-f","--",@ARGV); +} + +if (! $dh{K_FLAG}) { + doit("rm","-f","debian/files*"); +} # Remove other temp files. -# Use complex_doit so we can properly escape things. -complex_doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE \ - -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \ - -o -name '.*.orig' -o -name '.*.rej' -o -name .SUMS \ - -o -name TAGS -o -name core \ - \) -exec rm -f {} \;" +# (The \s+ is important, \s won't work because find would get null parameters). +doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE + -o -name *.orig -o -name *.rej -o -name *.bak + -o -name .*.orig -o -name .*.rej -o -name .SUMS + -o -name TAGS -o -name core + ) -exec rm -f {} ;")); diff --git a/dh_clean.1 b/dh_clean.1 index 3c1d2795..35f59158 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -33,8 +33,5 @@ See for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) -.SH BUGS -Filenames with spaces in them will not currently be deleted when specified -as parameters. .SH AUTHOR Joey Hess -- cgit v1.2.3 From a08b76c3505687f6298f762a28a80c34d2e9f07f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:27 +0000 Subject: r114: Initial Import --- Dh_Getopt.pm | 1 + Dh_Lib.pm | 11 +++++++++-- debian/changelog | 12 ++++++++++++ debian/control | 2 +- dh_gencontrol | 40 ++++++++++++++++++++++------------------ dh_gencontrol.1 | 2 +- dh_installcron | 32 ++++++++++++++++---------------- doc/PROGRAMMING | 2 +- 8 files changed, 63 insertions(+), 39 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 85f0e15b..0f9dafdf 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -90,6 +90,7 @@ sub parseopts { "u=s", => \$options{U_PARAMS}, "update-rcd-params=s", => \$options{U_PARAMS}, "dpkg-shlibdeps-params=s", => \$options{U_PARAMS}, + "dpkg-gencontrol-params=s", => \$options{U_PARAMS}, "m=s", => \$options{M_PARAMS}, "major=s" => \$options{M_PARAMS}, diff --git a/Dh_Lib.pm b/Dh_Lib.pm index b4d0db53..00f28132 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -70,12 +70,19 @@ sub init { # This package gets special treatement: files and directories specified on # the command line may affect it. $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; + + # Split the U_PARAMS up into an array. + my $u=$dh{U_PARAMS}; + undef $dh{U_PARAMS}; + if (defined $u) { + push @{$dh{U_PARAMS}}, split(/\s+/,$u); + } } # Escapes out shell metacharacters in a word of shell script. sub escape_shell { my $word=shift; - # This list is from )Unix in a Nutshell_. (except '#') - $word=~s/([-\s!"$()*+#;<>?@\[\]\\`|~])/\\$1/g; + # This list is from _Unix in a Nutshell_. (except '#') + $word=~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g; return $word; } diff --git a/debian/changelog b/debian/changelog index e1c7ee75..725f2ac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (1.1.8) unstable; urgency=low + + * Dh_Lib.pm: made U_PARAMS an array of parameters. + * Dh_Lib.pm: fixed bug in the escaping code, numbers don't need to be + escaped. Also, no longer escape "-". + * dh_clean, dh_gencontrol, dh_installcron: converted to perl. + * dh_gencontrol.1, dh_gencontrol: the man page had said that + --update-rcd-params was equivilant to -u for this program. You should + really use --dpkg-gencontrol-params. + + -- Joey Hess Fri, 14 Aug 1998 14:07:35 -0700 + debhelper (1.1.7) unstable; urgency=low * examples/rules.multi: moved dh_movefiles into the install section. diff --git a/debian/control b/debian/control index 0a97ae80..8ba5d999 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.2 +Standards-Version: 2.4.1.3 Package: debhelper Architecture: all diff --git a/dh_gencontrol b/dh_gencontrol index c3698b56..cadfdc03 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -1,26 +1,30 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -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); + + $changelog=pkgfile($PACKAGE,'changelog'); + if (! $changelog) { + $changelog='debian/changelog'; + } - changelog=`pkgfile $PACKAGE changelog` - if [ ! "$changelog" ]; then - changelog=debian/changelog - fi - - 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"); + } # Generate and install control file. - doit "dpkg-gencontrol -l$changelog -isp -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE", + "-Tdebian/$EXT\substvars","-P$TMP",@{$dh{U_PARAMS}}); + # This chmod is only necessary if the user sets the umask to something odd. - doit "chmod 644 $TMP/DEBIAN/control" - doit "chown root.root $TMP/DEBIAN/control" -done + doit("chmod","644","$TMP/DEBIAN/control"); + + doit("chown","root.root","$TMP/DEBIAN/control"); +} diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 2bfade49..7ceb532a 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -18,7 +18,7 @@ See .BR debhelper (1) for a list of options common to all debhelper commands. .TP -.B \-uparams, \--update-rcd-params=params +.B \-uparams, \--dpkg-gencontrol-params=params Pass "params" to .BR dpkg-gencontrol (1) .SH ENVIRONMENT diff --git a/dh_installcron b/dh_installcron index 448e38a4..133ba743 100755 --- a/dh_installcron +++ b/dh_installcron @@ -1,20 +1,20 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Install cron scripts into the appropriate places. -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` - - for type in daily weekly monthly d; do - 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 "$cron" $TMP/etc/cron.$type/$PACKAGE" - fi - done -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + foreach $type (qw{daily weekly monthly d}) { + $cron=pkgfile($PACKAGE,"cron.$type"); + if ($cron) { + if (! -d "$TMP/etc/cron.$type") { + doit("install","-o","root","-g","root","-d","$TMP/etc/cron.$type"); + } + doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE"); + } + } +} diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index e514095d..1addc3b8 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -117,7 +117,7 @@ switch variable description package is being acted on) -u U_PARAMS will be set to a string, that is typically parameters your program passes on to some - other program. + other program. (In Dh_Lib.pm, this is an array) -m M_PARAMS will be set to a string, you decide what it means to your program -V V_FLAG will be set to a string, you decide what it -- cgit v1.2.3 From 225d86509ae859057d89f3ad88c1b6de7c8e98ba Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:40 +0000 Subject: r115: Initial Import --- debian/changelog | 7 +++++++ dh_clean | 2 +- dh_fixperms | 6 +++--- doc/TODO | 3 +++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 725f2ac6..f1a479e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.9) unstable; urgency=low + + * dh_fixperms: has been removing the +x bits of all doc/*/examples/* files + since version 0.97 or so. Fixed. + + -- Joey Hess Sun, 16 Aug 1998 17:11:48 -0700 + debhelper (1.1.8) unstable; urgency=low * Dh_Lib.pm: made U_PARAMS an array of parameters. diff --git a/dh_clean b/dh_clean index 3388f146..544c09a0 100755 --- a/dh_clean +++ b/dh_clean @@ -25,7 +25,7 @@ if (@ARGV) { } if (! $dh{K_FLAG}) { - doit("rm","-f","debian/files*"); + doit("rm","-f","debian/files"); } # Remove other temp files. diff --git a/dh_fixperms b/dh_fixperms index 544ee9be..0e845335 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -18,7 +18,7 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R u+rw $TMP" fi - FIND_OPTIONS= + FIND_OPTIONS="" else # Do it the hard way. complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ @@ -33,8 +33,8 @@ for PACKAGE in $DH_DOPACKAGES; do # 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 -print0 \ - 2>/dev/null | xargs -0r chmod 644" + 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" diff --git a/doc/TODO b/doc/TODO index a4e4a10d..460abc63 100644 --- a/doc/TODO +++ b/doc/TODO @@ -69,3 +69,6 @@ Fixes to backport to 1.0 tree: * dh_installdocs used -m 655 for a TODO file. (minor, dh_fixperms cleans up after it) +* dh_fixperms had a problkem with removing x bits on examples files - + backport fix. + -- cgit v1.2.3 From 0287a9cbf507569b92fa157fb002a4ead079bbdb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:44 +0000 Subject: r116: Initial Import --- debian/changelog | 18 ++++++++++++++++++ debian/rules | 19 +++++++------------ dh_installchangelogs | 5 +++++ dh_installchangelogs.1 | 9 ++++++++- dh_shlibdeps | 42 +++++++++++++++++++++++------------------- dh_testdir | 17 +++++++++-------- dh_testdir.1 | 2 -- dh_testroot | 13 +++++++------ 8 files changed, 77 insertions(+), 48 deletions(-) diff --git a/debian/changelog b/debian/changelog index f1a479e4..b124f138 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +debhelper (1.1.10) unstable; urgency=low + + * It's come to my attention that a few packages use filename globbing in + debian/{docs,examples,whatever} files and expect that to work. It used + to work before the perl conversion, but it was never _documented_, or + intented to work. If you use this in your packages, they are broken and + need fixing (and will refuse to build with current versions of debhelper). + I apologize for the inconvenience. + + * dh_clean: fixed a bug, intorduced in version 1.1.8, where it didn't + remove debian/files properly. + * dh_shlibdeps, dh_testdir, dh_testroot, dh_testversion: converted to perl. + * Encode the version of debhelper in a sepererate file, so dh_testversion + doesn't have to be generated when a new version of debhelper is built. + * Removed bogus menu file. + + -- Joey Hess Mon, 17 Aug 1998 14:15:17 -0700 + debhelper (1.1.9) unstable; urgency=low * dh_fixperms: has been removing the +x bits of all doc/*/examples/* files diff --git a/debian/rules b/debian/rules index 8572498b..94af8686 100755 --- a/debian/rules +++ b/debian/rules @@ -8,35 +8,30 @@ export DH_AUTOSCRIPTDIR=autoscripts # Figure out the current debhelper version. -VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null`" : \ - '.*Version: \(.*\).*Distribution:') +VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)') 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 +# Nothing to do. clean: - ./dh_testdir $(test_files) + ./dh_testdir ./dh_testroot - ./dh_clean dh_testversion + ./dh_clean # Build architecture-dependent files here. binary-arch: build -# We have nothing to do by default. +# Nothing to do. # Build architecture-independent files here. binary-indep: build - ./dh_testdir $(test_files) + ./dh_testdir ./dh_testroot ./dh_clean -k ./dh_installdirs usr/bin usr/lib/debhelper + echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; cp -a dh_lib dh_getopt.pl *.pm debian/tmp/usr/lib/debhelper diff --git a/dh_installchangelogs b/dh_installchangelogs index 0024fc10..97e057b7 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -43,5 +43,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if ($upstream) { doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + if ($dh{K_FLAG}) { + # Install symlink to original name of the upstream changelog file. + # Use basename in case original file was in a subdirectory or something. + doit("ln","-sf","changelog","$TMP/usr/doc/$PACKAGE/".Dh_Lib::basename($upstream)); + } } } diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 9a579a65..815c2dda 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 "[debhelper options] [upstream]" +.I "[debhelper options] [-k] [upstream]" .SH "DESCRIPTION" dh_installchangelogs is a debhelper program that is responsible for installing changelogs into package build directories. @@ -25,6 +25,13 @@ See .BR debhelper (1) for a list of options common to all debhelper commands. .TP +.B \-k, \--keep +Keep the original name of the upstream changelog. This will be accomplished +by installing the upstream changelog as "changelog", and making a symlink from +that to the original name of the changelog file. This can be useful if the +upstream changelog has an unusual name, or if other documentation in the +package refers to the changelog file. +.TP .B upstream Install this file as the upstream changelog. .SH NOTES diff --git a/dh_shlibdeps b/dh_shlibdeps index e30c4a5b..f7ac6012 100755 --- a/dh_shlibdeps +++ b/dh_shlibdeps @@ -1,24 +1,28 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Find dependancies. Simple dpkg-shlibdeps wrapper. -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); - # Run dpkg-shlibdeps to generate dependancies. - filelist="" - for file in `find $TMP -type f \( -perm +111 -or -name "*.so*" \) | tr "\n" " "` ; do - case "`file $file`" in - *ELF*) - filelist="$file $filelist" - ;; - esac - done - if [ "$filelist" ]; then - doit "dpkg-shlibdeps -Tdebian/${EXT}substvars $DH_U_PARAMS $filelist" - fi -done + my @filelist; + my $ff; + + # Generate a list of all ELF binaries in the package. + foreach $file (split(/\n/,`find $TMP -type f \\( -perm +111 -or -name "*.so*" \\)`)) { + # TODO: this is slow, optimize. Ie, file can run once on multiple files.. + $ff=`file $file`; + if ($ff=~m/ELF/) { + push @filelist,$file; + } + } + + if (@filelist) { + doit("dpkg-shlibdeps","-Tdebian/$EXT\substvars",@{$dh{U_PARAMS}},@filelist); + } +} diff --git a/dh_testdir b/dh_testdir index 4e482fce..0cb95c1d 100755 --- a/dh_testdir +++ b/dh_testdir @@ -1,14 +1,15 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Checks to make sure we are building the package in the right directory. # Tests for the existance of debian/control, and for the existance # of any other files you specify on the command line. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for file in debian/control $@; do - if [ ! -e "$file" ] ; then - error "\"$file\" not found. Are you sure you are in the correct directory?" - fi -done +foreach $file ('debian/control',@ARGV) { + if (! -e $file) { + error("\"$file\" not found. Are you sure you are in the correct directory?"); + } +} diff --git a/dh_testdir.1 b/dh_testdir.1 index 309a7d94..43c7439a 100644 --- a/dh_testdir.1 +++ b/dh_testdir.1 @@ -24,7 +24,5 @@ See for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) -.SH BUGS -Files with spaces in their names will not be processed correctly. .SH AUTHOR Joey Hess diff --git a/dh_testroot b/dh_testroot index c7041094..629b8f84 100755 --- a/dh_testroot +++ b/dh_testroot @@ -1,12 +1,13 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Checks to make sure you are root. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); # 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 +if ($< != 0) { + error("You must run this as root."); +} -- cgit v1.2.3 From ec938d4da786f7fd545b2ca27ebd5ea5c8b45c84 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:45 +0000 Subject: r117: Initial Import --- Dh_Lib.pm | 9 ++++----- debian/changelog | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 00f28132..e7070326 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -131,12 +131,11 @@ sub error { my $message=shift; # Output a warning. sub warning { my $message=shift; - print STDERR basename().": $message\n"; + print STDERR basename($0).": $message\n"; } -# Returns the basename of the program. -sub basename { - my $fn=$0; +# Returns the basename of the argument passed to it. +sub basename { my $fn=shift; $fn=~s:.*/(.*?):$1:; return $fn; } @@ -241,7 +240,7 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se } # TODO: do this in perl, perhaps? - complex_doit("echo \"# Automatically added by ".basename().">> $outfile"); + complex_doit("echo \"# Automatically added by ".basename($0).">> $outfile"); complex_doit("sed \"$sed\" $infile >> $outfile"); complex_doit("echo '# End automatically added section' >> $outfile"); } diff --git a/debian/changelog b/debian/changelog index b124f138..314ea71e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.11) unstable; urgency=low + + * dh_installchangelogs: added -k flag, that will make it install a symlink + to the original name of the upstream changelog. + + -- Joey Hess Thu, 20 Aug 1998 15:40:40 -0700 + debhelper (1.1.10) unstable; urgency=low * It's come to my attention that a few packages use filename globbing in -- cgit v1.2.3 From be64835b776e14dedc2ed4861af112d487a3bd79 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:49 +0000 Subject: r118: Initial Import --- debian/changelog | 9 +++++++++ dh_installdocs | 2 +- doc/TODO | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 314ea71e..05d39810 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.1.12) unstable; urgency=low + + * dh_installdocs: forgot to pass package name to isnative(). Any native + debian package that had a debian/TODO would have it installed with the + wrong name, and debhelper would warn of undefined values for some + packages. Fixed. + + -- Joey Hess Thu, 27 Aug 1998 12:35:42 -0700 + debhelper (1.1.11) unstable; urgency=low * dh_installchangelogs: added -k flag, that will make it install a symlink diff --git a/dh_installdocs b/dh_installdocs index 3229cd15..34fe97d1 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -40,7 +40,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $todo=pkgfile($PACKAGE,'TODO'); if ($todo) { - if (isnative()) { + if (isnative($PACKAGE)) { doit("install","-m","644","-p",$todo,"$TMP/usr/doc/$PACKAGE/TODO"); } else { diff --git a/doc/TODO b/doc/TODO index 460abc63..9f184e3d 100644 --- a/doc/TODO +++ b/doc/TODO @@ -32,6 +32,10 @@ Wishlist items: 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. +* Need a way to make dh_strip not strip any static libs. Also, it'd be nice + if there were options to dh_strip, dh_compress, etc, to allow inclusiuon of + directories and exclusion of files based on filname globbing. (Request from + Matthias Klose ) * docbase support (#25233). Waiting for docbase to stabalize and be used widly. * Support /etc/X11/window-managers, by making it easy for window managers to -- cgit v1.2.3 From 9681548b9a12725a560d1e9f1cbe55fc8b07a0d3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:59:59 +0000 Subject: r120: Initial Import --- Dh_Lib.pm | 8 ++- debian/changelog | 7 +++ dh_installmanpages | 168 ++++++++++++++++++++++++++++++++++------------------- doc/TODO | 3 +- 4 files changed, 123 insertions(+), 63 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index e7070326..a3965ec1 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -136,7 +136,13 @@ sub warning { my $message=shift; # Returns the basename of the argument passed to it. sub basename { my $fn=shift; - $fn=~s:.*/(.*?):$1:; + $fn=~s:^.*/(.*?)$:$1:; + return $fn; +} + +# Returns the directory name of the argument passed to it. +sub dirname { my $fn=shift; + $fn=~s:^(.*)/.*?$:$1:; return $fn; } diff --git a/debian/changelog b/debian/changelog index 05d39810..3ee30048 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.13) unstable; urgency=low + + * dh_installmanpages: rewritten in perl. Allows me to fix bug #26221 (long + symlink problem after .so conversion), and is about twice as fast. + + -- Joey Hess Sat, 29 Aug 1998 22:06:06 -0700 + debhelper (1.1.12) unstable; urgency=low * dh_installdocs: forgot to pass package name to isnative(). Any native diff --git a/dh_installmanpages b/dh_installmanpages index a8fb1e99..34d33289 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Automatically find and install man pages. However, do not install any man # pages listed on the command line. @@ -6,66 +6,114 @@ # # This is a little bit (hah!) DWIMish, but still very handy. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use File::Find; +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` +# Check if a file is a man page, for use by File::Find. +my @manpages; +sub find_man { + # Does its filename look like a man page? + # .ex files are examples installed by deb-make, + # we don't want those, or .in files, which are + # from configure. + if (! (-f $_ && /^.*\.[1-9].*$/ && ! /\.(ex|in)$/)) { + return; + } + # It's not in a tmp directory is it? + if ($File::Find::dir=~m:debian/.*tmp.*:) { + return; + } + # And file does think it's a real man page? + if (! `file $_`=~/roff/) { + return; + } - # 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. - # We also need to exclude all debian/tmp type dirs. - EXCLUDE=`grep ^Package: debian/control | \ - cut -d " " -f 2 | tr "\n" "|"` - for file in `find * -type f -name "*.[1-9]*" ! -name "*.ex" \ - ! -name "*.in" | egrep -v "^debian/(${EXCLUDE}tmp)/"` - do - # Make sure file thinks they are man pages. - if file -L $file|grep -q roff; then - if echo $file|grep -q /; then - NAME=`expr $file : '.*/\(.*\)'` - else - NAME=$file - fi - # Look at the command line and check if we should - # install the file. - install=1 - for notinstall in $@; do - if [ "$NAME" = "$notinstall" -o \ - "$file" = "$notinstall" ]; then - install="" - fi - done - if [ "$install" ]; then - SECTION=man`expr $NAME : '.*\.\([123456789]\)'` - # Test to see if the filename ends with 'x', - # if so, this is an X man page. - if expr $NAME : '.*\.[123456789]x' >/dev/null; then - EXTDIR="X11R6" - else - EXTDIR="" - fi - if [ ! -e $TMP/usr/man/$SECTION/$NAME -a \ - ! -e $TMP/usr/X11*/man/$SECTION/$NAME ]; then - if [ ! -d $TMP/usr/$EXTDIR/man/$SECTION ]; then - doit "install -d $TMP/usr/$EXTDIR/man/$SECTION" - fi - doit "install -p -m644 $file $TMP/usr/$EXTDIR/man/$SECTION/$NAME" - fi - fi - fi - done + # Good enough. + push @manpages,"$File::Find::dir/$_"; +} + +# Check if a file is a .so man page, for use by File::Find. +my @sofiles; +my @sodests; +sub find_so_man { + # The -s test is becuase a .so file tends to be small. We don't want + # to open every man page. 1024 is arbitrary. + if (! -f $_ || -s $_ > 1024) { + return; + } + + # Test first line of file for the .so thing. + open (SOTEST,$_); + my $l=; + close SOTEST; + if ($l=~m/\.so\s+(.*)/) { + my $solink=$1; + # This test is here to prevent links like ... man8/../man8/foo.8 + if (Dh_Lib::basename($File::Find::dir) eq Dh_Lib::dirname($solink)) { + $solink=Dh_Lib::basename($solink); + } + else { + $solink="../$solink"; + } + + push @sofiles,"$File::Find::dir/$_"; + push @sodests,$solink; + } +} +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + + # Find all filenames that look like man pages. + @manpages=(); + find(\&find_man,'.'); # populates @manpages + + foreach $page (@manpages) { + $page=~s:^\./::; # just for looks + + $basename=Dh_Lib::basename($page); + + # Skip all files listed on command line. + my $install=1; + foreach $skip (@ARGV) { + if ($basename eq $skip) { + $install=undef; + last; + } + } + + if ($install) { + my $extdir=""; + # Handle X man pages specially. + if ($basename=~/x$/) { + $extdir="X11R6"; + } + + my ($section)=$basename=~m/.*\.([1-9])/; + + my $destdir="$TMP/usr/$extdir/man/man$section/"; + $destdir=~tr:/:/:s; # just for looks + if (! -e "$destdir/$basename" && !-l "$destdir/$basename") { + if (! -d $destdir) { + doit "install","-d",$destdir; + } + doit "install","-p","-m644",$page,$destdir; + } + } + } + # Now the .so conversion. - for file in `find $TMP/usr/man $TMP/usr/X11*/man -type f -size -256c 2>/dev/null` - do - solink=`expr "\`head -1 $file\`" : '\.so \(.*\)'` - if [ "$solink" ]; then - doit "rm -f $file" - # The .so links include the subdir the page is in, - # thus the ../ - doit "ln -s ../$solink $file" - fi - done -done + @sofiles=@sodests=(); + foreach $dir (qw{usr/man usr/X11R6/man}) { + if (-e "$TMP/$dir") { + find(\&find_so_man, "$TMP/$dir"); + } + } + foreach $sofile (@sofiles) { + my $sodest=shift(@sodests); + doit "rm","-f",$sofile; + doit "ln","-sf",$sodest,$sofile; + } +} diff --git a/doc/TODO b/doc/TODO index 9f184e3d..c36b1dc6 100644 --- a/doc/TODO +++ b/doc/TODO @@ -73,6 +73,5 @@ Fixes to backport to 1.0 tree: * dh_installdocs used -m 655 for a TODO file. (minor, dh_fixperms cleans up after it) -* dh_fixperms had a problkem with removing x bits on examples files - +* dh_fixperms had a problem with removing x bits on examples files - backport fix. - -- cgit v1.2.3 From 4b48a476979f5e02fcb6add76440df44bfb5c813 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:00:36 +0000 Subject: r121: Initial Import --- debhelper.1 | 3 +++ debian/changelog | 14 ++++++++++++++ debian/rules | 22 +++++++++++++++++++++- dh_compress | 2 +- doc/README | 2 ++ doc/TODO | 7 ------- 6 files changed, 41 insertions(+), 9 deletions(-) diff --git a/debhelper.1 b/debhelper.1 index f3296666..e37085aa 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -100,5 +100,8 @@ An introduction to debhelper. .TP .BR /usr/doc/debhelper/examples/ A set of example debian/rules files that use debhelper. +.TP +.BR http://kitenet.net/programs/debhelper/ +Debhelper web site. .SH AUTHOR Joey Hess diff --git a/debian/changelog b/debian/changelog index 3ee30048..651c20a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.1.14) unstable; urgency=low + + * Debhelper now has a web page at http://kitenet.net/programs/debhelper/ + + * Added code to debian/rules to update the web page when I release new + debhelpers. + * dh_compress: since version 0.88 or so, dh_compress has bombed out if + a debian/compress file returned an error code. This was actually + unintentional - in fact, the debian/compress example in the man page + will fail this way if usr/info or usr/X11R6 is not present. Corrected + the program to not fail. (#26214) + + -- Joey Hess Sun, 30 Aug 1998 22:15:44 -0700 + debhelper (1.1.13) unstable; urgency=low * dh_installmanpages: rewritten in perl. Allows me to fix bug #26221 (long diff --git a/debian/rules b/debian/rules index 94af8686..20ba1a70 100755 --- a/debian/rules +++ b/debian/rules @@ -51,5 +51,25 @@ binary-indep: build ./dh_md5sums ./dh_builddeb +# Install in the proper location on my ftp server and web server. Not intended +# for use by anyone except the author. +OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/' /home/pub/programs/debhelper/LATEST-VERSION-IS; \ + cd ..; rm -rf debhelper-$(OLD_VER); \ + [ -f ../public/debhelper_$(OLD_VER).tar.gz ] && \ + tar zxf ../public/debhelper_$(OLD_VER).tar.gz || \ + tar zxf ../outdated/debhelper_$(OLD_VER).tar.gz; \ + diff -r -u --new-file debhelper-$(OLD_VER) debhelper-$(VERSION) > \ + /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \ + gzip -9f /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \ + cd /tmp; rm -f debhelper-$(OLD-VER); \ + fi + binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary +.PHONY: build clean binary-indep binary-arch binary localdist diff --git a/dh_compress b/dh_compress index b94cfcfe..76f7614d 100755 --- a/dh_compress +++ b/dh_compress @@ -21,7 +21,7 @@ filelist () { if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). - sh $olddir/$compress 2>/dev/null + sh $olddir/$compress 2>/dev/null || true 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 || true diff --git a/doc/README b/doc/README index 76b2263e..2aa9175d 100644 --- a/doc/README +++ b/doc/README @@ -51,4 +51,6 @@ does this even if only the arch-dependant package is being built (for ports to other architectures). I handle this in debian/rules.multi by calling dh_movefiles in the install target. +Debhelper's home page is at http://kitenet.net/programs/debhelper/ + -- Joey Hess diff --git a/doc/TODO b/doc/TODO index c36b1dc6..df9e3c48 100644 --- a/doc/TODO +++ b/doc/TODO @@ -68,10 +68,3 @@ Long term goals: * Convert selected debhelper commands to be perl programs, for speed, ease of maintainence, and 8-bit cleanness. - -Fixes to backport to 1.0 tree: - -* dh_installdocs used -m 655 for a TODO file. (minor, dh_fixperms cleans up - after it) -* dh_fixperms had a problem with removing x bits on examples files - - backport fix. -- cgit v1.2.3 From 7c9cd3a473fa6ab09c4bbe565f39e95c8e358e50 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:01:13 +0000 Subject: r122: Initial Import --- debian/changelog | 9 +++++++++ dh_fixperms | 5 +++-- dh_installmanpages | 12 +++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 651c20a5..bb95dc09 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.1.15) unstable; urgency=medium + + * dh_installmanpages: the new perl version had a nasty habit of + installing .so.x library files as man pages. Fixed. + * dh_installmanpages: the code to exclude searching for man pages in + debian/tmp directories was broken. Fixed. + + -- Joey Hess Mon, 31 Aug 1998 00:05:17 -0700 + debhelper (1.1.14) unstable; urgency=low * Debhelper now has a web page at http://kitenet.net/programs/debhelper/ diff --git a/dh_fixperms b/dh_fixperms index 0e845335..b36f68c8 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -42,8 +42,9 @@ for PACKAGE in $DH_DOPACKAGES; do 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 libraries (and .la files from libtool) + # ..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" \) $FIND_OPTIONS -print0 \ + \( -name "*.so*" -or -name "*.la" -or -name "*.a" \) $FIND_OPTIONS -print0 \ 2>/dev/null | xargs -0r chmod a-X" done diff --git a/dh_installmanpages b/dh_installmanpages index 34d33289..24772e5d 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -13,6 +13,7 @@ init(); # Check if a file is a man page, for use by File::Find. my @manpages; +my @allpackages; sub find_man { # Does its filename look like a man page? # .ex files are examples installed by deb-make, @@ -21,12 +22,20 @@ sub find_man { if (! (-f $_ && /^.*\.[1-9].*$/ && ! /\.(ex|in)$/)) { return; } + # It's not in a tmp directory is it? if ($File::Find::dir=~m:debian/.*tmp.*:) { return; } + foreach $dir (@allpackages) { + if ($File::Find::dir=~m:debian/$dir:) { + return; + } + } + # And file does think it's a real man page? - if (! `file $_`=~/roff/) { + my $type=`file $_`; + if ($type !~ m/:.*roff/) { return; } @@ -68,6 +77,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Find all filenames that look like man pages. @manpages=(); + @allpackages=GetPackages(''); find(\&find_man,'.'); # populates @manpages foreach $page (@manpages) { -- cgit v1.2.3 From 4e943112129121f04813e945eedded4c889ca65b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:01:14 +0000 Subject: r123: Initial Import --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index bb95dc09..1b84f02f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.16) unstable; urgency=low + + * dh_fixperms: remove execute bits from static libraries as well as + shared libraries. (#26414) + + -- Joey Hess Fri, 4 Sep 1998 14:46:37 -0700 + debhelper (1.1.15) unstable; urgency=medium * dh_installmanpages: the new perl version had a nasty habit of -- cgit v1.2.3 From 19f377de13cb281cf19fe829e79a2498b7465002 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:01:21 +0000 Subject: r124: Initial Import --- Dh_Getopt.pm | 23 ++++++++++++++++++++--- Dh_Lib.pm | 5 +++++ debhelper.1 | 7 +++++++ debian/changelog | 15 +++++++++++++++ debian/control | 2 +- dh_lib | 5 +++++ dh_strip | 4 +++- 7 files changed, 56 insertions(+), 5 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 0f9dafdf..e9240893 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -49,7 +49,7 @@ sub AddExclude { my($option,$value)=@_; # Parse options and return a hash of the values. sub parseopts { undef %options; - + my $ret=GetOptions( "v" => \$options{VERBOSE}, "verbose" => \$options{VERBOSE}, @@ -109,13 +109,25 @@ sub parseopts { if (!$ret) { error("unknown option; aborting"); } - + # Check to see if -V was specified. If so, but no parameters were # passed, the variable will be defined but empty. if (defined($options{V_FLAG})) { $options{V_FLAG_SET}=1; } + # If we have not been given any packages to act on, assume they + # want us to act on them all. Note we have to do this before excluding + # packages out, below. + if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) { + if ($options{DOINDEP} || $options{DOARCH}) { + # User specified that all arch (in)dep package be + # built, and there are none of that type. + error("I have no package to build"); + } + push @{$options{DOPACKAGES}},GetPackages(); + } + # Remove excluded packages from the list of packages to act on. my @package_list; my $package; @@ -125,7 +137,12 @@ sub parseopts { } } @{$options{DOPACKAGES}}=@package_list; - + + # 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"); + } + return %options; } diff --git a/Dh_Lib.pm b/Dh_Lib.pm index a3965ec1..be8a3e04 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -15,6 +15,11 @@ use vars qw(@ISA @EXPORT %dh); %dh); sub init { + # If DH_OPTIONS is set, prepend it @ARGV. + if (defined($ENV{DH_OPTIONS})) { + unshift @ARGV,split(/\s+/,$ENV{DH_OPTIONS}); + } + # 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 Getopt::Long, # which I'd prefer to avoid loading at all if possible. diff --git a/debhelper.1 b/debhelper.1 index e37085aa..9051d438 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -93,6 +93,13 @@ Enables verbose mode. .TP .I DH_NO_ACT Enables no-act mode. +.TP +.I DH_OPTIONS +Anything in this variable will be prepended to the command line +arguments of all debhelper commands. This in useful in some situations, +for example, if you need to pass -p to all debhelper commands that will be +run. If you use DH_OPTIONS, be sure to use "dh_testversion 1.1.17" - older +debhelpers will ignore it and do things you don't want them to. .SH "SEE ALSO" .TP .BR /usr/doc/debhelper/README diff --git a/debian/changelog b/debian/changelog index 1b84f02f..a52e4fc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +debhelper (1.1.17) unstable; urgency=low + + * dh_strip: on Richard Braakman's advice, strip the .comment and .note + sections of shared libraries. + * Added DH_OPTIONS environment variable - anything in it will be treated + as additional command line arguments by all debhelper commands. This in + useful in some situations, for example, if you need to pass -p to all + debhelper commands that will be run. If you use DH_OPTIONS, be sure to + use dh_testversion 1.1.17 - older debhelpers will ignore it and do + things you don't want them to. + * Made -N properly exclude packages when no -i, -a, or -p flags are + present. It didn't before, which was a bug. + + -- Joey Hess Mon, 7 Sep 1998 17:33:19 -0700 + debhelper (1.1.16) unstable; urgency=low * dh_fixperms: remove execute bits from static libraries as well as diff --git a/debian/control b/debian/control index 8ba5d999..c6e236d3 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.3 +Standards-Version: 2.4.1.4 Package: debhelper Architecture: all diff --git a/dh_lib b/dh_lib index 41812b8f..1ff2a5b1 100644 --- a/dh_lib +++ b/dh_lib @@ -136,6 +136,11 @@ autoscript() { # Argument processing and global variable initialization is below. +# If DH_OPTIONS is set, prepend it to the command line. +if [ "$DH_OPTIONS" ]; then + set -- $DH_OPTIONS $@ +fi + # 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 diff --git a/dh_strip b/dh_strip index 385efeff..28e950a8 100755 --- a/dh_strip +++ b/dh_strip @@ -24,7 +24,9 @@ for PACKAGE in $DH_DOPACKAGES; do 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*) - doit "strip --strip-unneeded $TMP/$file" + # 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" -- cgit v1.2.3 From 8162f479ea8540086c6f0415abbadeb39ce823b8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:01:28 +0000 Subject: r125: Initial Import --- debian/changelog | 7 +++++++ dh_installemacsen | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a52e4fc5..4ec7e846 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.18) unstable; urgency=low + + * dh_installemacsen: substitute package name for #PACKAGE# when setting + up postinst and prerm (#26560). + + -- Joey Hess Tue, 8 Sep 1998 14:24:30 -0700 + debhelper (1.1.17) unstable; urgency=low * dh_strip: on Richard Braakman's advice, strip the .comment and .note diff --git a/dh_installemacsen b/dh_installemacsen index e87cecef..008d9531 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -27,8 +27,10 @@ for PACKAGE in $DH_DOPACKAGES; do if [ "$emacsen_install" -o "$emacsen_remove" ]; then if [ ! "$DH_NOSCRIPTS" ]; then - autoscript "postinst" "postinst-emacsen" - autoscript "prerm" "prerm-emacsen" + autoscript "postinst" "postinst-emacsen" \ + "s/#PACKAGE#/$PACKAGE/" + autoscript "prerm" "prerm-emacsen" \ + "s/#PACKAGE#/$PACKAGE/" fi fi done -- cgit v1.2.3 From 6fb331ff4cd5565777961c3e150cd066db8e9333 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:01:39 +0000 Subject: r126: Initial Import --- debian/changelog | 7 +++++++ dh_installmanpages | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4ec7e846..283a88e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.19) unstable; urgency=low + + * dh_installmanpages: look at basename of man pacges specified on command + line to skip, for backwards compatability. + + -- Joey Hess Thu, 10 Sep 1998 11:31:42 -0700 + debhelper (1.1.18) unstable; urgency=low * dh_installemacsen: substitute package name for #PACKAGE# when setting diff --git a/dh_installmanpages b/dh_installmanpages index 24772e5d..dbb73cf4 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -88,7 +88,9 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Skip all files listed on command line. my $install=1; foreach $skip (@ARGV) { - if ($basename eq $skip) { + # Look at basename of what's on connect line + # for backwards compatability. + if ($basename eq Dh_Lib::basename($skip)) { $install=undef; last; } -- cgit v1.2.3 From 1225012d118cdc75892d02a41eb3ffcede466473 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:02:01 +0000 Subject: r127: Initial Import --- Dh_Getopt.pm | 9 ++++++++- Dh_Lib.pm | 24 +++++++++++++++++------- autoscripts/postinst-init-norestart | 5 +++++ debhelper.1 | 15 +++++++++++++-- debian/changelog | 10 ++++++++++ debian/rules | 2 +- dh_lib | 2 +- examples/rules.indep | 2 +- 8 files changed, 56 insertions(+), 13 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index e9240893..1592d5d0 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -31,6 +31,10 @@ sub AddPackage { my($option,$value)=@_; elsif ($option eq 'p' or $option eq 'package') { push @{$options{DOPACKAGES}}, $value; } + elsif ($option eq 's' or $option eq 'same-arch') { + push @{$options{DOPACKAGES}}, GetPackages('same'); + $options{DOSAME}=1; + } else { error("bad option $option - should never happen!\n"); } @@ -63,6 +67,9 @@ sub parseopts { "p=s" => \&AddPackage, "package=s" => \&AddPackage, + "s" => \&AddPackage, + "same-arch" => \&AddPackage, + "N=s" => \&ExcludePackage, "no-package=s" => \&ExcludePackage, @@ -120,7 +127,7 @@ sub parseopts { # want us to act on them all. Note we have to do this before excluding # packages out, below. if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) { - if ($options{DOINDEP} || $options{DOARCH}) { + if ($options{DOINDEP} || $options{DOARCH} || $options{DOSAME}) { # User specified that all arch (in)dep package be # built, and there are none of that type. error("I have no package to build"); diff --git a/Dh_Lib.pm b/Dh_Lib.pm index be8a3e04..2b80ce45 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -21,8 +21,8 @@ sub init { } # 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 Getopt::Long, - # which I'd prefer to avoid loading at all if possible. + # if so, we need to pass this off to the resource intensive + # Getopt::Long, which I'd prefer to avoid loading at all if possible. my $parseopt=undef; my $arg; foreach $arg (@ARGV) { @@ -54,10 +54,10 @@ sub init { my @allpackages=GetPackages(); $dh{MAINPACKAGE}=$allpackages[0]; - # Check if packages to build have been specified, if not, fall back to + # Check if packages to build have been specified, if not, fall back to # the default, doing them all. if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) { - if ($dh{DOINDEP} || $dh{DOARCH}) { + if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) { # User specified that all arch (in)dep package be # built, and there are none of that type. error("I have no package to build"); @@ -270,14 +270,23 @@ sub filearray { my $file=shift; } # Returns a list of packages in the control file. -# Must pass "arch" or "indep" to specify arch-dependant or -independant -# packages. If nothing is specified, returns all packages. +# Must pass "arch" or "indep" or "same" to specify arch-dependant or +# -independant or same arch packages. If nothing is specified, returns all +# packages. sub GetPackages { my $type=shift; $type="" if ! defined $type; + + # Look up the build arch if we need to. + my$buildarch=''; + if ($type eq 'same') { + $buildarch=`dpkg --print-architecture` || error($!); + chomp $buildarch; + } + my $package=""; my $arch=""; my @list=(); - open (CONTROL,") { chomp; @@ -292,6 +301,7 @@ sub GetPackages { my $type=shift; if ($package && (($type eq 'indep' && $arch eq 'all') || ($type eq 'arch' && $arch ne 'all') || + ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) || ! $type)) { push @list, $package; $package=""; diff --git a/autoscripts/postinst-init-norestart b/autoscripts/postinst-init-norestart index 05357d07..b33702c5 100644 --- a/autoscripts/postinst-init-norestart +++ b/autoscripts/postinst-init-norestart @@ -1 +1,6 @@ update-rc.d #SCRIPT# #INITPARMS# >/dev/null +if [ "$1" = "configure" ]; then + if [ -z "$2" -o "$2" = "" ]; then + /etc/init.d/#SCRIPT# start + fi +fi diff --git a/debhelper.1 b/debhelper.1 index 9051d438..62906dc5 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -3,7 +3,7 @@ debhelper \- overview of the debhelper commands .SH SYNOPSIS .B dh_* -.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]" +.I "[-v] [-a] [-i] [-s] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]" .SH "DESCRIPTION" Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks related to building debian binary packages. All the @@ -29,6 +29,15 @@ Act on all architecture independent packages. .B \-ppackage, \--package=package Act on the package named "package". .TP +.B \-s, \--same-arch +This is a smarter version of the -a flag, that is used in some rare +circumstances. It understands that if the control file lists "Architecture: i386" +for the package, the package should not be acted on on other architectures. So +this flag makes the command act on all "Architecture: any" packages, as well +as on any packages that have the current architecture explicitly specified. +Constrast to the -a flag, which makes the command work on all packages that +are not architecture independant. +.TP .B \-Npackage, \--no-package=package Do not act on the specified package even if an -a, -i, or -p option lists the package as one that should be acted on. @@ -52,8 +61,10 @@ are acted on by debhelper programs, all debhelper programs accept the .B -a , .B -i -, and +, .B -p +, and +.B -s parameters. These parameters are cumulative. If none are given, debhelper programs default to acting on all packages listed in the control file. diff --git a/debian/changelog b/debian/changelog index 283a88e3..3c867107 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.1.20) unstable; urgency=low + + * Added a --same-arch flag, that is useful in the rare case when you have + a package that builds only for 1 architecture, as part of a multi-part, + multi-architecture source package. (Ie, netscape-dmotif). + * Modified dh_installinit -r so it does start the daemon on the initial + install (#26680). + + -- Joey Hess Fri, 2 Oct 1998 15:55:13 -0700 + debhelper (1.1.19) unstable; urgency=low * dh_installmanpages: look at basename of man pacges specified on command diff --git a/debian/rules b/debian/rules index 20ba1a70..bb790cd3 100755 --- a/debian/rules +++ b/debian/rules @@ -54,7 +54,7 @@ binary-indep: build # Install in the proper location on my ftp server and web server. Not intended # for use by anyone except the author. OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary +.PHONY: build clean binary-indep binary-arch binary install -- cgit v1.2.3 From 2b197c28c63bdd7a316fdc3938be2e411c69fa33 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:02:08 +0000 Subject: r129: Initial Import --- Test.pm | 254 ++++++++++++++++++++++++++++++++++++++++++ autoscripts/postinst-doc-base | 3 + autoscripts/postinst-wm | 3 + autoscripts/postinst-xaw | 3 + autoscripts/postrm-wm | 3 + autoscripts/prerm-doc-base | 3 + debian/changelog | 6 + debian/emacsen-install | 0 debian/emacsen-remove | 0 debian/init.d | 0 debian/links | 4 + dh_installmime.1 | 38 +++++++ dh_installmodules.1 | 35 ++++++ dh_installpam.1 | 30 +++++ dh_installwm | 21 ++++ dh_installwm.1 | 42 +++++++ dh_installxaw | 30 +++++ dh_installxaw.1 | 40 +++++++ dh_link | 70 ++++++++++++ dh_link.1 | 75 +++++++++++++ dh_listpackages | 8 ++ dh_listpackages.1 | 25 +++++ dh_perl.1 | 44 ++++++++ examples/rules | 2 +- examples/rules.multi | 2 +- me | 0 pgptemp.$00 | 0 27 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 Test.pm create mode 100644 autoscripts/postinst-doc-base create mode 100644 autoscripts/postinst-wm create mode 100644 autoscripts/postinst-xaw create mode 100644 autoscripts/postrm-wm create mode 100644 autoscripts/prerm-doc-base create mode 100644 debian/emacsen-install create mode 100644 debian/emacsen-remove create mode 100644 debian/init.d create mode 100644 debian/links create mode 100644 dh_installmime.1 create mode 100644 dh_installmodules.1 create mode 100644 dh_installpam.1 create mode 100755 dh_installwm create mode 100644 dh_installwm.1 create mode 100755 dh_installxaw create mode 100644 dh_installxaw.1 create mode 100755 dh_link create mode 100644 dh_link.1 create mode 100755 dh_listpackages create mode 100644 dh_listpackages.1 create mode 100644 dh_perl.1 create mode 100644 me create mode 100644 pgptemp.$00 diff --git a/Test.pm b/Test.pm new file mode 100644 index 00000000..55f80ac2 --- /dev/null +++ b/Test.pm @@ -0,0 +1,254 @@ +use strict; +package Test; +use Test::Harness 1.1501 (); +use Carp; +use vars (qw($VERSION @ISA @EXPORT @EXPORT_OK $ntest $TestLevel), #public-ish + qw($TESTOUT $ONFAIL %todo %history $planned @FAILDETAIL)); #private-ish +$VERSION = '1.13'; +require Exporter; +@ISA=('Exporter'); +@EXPORT=qw(&plan &ok &skip); +@EXPORT_OK=qw($ntest $TESTOUT); + +$TestLevel = 0; # how many extra stack frames to skip +$|=1; +#$^W=1; ? +$ntest=1; +$TESTOUT = *STDOUT{IO}; + +# Use of this variable is strongly discouraged. It is set mainly to +# help test coverage analyzers know which test is running. +$ENV{REGRESSION_TEST} = $0; + +sub plan { + croak "Test::plan(%args): odd number of arguments" if @_ & 1; + croak "Test::plan(): should not be called more than once" if $planned; + my $max=0; + for (my $x=0; $x < @_; $x+=2) { + my ($k,$v) = @_[$x,$x+1]; + if ($k =~ /^test(s)?$/) { $max = $v; } + elsif ($k eq 'todo' or + $k eq 'failok') { for (@$v) { $todo{$_}=1; }; } + elsif ($k eq 'onfail') { + ref $v eq 'CODE' or croak "Test::plan(onfail => $v): must be CODE"; + $ONFAIL = $v; + } + else { carp "Test::plan(): skipping unrecognized directive '$k'" } + } + my @todo = sort { $a <=> $b } keys %todo; + if (@todo) { + print $TESTOUT "1..$max todo ".join(' ', @todo).";\n"; + } else { + print $TESTOUT "1..$max\n"; + } + ++$planned; +} + +sub to_value { + my ($v) = @_; + (ref $v or '') eq 'CODE' ? $v->() : $v; +} + +sub ok ($;$$) { + croak "ok: plan before you test!" if !$planned; + my ($pkg,$file,$line) = caller($TestLevel); + my $repetition = ++$history{"$file:$line"}; + my $context = ("$file at line $line". + ($repetition > 1 ? " fail \#$repetition" : '')); + my $ok=0; + my $result = to_value(shift); + my ($expected,$diag); + if (@_ == 0) { + $ok = $result; + } else { + $expected = to_value(shift); + my ($regex,$ignore); + if (!defined $expected) { + $ok = !defined $result; + } elsif (!defined $result) { + $ok = 0; + } elsif ((ref($expected)||'') eq 'Regexp') { + $ok = $result =~ /$expected/; + } elsif (($regex) = ($expected =~ m,^ / (.+) / $,sx) or + ($ignore, $regex) = ($expected =~ m,^ m([^\w\s]) (.+) \1 $,sx)) { + $ok = $result =~ /$regex/; + } else { + $ok = $result eq $expected; + } + } + my $todo = $todo{$ntest}; + if ($todo and $ok) { + $context .= ' TODO?!' if $todo; + print $TESTOUT "ok $ntest # ($context)\n"; + } else { + print $TESTOUT "not " if !$ok; + print $TESTOUT "ok $ntest\n"; + + if (!$ok) { + my $detail = { 'repetition' => $repetition, 'package' => $pkg, + 'result' => $result, 'todo' => $todo }; + $$detail{expected} = $expected if defined $expected; + $diag = $$detail{diagnostic} = to_value(shift) if @_; + $context .= ' *TODO*' if $todo; + if (!defined $expected) { + if (!$diag) { + print $TESTOUT "# Failed test $ntest in $context\n"; + } else { + print $TESTOUT "# Failed test $ntest in $context: $diag\n"; + } + } else { + my $prefix = "Test $ntest"; + print $TESTOUT "# $prefix got: ". + (defined $result? "'$result'":'')." ($context)\n"; + $prefix = ' ' x (length($prefix) - 5); + if ((ref($expected)||'') eq 'Regexp') { + $expected = 'qr/'.$expected.'/' + } else { + $expected = "'$expected'"; + } + if (!$diag) { + print $TESTOUT "# $prefix Expected: $expected\n"; + } else { + print $TESTOUT "# $prefix Expected: $expected ($diag)\n"; + } + } + push @FAILDETAIL, $detail; + } + } + ++ $ntest; + $ok; +} + +sub skip ($$;$$) { + my $whyskip = to_value(shift); + if ($whyskip) { + $whyskip = 'skip' if $whyskip =~ m/^\d+$/; + print $TESTOUT "ok $ntest # $whyskip\n"; + ++ $ntest; + 1; + } else { + local($TestLevel) = $TestLevel+1; #ignore this stack frame + &ok; + } +} + +END { + $ONFAIL->(\@FAILDETAIL) if @FAILDETAIL && $ONFAIL; +} + +1; +__END__ + +=head1 NAME + + Test - provides a simple framework for writing test scripts + +=head1 SYNOPSIS + + use strict; + use Test; + + # use a BEGIN block so we print our plan before MyModule is loaded + BEGIN { plan tests => 14, todo => [3,4] } + + # load your module... + use MyModule; + + ok(0); # failure + ok(1); # success + + ok(0); # ok, expected failure (see todo list, above) + ok(1); # surprise success! + + ok(0,1); # failure: '0' ne '1' + ok('broke','fixed'); # failure: 'broke' ne 'fixed' + ok('fixed','fixed'); # success: 'fixed' eq 'fixed' + ok('fixed',qr/x/); # success: 'fixed' =~ qr/x/ + + ok(sub { 1+1 }, 2); # success: '2' eq '2' + ok(sub { 1+1 }, 3); # failure: '2' ne '3' + ok(0, int(rand(2)); # (just kidding :-) + + my @list = (0,0); + ok @list, 3, "\@list=".join(',',@list); #extra diagnostics + ok 'segmentation fault', '/(?i)success/'; #regex match + + skip($feature_is_missing, ...); #do platform specific test + +=head1 DESCRIPTION + +L expects to see particular output when it executes +tests. This module aims to make writing proper test scripts just a +little bit easier (and less error prone :-). + +=head1 TEST TYPES + +=over 4 + +=item * NORMAL TESTS + +These tests are expected to succeed. If they don't something's +screwed up! + +=item * SKIPPED TESTS + +Skip is for tests that might or might not be possible to run depending +on the availability of platform specific features. The first argument +should evaluate to true (think "yes, please skip") if the required +feature is not available. After the first argument, skip works +exactly the same way as do normal tests. + +=item * TODO TESTS + +TODO tests are designed for maintaining an B. +These tests are expected NOT to succeed. If a TODO test does succeed, +the feature in question should not be on the TODO list, now should it? + +Packages should NOT be released with succeeding TODO tests. As soon +as a TODO test starts working, it should be promoted to a normal test +and the newly working feature should be documented in the release +notes or change log. + +=back + +=head1 RETURN VALUE + +Both C and C return true if their test succeeds and false +otherwise in a scalar context. + +=head1 ONFAIL + + BEGIN { plan test => 4, onfail => sub { warn "CALL 911!" } } + +While test failures should be enough, extra diagnostics can be +triggered at the end of a test run. C is passed an array ref +of hash refs that describe each test failure. Each hash will contain +at least the following fields: C, C, and +C. (The file, line, and test number are not included because +their correspondence to a particular test is tenuous.) If the test +had an expected value or a diagnostic string, these will also be +included. + +The B C hook might be used simply to print out the +version of your package and/or how to report problems. It might also +be used to generate extremely sophisticated diagnostics for a +particularly bizarre test failure. However it's not a panacea. Core +dumps or other unrecoverable errors prevent the C hook from +running. (It is run inside an C block.) Besides, C is +probably over-kill in most cases. (Your test code should be simpler +than the code it is testing, yes?) + +=head1 SEE ALSO + +L and, perhaps, test coverage analysis tools. + +=head1 AUTHOR + +Copyright (c) 1998-1999 Joshua Nathaniel Pritikin. All rights reserved. + +This package is free software and is provided "as is" without express +or implied warranty. It may be used, redistributed and/or modified +under the terms of the Perl Artistic License (see +http://www.perl.com/perl/misc/Artistic.html) + +=cut diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base new file mode 100644 index 00000000..a53ed7bf --- /dev/null +++ b/autoscripts/postinst-doc-base @@ -0,0 +1,3 @@ +if command -v install-docs >/dev/null 2>&1; then + install-docs -i /usr/share/doc-base/#PACKAGE# +fi diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm new file mode 100644 index 00000000..94c052fc --- /dev/null +++ b/autoscripts/postinst-wm @@ -0,0 +1,3 @@ +if [ -x /usr/sbin/register-window-manager ] ; then + register-window-manager --add #WM# +fi diff --git a/autoscripts/postinst-xaw b/autoscripts/postinst-xaw new file mode 100644 index 00000000..b8d718ea --- /dev/null +++ b/autoscripts/postinst-xaw @@ -0,0 +1,3 @@ +if test -x /usr/sbin/update-xaw-wrappers; then + /usr/sbin/update-xaw-wrappers +fi diff --git a/autoscripts/postrm-wm b/autoscripts/postrm-wm new file mode 100644 index 00000000..6dc9f5da --- /dev/null +++ b/autoscripts/postrm-wm @@ -0,0 +1,3 @@ +if [ "$1" == "purge" -a -x /usr/sbin/register-window-manager ] ; then + register-window-manager --remove #WM# +fi diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base new file mode 100644 index 00000000..339361a5 --- /dev/null +++ b/autoscripts/prerm-doc-base @@ -0,0 +1,3 @@ +if command -v install-docs >/dev/null 2>&1; then + install-docs -r #PACKAGE# +fi diff --git a/debian/changelog b/debian/changelog index 3c867107..25279d3f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.1.21) unstable; urgency=low + + * Added install to .PHONY target of example rules files. + + -- Joey Hess Sun, 11 Oct 1998 22:36:10 -0700 + debhelper (1.1.20) unstable; urgency=low * Added a --same-arch flag, that is useful in the rare case when you have diff --git a/debian/emacsen-install b/debian/emacsen-install new file mode 100644 index 00000000..e69de29b diff --git a/debian/emacsen-remove b/debian/emacsen-remove new file mode 100644 index 00000000..e69de29b diff --git a/debian/init.d b/debian/init.d new file mode 100644 index 00000000..e69de29b diff --git a/debian/links b/debian/links new file mode 100644 index 00000000..9a72e0fb --- /dev/null +++ b/debian/links @@ -0,0 +1,4 @@ +usr/bin/sysdb-wrapper usr/bin/chfn +usr/bin/sysdb-wrapper usr/bin/chsh +usr/bin/sysdb-wrapper usr/bin/passwd + diff --git a/dh_installmime.1 b/dh_installmime.1 new file mode 100644 index 00000000..4ace9985 --- /dev/null +++ b/dh_installmime.1 @@ -0,0 +1,38 @@ +.TH DH_INSTALLMIME 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installmime \- install mime files into package build directories +.SH SYNOPSIS +.B dh_installmime +.I "[debhelper options] [-n]" +.SH "DESCRIPTION" +dh_installmime is a debhelper program that is responsible for installing +mime files into package build directories. +.P +It also automatically generates the postinst and postrm commands needed to +interface with the debian mime-support package. See +.BR dh_installdeb (1) +for an explanation of how this works. +.P +If a file named debian/package.mime exists, then it is installed into +usr/lib/mime/packages/package in the package build directory. +.P +For the first first binary package listed in the control file, you may use +debian/mime instead. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-n, \--noscripts +Do not modify postinst/postrm scripts. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.SH AUTHOR +Joey Hess diff --git a/dh_installmodules.1 b/dh_installmodules.1 new file mode 100644 index 00000000..6d9016fe --- /dev/null +++ b/dh_installmodules.1 @@ -0,0 +1,35 @@ +.TH DH_INSTALLMODULES 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installmodules \- register modules with modutils +.SH SYNOPSIS +.B dh_installmodules +.I "[debhelper options] [-n]" +.SH "DESCRIPTION" +dh_installmodules is a debhelper program that is responsible for registering +kernel modules with modutils. +.P +A file named debian/package.modules (debian/modules my be used for the first +binary package in debian/control) will be installed as etc/modutils/package +in the package build directory. +.P +Then postinst and postrm commands are automatically generated to register +the modules when the package is installed. See +.BR dh_installdeb (1) +for an explanation of how this works. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-n, \--noscripts +Do not modify postinst/postrm scripts. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.BR debhelper (1) +.SH AUTHOR +Joey Hess diff --git a/dh_installpam.1 b/dh_installpam.1 new file mode 100644 index 00000000..bb34a45c --- /dev/null +++ b/dh_installpam.1 @@ -0,0 +1,30 @@ +.TH DH_INSTALLPAM 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installpam \- install pam support files +.SH SYNOPSIS +.B dh_installpam +.I "[debhelper options] [-n]" +.SH "DESCRIPTION" +dh_installpam is a debhelper program that is responsible for installing +files used by PAM into package build directories. +.P +If a file named debian/package.pam exists, then it is installed into +etc/pam.d/package in the package build directory. +.P +For the first first binary package listed in the control file, you may use +debian/pam instead. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.SH AUTHOR +Joey Hess diff --git a/dh_installwm b/dh_installwm new file mode 100755 index 00000000..be3a1373 --- /dev/null +++ b/dh_installwm @@ -0,0 +1,21 @@ +#!/bin/sh -e +# +# Add to postinst and postrm to register a window manager. + +PATH=debian:$PATH:/usr/lib/debhelper +. dh_lib + +wm=$1 + +if [ -z "$wm" ]; then + error "No window manager was specified." +fi + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + if [ ! "$DH_NOSCRIPTS" ]; then + autoscript "postinst" "postinst-wm" "s/#WM#/$wm/" + autoscript "postrm" "postrm-wm" "s/#WM#/$wm/" + fi +done diff --git a/dh_installwm.1 b/dh_installwm.1 new file mode 100644 index 00000000..bc6ea446 --- /dev/null +++ b/dh_installwm.1 @@ -0,0 +1,42 @@ +.TH DH_INSTALLWM 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installwm \- register a window manager +.SH SYNOPSIS +.B dh_installmenu +.I "[debhelper options] [-n] wmfilename" +.SH "DESCRIPTION" +dh_installwm is a debhelper program that is responsible for +generating the postinst and postrm commands needed to +interface with the the +.BR register-window-manager (1) +command. This results in a window manager being registered when it is +installed. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-n, \--noscripts +Do not modify postinst/postrm scripts. Turns this command into a no-op. +.TP +.B wmfilename +The filename of the window manager you wish to register. May be either a +simple filename if the window manager is in /usr/X11R6/bin/, or a complete +path otherwise. +.SH NOTES +Note that this command will set up postinst and postrm scripts for every +package it acts on. It's wise to limit its action to a single package with, +for example, the -p switch. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.TP +.BR register-window-manager (1) +.SH AUTHOR +Joey Hess diff --git a/dh_installxaw b/dh_installxaw new file mode 100755 index 00000000..31867f15 --- /dev/null +++ b/dh_installxaw @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w +# +# Integration with xaw-wrappers +# +# If debian/xaw-wrappers file exists, save it to +# $TMP/usr/lib/xaw-wrappers/conf/$PACKAGE +# +# Also, add calls to postinst and postrm. + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $xaw=pkgfile($PACKAGE,'xaw'); + + if ($xaw ne '') { + if (! -d "$TMP/usr/lib/xaw-wrappers/conf") { + doit("install","-d","$TMP/usr/lib/xaw-wrappers/conf"); + } + doit("install","-p","-m644",$xaw, + "$TMP/usr/lib/xaw-wrappers/conf/$PACKAGE"); + + if (! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-xaw"); + autoscript($PACKAGE,"postrm","postrm-xaw"); + } + } +} diff --git a/dh_installxaw.1 b/dh_installxaw.1 new file mode 100644 index 00000000..19f47423 --- /dev/null +++ b/dh_installxaw.1 @@ -0,0 +1,40 @@ +.TH DH_INSTALLXAW 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_installxaw \- install xaw wrappers config files into package build directories +.SH SYNOPSIS +.B dh_installxaw +.I "[debhelper options] [-n]" +.SH "DESCRIPTION" +dh_installxaw is a debhelper program that is responsible for installing +xaw wrappers config files into package build directories. +.P +It also automatically generates the postinst and postrm commands needed to +interface with the debian xaw-wrappers package. See +.BR dh_installdeb (1) +for an explanation of how this works. +.P +If a file named debian/package.xaw exists, then it is installed into +usr/lib/xaw-wrappers/conf/package in the package build directory. +.P +For the first first binary package listed in the control file, you may use +debian/xaw instead. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-n, \--noscripts +Do not modify postinst/postrm scripts. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.TP +.BR update-xaw-wrappers (8) +.SH AUTHOR +Joey Hess diff --git a/dh_link b/dh_link new file mode 100755 index 00000000..8d4c32ad --- /dev/null +++ b/dh_link @@ -0,0 +1,70 @@ +#!/usr/bin/perl -w +# +# Generate symlinks in debian packages, reading debian/links. The +# file contains pairs of files and symlinks. + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"links"); + + undef @links; + if ($file) { + @links=filearray($file); + } + + # Make sure it has pairs of symlinks and destinations. If it + # doesn't, $#links will be _odd_ (not even, -- it's zero-based). + if (int($#links/2) eq $#links/2) { + error("$file lists a link without a destination."); + } + + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @links, @ARGV; + } + + # Same test as above, including arguments this time. + if (int($#links/2) eq $#links/2) { + error("parameters list a link without a destination."); + } + + # Now I'd prefer to work with a hash. + %links=@links; + + foreach $src (keys %links) { + $dest=$links{$src}; + + # Make sure the directory the link will be in exists. + $basedir=Dh_Lib::dirname("$TMP/$dest"); + if (! -e $basedir) { + doit("install","-d",$basedir); + } + + # Policy says that if the link is all within one toplevel + # directory, it should be relative. If it's between + # top level directories, leave it absolute. + @src_dirs=split(m:/+:,$src); + @dest_dirs=split(m:/+:,$dest); + if ($src_dirs[0] eq $dest_dirs[0]) { + # Figure out how much of a path $src and $dest + # share in common. + for ($x=0; $x<$#src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {} + + # Build up the new src. + $src=""; + for (1..$#dest_dirs - $x) { + $src.="../"; + } + # The + 1 is here to include the actual filename. + for (1..$#src_dirs - $x + 1) { + $src.=$src_dirs[$_]."/"; + } + $src=~s:/$::; + } + + doit("ln","-sf",$src,"$TMP/$dest"); + } +} diff --git a/dh_link.1 b/dh_link.1 new file mode 100644 index 00000000..5a3fbbc2 --- /dev/null +++ b/dh_link.1 @@ -0,0 +1,75 @@ +.TH DH_LINK 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_link \- create symlinks in package build directories +.SH SYNOPSIS +.B dh_link +.I "[debhelper options] [-A] [source destination ...]" +.SH "DESCRIPTION" +dh_link is a debhelper program that creates symlinks in package build +directories. +.P +dh_link accepts a list of pairs of source and destination files. The source +files are the already existing files that will be symlinked from. The +destination files are the symlinks that will be created. There +.B must +be an equal number of source and destination files specified. +.P +The list can be specified in two ways. A file named debian/package.links +(debian/links may be used for the first binary package in debian/control) +can list pairs of files. If you use this file, you should put each pair +of files on its own line, and separate the files within the pair with +whitespace. Also, pairs of files can be specified as parameters - these +pairs will only be created in the package build directory of the first +ackage dh_link 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 +Be sure to only use file names relative to the package build +directory. Ie, "/usr/bin/foo" should not be used, use "usr/bin/foo" instead. +Also, be sure you +.B do +specify the full filename to both the source and destination files (unlike +you would do if you were using something like +.BR ln (1) +) +.P +dh_link will generate symlinks that comply with debian policy - absolute +when policy says they should be absolute, and relative links with as short a +path as possible. It will also create any subdirectories it needs to to put +the symlinks in. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B \-A, \--all +Create any links specified by command line parameters in ALL packages +acted on, not just the first. +.TP +.B source destination ... +Create a file named "destination" as a link to a file named "source". Do +this in the package build directory of the first package acted on. +(Or in all packages if -A is specified.) +.SH EXAMPLES +.TP +.B dh_link usr/man/man1/foo.1 usr/man/man1/bar.1 +Make bar.1 be a symlink to foo.1 +.TP +.B dh_link var/lib/foo usr/lib/foo usr/X11R6/man/man1/foo.1x usr/man/man1/bar.1 +Make /usr/lib/foo/ be a link to /var/lib/foo/, and bar.1 be a symlink to the +X man page foo.1x +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.BR debhelper (1) +.SH BUGS +It's impossible to specify filenames with spaces or other whitespace in them +in debian/links file. This is more a historical design flaw than a bug. +.SH "CONFORMS TO" +Debian policy, version 2.5.0.0 +.SH AUTHOR +Joey Hess diff --git a/dh_listpackages b/dh_listpackages new file mode 100755 index 00000000..7a764af5 --- /dev/null +++ b/dh_listpackages @@ -0,0 +1,8 @@ +#!/usr/bin/perl -w +# +# Output a list of all packages debhelper will act on. + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); +print join("\n",@{$dh{DOPACKAGES}})."\n"; diff --git a/dh_listpackages.1 b/dh_listpackages.1 new file mode 100644 index 00000000..aa4e7419 --- /dev/null +++ b/dh_listpackages.1 @@ -0,0 +1,25 @@ +.TH DH_LISTPACKAGES 1 "" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_listpackages \- list binary packages debhelper will act on +.SH SYNOPSIS +.B dh_listpackages +.I "[debhelper options]" +.SH "DESCRIPTION" +dh_listpackages is a debhelper program that outputs a list of all binary +packages debhelper commands will act on. If you pass it some options, it +will change the list to match the packages other debhelper commands would +act on if passed the same options. +.SH OPTIONS +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.BR debhelper (1) +.SH AUTHOR +Joey Hess diff --git a/dh_perl.1 b/dh_perl.1 new file mode 100644 index 00000000..f1277b0b --- /dev/null +++ b/dh_perl.1 @@ -0,0 +1,44 @@ +.TH DH_PERLCHECK 1 "22 June 1999" "Debhelper Commands" "Debhelper Commands" +.SH NAME +dh_perl \- calculates perl scripts & modules dependencies +.SH SYNOPSIS +.B dh_perl +.I "[debhelper options] [-k]" +.SH "DESCRIPTION" +dh_perl is a debhelper program that is responsible for generating +the perl:Depends substitutions and adding them to substvars files. +.P +The program will look for the location of installed modules and will +use this information to generate a dependency (at the present time +it can only be perl5, perl5-thread, perl-5.00X or perl-5.00X-thread). +.P +It will also look at #! lines of perl scripts in order to be able +to calculate a dependency for perl scripts and not only perl modules. +.P +In addition it will automatically remove .packlist file and will +remove the directory in which it was if it's empty. You can +switch off this option by passing -k. +.SH OPTIONS +.TP +.TP +.B debhelper options +See +.BR debhelper (1) +for a list of options common to all debhelper commands. +.TP +.B -k +Keep .packlist files. +.SH ENVIRONMENT +See +.BR debhelper (1) +for a list of environment variables that affect all debhelper commands. +.SH "SEE ALSO" +.TP +.BR debhelper (1) +.SH "CONFORMS TO" +.P +Debian policy, version 2.5.0.0 +.P +Perl policy, version 1.0 +.SH AUTHOR +Raphaël Hertzog diff --git a/examples/rules b/examples/rules index 8756505e..4573ebf8 100755 --- a/examples/rules +++ b/examples/rules @@ -69,4 +69,4 @@ source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary +.PHONY: build clean binary-indep binary-arch binary install diff --git a/examples/rules.multi b/examples/rules.multi index 04732edb..77714982 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -91,4 +91,4 @@ source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary +.PHONY: build clean binary-indep binary-arch binary install diff --git a/me b/me new file mode 100644 index 00000000..e69de29b diff --git a/pgptemp.$00 b/pgptemp.$00 new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3 From 74bbde37b5769254f730525c22fb8a71d547a23d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:02:18 +0000 Subject: r130: Initial Import --- debian/changelog | 14 ++++++++++++++ dh_clean | 3 ++- dh_fixperms | 2 +- doc/README | 4 +++- doc/TODO | 3 --- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 25279d3f..76643343 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.1.22) unstable; urgency=low + + * dh_fixperms: quoting fix from Roderick Schertler + * Added support for register-window-manager command which will be in a new + (as yet unreleased) xbase. Now a new dh_installwm program handles + registration of a window manager and the necessary modifications to + postinst and postrm. It's safe to go ahead and start using this for your + window manager packages, just note that it won't do anything until the new + xbase is out, and that due to the design of register-window-manager, if + your wm is installed before a xbase that supports register-window-manager + is installed, the window manager will never be registered. (#20971) + + -- Joey Hess Wed, 14 Oct 1998 23:08:04 -0700 + debhelper (1.1.21) unstable; urgency=low * Added install to .PHONY target of example rules files. diff --git a/dh_clean b/dh_clean index 544c09a0..821a54dc 100755 --- a/dh_clean +++ b/dh_clean @@ -30,8 +30,9 @@ if (! $dh{K_FLAG}) { # Remove other temp files. # (The \s+ is important, \s won't work because find would get null parameters). +# Note that you _don't_ quote wildcards used by find in here. doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE -o -name *.orig -o -name *.rej -o -name *.bak -o -name .*.orig -o -name .*.rej -o -name .SUMS - -o -name TAGS -o -name core + -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) ) -exec rm -f {} ;")); diff --git a/dh_fixperms b/dh_fixperms index b36f68c8..58aa1484 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -45,6 +45,6 @@ for PACKAGE in $DH_DOPACKAGES; do # ..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 \ + \( -name '*.so*' -or -name '*.la' -or -name '*.a' \) $FIND_OPTIONS -print0 \ 2>/dev/null | xargs -0r chmod a-X" done diff --git a/doc/README b/doc/README index 2aa9175d..93b1687c 100644 --- a/doc/README +++ b/doc/README @@ -35,9 +35,11 @@ by the -n parameter. Note that it will be shell code, so you cannot directly use it in a perl script. If you would like to embed it into a perl script, here is one way to -do that (note the tricky use of backquotes): +do that (note the tricky use of backquotes) (also note that I made sure that +$1, $2, etc are set with the set command): print << `EOF` +set -- @ARGV #DEBHELPER# EOF diff --git a/doc/TODO b/doc/TODO index df9e3c48..ac5c2127 100644 --- a/doc/TODO +++ b/doc/TODO @@ -38,9 +38,6 @@ Wishlist items: Matthias Klose ) * docbase support (#25233). Waiting for docbase to stabalize and be used widly. -* Support /etc/X11/window-managers, by making it easy for window managers to - add themselves to it in the postinst. Not high priority because there are - few window managers. (#20971) * dhelp support. Currently pending on dhelp use becoming widespead (#18342) * Support use of environment variables in data taken from user, ie, in debian/dirs. The problem with doing this is that we really want to allow -- cgit v1.2.3 From f52118bc1737140efeee4b56c3ab92ac3c54a61e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:02:19 +0000 Subject: r131: Initial Import --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 76643343..4826b630 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.1.23) unstable; urgency=low + + * dh_clean: At the suggestion of James Troup now deletes + files named *.P in .deps/ subdirectories. They are generated by automake. + + -- Joey Hess Sat, 24 Oct 1998 15:14:53 -0700 + debhelper (1.1.22) unstable; urgency=low * dh_fixperms: quoting fix from Roderick Schertler -- cgit v1.2.3 From 5501271678d88ac578082ce2d0705ca211d7e980 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:02:56 +0000 Subject: r132: Initial Import --- Dh_Lib.pm | 13 ++++++------ debian/changelog | 10 +++++++++ dh_installemacsen | 57 ++++++++++++++++++++++++++------------------------- dh_installmenu | 61 ++++++++++++++++++++++++++++--------------------------- dh_installwm | 31 ++++++++++++++-------------- dh_md5sums | 44 +++++++++++++++++++++++---------------- dh_suidregister | 4 ++++ dh_suidregister.1 | 4 ++++ 8 files changed, 126 insertions(+), 98 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 2b80ce45..61d807af 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -230,19 +230,18 @@ sub pkgext { my $package=shift; # 2: script to add to # 3: filename of snippet # 4: sed to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ -sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $sed=shift; - error "autoscript() not yet implemented (lazy, lazy!)"; - +sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $sed=shift || ""; # This is the file we will append to. my $outfile="debian/".pkgext($package)."$script.debhelper"; # Figure out what shell script snippet to use. my $infile; - if ( -e "$main::ENV{DH_AUTOSCRIPTDIR}/$filename" ) { - $infile="$main::ENV{DH_AUTOSCRIPTDIR}/$filename"; + if (defined($ENV{DH_AUTOSCRIPTDIR}) && + -e "$ENV{DH_AUTOSCRIPTDIR}/$filename") { + $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename"; } else { - if ( -e "/usr/lib/debhelper/autoscripts/$filename" ) { + if (-e "/usr/lib/debhelper/autoscripts/$filename") { $infile="/usr/lib/debhelper/autoscripts/$filename"; } else { @@ -251,7 +250,7 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se } # TODO: do this in perl, perhaps? - complex_doit("echo \"# Automatically added by ".basename($0).">> $outfile"); + complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile"); complex_doit("sed \"$sed\" $infile >> $outfile"); complex_doit("echo '# End automatically added section' >> $outfile"); } diff --git a/debian/changelog b/debian/changelog index 4826b630..fb3aaa58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.1.24) unstable; urgency=low + + * dh_suidregister: remove suid/sgid bits from all files registered. The + reason is this: if you're using suidmanager, and you want a file that + ships suid to never be suid on your system, shipping it suid in the .deb + will create a window where it is suid before suidmanager fixes it's + permissions. This change should be transparent to users and developers. + + -- Joey Hess Tue, 27 Oct 1998 18:19:48 -0800 + debhelper (1.1.23) unstable; urgency=low * dh_clean: At the suggestion of James Troup now deletes diff --git a/dh_installemacsen b/dh_installemacsen index 008d9531..79c7dda9 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -1,36 +1,37 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Registration with emacsen-common. -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); - emacsen_install=`pkgfile $PACKAGE emacsen-install` - emacsen_remove=`pkgfile $PACKAGE emacsen-remove` + $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); + $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); - if [ "$emacsen_install" ]; then - if [ ! -d "$TMP/usr/lib/emacsen-common/packages/install" ]; then - doit "install -d $TMP/usr/lib/emacsen-common/packages/install" - fi - doit "install $emacsen_install $TMP/usr/lib/emacsen-common/packages/install/$PACKAGE" - fi + if ($emacsen_install ne '') { + if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { + doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install"); + } + doit("install",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"); + } - if [ "$emacsen_remove" ]; then - if [ ! -d "$TMP/usr/lib/emacsen-common/packages/remove" ]; then - doit "install -d $TMP/usr/lib/emacsen-common/packages/remove" - fi - doit "install $emacsen_remove $TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE" - fi + if ($emacsen_remove ne '') { + if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") { + doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove"); + } + doit("install","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); + } - if [ "$emacsen_install" -o "$emacsen_remove" ]; then - if [ ! "$DH_NOSCRIPTS" ]; then - autoscript "postinst" "postinst-emacsen" \ - "s/#PACKAGE#/$PACKAGE/" - autoscript "prerm" "prerm-emacsen" \ - "s/#PACKAGE#/$PACKAGE/" - fi - fi -done + if ($emacsen_install ne '' || $emacsen_remove ne '') { + if (! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-emacsen", + "s/#PACKAGE#/$PACKAGE/"); + autoscript($PACKAGE,"prerm","prerm-emacsen", + "s/#PACKAGE#/$PACKAGE/"); + } + } +} diff --git a/dh_installmenu b/dh_installmenu index 9fbbfb21..2db16603 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Integration with debian menu system: # @@ -8,37 +8,38 @@ # # Also, add to postinst and postrm. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - menu=`pkgfile $PACKAGE menu` - menu_method=`pkgfile $PACKAGE menu-method` - - if [ "$menu" ]; then - if [ ! -d $TMP/usr/lib/menu ]; then - doit "install -d $TMP/usr/lib/menu" - fi - doit "install -p -m644 $menu $TMP/usr/lib/menu/$PACKAGE" +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $menu=pkgfile($PACKAGE,"menu"); + $menu_method=pkgfile($PACKAGE,"menu-method"); + + if ($menu ne '') { + if (! -d "$TMP/usr/lib/menu") { + doit("install","-d","$TMP/usr/lib/menu"); + } + 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 [ ! "$menu_method" -a ! "$DH_NOSCRIPTS" ]; then - autoscript "postinst" "postinst-menu" - autoscript "postrm" "postrm-menu" - fi - fi + if ($menu_method eq "" && ! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-menu"); + autoscript($PACKAGE,"postrm","postrm-menu") + } + } - if [ "$menu_method" ]; then - if [ ! -d $TMP/etc/menu-methods ]; then - doit "install -d $TMP/etc/menu-methods" - fi - doit "install -p $menu_method $TMP/etc/menu-methods/$PACKAGE" + if ($menu_method ne '') { + if (!-d "$TMP/etc/menu-methods") { + doit("install","-d","$TMP/etc/menu-methods"); + } + doit("install","-p",$menu_method,"$TMP/etc/menu-methods/$PACKAGE"); - if [ ! "$DH_NOSCRIPTS" ]; then - autoscript "postinst" "postinst-menu-method" "s/#PACKAGE#/$PACKAGE/" - autoscript "postrm" "postrm-menu-method" "s/#PACKAGE#/$PACKAGE/" - fi - fi -done + if (! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-menu-method","s/#PACKAGE#/$PACKAGE/"); + autoscript($PACKAGE,"postrm","postrm-menu-method","s/#PACKAGE#/$PACKAGE/"); + } + } +} diff --git a/dh_installwm b/dh_installwm index be3a1373..0cae9147 100755 --- a/dh_installwm +++ b/dh_installwm @@ -1,21 +1,22 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Add to postinst and postrm to register a window manager. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -wm=$1 +$wm=shift; -if [ -z "$wm" ]; then - error "No window manager was specified." -fi +if ($wm eq '') { + error("No window manager filename was specified."); +} -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - - if [ ! "$DH_NOSCRIPTS" ]; then - autoscript "postinst" "postinst-wm" "s/#WM#/$wm/" - autoscript "postrm" "postrm-wm" "s/#WM#/$wm/" - fi -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { +# $TMP=tmpdir($PACKAGE); + + if (! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-wm","s/#WM#/$wm/"); + autoscript($PACKAGE,"postrm","postrm-wm","s/#WM#/$wm/"); + } +} diff --git a/dh_md5sums b/dh_md5sums index 9c47a90b..4ab9041a 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -1,27 +1,35 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the # package. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +use Cwd; +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); - if [ ! -d "$TMP/DEBIAN" ]; then - doit "install -d $TMP/DEBIAN" - fi + if (! -d "$TMP/DEBIAN") { + doit("install","-d","$TMP/DEBIAN"); + } # Check if we should exclude conffiles. - if [ ! "$DH_INCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then - # Generate exclude regexp. Using perl here may be overkill, - # but it does insure conffiles with spaces in them work. - exclude=`perl -ne 'chomp; s/^\///; print "! -path \"$_\" "' $TMP/DEBIAN/conffiles` - fi + my $exclude=""; + if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") { + # Generate exclude regexp. + open (CONFF,"$TMP/DEBIAN/conffiles"); + while () { + chomp; + s/^\///; + $exclude.="! -path \"$_\" "; + } + close CONFF; + } - olddir=`pwd` - complex_doit "cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir" - doit "chmod 644 $TMP/DEBIAN/md5sums" - doit "chown root.root $TMP/DEBIAN/md5sums" -done + $olddir=getcwd(); + complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir"); + doit("chmod",644,"$TMP/DEBIAN/md5sums"); + doit("chown","root.root","$TMP/DEBIAN/md5sums"); +} diff --git a/dh_suidregister b/dh_suidregister index bc8aa5f2..f6d02bc1 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -54,6 +54,10 @@ for PACKAGE in $DH_DOPACKAGES; do 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 diff --git a/dh_suidregister.1 b/dh_suidregister.1 index edce61d0..ee804aff 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -26,6 +26,10 @@ will automatically register all files it finds. Note that this program modifies your postinst and postrm files. See .BR dh_installdeb (1) for an explanation of how this works. +.P +Also note that all files registered by this program will *not* be suid in the +resulting .deb file. The postinst of the package will set their permissions +(even if the user doesn't have suidmanager installed). .SH OPTIONS .TP .B debhelper options -- cgit v1.2.3 From ab02dbc90be2f33ce420c672efb4931a50ab22b4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:12 +0000 Subject: r134: Initial Import --- debian/changelog | 11 +++++++++++ debian/control | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fb3aaa58..94c582c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +debhelper (1.2.0) unstable; urgency=low + + * A new unstable dist means I'm back to converting more of debhelper to + perl.. Since 1.1 has actually stabalized, I've upped this to 1.2. + * dh_md5sums: rewritten in perl, for large speed gain under some + circumstances (old version called perl sometimes, once per package.) + * dh_installmenu, dh_installwmacsen, dh_installwm: perlized. + * Dh_Lib.pm: made autoscript() really work. + + -- Joey Hess Mon, 9 Nov 1998 13:04:16 -0800 + debhelper (1.1.24) unstable; urgency=low * dh_suidregister: remove suid/sgid bits from all files registered. The diff --git a/debian/control b/debian/control index c6e236d3..9591b1ef 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.4 +Standards-Version: 2.5.0.0 Package: debhelper Architecture: all -- 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(-) 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 1e5ea4d0567b63073061c867062043c4327e62a1 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:35 +0000 Subject: r136: Initial Import --- debian/changelog | 8 +++++ dh_du | 4 +-- dh_getopt.pl | 4 --- dh_makeshlibs | 80 ++++++++++++++++++++++++------------------------ dh_undocumented | 93 ++++++++++++++++++++++++++++---------------------------- 5 files changed, 98 insertions(+), 91 deletions(-) diff --git a/debian/changelog b/debian/changelog index 26d6963f..5f3eb367 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.2) unstable; urgency=low + + * dh_du, dh_shlibdeps, dh_undocumented: rewrite in perl. + * dh_undocumented: shortened the symlink used for section 7 undocumented + man pages, since it can link to undocuemented.7.gz in the same directory. + + -- Joey Hess Tue, 10 Nov 1998 13:40:22 -0800 + debhelper (1.2.1) unstable; urgency=low * dh_strip, dh_installinit: rewrite in perl. diff --git a/dh_du b/dh_du index 9e641a27..78518f8e 100755 --- a/dh_du +++ b/dh_du @@ -1,8 +1,8 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Generate a DEBIAN/du file, that lists the disk usage of the directories in # the package. # # No longer - it was decided these files are a bad idea. -echo "dh_du: this program does nothing and is deprecated. Remove it from debian/rules." >&2 +print STDERR "dh_du: this program does nothing and is deprecated. Remove it from debian/rules.\n"; diff --git a/dh_getopt.pl b/dh_getopt.pl index b1dcf7b1..4d1d3903 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -27,10 +27,6 @@ my %options=Dh_Getopt::parseopts(); $options{DOPACKAGES}=join " ",@{$options{DOPACKAGES}}; if ($#{$options{EXCLUDE}} > -1) { $options{EXCLUDE_GREP}=join '|', @{$options{EXCLUDE}}; - foreach (@{$options{EXCLUDE}}) { - $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or "; - } - $options{EXCLUDE_FIND}=~s/ -or $//; } $options{EXCLUDE}=join " ",@{$options{EXCLUDE}}; diff --git a/dh_makeshlibs b/dh_makeshlibs index eb88f448..68dc83eb 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -1,47 +1,49 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Automatically generate shlibs files. -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); - if [ -e "$TMP/DEBIAN/shlibs" ]; then - error "$TMP/DEBIAN/shlibs already exists." - fi + if (-e "$TMP/DEBIAN/shlibs") { + error("$TMP/DEBIAN/shlibs already exists."); + } - for file in `find $TMP -type f -name "*.so.*" | tr "\n" " "` ; do - LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true - LIB_VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true - if [ -z "$DH_M_PARAMS" ]; then - MAJOR=`expr $LIB_VERSION : "\([0-9]*\)\."` || true - else - MAJOR="$DH_M_PARAMS" - fi -# LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true - if [ ! -d "$TMP/DEBIAN" ] ; then - doit "install -d $TMP/DEBIAN" - fi - DEPS=$PACKAGE - if [ "$DH_V_FLAG_SET" ]; then - if [ "$DH_V_FLAG" ]; then - DEPS="$DH_V_FLAG" - else - # Call isnative becuase it sets $VERSION + open (FIND, "find $TMP -type f -name '*.so.*' |"); + while () { + chomp; + ($library, $major)=m#.*/(.*)\.so\.(\d*)\.#; + if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { + $major=$dh{M_PARAMS}; + } + if (! -d "$TMP/DEBIAN") { + doit("install","-d","$TMP/DEBIAN"); + } + $deps=$PACKAGE; + if ($dh{V_FLAG_SET}) { + if ($dh{V_FLAG} ne '') { + $deps=$dh{V_FLAG}; + } + else { + # Call isnative becuase it sets $dh{VERSION} # as a side effect. - isnative || true - DEPS="$PACKAGE (>= $VERSION)" - fi - fi - if [ "$LIBRARY" -a "$MAJOR" -a "$DEPS" ]; then - complex_doit "echo '$LIBRARY $MAJOR $DEPS' >>$TMP/DEBIAN/shlibs" - fi - done + isnative($PACKAGE); + $deps="$PACKAGE (>= $dh{VERSION})"; + } + } + if (defined($library) && defined($major) && defined($deps) && + $library ne '' && $major ne '' && $deps ne '') { + complex_doit("echo '$library $major $deps' >>$TMP/DEBIAN/shlibs"); + } + } + close FIND; - if [ -e "$TMP/DEBIAN/shlibs" ]; then - doit "chmod 644 $TMP/DEBIAN/shlibs" - doit "chown root.root $TMP/DEBIAN/shlibs" - fi -done + if (-e "$TMP/DEBIAN/shlibs") { + doit("chmod",644,"$TMP/DEBIAN/shlibs"); + doit("chown","root.root","$TMP/DEBIAN/shlibs"); + } +} diff --git a/dh_undocumented b/dh_undocumented index edd873f7..c4264d6b 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Passed a list of undocumented man pages, generates symlinks to # undocumented.7.gz for those man pages. @@ -6,48 +6,49 @@ # Also, it looks for debian/undocumented files for more lists of # undocumented man pages. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - undocumented=`pkgfile $PACKAGE undocumented` - - undoc="" - - if [ "$undocumented" ]; then - undoc=`tr "\n" " " < $undocumented` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - undoc="$* $undoc" - fi - - if [ "$undoc" ]; then - for file in $undoc; do - # Remove .gz extention from the filename, if present. - if [ `expr "$file" : '\(.*\).gz'` ]; then - file=`expr "$file" : '\(.*\).gz'` - fi - - # Determine what directory the file belongs in, - # /usr/man, or /usr/X11R6/man. - section=`expr "$file" : '.*\.\([123456789]\)'` \ - || error "\"$file\" does not have an extention." - if [ `expr "$file" : '.*\.[123456789]\(x\)'` ] ; then - dir=usr/X11R6/man/man$section - reldir=../../../man - else - dir=usr/man/man$section - reldir=.. - fi - - if [ ! -d $TMP/$dir ]; then - doit "install -d $TMP/$dir" - fi - - doit "ln -s $reldir/man7/undocumented.7.gz $TMP/$dir/$file.gz" - done - fi -done +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $undocumented=pkgfile($PACKAGE,"undocumented"); + + @undoc=(); + if ($undocumented) { + @undoc=filearray($undocumented); + } + + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @undoc, @ARGV; + } + + foreach $file (@undoc) { + $file=~s/.gz$//; # .gz extention is optional in input. + + # Determine what directory the file belongs in, + # /usr/man, or /usr/X11R6/man, and how the link to + # the undocuemtned.7 man page will look. + ($section)=$file=~m/^.*\.(\d)/; + if (!$section) { + error("\"$file\" does not have an extention."); + } + if ($file=~/.*\.\dx/) { + $dir="usr/X11R6/man/man$section"; + $reldir="../../../man/man7/"; + } + elsif ($section != 7) { + $dir="usr/man/man$section"; + $reldir="../man7/"; + } + else { + $dir="usr/man/man$section"; + $reldir=""; + } + + if (! -d "$TMP/$dir") { + doit("install","-d","$TMP/$dir"); + } + doit("ln","-sf","${reldir}undocumented.7.gz","$TMP/$dir/$file.gz"); + } +} -- 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(-) 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 d914f3382342fd6fdff6aa56f2a707486e9b31a0 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:42 +0000 Subject: r138: Initial Import --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 51977f18..2c4e79a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.2.4) unstable; urgency=low + + * dh_debstd, dh_movefiles: perlized. + * dh_debstd: fixed -c option. + * dh_installinit: fixed minor perl -w warning. + * Only 1 shell script remains! (But it's a doozy..) + + -- Joey Hess Fri, 13 Nov 1998 13:29:39 -0800 + debhelper (1.2.3) unstable; urgency=low * dh_fixperms, dh_installdebfiles, dh_installdeb: perlized -- cgit v1.2.3 From 86dad95164449b89ef4d97df2750c3e8b94cf47f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:50 +0000 Subject: r139: Initial Import --- debian/changelog | 13 ++++++ debian/rules | 4 +- dh_compress | 130 ++++++++++++++++++++++++++----------------------------- dh_debstd | 2 +- doc/PROGRAMMING | 88 ++++++++++++++----------------------- doc/README | 2 +- doc/TODO | 5 --- 7 files changed, 111 insertions(+), 133 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2c4e79a3..32baae86 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (1.2.5) unstable; urgency=low + + * The perl conversion is complete. + . + * dh_compress: perlized (yay, perl has readlink, no more ls -l | awk + garbage!) + * dh_lib, dh_getopt.pl: deleted, nothing uses them anymore. + * debian/rules: don't install above 2 files. + * doc/PROGRAMMING: removed all documentation of the old shell library + interface. + + -- Joey Hess Fri, 13 Nov 1998 15:36:57 -0800 + debhelper (1.2.4) unstable; urgency=low * dh_debstd, dh_movefiles: perlized. diff --git a/debian/rules b/debian/rules index bb790cd3..48275979 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 and the current dh_getopt.pl in this debian/ directory. +# current Dh_lib.pm and the current Dh_getopt.pm 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. @@ -34,7 +34,7 @@ binary-indep: build echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; - cp -a dh_lib dh_getopt.pl *.pm debian/tmp/usr/lib/debhelper + cp -a *.pm debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd diff --git a/dh_compress b/dh_compress index 76f7614d..0cc79c78 100755 --- a/dh_compress +++ b/dh_compress @@ -1,82 +1,74 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Compresses files and makes sure that symlinks pointing to the # compressed files get fixed. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +use Cwd; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -# Returns a list of all the files that we want to compress, -# (ignoring any files we were asked to exclude on the command -# line). Assumes we are already in the temp directory. -filelist () { - # First of all, deal with any files specified right on the command line. - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - # Convert to having each file on its own line - # so grep will work. - echo "$*" | tr " " "\n" - fi - - if [ "$compress" ]; then - # The config file is a sh script that outputs the files to be compressed - # (typically using find). - sh $olddir/$compress 2>/dev/null || true - 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 || true - find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ - ! -name "*.htm*" ! -name "*.gif" ! -name "*.gz" \ - ! -name "copyright" 2>/dev/null || true - fi -} - -# Returns a list of all the files we want to compress, -# after taking command line exclusions into account. -# Call only if DH_EXCLUDE_GREP is non-empty. -filelist_excluded () { - # Use grep -F so we don't have to worry about regexp's. - (filelist "$*" | grep -v -F \ - "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`") || true -} - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - compress=`pkgfile $PACKAGE compress` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $compress=pkgfile($PACKAGE,"compress"); # Run the file name gathering commands from within the directory # structure that will be effected. - olddir=`pwd` - # Can't use doit here, that breaks --no-act mode. - verbose_echo "cd $TMP" - cd "$TMP" + $olddir=getcwd(); + chdir($TMP) || error("Can't cd to $TMP: $!"); + + # Figure out what files to compress. + @files=(); + # First of all, deal with any files specified right on the command line. + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @files,#ARGV; + } + if ($compress) { + # The config file is a sh script that outputs the files to be compressed + # (typically using find). + push @files, split(/\n/,`sh $olddir/$compress 2>/dev/null`); + } + else { + # By default, fall back to what the policy manual says to compress. + push @files, split(/\n/,` + 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 || true + `); + } - # Get the list of files to compress. - if [ "$DH_EXCLUDE_GREP" ]; then - files=`filelist_excluded $*` - else - files=`filelist $*` - fi + # Exclude files from compression. + if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) { + @new=(); + foreach (@files) { + $ok=1; + foreach $x (@{$dh{EXCLUDE}}) { + if (/\Q$x\E/) { + $ok=''; + last; + } + } + push @new,$_ if $ok; + } + @files=@new; + } - if [ "$files" ]; then - # This is just a cosmetic fix. - files=`echo $files | tr "\n" " "` - - doit "gzip -f9 $files" || true - fi + if (@files) { + doit("gzip","-9f",@files); + } - # Change back to old pwd. - verbose_echo "cd $olddir" - cd "$olddir" + chdir($olddir); # Fix up symlinks that were pointing to the uncompressed files. - for file in `find $TMP -type l`; do - DIRECTORY=`expr $file : "\(.*\)/[^/]*"` - NAME=`expr $file : ".*/\([^/]*\)"` - LINKVAL=`ls -l $DIRECTORY/$NAME | awk '{ print $11;}'` - if [ ! -e $DIRECTORY/$LINKVAL -a -f $DIRECTORY/$LINKVAL.gz ]; then - doit "rm $DIRECTORY/$NAME" - doit "ln -s $LINKVAL.gz $DIRECTORY/$NAME.gz" - fi - done -done + open (FIND,"find $TMP -type l |"); + while () { + chomp; + ($directory)=m:(.*)/:; + $linkval=readlink($_); + if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") { + doit("rm","-f",$_); + doit("ln","-sf","$linkval.gz","$_.gz"); + } + } +} diff --git a/dh_debstd b/dh_debstd index e9e7b3ca..2a557ec9 100755 --- a/dh_debstd +++ b/dh_debstd @@ -10,7 +10,7 @@ # This has been gutted and extensively rewritten to function as a debhelper # command by Joey Hess. And then completly rewritten in perl. -# Pre-parse command line before we load dh_lib, becuase we use a +# Pre-parse command line before we load Dh_lib, becuase we use a # different style of arguments. @argv=(); foreach (@ARGV) { diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 67d25d00..da21ea9d 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -36,27 +36,20 @@ merge these modifications into the actual postinst scripts. There are always exceptions. Just ask me. -Introducing dh_lib and Dh_Lib.pm: --------------------------------- +Introducing Dh_Lib.pm: +--------------------- -dh_lib/Dh_lib.pm is the library used by all debhelper programs to parse -their arguments and set some useful variables. It's not mandatory that your -program use dh_lib/Dh_lib.pm, but it will make it a lot easier to keep it in -sync with the rest of debhelper if it does, so this is highly encouraged. -There are two versions of this library - dh_lib is a shell library, while -Dh_Lib.pm is a perl module. +Dh_lib.pm is the library used by all debhelper programs to parse their +arguments and set some useful variables. It's not mandatory that your +program use Dh_lib.pm, but it will make it a lot easier to keep it in sync +with the rest of debhelper if it does, so this is highly encouraged. -Typically, you invoke dh_lib like this if your debhelper program is a shell -script: +(There used to be a version of Dh_lib.pm that was a library of functions for +shell scripts. If you want to write a debhelper command that is a shell +script, I can dig up that old library for you. Only the perl one is +supported now, though.) -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -The path statement is there to make your program look first in debian/ for -dh_lib (so users can install a modified version there if necessary), then the -rest of the path, then the canonical location of dh_lib, /usr/lib/debhelper. - -If you are writing a perl program instead, use Dh_lib.pm like this: +Use Dh_lib.pm like this: BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; @@ -65,25 +58,19 @@ init(); The BEGIN block is there to make perl look for the module in all the right places. -Notice the init() function in the perl version. dh_lib automatically parses -the command line and does some other initialization tasks. Dh_Lib.pm -requires you to run init() to accomplish the same task. +The init() function in the perl version. This causes Dh_lib to +parse the command line and do some other initialization tasks. Argument processing: ------------------- All debhelper programs should respond to certain arguments, such as -v, -i, --a, and -p. To help you make this work right, dh_lib/Dh_Lib.pm handles -argument processing. - -As soon as dh_lib loads, it processes any arguments that have been passed to -your program. On the other hand, you need to call init() in Dh_Lib.pm before -it will parse arguments. +-a, and -p. To help you make this work right, Dh_Lib.pm handles argument +processing. Just call init(). After argument processing, some global variables are used to hold the -results; program can use them later. If using dh_lib, prefix DH_ to the name -of each of these variables to get the name of the environment variable that -is set. If using Dh_lib.pm, these variables are in the %dh hash. +results; programs can use them later. These variables are elements of the +%dh hash. switch variable description -v VERBOSE should the program verbosely output what it is @@ -99,10 +86,7 @@ switch variable description package's postinst, postrm, etc scripts. -X EXCLUDE exclude a something from processing (you decide what this means for your program) - (In Dh_Lib.pm, this is an array) - EXCLUDE_GREP same as DH_EXCLUDE, except all items are - separated by '|' characters, instead of spaces, - handy for egrep -v (only available to dh_lib) + (This is an array) 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 @@ -117,7 +101,7 @@ switch variable description package is being acted on) -u U_PARAMS will be set to a string, that is typically parameters your program passes on to some - other program. (In Dh_Lib.pm, this is an array) + other program. (This is an array) -m M_PARAMS will be set to a string, you decide what it means to your program -V V_FLAG will be set to a string, you decide what it @@ -141,38 +125,32 @@ If you need a new command line option, just ask me, and I will add it. Global variables: ---------------- -If using dh_lib, the following variables are also set as soon as you load -the library: +The following keys are also set in the %dh hash when you call init(): MAINPACKAGE the name of the first binary package listed in debian/control -DH_FIRSTPACKAGE the first package we were instructed to act on. This package +FIRSTPACKAGE the first package we were instructed to act on. This package typically gets special treatment, additional arguments specified on the command line may effect it. -If using Dh_Lib.pm, these are only set after init(), and they are named -$dh{MAINPACKAGE} and $dh{FIRSTPACKAGE}, instead. - Functions: --------- -dh_lib/Dh_Lib.pm also contains a number of functions you may find useful. -Note that the functions calling conventions are slightly different between -the two versions of the library. +Dh_Lib.pm also contains a number of functions you may find useful. doit() - Pass this function a string (dh_lib) or array (Dh_Lib.pm) that is a - shell command. It will run the command (unless DH_NO_ACT is set), and - if DH_VERBOSE is set, it will also output the command to stdout. You + Pass this function an array that is a + shell command. It will run the command (unless $dh{NO_ACT} is set), and + if $dh{VERBOSE} is set, it will also output the command to stdout. You should use this function for almost all commands your program performs that manipulate files in the package build directories. complex_doit() Pass this function a string that is a shell command, it will run it similarly to how doit() does. You can pass more complicated commands - to this (ie, commands involving piping redirection) -verbose_echo() (dh_lib) -verbose_print() (Dh_Lib.pm) - Pass this command a string, and it will echo it if DH_VERBOSE is set. + to this (ie, commands involving piping redirection), however, you + have to worry about things like escaping shell metacharacters. +verbose_print() + Pass this command a string, and it will echo it if $dh{VERBOSE} is set. error() Pass this command a string, it will output it to standard error and exit. @@ -191,20 +169,20 @@ pkgfile() debian/ directory, so there can be one config file per binary package. The convention is that the files are named debian/package.filename, and debian/filename is also allowable for - the MAINPACKAGE. If the file does not exist, nothing is returned. + the $dh{MAINPACKAGE}. If the file does not exist, nothing is returned. pkgext() Pass this command the name of a binary package, and it will return the name to prefix to files in debian/ for this package. For the - MAINPACKAGE, it returns nothing (there is no prefix), for the other + $dh{MAINPACKAGE}, it returns nothing (there is no prefix), for the other packages, it returns "package.". isnative() Pass this command the name of a package, it returns 1 if the package is a native debian package. - As a side effect, VERSION is set to the version number of the + As a side effect, $dh{VERSION} is set to the version number of the package. autoscript() Pass parameters: - - package to be affected (Dh_Lib.pm only) + - binary package to be affected - script to add to - filename of snippet - sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ diff --git a/doc/README b/doc/README index 93b1687c..d8519667 100644 --- a/doc/README +++ b/doc/README @@ -1,7 +1,7 @@ Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks related to building debian binary packages. For further documentation, see the man pages for dh_* commands. For an overview -of debhelper, see the debhelper man page. +of debhelper, see the debhelper(1) man page. To help you get started, I've included examples of debian/rules files that use debhelper commands extensively. See /usr/doc/debhelper/examples/ . diff --git a/doc/TODO b/doc/TODO index ac5c2127..9a103358 100644 --- a/doc/TODO +++ b/doc/TODO @@ -60,8 +60,3 @@ Depricated: on doing this after slink is released or one year after they were depricated, whichever comes first. Be sure to grep whole debian archive for alls to them before removing them, though! - -Long term goals: - -* Convert selected debhelper commands to be perl programs, for speed, ease - of maintainence, and 8-bit cleanness. -- cgit v1.2.3 From c84b7d0025dc6c2d64452e0b46f7e95e2d70e34e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:00 +0000 Subject: r140: Initial Import --- debian/changelog | 6 ++++++ dh_movefiles | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 32baae86..05636c5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.6) unstable; urgency=low + + * dh_movefiles: fixed non-integer comparison (#29476) + + -- Joey Hess Sun, 15 Nov 1998 13:03:09 -0800 + debhelper (1.2.5) unstable; urgency=low * The perl conversion is complete. diff --git a/dh_movefiles b/dh_movefiles index 5967ff54..52a7fe34 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -19,7 +19,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { @tomove=(); # debian/files has a different purpose, so ignore it. - if ( $files && $files != "debian/files" ) { + if ( $files && $files ne "debian/files" ) { @tomove=filearray($files); } -- cgit v1.2.3 From 7a3034bad2993ee50755a5a2e22e2e4d58a5c4fe Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:15 +0000 Subject: r141: Initial Import --- debian/changelog | 6 ++++++ dh_movefiles | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 05636c5d..edfcacf7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.7) unstable; urgency=low + + * dh_movefiles: Fixed another bug. + + -- Joey Hess Mon, 16 Nov 1998 12:53:05 -0800 + debhelper (1.2.6) unstable; urgency=low * dh_movefiles: fixed non-integer comparison (#29476) diff --git a/dh_movefiles b/dh_movefiles index 52a7fe34..d6af3467 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -46,14 +46,16 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # packages and doesn't affect much of anything else. 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"); + $file=$_; + $ret=1 if (! -e $file && ! -l $file); + $file=~s:^debian/tmp/*::; + complex_doit("(cd debian/tmp ; find $file ! -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"); + $file=$_; + $ret=1 if (! -e $file && ! -l $file); + $file=~s:^debian/tmp/*::; + complex_doit("(cd debian/tmp ; find $file ! -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"); -- cgit v1.2.3 From 9bbed39d6d27346d4092f5869b36b8ec93426d18 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:32 +0000 Subject: r142: Initial Import --- debian/changelog | 6 ++++++ debian/control | 1 + 2 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index edfcacf7..d5aed54b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.8) unstable; urgency=low + + * Suggest dh-make (#29376). + + -- Joey Hess Wed, 18 Nov 1998 02:29:47 -0800 + debhelper (1.2.7) unstable; urgency=low * dh_movefiles: Fixed another bug. diff --git a/debian/control b/debian/control index 9591b1ef..8edb5aa9 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Standards-Version: 2.5.0.0 Package: debhelper Architecture: all Depends: perl (>= 5.004), fileutils (>= 3.16-4), file +Suggests: dh-make Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to automate common tasks related to building binary debian packages. Programs -- cgit v1.2.3 From a7548a2bec041aeefd49526563a13d9f5fedcd78 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:38 +0000 Subject: r143: Initial Import --- debian/changelog | 7 +++++++ examples/rules.indep | 1 + 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index d5aed54b..4f49077e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.9) unstable; urgency=low + + * Added dh_link, which generates policy complient symlinks in binary + packages, painlessly. + + -- Joey Hess Thu, 19 Nov 1998 18:43:36 -0800 + debhelper (1.2.8) unstable; urgency=low * Suggest dh-make (#29376). diff --git a/examples/rules.indep b/examples/rules.indep index 4b80f1c8..142b99fe 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -51,6 +51,7 @@ binary-indep: build install # dh_installmanpages # dh_undocumented dh_installchangelogs + dh_link dh_compress dh_fixperms dh_suidregister -- cgit v1.2.3 From 3da73dffff8be46160d58a0c1ee2566d6bf1e7f8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:38 +0000 Subject: r144: Initial Import --- debian/changelog | 6 ++++++ examples/rules | 1 + examples/rules.multi | 2 ++ 3 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4f49077e..3c124e77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.10) unstable; urgency=low + + * examples/*: added dh_link calls to example rules files. + + -- Joey Hess Fri, 20 Nov 1998 15:43:07 -0800 + debhelper (1.2.9) unstable; urgency=low * Added dh_link, which generates policy complient symlinks in binary diff --git a/examples/rules b/examples/rules index 4573ebf8..e1a9c260 100755 --- a/examples/rules +++ b/examples/rules @@ -54,6 +54,7 @@ binary-arch: build install dh_installmanpages # dh_undocumented dh_installchangelogs + dh_link dh_strip dh_compress dh_fixperms diff --git a/examples/rules.multi b/examples/rules.multi index 77714982..c4302007 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -54,6 +54,7 @@ binary-indep: build install # dh_installmanpages -i # dh_undocumented dh_installchangelogs -i + dh_link -i dh_compress -i dh_fixperms -i dh_suidregister -i @@ -77,6 +78,7 @@ binary-arch: build install # dh_undocumented dh_installchangelogs -a dh_strip -a + dh_link -a dh_compress -a dh_fixperms -a dh_suidregister -a -- cgit v1.2.3 From 2498b1b9d483d1b79883677a72689e76acee3b9d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:45 +0000 Subject: r146: Initial Import --- debian/changelog | 8 ++++++++ debian/rules | 1 + dh_link | 5 ++--- dh_movefiles | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3c124e77..b93b1471 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.11) unstable; urgency=low + + * dh_movefiles: if given absolute filenames to move (note that that is + *wrong*), it will move relative files anyway. Related to bug #29761. + * dh_link: made relative links work right. (I hope!) + + -- Joey Hess Fri, 20 Nov 1998 20:21:51 -0800 + debhelper (1.2.10) unstable; urgency=low * examples/*: added dh_link calls to example rules files. diff --git a/debian/rules b/debian/rules index 48275979..14b5e7f0 100755 --- a/debian/rules +++ b/debian/rules @@ -43,6 +43,7 @@ binary-indep: build ./dh_installmanpages ./dh_installchangelogs ./dh_movefiles + ./dh_link ./dh_compress ./dh_fixperms ./dh_suidregister diff --git a/dh_link b/dh_link index 8d4c32ad..41dd736e 100755 --- a/dh_link +++ b/dh_link @@ -58,12 +58,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { for (1..$#dest_dirs - $x) { $src.="../"; } - # The + 1 is here to include the actual filename. - for (1..$#src_dirs - $x + 1) { + for ($x .. $#src_dirs) { $src.=$src_dirs[$_]."/"; } $src=~s:/$::; - } + } doit("ln","-sf",$src,"$TMP/$dest"); } diff --git a/dh_movefiles b/dh_movefiles index d6af3467..9819fd2d 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -48,13 +48,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); - $file=~s:^debian/tmp/*::; + $file=~s:^debian/tmp/+::; complex_doit("(cd debian/tmp ; find $file ! -type d -and ! -type l -print || true) >> movelist"); } foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); - $file=~s:^debian/tmp/*::; + $file=~s:^debian/tmp/+::; complex_doit("(cd debian/tmp ; find $file ! -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 -)"); -- cgit v1.2.3 From d66756072ecd58a965f726bad6e0173142f6b4db Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:04:52 +0000 Subject: r147: Initial Import --- debian/changelog | 10 ++++++++++ dh_suidregister | 5 ++++- examples/rules | 2 +- examples/rules.multi | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index b93b1471..09eea311 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.12) unstable; urgency=low + + * examples/*: moved dh_makeshlibs call to before dh_installdeb call. + (#29762). This is just so if you replace dh_makeshlibs with something + that generates debian/shlibs, it still gets installed properly. + * dh_suidregister: use names instead of uid's and gid's, at request of + suidregister maintainer (#29802). + + -- Joey Hess Sat, 21 Nov 1998 13:13:10 -0800 + debhelper (1.2.11) unstable; urgency=low * dh_movefiles: if given absolute filenames to move (note that that is diff --git a/dh_suidregister b/dh_suidregister index 86188cd4..d5b10ebd 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -47,8 +47,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # 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"); + # Now come up with the user and group names for the uid and gid. + $user=getpwuid($uid); + $group=getgrgid($gid); # 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/", + $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", $mode & 07777); autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); diff --git a/examples/rules b/examples/rules index e1a9c260..091a67a6 100755 --- a/examples/rules +++ b/examples/rules @@ -61,8 +61,8 @@ binary-arch: build install dh_suidregister dh_installdeb dh_shlibdeps - dh_gencontrol # dh_makeshlibs + dh_gencontrol dh_md5sums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index c4302007..c7426b2e 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -84,8 +84,8 @@ binary-arch: build install dh_suidregister -a dh_installdeb -a dh_shlibdeps -a - dh_gencontrol -a # dh_makeshlibs -a + dh_gencontrol -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 0c87acf25b4c07757402dfb0810c6404af0700f4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:05:04 +0000 Subject: r149: Initial Import --- debian/changelog | 6 ++++++ debian/copyright | 2 +- dh_du.1 | 2 +- doc/README | 4 ++-- doc/TODO | 20 ++++++++++---------- doc/from-debstd | 2 +- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 09eea311..6608522a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.13) unstable; urgency=low + + * Spelling and typo fixes. + + -- Joey Hess Wed, 25 Nov 1998 15:23:55 -0800 + debhelper (1.2.12) unstable; urgency=low * examples/*: moved dh_makeshlibs call to before dh_installdeb call. diff --git a/debian/copyright b/debian/copyright index 2845a267..50256a89 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Debhelper is written by Joey Hess . -Parts of the code (and certianly my inspiration from the whole thing) came +Parts of the code (and certainly my inspiration from the whole thing) came from debmake, by Christoph Lameter . Some of the dh_md5sums and dh_du commands is from a program by Charles diff --git a/dh_du.1 b/dh_du.1 index 670e371d..38d3d7bd 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -7,7 +7,7 @@ dh_du \- generate DEBIAN/du file dh_du is a debhelper program that was responsible for generating a DEBIAN/du file, which listed the disk usage of directories in the package. .P -This program is now depricated, and does nothing, after a decision by the +This program is now deprecated, and does nothing, after a decision by the debian developers that du control files should not exit. It will simply output a warning message now. .SH "SEE ALSO" diff --git a/doc/README b/doc/README index d8519667..b283af20 100644 --- a/doc/README +++ b/doc/README @@ -47,9 +47,9 @@ Other notes: ----------- Note that if you are generating a debian package that has arch-indep and -arch-dependant portions, and you are using dh_movefiles to move the +arch-dependent portions, and you are using dh_movefiles to move the arch-indep files out of debian/tmp, you need to make sure that dh_movefiles -does this even if only the arch-dependant package is being built (for ports +does this even if only the arch-dependent package is being built (for ports to other architectures). I handle this in debian/rules.multi by calling dh_movefiles in the install target. diff --git a/doc/TODO b/doc/TODO index 9a103358..282c24ed 100644 --- a/doc/TODO +++ b/doc/TODO @@ -30,14 +30,14 @@ Wishlist items: * 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 + dh_installdeb, so the fragments wouldn't go into the postinst. So maybe a new script is called for. * Need a way to make dh_strip not strip any static libs. Also, it'd be nice - if there were options to dh_strip, dh_compress, etc, to allow inclusiuon of - directories and exclusion of files based on filname globbing. (Request from + if there were options to dh_strip, dh_compress, etc, to allow inclusion of + directories and exclusion of files based on filename globbing. (Request from Matthias Klose ) -* docbase support (#25233). Waiting for docbase to stabalize and be used - widly. +* docbase support (#25233). Waiting for docbase to stabilize and be used + widely. * dhelp support. Currently pending on dhelp use becoming widespead (#18342) * Support use of environment variables in data taken from user, ie, in debian/dirs. The problem with doing this is that we really want to allow @@ -49,14 +49,14 @@ Wishlist items: that generates the cache. The catch is that if the user runs that program, they are stating that they don't do anything later to invalidate the cache, without calling ch_cache again. (#23792) -* Add a switch to dh_installdeb to allow it to do user definied - substitutions. TOH, maybe it's better if peopld just sed +* Add a switch to dh_installdeb to allow it to do user defined + substitutions. OTOH, maybe it's better if people just sed postinst.in before debhelper gets it's hands on it... (#25235) -Depricated: +Deprecated: * remove dh_installdebfiles, dh_du. - need to wait a reasonable length of time. I'm currently planning on doing this after slink is released or one year after they were - depricated, whichever comes first. Be sure to grep whole debian - archive for alls to them before removing them, though! + deprecated, whichever comes first. Be sure to grep whole debian + archive for all of them before removing them, though! diff --git a/doc/from-debstd b/doc/from-debstd index 50bf4ffb..86f29dce 100644 --- a/doc/from-debstd +++ b/doc/from-debstd @@ -45,7 +45,7 @@ actually doing anything to your package. The list will look similar to this: dh_builddeb Now copy that output into debian/rules, replacing the debstd command, as -well as any dpkg-gencontol and dpkg --build commands. +well as any dpkg-gencontrol and dpkg --build commands. Finally, debstd automatically modified postinst, postrm, etc scripts. Some of the debhelper apps do that too, but they do it differently. Debstd just -- cgit v1.2.3 From dd15d8928f80c2860bee3fe1a8122f48d4f06bc4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:05:53 +0000 Subject: r150: Initial Import --- debian/changelog | 8 ++++++++ debian/control | 2 +- examples/rules | 2 +- examples/rules.multi | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6608522a..fa047f8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.14) unstable; urgency=low + + * Really fixed #29762 this time. This also fixes #30025, which asked that + dh_makeshlibs come before dh_shlibdeps, so the files it generates can + also be used as a shlibs.local file, which will be used by dh_shlibdeps. + + -- Joey Hess Thu, 29 Oct 1998 04:00:14 -0800 + debhelper (1.2.13) unstable; urgency=low * Spelling and typo fixes. diff --git a/debian/control b/debian/control index 8edb5aa9..b9870780 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.5.0.0 +Standards-Version: 2.4.1.4 Package: debhelper Architecture: all diff --git a/examples/rules b/examples/rules index 091a67a6..89263a1a 100755 --- a/examples/rules +++ b/examples/rules @@ -59,9 +59,9 @@ binary-arch: build install dh_compress dh_fixperms dh_suidregister +# dh_makeshlibs dh_installdeb dh_shlibdeps -# dh_makeshlibs dh_gencontrol dh_md5sums dh_builddeb diff --git a/examples/rules.multi b/examples/rules.multi index c7426b2e..6f01cc82 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -83,9 +83,9 @@ binary-arch: build install dh_fixperms -a dh_suidregister -a dh_installdeb -a - dh_shlibdeps -a # dh_makeshlibs -a dh_gencontrol -a + dh_shlibdeps -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 9f541c8e0ec6d0ede61c9e26330e8cd4e04cf6c4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:06:08 +0000 Subject: r151: Initial Import --- debian/changelog | 6 ++++++ debian/control | 2 +- dh_compress.1 | 2 +- dh_fixperms.1 | 2 +- dh_installexamples.1 | 2 +- dh_undocumented.1 | 2 +- doc/TODO | 1 + 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index fa047f8a..32d47370 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.15) unstable; urgency=low + + * Just a re-upload, last upload failed for some obscure reason. + + -- Joey Hess Sun, 29 Nov 1998 13:07:44 -0800 + debhelper (1.2.14) unstable; urgency=low * Really fixed #29762 this time. This also fixes #30025, which asked that diff --git a/debian/control b/debian/control index b9870780..8edb5aa9 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.4 +Standards-Version: 2.5.0.0 Package: debhelper Architecture: all diff --git a/dh_compress.1 b/dh_compress.1 index 4e5ed9e8..4d1fa1f7 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -63,6 +63,6 @@ for a list of environment variables that affect all debhelper commands. .SH BUGS Filenames with spaces in them may not properly be compressed. .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_fixperms.1 b/dh_fixperms.1 index fd304c70..9e016d17 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -31,6 +31,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.1 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 91d9988b..61ec0ea0 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -43,6 +43,6 @@ for a list of environment variables that affect all debhelper commands. It's impossible to specify filenames with spaces or other whitespace in them in debian/examples file. This is more a historical design flaw than a bug. .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_undocumented.1 b/dh_undocumented.1 index 25654ed5..63a83970 100644 --- a/dh_undocumented.1 +++ b/dh_undocumented.1 @@ -57,6 +57,6 @@ for a list of environment variables that affect all debhelper commands. .TP .BR undocumented (7) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/doc/TODO b/doc/TODO index 282c24ed..dcac7134 100644 --- a/doc/TODO +++ b/doc/TODO @@ -6,6 +6,7 @@ Bugs: * all commands should print a warning message if non-cumulative parameters are given more than once (ie, two -u's to dh_gencontrol). (#22588) (Bug currently under dispute, I think this is bogus). +* dh_compress doesn't preserve hard links Wishlist items: -- cgit v1.2.3 From e06e87d0aee1e09703e21b74a23f2249fcd4c6bb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:06:17 +0000 Subject: r152: Initial Import --- debian/changelog | 14 ++++++++++++++ dh_gencontrol.1 | 2 +- dh_installchangelogs | 8 +++++++- dh_installchangelogs.1 | 6 ++++-- dh_installcron.1 | 2 +- dh_installdeb.1 | 2 +- dh_installdocs | 2 ++ dh_installdocs.1 | 2 +- dh_makeshlibs | 2 +- dh_movefiles.1 | 15 +++++++++++---- dh_shlibdeps.1 | 2 +- dh_strip.1 | 2 +- 12 files changed, 45 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 32d47370..5c2d87a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.2.16) unstable; urgency=low + + * dh_installchangelogs: now detects html changelogs and installs them as + changelog.html.gz, to comply with latest policy (which I disagree with + BTW). + * manpages: updated policy version numbers. + * dh_installdocs: behavior change: all docs are now installed mode 644. + I have looked and it doesn't seem this will actually affect any packages + in debian. This is useful only if you want to use dh_installdocs and not + dh_fixperms, and that's the only time this behavior change will have any + effect, either. (#30118) + + -- Joey Hess Thu, 3 Dec 1998 23:31:56 -0800 + debhelper (1.2.15) unstable; urgency=low * Just a re-upload, last upload failed for some obscure reason. diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 7ceb532a..79182619 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -31,6 +31,6 @@ for a list of environment variables that affect all debhelper commands. .TP .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installchangelogs b/dh_installchangelogs index 97e057b7..40a68f3d 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -42,7 +42,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-p","-m644",$changelog,"$TMP/usr/doc/$PACKAGE/$changelog_name"); if ($upstream) { - doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + if ($upstream=~m/\.html?$/i) { + # HTML changelog + doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog.html"); + } + else { + doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + } if ($dh{K_FLAG}) { # Install symlink to original name of the upstream changelog file. # Use basename in case original file was in a subdirectory or something. diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 815c2dda..436ba947 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -17,7 +17,9 @@ debian/changelog.) .P If an upstream changelog file is specified as an option, and the package is not a native debian package, then this upstream changelog will be installed -as usr/doc/package/changelog in the package build directory. +as usr/doc/package/changelog in the package build directory. If the +changelog is a html file (determined by file extention), it will be +installed as usr/doc/package/changelog.html instead. .SH OPTIONS .TP .B debhelper options @@ -44,6 +46,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installcron.1 b/dh_installcron.1 index adda0711..a83f0401 100644 --- a/dh_installcron.1 +++ b/dh_installcron.1 @@ -25,6 +25,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installdeb.1 b/dh_installdeb.1 index 03fa1068..1d17b96c 100644 --- a/dh_installdeb.1 +++ b/dh_installdeb.1 @@ -45,6 +45,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_installdocs b/dh_installdocs index 34fe97d1..97117a34 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -27,6 +27,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (@docs) { doit("cp","-a",@docs,"$TMP/usr/doc/$PACKAGE/"); + doit("chmod","-R","go=rX","$TMP/usr/doc"); + doit("chmod","-R","u+rw","$TMP/usr/doc"); } # .Debian is correct, according to policy, but I'm easy. diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 72f80ecd..f711492b 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -57,6 +57,6 @@ for a list of environment variables that affect all debhelper commands. It's impossible to specify filenames with spaces or other whitespace in them in debian/docs file. This is more a historical design flaw than a bug. .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_makeshlibs b/dh_makeshlibs index 68dc83eb..dbf6bfc9 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -16,7 +16,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { open (FIND, "find $TMP -type f -name '*.so.*' |"); while () { chomp; - ($library, $major)=m#.*/(.*)\.so\.(\d*)\.#; + ($library, $major)=m#.*/(.*)\.so\.(\d*)\.?#; if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') { $major=$dh{M_PARAMS}; } diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 260d5069..6ec525a8 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -3,12 +3,12 @@ dh_movefiles \- moves files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles -.I "[debhelper options] [file ..]" +.I "[debhelper options] [--sourcedir=dir] [file ..]" .SH "DESCRIPTION" dh_movefiles is a debhelper program that is responsible for moving files out -of debian/tmp and into other package build directories. This may be useful -if your package has a Makefile that installs everything into debian/tmp, and -you need to break that up into subpackages. +of debian/tmp or some other directory and into other package build +directories. This may be useful if your package has a Makefile that installs +everything into debian/tmp, and you need to break that up into subpackages. .P Files named debian/package.files list the files to be moved, separated by whitespace. The filenames listed should be relative to debian/tmp/. You can @@ -27,6 +27,13 @@ See .BR debhelper (1) for a list of options common to all debhelper commands. .TP +.B --sourcedir=dir +Instead of moveing files out of debian/tmp (the default), this option makes +it move files out of some other directory. Since the entire contents of +the sourcedir is moved, specifiying something like --sourcedir=/ is very +unsafe, so to prevent mistakes, the sourcedir must be a relative filename; it +cannot begin with a `/'. +.TP .B file .. Lists files to move. The filenames listed should be relative to debian/tmp/. You can also list directory names, and the whole directory will be moved. You diff --git a/dh_shlibdeps.1 b/dh_shlibdeps.1 index f9f6f3e4..b414965f 100644 --- a/dh_shlibdeps.1 +++ b/dh_shlibdeps.1 @@ -32,6 +32,6 @@ for a list of environment variables that affect all debhelper commands. .TP .BR dpkg-shlibdeps (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess diff --git a/dh_strip.1 b/dh_strip.1 index 6ddcde13..683de57c 100644 --- a/dh_strip.1 +++ b/dh_strip.1 @@ -29,6 +29,6 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH "CONFORMS TO" -Debian policy, version 2.3.0.0 +Debian policy, version 2.5.0.0 .SH AUTHOR Joey Hess -- cgit v1.2.3 From 180110c3cce8624deefc4fd8d7bd60ce05e11a4b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:06:17 +0000 Subject: r153: Initial Import --- Dh_Getopt.pm | 2 ++ debian/changelog | 10 ++++++++++ dh_movefiles | 30 ++++++++++++++++++++---------- doc/PROGRAMMING | 2 ++ 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 42ad7abf..e0b3896d 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -111,6 +111,8 @@ sub parseopts { "no-act" => \$options{NO_ACT}, "init-script=s" => \$options{INIT_SCRIPT}, + + "sourcedir=s" => \$options{SOURCEDIR}, ); if (!$ret) { diff --git a/debian/changelog b/debian/changelog index 5c2d87a6..f0c1a5d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.17) unstable; urgency=low + + * dh_makeshlibs: relaxed regexp to find library name and number a little so + it will work on libraries with a major but no minor version in their + filename (examples of such: libtcl8.0.so.1, libBLT-unoff.so.1) + * dh_movefiles: added --sourcedir option to make it move files out of + some directory besides debian/tmp (#30221) + + -- Joey Hess Fri, 4 Dec 1998 13:56:57 -0800 + debhelper (1.2.16) unstable; urgency=low * dh_installchangelogs: now detects html changelogs and installs them as diff --git a/dh_movefiles b/dh_movefiles index 9819fd2d..2ed8e376 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -12,8 +12,18 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $files=pkgfile($PACKAGE,"files"); - if (! -d "debian/tmp") { - error("debian/tmp does not exist."); + if ($dh{SOURCEDIR}) { + if ($dh{SOURCEDIR}=~m:^/:) { + error("The sourcedir must be a relative filename, not starting with `/'."); + } + $sourcedir=$dh{SOURCEDIR}; + } + else { + $sourcedir="debian/tmp"; + } + + if (! -d $sourcedir) { + error("$sourcedir does not exist."); } @tomove=(); @@ -27,8 +37,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { push @tomove, @ARGV; } - if (@tomove && $TMP eq "debian/tmp") { - error("I was asked to move files from debian/tmp to debian/tmp."); + if (@tomove && $TMP eq $sourcedir) { + error("I was asked to move files from $sourcedir to $sourcedir."); } if (@tomove) { @@ -38,7 +48,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Now we need to expand wildcards in @tomove. @filelist=(); foreach (@tomove) { - push @filelist, glob("debian/tmp/$_"); + push @filelist, glob("$sourcedir/$_"); } # Order the files. First all real files, then symlinks. @@ -48,16 +58,16 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); - $file=~s:^debian/tmp/+::; - complex_doit("(cd debian/tmp ; find $file ! -type d -and ! -type l -print || true) >> movelist"); + $file=~s:^$sourcedir/+::; + complex_doit("(cd $sourcedir ; find $file ! -type d -and ! -type l -print || true) >> movelist"); } foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); - $file=~s:^debian/tmp/+::; - complex_doit("(cd debian/tmp ; find $file ! -type d -and -type l -print || true) >> movelist"); + $file=~s:^$sourcedir/+::; + complex_doit("(cd $sourcedir ; find $file ! -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 -)"); + complex_doit("(cd $sourcedir;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"); doit("rm","-f","movelist"); } } diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index da21ea9d..e40f0421 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -116,6 +116,8 @@ switch variable description --init-script INIT_SCRIPT will be set to a string, which specifies an init script name (probably only dh_installinit will ever use this) +--sourcedir SOURCEDIR will be set to a string (probably only + dh_movefiles 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. -- cgit v1.2.3 From cb6d210f988f3378d6197fa358da760bebc134fd Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:06:53 +0000 Subject: r154: Initial Import --- Dh_Lib.pm | 2 +- debian/changelog | 7 +++++++ dh_fixperms | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 61d807af..fb02a5dd 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -60,7 +60,7 @@ sub init { if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) { # User specified that all arch (in)dep package be # built, and there are none of that type. - error("I have no package to build"); + error("I have no package to act on"); } push @{$dh{DOPACKAGES}},@allpackages; } diff --git a/debian/changelog b/debian/changelog index f0c1a5d7..993f0fa7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.18) unstable; urgency=medium + + * dh_fixperms: was not fixing permissions of files in usr/doc/ to 644, + this has been broken since version 1.2.3. + + -- Joey Hess Sun, 6 Dec 1998 23:35:35 -0800 + debhelper (1.2.17) unstable; urgency=low * dh_makeshlibs: relaxed regexp to find library name and number a little so diff --git a/dh_fixperms b/dh_fixperms index e7e1ec6a..7f047fbd 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -35,7 +35,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # 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", + 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"); -- cgit v1.2.3 From 35e3686ae9a536a4b91ccc97f9b1c8dbf6593af6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:00 +0000 Subject: r155: Initial Import --- debian/changelog | 13 +++++++++++++ dh_clean | 2 +- dh_compress | 28 ++++++++++++++++++++++++++++ doc/TODO | 1 - 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 993f0fa7..ddd85269 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (1.2.19) unstable; urgency=low + + * dh_listpackages: new command. Takes the standard options taken by other + debhelper commands, and just outputs a list of the binary packages a + debhelper command would act on. Added because of bug #30626, and because + of wn's truely ugly use of debhelper internals to get the same info (and + because it's just 4 lines of code ;-). + * dh_compress: is now smart about compressing files that are hardlinks. + When possible, will only compress one file, delete the hardlinks, and + re-make hardlinks to the compressed file, saving some disk space. + + -- Joey Hess Fri, 18 Dec 1998 22:26:41 -0500 + debhelper (1.2.18) unstable; urgency=medium * dh_fixperms: was not fixing permissions of files in usr/doc/ to 644, diff --git a/dh_clean b/dh_clean index 821a54dc..73f8af2e 100755 --- a/dh_clean +++ b/dh_clean @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Clean up $TMP and other tepmorary files generated by the +# Clean up $TMP and other tepmorary files generated by the # build process. BEGIN { push @INC, "debian", "/usr/lib/debhelper" } diff --git a/dh_compress b/dh_compress index 0cc79c78..2933e516 100755 --- a/dh_compress +++ b/dh_compress @@ -53,10 +53,38 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } @files=@new; } + + # Look for files with hard links. If we are going to compress both, + # we can preserve the hard link across the compression and save + # space in the end. + foreach (@files) { + ($dev, $inode, undef, $nlink)=stat($_); + if ($nlink > 1) { + @{$hardlinks{$_}}=($dev,$inode); + } + } + # TODO: with the info we have now, we could remove the hard link files + # from the list of files to compress and save some time. if (@files) { doit("gzip","-9f",@files); } + + # Now change over any files we can that used to be hard links so + # they are again. + my $old_dev=''; + my $old_inode=''; + my $old_fn=''; + foreach (sort keys %hardlinks) { + if ($hardlinks{$_}[0] eq $old_dev && + $hardlinks{$_}[1] eq $old_inode) { + doit("rm","-f","$_.gz"); + doit("ln","$old_fn.gz","$_.gz"); + } + $old_dev=$hardlinks{$_}[0]; + $old_inode=$hardlinks{$_}[1]; + $old_fn=$_; + } chdir($olddir); diff --git a/doc/TODO b/doc/TODO index dcac7134..282c24ed 100644 --- a/doc/TODO +++ b/doc/TODO @@ -6,7 +6,6 @@ Bugs: * all commands should print a warning message if non-cumulative parameters are given more than once (ie, two -u's to dh_gencontrol). (#22588) (Bug currently under dispute, I think this is bogus). -* dh_compress doesn't preserve hard links Wishlist items: -- cgit v1.2.3 From aa3db12b0c4892841179e5b135de6568f8ebdd3c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:14 +0000 Subject: r156: Initial Import --- debian/changelog | 7 +++++++ dh_compress | 36 +++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index ddd85269..3db2cd84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.20) unstable; urgency=low + + * dh_compress: handle the hard link stuff properly, it was broken. Also + faster now. + + -- Joey Hess Wed, 23 Dec 1998 19:53:03 -0500 + debhelper (1.2.19) unstable; urgency=low * dh_listpackages: new command. Takes the standard options taken by other diff --git a/dh_compress b/dh_compress index 2933e516..ffca30af 100755 --- a/dh_compress +++ b/dh_compress @@ -57,33 +57,35 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Look for files with hard links. If we are going to compress both, # we can preserve the hard link across the compression and save # space in the end. + my @f=(); foreach (@files) { ($dev, $inode, undef, $nlink)=stat($_); if ($nlink > 1) { - @{$hardlinks{$_}}=($dev,$inode); + if (! $seen{"$inode.$dev"}) { + $seen{"$inode.$dev"}=$_; + push @f, $_; + } + else { + # This is a hardlink. + $hardlinks{$_}=$seen{"$inode.$dev"}; + } + } + else { + push @f, $_; } } - # TODO: with the info we have now, we could remove the hard link files - # from the list of files to compress and save some time. - if (@files) { - doit("gzip","-9f",@files); + if (@f) { + doit("gzip","-9f",@f); } # Now change over any files we can that used to be hard links so # they are again. - my $old_dev=''; - my $old_inode=''; - my $old_fn=''; - foreach (sort keys %hardlinks) { - if ($hardlinks{$_}[0] eq $old_dev && - $hardlinks{$_}[1] eq $old_inode) { - doit("rm","-f","$_.gz"); - doit("ln","$old_fn.gz","$_.gz"); - } - $old_dev=$hardlinks{$_}[0]; - $old_inode=$hardlinks{$_}[1]; - $old_fn=$_; + foreach (keys %hardlinks) { + # Remove old file. + doit("rm","-f","$_"); + # Make new hardlink. + doit("ln","$hardlinks{$_}.gz","$_.gz"); } chdir($olddir); -- cgit v1.2.3 From 8d3f10b38de49099f20a7a0115dafdb318fbb2c0 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:14 +0000 Subject: r157: Initial Import --- autoscripts/postinst-menu | 2 +- autoscripts/postinst-menu-method | 2 +- autoscripts/postinst-suid | 2 +- autoscripts/postinst-wm | 2 +- autoscripts/postrm-menu-method | 2 +- autoscripts/postrm-suid | 2 +- autoscripts/postrm-wm | 3 ++- debian/changelog | 14 ++++++++++++++ debian/control | 3 ++- debian/rules | 2 +- dh_installdocs | 15 +++++++++++++++ dh_installdocs.1 | 16 +++++++++++++++- dh_suidregister | 2 +- 13 files changed, 56 insertions(+), 11 deletions(-) diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu index a73a1692..49b2c5de 100644 --- a/autoscripts/postinst-menu +++ b/autoscripts/postinst-menu @@ -1 +1 @@ -if [ -x /usr/bin/update-menus ] ; then update-menus ; fi +if command -v update-menus >/dev/null 2>&1 ; then update-menus ; fi diff --git a/autoscripts/postinst-menu-method b/autoscripts/postinst-menu-method index 0ea7959b..7f7aaa96 100644 --- a/autoscripts/postinst-menu-method +++ b/autoscripts/postinst-menu-method @@ -1,5 +1,5 @@ inst=/etc/menu-methods/#PACKAGE# -if [ -x /usr/bin/update-menus -a -f $inst -a -x /usr/sbin/install-menu ] ; then +if command -v update-menus >/dev/null 2>&1 && [ -f $inst ] ; then chmod a+x $inst update-menus fi diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid index 1294d313..de638efe 100644 --- a/autoscripts/postinst-suid +++ b/autoscripts/postinst-suid @@ -1,4 +1,4 @@ -if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]; then +if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# else chown #OWNER#.#GROUP# /#FILE# diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm index 94c052fc..925c7883 100644 --- a/autoscripts/postinst-wm +++ b/autoscripts/postinst-wm @@ -1,3 +1,3 @@ -if [ -x /usr/sbin/register-window-manager ] ; then +if command -v register-window-manager >/dev/null 2>&1; then register-window-manager --add #WM# fi diff --git a/autoscripts/postrm-menu-method b/autoscripts/postrm-menu-method index 3e63f2f4..0c2baae9 100644 --- a/autoscripts/postrm-menu-method +++ b/autoscripts/postrm-menu-method @@ -1,3 +1,3 @@ inst=/etc/menu-methods/#PACKAGE# if [ "$1" = "remove" -a -f "$inst" ]; then chmod a-x $inst ; fi -if [ -x /usr/bin/update-menus ] ; then update-menus; fi +if command -v update-menus >/dev/null 2>&1 ; then update-menus; fi diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid index 9712d256..d4a76199 100644 --- a/autoscripts/postrm-suid +++ b/autoscripts/postrm-suid @@ -1,3 +1,3 @@ -if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]; then +if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then suidunregister -s #PACKAGE# /#FILE# fi diff --git a/autoscripts/postrm-wm b/autoscripts/postrm-wm index 6dc9f5da..8345aa97 100644 --- a/autoscripts/postrm-wm +++ b/autoscripts/postrm-wm @@ -1,3 +1,4 @@ -if [ "$1" == "purge" -a -x /usr/sbin/register-window-manager ] ; then +if [ "$1" == "purge" ] && command -v register-window-manager >/dev/null 2>&1 +then register-window-manager --remove #WM# fi diff --git a/debian/changelog b/debian/changelog index 3db2cd84..5cdf2f47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +debhelper (1.2.21) unstable; urgency=low + + * dh_installdocs: Added doc-base support, if debian/.doc-base + exists, it will be installed as a doc-base control file. If you use this, + you probably want to add "dh_testversion 1.2.21" to the rules file to make + sure your package is built with a new enough debhelper. + * dh_installdocs: now supports -n to make it not modify postinst/prerm. + * dh_suidregister: turned off leading 0/1 in permissions settings, until + suidregister actually supports it. + * autoscripts/*: instead of "text -x", use "command -v" to see if various + binaries exist. This gets rid of lots of hard-coded paths. + + -- Joey Hess Wed, 30 Dec 1998 22:50:04 -0500 + debhelper (1.2.20) unstable; urgency=low * dh_compress: handle the hard link stuff properly, it was broken. Also diff --git a/debian/control b/debian/control index 8edb5aa9..7254be98 100644 --- a/debian/control +++ b/debian/control @@ -12,4 +12,5 @@ Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to automate common tasks related to building binary debian packages. Programs are included to install various files into your package, compress files, fix - file permissions, integrate your package with the debian menu system, etc. + file permissions, integrate your package with the debian menu system, + suidmanager, doc-base, etc. diff --git a/debian/rules b/debian/rules index 14b5e7f0..0d9676f2 100755 --- a/debian/rules +++ b/debian/rules @@ -73,4 +73,4 @@ dist: fi binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary localdist +.PHONY: build clean binary-indep binary-arch binary dist diff --git a/dh_installdocs b/dh_installdocs index 97117a34..347881cc 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -2,6 +2,7 @@ # # Reads debian/docs, installs all files listed there into /usr/doc/$PACKAGE # Also installs the debian/copyright and debian/README.debian and debian/TODO +# and handles debian/doc-base. BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; @@ -60,4 +61,18 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if ($copyright) { doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); } + + # Handle doc-base files. + $file=pkgfile($PACKAGE,"doc-base"); + if ($file) { + if (! -d "$TMP/usr/share/doc-base/") { + doit("install","-d","$TMP/usr/share/doc-base/"); + } + doit("install","-p","-m644",$file, + "$TMP/usr/share/doc-base/$PACKAGE"); + if (! $dh{NOSCRIPTS}) { + autoscript($PACKAGE,"postinst","postinst-doc-base"); + autoscript($PACKAGE,"postrm","postrm-doc-base") + } + } } diff --git a/dh_installdocs.1 b/dh_installdocs.1 index f711492b..abdef780 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -3,7 +3,7 @@ dh_installdocs \- install documentation into package build directories .SH SYNOPSIS .B dh_installdocs -.I "[debhelper options] [-A] [file ...]" +.I "[debhelper options] [-A] [-n] [file ...]" .SH "DESCRIPTION" dh_installdocs is a debhelper program that is responsible for installing documentation into usr/doc/package in package build directories. @@ -29,6 +29,15 @@ debian/package.TODO can be used to specify files for subpackages. .P 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. +.P +A file named debian/package.doc-base (debian/doc-base may be used for the +first binary package in debian/control), if it exists, will make +dh_installdocs use that file as a doc-base control file, and will +automatically generate the postinst and prerm commands needed to +interface with the doc-base package. See +.BR dh_installdeb (1) +for an explanation of how this works. Note that the package name will be +used as the doc-base document id. .SH OPTIONS .TP .B debhelper options @@ -40,6 +49,9 @@ for a list of options common to all debhelper commands. Install all files specified by command line parameters in ALL packages acted on. .TP +.B \-n, \--noscripts +DO not modify postinst/prerm scripts. +.TP .B file ... Install these files as documentation into the first package acted on. (Or in all packages if -A is specified). @@ -53,6 +65,8 @@ See for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) +.TP +.BR install-docs (8) .SH BUGS It's impossible to specify filenames with spaces or other whitespace in them in debian/docs file. This is more a historical design flaw than a bug. diff --git a/dh_suidregister b/dh_suidregister index d5b10ebd..951984fe 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -52,7 +52,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $group=getgrgid($gid); # Note that I have to print mode in ocal, stripping file type. $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", - $mode & 07777); + $mode & 00777); autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); -- cgit v1.2.3 From 84c275b57198f8d11154d0c9d17b97faca3c800c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:21 +0000 Subject: r158: Initial Import --- debian/changelog | 6 ++++++ dh_suidregister | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5cdf2f47..2a15b97a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.22) unstable; urgency=low + + * Reversed change in last version; don't clobber mode (#31628). + + -- Joey Hess Fri, 8 Jan 1999 15:01:25 -0800 + debhelper (1.2.21) unstable; urgency=low * dh_installdocs: Added doc-base support, if debian/.doc-base diff --git a/dh_suidregister b/dh_suidregister index 951984fe..d5b10ebd 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -52,7 +52,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $group=getgrgid($gid); # Note that I have to print mode in ocal, stripping file type. $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", - $mode & 00777); + $mode & 07777); autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); -- cgit v1.2.3 From b45f254fc53ba0418eb6a95dc0cf2677beabbe1f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:54 +0000 Subject: r159: Initial Import --- autoscripts/postrm-wm | 2 +- debian/changelog | 6 ++++++ dh_fixperms | 3 +++ dh_fixperms.1 | 3 ++- examples/rules.indep | 1 + 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/autoscripts/postrm-wm b/autoscripts/postrm-wm index 8345aa97..6a7eb47a 100644 --- a/autoscripts/postrm-wm +++ b/autoscripts/postrm-wm @@ -1,4 +1,4 @@ -if [ "$1" == "purge" ] && command -v register-window-manager >/dev/null 2>&1 +if [ "$1" = "purge" ] && command -v register-window-manager >/dev/null 2>&1 then register-window-manager --remove #WM# fi diff --git a/debian/changelog b/debian/changelog index 2a15b97a..f15c8dd6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.23) unstable; urgency=low + + * autoscripts/postrm-wm: use "=", not "==" (#31727). + + -- Joey Hess Mon, 11 Jan 1999 13:35:00 -0800 + debhelper (1.2.22) unstable; urgency=low * Reversed change in last version; don't clobber mode (#31628). diff --git a/dh_fixperms b/dh_fixperms index 7f047fbd..10baaa01 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -17,6 +17,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("chown","-R","root.root",$TMP); doit("chmod","-R","go=rX",$TMP); doit("chmod","-R","u+rw",$TMP); + doit("chmod","-R","a-s",$TMP); } $find_options=""; @@ -29,6 +30,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { 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 chmod a-s"); $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; } diff --git a/dh_fixperms.1 b/dh_fixperms.1 index 9e016d17..f45f0c3c 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -12,7 +12,8 @@ dh_fixperms makes all files in usr/doc in the package build directory (excluding files in the examples/ directory) be mode 644. It also changes the permissions of all man pages to mode 644. It makes all files be owned by root, and it removes group and other write permission from all files. -Finally, it removes execute permissions from any libraries that have it set. +It removes execute permissions from any libraries that have it set. Finally, +it removes the setuid and setgid bits from all files in the package. .SH OPTIONS .TP .B debhelper options diff --git a/examples/rules.indep b/examples/rules.indep index 142b99fe..34b78d89 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -54,6 +54,7 @@ binary-indep: build install dh_link dh_compress dh_fixperms + # You may want to make some executables suid here. dh_suidregister dh_installdeb dh_gencontrol -- cgit v1.2.3 From 6b0e8f6773b98cc4905cc0329e471ade8db3ac32 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:07:54 +0000 Subject: r160: Initial Import --- debian/changelog | 16 ++++++++++++++++ examples/rules | 1 + examples/rules.multi | 2 ++ 3 files changed, 19 insertions(+) diff --git a/debian/changelog b/debian/changelog index f15c8dd6..4feee157 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +debhelper (1.2.24) unstable; urgency=low + + * dh_fixperms: linux 2.1.x and 2.2.x differ from earlier versions in that + they do not clear the suid bit on a file when the owner of that file + changes. It seems that fakeroot behaves the same as linux 2.1 here. I + was relying on the old behavior to get rid of suid and sgid bits on files. + Since this no longer happens implicitly, I've changed to clearing the + bits explicitly. + * There's also a small behavior change involved here. Before, dh_fixperms + did not clear suid permissions on files that were already owned by root. + Now it does. + * dh_fixperms.1: cleaned up the docs to mention that those bits are + cleared. + + -- Joey Hess Fri, 15 Jan 1999 16:54:44 -0800 + debhelper (1.2.23) unstable; urgency=low * autoscripts/postrm-wm: use "=", not "==" (#31727). diff --git a/examples/rules b/examples/rules index 89263a1a..a0806c1d 100755 --- a/examples/rules +++ b/examples/rules @@ -58,6 +58,7 @@ binary-arch: build install dh_strip dh_compress dh_fixperms + # You may want to make some executables suid here. dh_suidregister # dh_makeshlibs dh_installdeb diff --git a/examples/rules.multi b/examples/rules.multi index 6f01cc82..f03909f6 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -57,6 +57,7 @@ binary-indep: build install dh_link -i dh_compress -i dh_fixperms -i + # You may want to make some executables suid here. dh_suidregister -i dh_installdeb -i dh_gencontrol -i @@ -81,6 +82,7 @@ binary-arch: build install dh_link -a dh_compress -a dh_fixperms -a + # You may want to make some executables suid here. dh_suidregister -a dh_installdeb -a # dh_makeshlibs -a -- cgit v1.2.3 From dc1239161f436fffdd586b4640cef147424f626e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:08:02 +0000 Subject: r161: Initial Import --- autoscripts/postinst-menu | 2 +- autoscripts/postinst-menu-method | 2 +- autoscripts/postrm-menu-method | 2 +- debian/changelog | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu index 49b2c5de..2b0f740c 100644 --- a/autoscripts/postinst-menu +++ b/autoscripts/postinst-menu @@ -1 +1 @@ -if command -v update-menus >/dev/null 2>&1 ; then update-menus ; fi +if text -x /usr/bin/update-menus ; then update-menus ; fi diff --git a/autoscripts/postinst-menu-method b/autoscripts/postinst-menu-method index 7f7aaa96..6ab538cb 100644 --- a/autoscripts/postinst-menu-method +++ b/autoscripts/postinst-menu-method @@ -1,5 +1,5 @@ inst=/etc/menu-methods/#PACKAGE# -if command -v update-menus >/dev/null 2>&1 && [ -f $inst ] ; then +if [ -x /usr/bin/update-menus && -f $inst ] ; then chmod a+x $inst update-menus fi diff --git a/autoscripts/postrm-menu-method b/autoscripts/postrm-menu-method index 0c2baae9..a6682fee 100644 --- a/autoscripts/postrm-menu-method +++ b/autoscripts/postrm-menu-method @@ -1,3 +1,3 @@ inst=/etc/menu-methods/#PACKAGE# if [ "$1" = "remove" -a -f "$inst" ]; then chmod a-x $inst ; fi -if command -v update-menus >/dev/null 2>&1 ; then update-menus; fi +if text -x /usr/bin/update-menus ; then update-menus; fi diff --git a/debian/changelog b/debian/changelog index 4feee157..33bbbe2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.25) unstable; urgency=low + + * autoscripts/*menu*: It turns out that "command" is like test -w, it will + still return true if update-menus is not executable. This can + legitimatly happen if you are upgrading the menu package, and it makes + postinsts that use command fail. Reverted to using test -x. Packages + built with debhelper >= 1.2.21 that use menus should be rebuilt. + + -- Joey Hess Sat, 16 Jan 1999 13:47:16 -0800 + debhelper (1.2.24) unstable; urgency=low * dh_fixperms: linux 2.1.x and 2.2.x differ from earlier versions in that -- cgit v1.2.3 From 61fc7ffe47681eed509bf441fbbc9108775c5f43 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:08:10 +0000 Subject: r162: Initial Import --- debian/changelog | 7 +++++++ dh_installdocs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 33bbbe2e..cd5bdff1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.26) unstable; urgency=low + + * dh_installdocs: use prerm-doc-base script fragement. Was using + postrm-doc-base, for some weird reason. + + -- Joey Hess Mon, 18 Jan 1999 13:36:40 -0800 + debhelper (1.2.25) unstable; urgency=low * autoscripts/*menu*: It turns out that "command" is like test -w, it will diff --git a/dh_installdocs b/dh_installdocs index 347881cc..1d051819 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -72,7 +72,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { "$TMP/usr/share/doc-base/$PACKAGE"); if (! $dh{NOSCRIPTS}) { autoscript($PACKAGE,"postinst","postinst-doc-base"); - autoscript($PACKAGE,"postrm","postrm-doc-base") + autoscript($PACKAGE,"prerm","prerm-doc-base") } } } -- cgit v1.2.3 From 445640239aa47534554f20494ff969ef8be81ae4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:08:37 +0000 Subject: r163: Initial Import --- autoscripts/postinst-menu | 2 +- autoscripts/postrm-menu-method | 2 +- debian/changelog | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu index 2b0f740c..2be88247 100644 --- a/autoscripts/postinst-menu +++ b/autoscripts/postinst-menu @@ -1 +1 @@ -if text -x /usr/bin/update-menus ; then update-menus ; fi +if test -x /usr/bin/update-menus ; then update-menus ; fi diff --git a/autoscripts/postrm-menu-method b/autoscripts/postrm-menu-method index a6682fee..3270b7c7 100644 --- a/autoscripts/postrm-menu-method +++ b/autoscripts/postrm-menu-method @@ -1,3 +1,3 @@ inst=/etc/menu-methods/#PACKAGE# if [ "$1" = "remove" -a -f "$inst" ]; then chmod a-x $inst ; fi -if text -x /usr/bin/update-menus ; then update-menus; fi +if test -x /usr/bin/update-menus ; then update-menus; fi diff --git a/debian/changelog b/debian/changelog index cd5bdff1..8f952159 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.27) unstable; urgency=low + + * autoscripts/*menu*: "test", not "text"! + + -- Joey Hess Tue, 19 Jan 1999 15:18:52 -0800 + debhelper (1.2.26) unstable; urgency=low * dh_installdocs: use prerm-doc-base script fragement. Was using -- cgit v1.2.3 From 31a6b97baf020c0bad249a47072694cd7bf3a7dd Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:08:37 +0000 Subject: r164: Initial Import --- debian/changelog | 7 +++++++ dh_link | 8 +++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8f952159..83977c37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.28) unstable; urgency=low + + * dh_link: fixed bug that prevent multiple links to the same source from + being made. (#23255) + + -- Joey Hess Sun, 24 Jan 1999 19:46:33 -0800 + debhelper (1.2.27) unstable; urgency=low * autoscripts/*menu*: "test", not "text"! diff --git a/dh_link b/dh_link index 41dd736e..cc1b4954 100755 --- a/dh_link +++ b/dh_link @@ -31,12 +31,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { error("parameters list a link without a destination."); } - # Now I'd prefer to work with a hash. - %links=@links; + while (@links) { + $dest=pop @links; + $src=pop @links; - foreach $src (keys %links) { - $dest=$links{$src}; - # Make sure the directory the link will be in exists. $basedir=Dh_Lib::dirname("$TMP/$dest"); if (! -e $basedir) { -- cgit v1.2.3 From 87ad9f2cc4e7c4432a40b3c1d2ddc91ffcb764bb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:08:46 +0000 Subject: r165: Initial Import --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 83977c37..ddd2e33a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.29) unstable; urgency=high + + * Do not include bogus chsh, chfn, passwd links in debhelper binary! + These were acidentially left in after dh_link testing I did as I was + working on the last version of debhelper. + + -- Joey Hess Mon, 25 Jan 1999 20:26:46 -0800 + debhelper (1.2.28) unstable; urgency=low * dh_link: fixed bug that prevent multiple links to the same source from -- cgit v1.2.3 From 60f9263c40e023a3ee8562815845ad995ffffa44 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:04 +0000 Subject: r166: Initial Import --- debian/changelog | 7 +++++++ dh_fixperms | 10 ++-------- dh_installinit.1 | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index ddd2e33a..6b36d7b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.30) unstable; urgency=low + + * dh_fixperms: cut down the number of chmod commands that are executed + from 3 to 1, no change in functionality. + + -- Joey Hess Mon, 1 Feb 1999 17:05:29 -0800 + debhelper (1.2.29) unstable; urgency=high * Do not include bogus chsh, chfn, passwd links in debhelper binary! diff --git a/dh_fixperms b/dh_fixperms index 10baaa01..6825ed6d 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -15,9 +15,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # this if there is nothing to exclude. if (-d $TMP) { doit("chown","-R","root.root",$TMP); - doit("chmod","-R","go=rX",$TMP); - doit("chmod","-R","u+rw",$TMP); - doit("chmod","-R","a-s",$TMP); + doit("chmod","-R","go=rX,u+rw,a-s",$TMP); } $find_options=""; @@ -27,11 +25,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { 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 chmod a-s"); + 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s"); $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; } diff --git a/dh_installinit.1 b/dh_installinit.1 index f76ec917..bef681cb 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -39,7 +39,7 @@ the --init-script parameter described below.) .B \-uparams, \--update-rcd-params=params Pass "params" to .BR update-rc.d (8) -If not specified, "default" will be passed to +If not specified, "defaults" will be passed to .BR update-rc.d (8) .TP .B \--init-script=scriptname -- cgit v1.2.3 From 3dd7efa761f4067529ed7c6785dadaa8ec4c89d4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:12 +0000 Subject: r167: Initial Import --- debian/changelog | 6 ++++++ dh_suidregister | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6b36d7b0..4af4fb84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.31) unstable; urgency=low + + * dh_installinit.1: minor typo fix (closes: #32753) + + -- Joey Hess Tue, 2 Feb 1999 14:32:46 -0800 + debhelper (1.2.30) unstable; urgency=low * dh_fixperms: cut down the number of chmod commands that are executed diff --git a/dh_suidregister b/dh_suidregister index d5b10ebd..15b1fe4d 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -49,7 +49,15 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { (undef,undef,$mode,undef,$uid,$gid,undef) = stat("$TMP/$file"); # Now come up with the user and group names for the uid and gid. $user=getpwuid($uid); + if (! defined $user) { + warning("$file has odd uid $uid, not in /etc/passwd"); + $user=$uid; + } $group=getgrgid($gid); + if (! defined $group) { + warning("$file has odd gid $gid not in /etc/group"); + $group=$gid; + } # Note that I have to print mode in ocal, stripping file type. $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", $mode & 07777); -- cgit v1.2.3 From ebf6b046d1165c4ac3897545aa8e46c05a563658 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:12 +0000 Subject: r168: Initial Import --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4af4fb84..28f555f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.32) unstable; urgency=low + + * dh_suidmanager: if it cannot determine the user name or group name from + the uid or gid, it will pass the uid or gid to suidmanager. This should + probably never happen, but it's good to be safe. + + -- Joey Hess Thu, 4 Feb 1999 16:00:35 -0800 + debhelper (1.2.31) unstable; urgency=low * dh_installinit.1: minor typo fix (closes: #32753) -- cgit v1.2.3 From 36411bfcb72fc17c6aa0f3b11cdd04e52828db98 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:26 +0000 Subject: r169: Initial Import --- debian/changelog | 9 +++++++++ dh_clean | 43 ++++++++++++++++++++++++------------------- dh_clean.1 | 6 +++++- dh_compress | 3 +++ doc/TODO | 7 +++---- 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index 28f555f2..9e0179ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.2.33) unstable; urgency=low + + * dh_compress: verbose_print() cd's. + * dh_compress: clear the hash of hard links when we loop - was making + dh_compress fail on multi-binary packages that had harlinks. Thanks to + Craig Small for spotting this. + + -- Joey Hess Thu, 4 Feb 1999 20:19:37 -0800 + debhelper (1.2.32) unstable; urgency=low * dh_suidmanager: if it cannot determine the user name or group name from diff --git a/dh_clean b/dh_clean index 73f8af2e..c883a626 100755 --- a/dh_clean +++ b/dh_clean @@ -11,28 +11,33 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $EXT=pkgext($PACKAGE); - doit("rm","-f","debian/$EXT\substvars", - "debian/$EXT\postinst.debhelper", - "debian/$EXT\postrm.debhelper", - "debian/$EXT\preinst.debhelper", - "debian/$EXT\prerm.debhelper"); + if (! $dh{D_FLAG}) { + doit("rm","-f","debian/$EXT\substvars", + "debian/$EXT\postinst.debhelper", + "debian/$EXT\postrm.debhelper", + "debian/$EXT\preinst.debhelper", + "debian/$EXT\prerm.debhelper"); + } doit ("rm","-rf",$TMP); } -if (@ARGV) { - doit("rm","-f","--",@ARGV); -} +if (! $dh{D_FLAG}) { + if (@ARGV) { + doit("rm","-f","--",@ARGV); + } -if (! $dh{K_FLAG}) { - doit("rm","-f","debian/files"); -} + if (! $dh{K_FLAG}) { + doit("rm","-f","debian/files"); + } -# Remove other temp files. -# (The \s+ is important, \s won't work because find would get null parameters). -# Note that you _don't_ quote wildcards used by find in here. -doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE - -o -name *.orig -o -name *.rej -o -name *.bak - -o -name .*.orig -o -name .*.rej -o -name .SUMS - -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) - ) -exec rm -f {} ;")); + # Remove other temp files. + # (The \s+ is important, \s won't work because find would get null + # parameters). Note that you _don't_ quote wildcards used by find + # in here. + doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE + -o -name *.orig -o -name *.rej -o -name *.bak + -o -name .*.orig -o -name .*.rej -o -name .SUMS + -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) + ) -exec rm -f {} ;")); +} diff --git a/dh_clean.1 b/dh_clean.1 index 35f59158..c2e71bf3 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -3,7 +3,7 @@ dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[debhelper options] [-k] [file ...]" +.I "[debhelper options] [-k] [-d] [file ...]" .SH "DESCRIPTION" dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some @@ -25,6 +25,10 @@ didn't use -k in these cases, then debian/files would be deleted in the middle, and your changes file will only contain the last binary package that was built. .TP +.B \-d, \--dirs-only +Only clean the package build directories, do not clean up any other files at +all. +.TP .B file ... Delete these files too. .SH ENVIRONMENT diff --git a/dh_compress b/dh_compress index ffca30af..673f9102 100755 --- a/dh_compress +++ b/dh_compress @@ -15,6 +15,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Run the file name gathering commands from within the directory # structure that will be effected. $olddir=getcwd(); + verbose_print("cd $TMP"); chdir($TMP) || error("Can't cd to $TMP: $!"); # Figure out what files to compress. @@ -58,6 +59,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # we can preserve the hard link across the compression and save # space in the end. my @f=(); + my %hardlinks={}; foreach (@files) { ($dev, $inode, undef, $nlink)=stat($_); if ($nlink > 1) { @@ -88,6 +90,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("ln","$hardlinks{$_}.gz","$_.gz"); } + verbose_print("cd $olddir"); chdir($olddir); # Fix up symlinks that were pointing to the uncompressed files. diff --git a/doc/TODO b/doc/TODO index 282c24ed..27b5055a 100644 --- a/doc/TODO +++ b/doc/TODO @@ -9,6 +9,7 @@ Bugs: Wishlist items: +* Make dh_* "use strict". * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). * info support for debhelper (currently implemented, but I hate how I did it, @@ -31,14 +32,12 @@ Wishlist items: 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 fragments wouldn't go into the postinst. So maybe a - new script is called for. + new script is called for. But it's probably be best to just have a switch + to enable this. * Need a way to make dh_strip not strip any static libs. Also, it'd be nice if there were options to dh_strip, dh_compress, etc, to allow inclusion of directories and exclusion of files based on filename globbing. (Request from Matthias Klose ) -* docbase support (#25233). Waiting for docbase to stabilize and be used - widely. -* dhelp support. Currently pending on dhelp use becoming widespead (#18342) * Support use of environment variables in data taken from user, ie, in debian/dirs. The problem with doing this is that we really want to allow any filenames in that input, even those that look like environment -- cgit v1.2.3 From 7e30b95a60b9197618c6223388d2c49bee13c2c6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:33 +0000 Subject: r170: Initial Import --- Dh_Getopt.pm | 1 + Dh_Lib.pm | 2 +- autoscripts/postinst-doc-base | 2 +- autoscripts/prerm-doc-base | 2 +- debian/changelog | 10 +++++++++ dh_compress | 2 +- dh_installdocs | 47 +++++++++++++++++++++++++++++++++++++------ dh_installdocs.1 | 6 ++++++ doc/README | 2 +- doc/TODO | 16 +++++---------- 10 files changed, 68 insertions(+), 22 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index e0b3896d..5f43496b 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -84,6 +84,7 @@ sub parseopts { "d" => \$options{D_FLAG}, "remove-d" => \$options{D_FLAG}, + "dirs-only" => \$options{D_FLAG}, "r" => \$options{R_FLAG}, "no-restart-on-upgrade" => \$options{R_FLAG}, diff --git a/Dh_Lib.pm b/Dh_Lib.pm index fb02a5dd..f20cd5db 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -261,7 +261,7 @@ sub filearray { my $file=shift; my @ret; open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); while () { - push @ret,split(/\s/,$_); + push @ret,split(' ',$_); } close DH_FARRAY_IN; diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base index a53ed7bf..c3653bed 100644 --- a/autoscripts/postinst-doc-base +++ b/autoscripts/postinst-doc-base @@ -1,3 +1,3 @@ if command -v install-docs >/dev/null 2>&1; then - install-docs -i /usr/share/doc-base/#PACKAGE# + install-docs -i /usr/share/doc-base/#DOC-ID# fi diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base index 339361a5..9678003e 100644 --- a/autoscripts/prerm-doc-base +++ b/autoscripts/prerm-doc-base @@ -1,3 +1,3 @@ if command -v install-docs >/dev/null 2>&1; then - install-docs -r #PACKAGE# + install-docs -r #DOC-ID# fi diff --git a/debian/changelog b/debian/changelog index 9e0179ca..cf51a7ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.34) unstable; urgency=low + + * dh_clean: added -d flag (also --dirs-only) that will make it clean only + tmp dirs. (closes: #30807) + * dh_installdocs: to support packages that need multiple doc-base files, + will now look for debian/.doc-base.. + * dh_compress: removed warning message (harmless). + + -- Joey Hess Sat, 6 Feb 1999 17:48:33 -0800 + debhelper (1.2.33) unstable; urgency=low * dh_compress: verbose_print() cd's. diff --git a/dh_compress b/dh_compress index 673f9102..caffc11e 100755 --- a/dh_compress +++ b/dh_compress @@ -59,7 +59,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # we can preserve the hard link across the compression and save # space in the end. my @f=(); - my %hardlinks={}; + my %hardlinks; foreach (@files) { ($dev, $inode, undef, $nlink)=stat($_); if ($nlink > 1) { diff --git a/dh_installdocs b/dh_installdocs index 1d051819..bc8fb8f5 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -62,17 +62,52 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); } - # Handle doc-base files. + # Handle doc-base files. There are two filename formats, the usual plus + # an extended format (debian/package.doc-base.). Have to + # come up with good document-id's too. + my %doc_ids; + + opendir(DEB,"debian/") || error("can't read debian directory: $!"); + foreach (grep {/^$PACKAGE\.doc-base\..*$/} readdir(DEB)) { + $id=$_; + $id=~s/\.doc-base\./-/; + $doc_ids{$id}="debian/$_"; + } + closedir(DEB); + + # These next lines handle the format debian/doc-base., + # which is in for completeness. + if ($PACKAGE eq $dh{MAINPACKAGE}) { + opendir(DEB,"debian/") || error("can't read debian directory: $!"); + foreach (grep {/^doc-base\..*$/} readdir(DEB)) { + $id=$_; + $id=~s/doc-base\./$PACKAGE-/; + $doc_ids{$id}="debian/$_"; + } + closedir(DEB); + } + + # And this handles the normal format of course. $file=pkgfile($PACKAGE,"doc-base"); - if ($file) { + if ($file ne '') { + $doc_ids{$PACKAGE}=$file; + } + + if (%doc_ids) { if (! -d "$TMP/usr/share/doc-base/") { doit("install","-d","$TMP/usr/share/doc-base/"); } - doit("install","-p","-m644",$file, - "$TMP/usr/share/doc-base/$PACKAGE"); + } + foreach $doc_id (keys %doc_ids) { + doit("install","-m644","-p",$doc_ids{$doc_id}, + "$TMP/usr/share/doc-base/$doc_id"); if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-doc-base"); - autoscript($PACKAGE,"prerm","prerm-doc-base") + autoscript($PACKAGE,"postinst","postinst-doc-base", + "s/#DOC-ID#/$doc_id/", + ); + autoscript($PACKAGE,"prerm","prerm-doc-base", + "s/#DOC-ID#/$doc_id/", + ); } } } diff --git a/dh_installdocs.1 b/dh_installdocs.1 index abdef780..50f07e1f 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -38,6 +38,12 @@ interface with the doc-base package. See .BR dh_installdeb (1) for an explanation of how this works. Note that the package name will be used as the doc-base document id. +.PP +If your package needs to register more +than one document, you need multiple files. To accomplish this, you can use +files named debian/package.doc-base.docid. The "docid" on the end is a +string that is combined with the package name to generate a unique doc-base +document id. .SH OPTIONS .TP .B debhelper options diff --git a/doc/README b/doc/README index b283af20..30f2a2cf 100644 --- a/doc/README +++ b/doc/README @@ -12,7 +12,7 @@ Starting a new package: ---------------------- You can just use the example rules files and do the rest of the new package -set up by hand, or you could try the new dh-make package, which contains a +set up by hand, or you could try the dh-make package, which contains a "dh_make" command that is similar to debmake, and tries to automate the process. diff --git a/doc/TODO b/doc/TODO index 27b5055a..b926737c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,12 +1,6 @@ This is the TODO for debhelper. As more and more people use debhelper, this list grows - I welcome patches to fix items on it! -Bugs: - -* all commands should print a warning message if non-cumulative parameters - are given more than once (ie, two -u's to dh_gencontrol). (#22588) - (Bug currently under dispute, I think this is bogus). - Wishlist items: * Make dh_* "use strict". @@ -54,8 +48,8 @@ Wishlist items: Deprecated: -* remove dh_installdebfiles, dh_du. - - need to wait a reasonable length of time. I'm currently planning - on doing this after slink is released or one year after they were - deprecated, whichever comes first. Be sure to grep whole debian - archive for all of them before removing them, though! +* remove dh_installdebfiles, dh_du. + - need to wait a reasonable length of + time. I'm currently planning on doing this after slink is released or + one year after they were deprecated, whichever comes first. Be sure to + grep whole debian archive for all of them before removing them, though! -- cgit v1.2.3 From 3a48e5ca07d99dacf1dc3899a66d5874fa7cf796 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:47 +0000 Subject: r171: Initial Import --- autoscripts/postinst-menu-method | 2 +- debian/changelog | 7 +++++++ dh_compress.1 | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/autoscripts/postinst-menu-method b/autoscripts/postinst-menu-method index 6ab538cb..03acde7f 100644 --- a/autoscripts/postinst-menu-method +++ b/autoscripts/postinst-menu-method @@ -1,5 +1,5 @@ inst=/etc/menu-methods/#PACKAGE# -if [ -x /usr/bin/update-menus && -f $inst ] ; then +if [ -x /usr/bin/update-menus -a -f $inst ] ; then chmod a+x $inst update-menus fi diff --git a/debian/changelog b/debian/changelog index cf51a7ca..5a4fe4e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.35) unstable; urgency=low + + * Dh_Lib.pm filearray(): Deal with multiple spaces and spaces at the + beginning of lines in files. (closes: #33161) + + -- Joey Hess Tue, 9 Feb 1999 21:01:07 -0800 + debhelper (1.2.34) unstable; urgency=low * dh_clean: added -d flag (also --dirs-only) that will make it clean only diff --git a/dh_compress.1 b/dh_compress.1 index 4d1fa1f7..8fa2d802 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -38,7 +38,7 @@ for a list of options common to all debhelper commands. .TP .B \-Xitem, \--exclude=item Exclude files that contain "item" anywhere in their filename from being -compressed. For example, -X=.jpeg will exclude jpeg's from compression. +compressed. For example, -X.jpeg will exclude jpeg's from compression. You may use this option multiple times to build up a list of things to exclude. You can accomplish the same thing by using a debian/compress file, but this is easier. -- cgit v1.2.3 From 54662ee64e05917a0bf4f8ed0bdf56940429f6d1 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:55 +0000 Subject: r172: Initial Import --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5a4fe4e4..78b10ed6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.36) unstable; urgency=low + + * dh_compress.1: Fixed typo in man page. (Closes: #33364) + * autoscripts/postinst-menu-method: fixed typo. (Closes: #33376) + + -- Joey Hess Sun, 14 Feb 1999 13:45:18 -0800 + debhelper (1.2.35) unstable; urgency=low * Dh_Lib.pm filearray(): Deal with multiple spaces and spaces at the -- cgit v1.2.3 From 1c41458abe1bd9f7e267f32b8946c2ab041a62c8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:55 +0000 Subject: r173: Initial Import --- debian/changelog | 9 +++++++++ dh_installdocs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 78b10ed6..a31d5240 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.2.37) unstable; urgency=low + + * dh_installdocs: Patch from Jim Pick , fixes regexp error (Closes: #33431). + * dh_installxaw: new program by Daniel Martin + , handles xaw-wrappers integration. + * dh_installxaw.1: wrote man page. + + -- Joey Hess Thu, 18 Feb 1999 17:32:53 -0800 + debhelper (1.2.36) unstable; urgency=low * dh_compress.1: Fixed typo in man page. (Closes: #33364) diff --git a/dh_installdocs b/dh_installdocs index bc8fb8f5..54e5b8e7 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -68,7 +68,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { my %doc_ids; opendir(DEB,"debian/") || error("can't read debian directory: $!"); - foreach (grep {/^$PACKAGE\.doc-base\..*$/} readdir(DEB)) { + foreach (grep {/^\Q$PACKAGE\E\.doc-base\..*$/} readdir(DEB)) { $id=$_; $id=~s/\.doc-base\./-/; $doc_ids{$id}="debian/$_"; -- cgit v1.2.3 From 2e46adeaf92024601a2c316cfa71f0e86b11485a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:10:12 +0000 Subject: r174: Initial Import --- debian/changelog | 6 ++++++ dh_clean | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index a31d5240..49eab4c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.38) unstable; urgency=low + + * dh_clean: don't try to delete directories named "core". + + -- Joey Hess Sat, 20 Feb 1999 19:13:40 -0800 + debhelper (1.2.37) unstable; urgency=low * dh_installdocs: Patch from Jim Pick , fixes regexp error (Closes: #33431). diff --git a/dh_clean b/dh_clean index c883a626..9ffb7437 100755 --- a/dh_clean +++ b/dh_clean @@ -35,9 +35,10 @@ if (! $dh{D_FLAG}) { # (The \s+ is important, \s won't work because find would get null # parameters). Note that you _don't_ quote wildcards used by find # in here. - doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE - -o -name *.orig -o -name *.rej -o -name *.bak - -o -name .*.orig -o -name .*.rej -o -name .SUMS - -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) + doit(split(/\s+/,"find . -type f -a + ( -name #*# -o -name *~ -o -name DEADJOE + -o -name *.orig -o -name *.rej -o -name *.bak + -o -name .*.orig -o -name .*.rej -o -name .SUMS + -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) ) -exec rm -f {} ;")); } -- cgit v1.2.3 From d1b0ab9c06dec3de45b94bc4c40cf7ca87f51cb8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:10:17 +0000 Subject: r175: Initial Import --- debian/changelog | 6 ++++++ dh_installcron | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 49eab4c3..2d8f91b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.39) unstable; urgency=low + + * dh_installcron: install files in cron.d with correct perms. + + -- Joey Hess Sat, 20 Feb 1999 22:28:38 -0800 + debhelper (1.2.38) unstable; urgency=low * dh_clean: don't try to delete directories named "core". diff --git a/dh_installcron b/dh_installcron index 133ba743..bd5eeddc 100755 --- a/dh_installcron +++ b/dh_installcron @@ -8,7 +8,7 @@ init(); foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); - foreach $type (qw{daily weekly monthly d}) { + foreach $type (qw{daily weekly monthly}) { $cron=pkgfile($PACKAGE,"cron.$type"); if ($cron) { if (! -d "$TMP/etc/cron.$type") { @@ -17,4 +17,12 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE"); } } + # Seperate because this needs to be mode 644. + $cron=pkgfile($PACKAGE,"cron.d"); + if ($cron) { + if (! -d "$TMP/etc/cron.d") { + doit("install","-o","root","-g","root","-d","$TMP/etc/cron.d"); + } + doit("install","-m",644,"-o","root","-g","root","-d","$TMP/etc/cron.d"); + } } -- cgit v1.2.3 From baff96382aa2b0e622ef2985c5451ba92de4fc71 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:10:27 +0000 Subject: r176: Initial Import --- debian/changelog | 7 +++++++ dh_installcron | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2d8f91b7..d00c0592 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.40) unstable; urgency=low + + * Let's just say 1.2.39 is not a good version of debhelper to use and + leave it at that. :-) + + -- Joey Hess Sat, 20 Feb 1999 22:55:27 -0800 + debhelper (1.2.39) unstable; urgency=low * dh_installcron: install files in cron.d with correct perms. diff --git a/dh_installcron b/dh_installcron index bd5eeddc..72872668 100755 --- a/dh_installcron +++ b/dh_installcron @@ -23,6 +23,6 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (! -d "$TMP/etc/cron.d") { doit("install","-o","root","-g","root","-d","$TMP/etc/cron.d"); } - doit("install","-m",644,"-o","root","-g","root","-d","$TMP/etc/cron.d"); + doit("install","-m",644,$cron,"$TMP/etc/cron.d/$PACKAGE"); } } -- cgit v1.2.3 From 092d1f70e74cc197215c6c8f401b634f50591830 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:10:37 +0000 Subject: r177: Initial Import --- debian/changelog | 6 ++++++ dh_md5sums | 12 +++++++++--- doc/README | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index d00c0592..8fdd8d52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.41) unstable; urgency=low + + * README: minor typo fix. + + -- Joey Hess Sat, 20 Feb 1999 23:30:00 -0800 + debhelper (1.2.40) unstable; urgency=low * Let's just say 1.2.39 is not a good version of debhelper to use and diff --git a/dh_md5sums b/dh_md5sums index 4ab9041a..76b87e82 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -29,7 +29,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } $olddir=getcwd(); - complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir"); - doit("chmod",644,"$TMP/DEBIAN/md5sums"); - doit("chown","root.root","$TMP/DEBIAN/md5sums"); + complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir"); + # If the file's empty, no reason to waste inodes on it. + if (-z "$TMP/DEBIAN/md5sums") { + doit("rm","-f","$TMP/DEBIAN/md5sums"); + } + else { + doit("chmod",644,"$TMP/DEBIAN/md5sums"); + doit("chown","root.root","$TMP/DEBIAN/md5sums"); + } } diff --git a/doc/README b/doc/README index 30f2a2cf..774f9fd4 100644 --- a/doc/README +++ b/doc/README @@ -38,7 +38,7 @@ script. If you would like to embed it into a perl script, here is one way to do that (note the tricky use of backquotes) (also note that I made sure that $1, $2, etc are set with the set command): -print << `EOF` +print << `EOF`; set -- @ARGV #DEBHELPER# EOF -- cgit v1.2.3 From d2273e03aae657f361060a9048edf407a3a9c694 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:15 +0000 Subject: r179: Initial Import --- Dh_Lib.pm | 36 ++++++++++++++++++++++++++++++++++++ debian/changelog | 7 +++++++ dh_compress | 2 +- dh_compress.1 | 9 +++++---- 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index f20cd5db..25174312 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -12,6 +12,7 @@ use vars qw(@ISA @EXPORT %dh); @ISA=qw(Exporter); @EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir &pkgfile &pkgext &isnative &autoscript &filearray &GetPackages + &xargs %dh); sub init { @@ -121,6 +122,41 @@ sub complex_doit { } } +# Run a command that may have a huge number of arguments, like xargs does. +# Pass in a reference to an array containing the arguments, and then other +# parameters that are the command and any parameters that should be passed to +# it each time. +sub xargs { + my $args=shift; + + # The kernel can accept command lines up to 20k worth of characters. + my $command_max=20000; + + # Figure out length of static portion of command. + my $static_length=0; + foreach (@_) { + $static_length+=length($_)+1; + } + + my @collect=(); + my $length=$static_length; + foreach (@$args) { + if (length($_) + 1 + $static_length > $command_max) { + error("This command is greater than the maximum command size allowed by the kernel, and cannot be split up further. What on earth are you doing? \"@_ $_\""); + } + $length+=length($_) + 1; + if ($length < $command_max) { + push @collect, $_; + } + else { + doit(@_,@collect) if $#collect > -1; + @collect=(); + $length=$static_length; + } + } + doit(@_,@collect) if $#collect > -1; +} + # Print something if the verbose flag is on. sub verbose_print { my $message=shift; if ($dh{VERBOSE}) { diff --git a/debian/changelog b/debian/changelog index 8fdd8d52..2dc3d012 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.42) unstable; urgency=low + + * dh_m5sums: don't generate bogus md5sums file if the package contains no + files. Yes, someone found a legitimate reason to do that. + + -- Joey Hess Thu, 25 Feb 1999 00:03:47 -0800 + debhelper (1.2.41) unstable; urgency=low * README: minor typo fix. diff --git a/dh_compress b/dh_compress index caffc11e..d4ec3cfd 100755 --- a/dh_compress +++ b/dh_compress @@ -78,7 +78,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } if (@f) { - doit("gzip","-9f",@f); + xargs(\@f,"gzip","-9f"); } # Now change over any files we can that used to be hard links so diff --git a/dh_compress.1 b/dh_compress.1 index 8fa2d802..f6628334 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -15,10 +15,11 @@ be compressed, namely all files in usr/info, usr/man, usr/X11R6/man, and all files in usr/doc that are larger than 4k in size, except the copyright file, .html files and .gif files, and all changelog files. .P -If a debian/compress file exits, however, it will be ran as a shell script, -and all filenames that the shell script outputs will be compressed instead -of the default files. Note that the shell script will be run from inside the -package build directory. +If a debian/package.compress file exists (debian/compress may be used for the +first binary package in debian/control), however, it will be ran as a shell +script, and all filenames that the shell script outputs will be compressed +instead of the default files. Note that the shell script will be run from +inside the package build directory. .SH EXAMPLE Here is a sample debian/compress file that causes dh_compress to compress the same files as it would by default. This is a good starting point for -- cgit v1.2.3 From 599f6c76b6478fc53800dccbdfb318c482971ac9 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:20 +0000 Subject: r180: Initial Import --- debian/changelog | 10 ++++++++++ dh_fixperms | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2dc3d012..d32c2826 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.43) unstable; urgency=low + + * dh_compress.1: man page fixes (Closes: #33858). + * dh_compress: now it can handle compressing arbitrary numbers of files, + spawning gzip multiple times like xargs does, if necessary. + (Closes: #33860) + * Dh_Lib.pm: added xargs() command. + + -- Joey Hess Tue, 9 Mar 1999 14:57:09 -0800 + debhelper (1.2.42) unstable; urgency=low * dh_m5sums: don't generate bogus md5sums file if the package contains no diff --git a/dh_fixperms b/dh_fixperms index 6825ed6d..fecf8ef4 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -22,10 +22,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } 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,u+rw,a-s"); + 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,u+rw,a-s"); $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; } -- cgit v1.2.3 From e96e7085e3c88f2dba9f44a490e5fcda62e76323 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:27 +0000 Subject: r181: Initial Import --- debhelper.1 | 3 +++ debian/changelog | 6 ++++++ dh_du.1 | 2 +- dh_installdebfiles.1 | 2 +- dh_installwm.1 | 6 +++--- dh_md5sums.1 | 2 +- dh_movefiles.1 | 2 +- doc/README | 3 ++- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/debhelper.1 b/debhelper.1 index 62906dc5..7bf55855 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -97,6 +97,9 @@ debian/, it will create it. I haven't bothered to document this in all the man pages, but for example, dh_installdeb knows to make debian/tmp/DEBIAN/ before trying to put files there, dh_installmenu knows you need a debian/tmp/usr/lib/menu/ before installing the menu files, etc. +.SH "DEBHELPER COMMANDS" +Here is the complete list of available debhelper commands. +#LIST# .SH ENVIRONMENT .TP .I DH_VERBOSE diff --git a/debian/changelog b/debian/changelog index d32c2826..7726e2e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.44) unstable; urgency=medium + + * dh_fixperms: has been mostly broken when used with -X, corrected this. + + -- Joey Hess Sat, 13 Mar 1999 17:25:59 -0800 + debhelper (1.2.43) unstable; urgency=low * dh_compress.1: man page fixes (Closes: #33858). diff --git a/dh_du.1 b/dh_du.1 index 38d3d7bd..aa3849e4 100644 --- a/dh_du.1 +++ b/dh_du.1 @@ -1,6 +1,6 @@ .TH DH_DU 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME -dh_du \- generate DEBIAN/du file +dh_du \- generate DEBIAN/du file (deprecated) .SH SYNOPSIS .B dh_du .SH "DESCRIPTION" diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index 5e41117a..bb66ed5b 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -1,6 +1,6 @@ .TH DH_INSTALLDEBFILES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME -dh_installdebfiles \- install files into the DEBIAN directory +dh_installdebfiles \- install files into the DEBIAN directory (deprecated) .SH SYNOPSIS .B dh_installdebfiles .SH "DESCRIPTION" diff --git a/dh_installwm.1 b/dh_installwm.1 index bc6ea446..d319d755 100644 --- a/dh_installwm.1 +++ b/dh_installwm.1 @@ -2,13 +2,13 @@ .SH NAME dh_installwm \- register a window manager .SH SYNOPSIS -.B dh_installmenu +.B dh_installwm .I "[debhelper options] [-n] wmfilename" .SH "DESCRIPTION" dh_installwm is a debhelper program that is responsible for generating the postinst and postrm commands needed to interface with the the -.BR register-window-manager (1) +.BR register-window-manager (8) command. This results in a window manager being registered when it is installed. .SH OPTIONS @@ -37,6 +37,6 @@ for a list of environment variables that affect all debhelper commands. .TP .BR debhelper (1) .TP -.BR register-window-manager (1) +.BR register-window-manager (8) .SH AUTHOR Joey Hess diff --git a/dh_md5sums.1 b/dh_md5sums.1 index 22b4fe28..6489a6c4 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -1,6 +1,6 @@ .TH DH_MD5SUMS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME -dh_md5sums \- generate DEBIAN/md5sums file +dh_md5sums \- generate DEBIAN/md5sums file (deprecated) .SH SYNOPSIS .B dh_md5sums .I "[debhelper options] [-x]" diff --git a/dh_movefiles.1 b/dh_movefiles.1 index 6ec525a8..de8ecd65 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -1,6 +1,6 @@ .TH DH_MOVEFILES 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME -dh_movefiles \- moves files out of debian/tmp into subpackages +dh_movefiles \- move files out of debian/tmp into subpackages .SH SYNOPSIS .B dh_movefiles .I "[debhelper options] [--sourcedir=dir] [file ..]" diff --git a/doc/README b/doc/README index 774f9fd4..07048e35 100644 --- a/doc/README +++ b/doc/README @@ -1,7 +1,8 @@ Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks related to building debian binary packages. For further documentation, see the man pages for dh_* commands. For an overview -of debhelper, see the debhelper(1) man page. +of debhelper, inclusing a list of all the available commands, see the +debhelper(1) man page. To help you get started, I've included examples of debian/rules files that use debhelper commands extensively. See /usr/doc/debhelper/examples/ . -- cgit v1.2.3 From 3e312fee14834a12f1c3f994f3f49c472207f0e3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:32 +0000 Subject: r182: Initial Import --- debian/changelog | 8 ++++++++ debian/rules | 16 ++++++++++++++++ doc/README | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7726e2e7..2a5843ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.45) unstable; urgency=low + + * dh_installwm.1: fixed two errors (#34534, #34535) + * debhelper.1: list all other debhelper commands with synopses + (automatically generated by build process). + + -- Joey Hess Sun, 14 Mar 1999 11:33:39 -0800 + debhelper (1.2.44) unstable; urgency=medium * dh_fixperms: has been mostly broken when used with -X, corrected this. diff --git a/debian/rules b/debian/rules index 0d9676f2..1c8c3b93 100755 --- a/debian/rules +++ b/debian/rules @@ -41,6 +41,22 @@ binary-indep: build ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages + # Fix up the debhelper.1 man page, substituting in a list of all + # debhelper commands. eek! + perl -ne ' \ + s/\\- /(1)\n/; \ + $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \ + close(ARGV) if eof; \ + END { \ + open(I,"debhelper.1"); \ + open(O,">debian/tmp/usr/man/man1/debhelper.1"); \ + while () { \ + s/#LIST#/$$collect/; \ + print O; \ + } \ + close I; \ + close O; \ + }' *.1 ./dh_installchangelogs ./dh_movefiles ./dh_link diff --git a/doc/README b/doc/README index 07048e35..34063629 100644 --- a/doc/README +++ b/doc/README @@ -9,6 +9,10 @@ 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). +For a more gentle introduction, the maint-guid debian package contains a +tutorial about making your first package using Debhelper. + + Starting a new package: ---------------------- -- cgit v1.2.3 From 8466c03d332e09d3350d7f381aa6a2a945b3cca2 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:38 +0000 Subject: r184: Initial Import --- debian/changelog | 6 ++++++ doc/README | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2a5843ce..ef661d28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.46) unstable; urgency=low + + * doc/README: pointer to maint-guide. + + -- Joey Hess Thu, 18 Mar 1999 21:04:57 -0800 + debhelper (1.2.45) unstable; urgency=low * dh_installwm.1: fixed two errors (#34534, #34535) diff --git a/doc/README b/doc/README index 34063629..fffa2bcc 100644 --- a/doc/README +++ b/doc/README @@ -40,13 +40,12 @@ by the -n parameter. Note that it will be shell code, so you cannot directly use it in a perl script. If you would like to embed it into a perl script, here is one way to -do that (note the tricky use of backquotes) (also note that I made sure that -$1, $2, etc are set with the set command): +do that (note that I made sure that $1, $2, etc are set with the set command): -print << `EOF`; -set -- @ARGV +my $temp="set -- @ARGV\n" . << `EOF`; #DEBHELPER# EOF +system $temp; Other notes: ----------- -- cgit v1.2.3 From 40fdf2d3762b3be7288cb95218c96a17a14ec764 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:44 +0000 Subject: r185: Initial Import --- debian/changelog | 8 ++++++++ dh_fixperms.1 | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ef661d28..bca74c89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.47) unstable; urgency=low + + * doc/README: updated the example of including debhelper shell script + fragments inside a perl program -- the old method didn't work with shell + variables properly (#34850). + + -- Joey Hess Sun, 21 Mar 1999 13:25:33 -0800 + debhelper (1.2.46) unstable; urgency=low * doc/README: pointer to maint-guide. diff --git a/dh_fixperms.1 b/dh_fixperms.1 index f45f0c3c..2822e27a 100644 --- a/dh_fixperms.1 +++ b/dh_fixperms.1 @@ -6,7 +6,8 @@ dh_fixperms \- fix permissions of files in package build directories .I "[debhelper options] [-Xitem]" .SH "DESCRIPTION" dh_fixperms is a debhelper program that is responsible for setting the -permissions of files in package build directories to a sane state. +permissions of files and directories in package build directories to a +sane state -- a state that complies with Debian policy. .P dh_fixperms makes all files in usr/doc in the package build directory (excluding files in the examples/ directory) be mode 644. It also changes -- cgit v1.2.3 From 70d0a9775002000820c6302d406e53e5598074d3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:49 +0000 Subject: r186: Initial Import --- debian/changelog | 6 ++++++ dh_fixperms | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bca74c89..b30b0f53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.48) unstable; urgency=low + + * dh_fixperms.1: improved documentation. (#34968) + + -- Joey Hess Tue, 23 Mar 1999 19:11:01 -0800 + debhelper (1.2.47) unstable; urgency=low * doc/README: updated the example of including debhelper shell script diff --git a/dh_fixperms b/dh_fixperms index fecf8ef4..665becc3 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -22,9 +22,9 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } else { # Do it the hard way. - complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0", + complex_doit("find $TMP ! -type l ! \\( $dh{EXCLUDE_FIND} \\) -print0", "2>/dev/null | xargs -0r chown root.root"); - complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0", + complex_doit("find $TMP ! -type l ! \\( $dh{EXCLUDE_FIND} \\) -print0", "2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s"); $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; -- cgit v1.2.3 From fbc69e71bb51ff59bb048021151fa10cfc6f8366 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:11:57 +0000 Subject: r187: Initial Import --- debian/changelog | 8 ++++++++ doc/README | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b30b0f53..58da543a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.49) unstable; urgency=low + + * dh_fixperms: if called with -X, was attempting to change permissions of + even symlinks. This could have even caused it to follow the symlinks and + modify files on the build system in some cases. Ignores them now. (#35102) + + -- Joey Hess Wed, 24 Mar 1999 13:21:49 -0800 + debhelper (1.2.48) unstable; urgency=low * dh_fixperms.1: improved documentation. (#34968) diff --git a/doc/README b/doc/README index fffa2bcc..c292c2ba 100644 --- a/doc/README +++ b/doc/README @@ -9,7 +9,7 @@ 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). -For a more gentle introduction, the maint-guid debian package contains a +For a more gentle introduction, the maint-guide debian package contains a tutorial about making your first package using Debhelper. -- cgit v1.2.3 From 83c009cd3bb93e4aace9ce4d94840b07df86116e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:03 +0000 Subject: r188: Initial Import --- debian/changelog | 6 ++++++ dh_movefiles.1 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 58da543a..a4b85a44 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.50) unstable; urgency=low + + * Very minor typo fix. + + -- Joey Hess Fri, 26 Mar 1999 17:27:01 -0800 + debhelper (1.2.49) unstable; urgency=low * dh_fixperms: if called with -X, was attempting to change permissions of diff --git a/dh_movefiles.1 b/dh_movefiles.1 index de8ecd65..45b84a64 100644 --- a/dh_movefiles.1 +++ b/dh_movefiles.1 @@ -18,7 +18,7 @@ move on the command line and this will apply to the first package dh_movefiles is told to act on. .P The files will be moved in a special order: first all normal files, then all -symlinks. This is done becuase it tends to be a good thing to have symlinks +symlinks. This is done because it tends to be a good thing to have symlinks last in debian packages, particularly in shared library packages. .SH OPTIONS .TP -- cgit v1.2.3 From f05e73ca956ba2e8a4c2b75635e94ccd7dc8554a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:14 +0000 Subject: r191: Initial Import --- debian/changelog | 6 ++++++ dh_compress.1 | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0410d70a..72475f92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.52) unstable; urgency=low + + * dh_installmodules: new program, closes #32546. + + -- Joey Hess Thu, 1 Apr 1999 17:25:37 -0800 + debhelper (1.2.51) unstable; urgency=low * Another very minor typo fix. diff --git a/dh_compress.1 b/dh_compress.1 index f6628334..77cd68f9 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -13,7 +13,9 @@ to the new files. By default, dh_compress compresses files that debian policy mandates should be compressed, namely all files in usr/info, usr/man, usr/X11R6/man, and all files in usr/doc that are larger than 4k in size, except -the copyright file, .html files and .gif files, and all changelog files. +the copyright file, .html files and .gif files, and all changelog files. It +skips any files that appear to be already compressed (based on their +extentions). .P If a debian/package.compress file exists (debian/compress may be used for the first binary package in debian/control), however, it will be ran as a shell @@ -26,9 +28,10 @@ the same files as it would by default. This is a good starting point for customization of what files are compressed: .PP find usr/info usr/man usr/X11*/man -type f - find usr/doc -type f \\ + find usr/doc -type f \\ \\( -size +4k -or -name "changelog*" \\) \\ - ! -name "*.htm*" ! -name "*.gif" \\ + ! -name "*.htm*" ! -name "*.gif" ! -iname "*.gz" \\ + ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\ ! -name "copyright" .SH OPTIONS .TP -- cgit v1.2.3 From b460b7f04eaf13aa5d9b41523c69656f7cd0e10e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:20 +0000 Subject: r192: Initial Import --- debian/changelog | 13 +++++++++++++ dh_compress | 9 ++++++++- dh_installinit.1 | 7 ++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 72475f92..fd8190fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (1.2.53) unstable; urgency=low + + * dh_compress: leave .taz and .tgz files alone. Previously trying to + compress such files caused gzip to fail and the whole command to fail. + Probably fixes #35677. Actually, it now skips files with a whole + range of odd suffixes that gzip refuses to compress, including "_z" and + "-gz". + * dh_compress.1: updated docs to reflect this, and to give the new + suggested starting point if you want to write your own debian/compress + file. + + -- Joey Hess Wed, 7 Apr 1999 02:20:14 -0700 + debhelper (1.2.52) unstable; urgency=low * dh_installmodules: new program, closes #32546. diff --git a/dh_compress b/dh_compress index d4ec3cfd..1c1badeb 100755 --- a/dh_compress +++ b/dh_compress @@ -31,10 +31,17 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } else { # By default, fall back to what the policy manual says to compress. + # Note that all the excludes of odd things like _z are because + # gzip refuses to compress such files, assumming they are zip files. + # I looked at the gzip source to get the complete list of such + # extentions. ".gz", ".z", ".taz", ".tgz", "-gz", "-z", "_z" + push @files, split(/\n/,` 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 "*.htm*" ! -name "*.gif" ! -iname "*.gz" \\ + ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\ + ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\ ! -name "copyright" 2>/dev/null || true `); } diff --git a/dh_installinit.1 b/dh_installinit.1 index bef681cb..5ec55fcd 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -13,7 +13,7 @@ needed to set up the symlinks in /etc/rc*.d/ and to start and stop the init scripts. .P If a file named debian/package.init (or debian/package.init.d for backwards -compatability with debstd) exists, then it is installed into +compatibility with debstd) 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.) @@ -33,7 +33,7 @@ Do not restart daemon on upgrade. .B \-d, \--remove-d Remove trailing "d" from the name of the package, and use the result for the filename the init script is installed as in etc/init.d/ . This may be useful -for daemons with names ending in "d". (Note: this takes precidence over +for daemons with names ending in "d". (Note: this takes precedence over the --init-script parameter described below.) .TP .B \-uparams, \--update-rcd-params=params @@ -51,6 +51,7 @@ See .BR debhelper (1) for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" -.BR debhelper (1) +.BR debhelper (1), +.BR update_rc.d (8) .SH AUTHOR Joey Hess -- cgit v1.2.3 From df579d501cb0dfde5718367699d47ad25598e03f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:26 +0000 Subject: r193: Initial Import --- debian/changelog | 8 ++++++++ debian/rules | 22 +++++++++++++++++++--- dh_md5sums | 7 ++++++- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index fd8190fb..3a50778c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.54) unstable; urgency=low + + * dh_installinit.1: man page fixups (#34160). + * *.1: the date of each man page is now automatically updated when + debhelper is built to be the last modification time of the man page. + + -- Joey Hess Thu, 8 Apr 1999 20:28:00 -0700 + debhelper (1.2.53) unstable; urgency=low * dh_compress: leave .taz and .tgz files alone. Previously trying to diff --git a/debian/rules b/debian/rules index 1c8c3b93..5995460f 100755 --- a/debian/rules +++ b/debian/rules @@ -41,6 +41,21 @@ binary-indep: build ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages + # Fix up all man pages, filling in the modification time for them. + # Note this runs beofre the command below so debhelper.1 gets the right + # date on it. + perl -mPOSIX -e ' \ + foreach $$f (@ARGV) { \ + @data=stat($$f); \ + $$date=POSIX::strftime("%d %B %Y",localtime($$data[9])); \ + open (IN,$$f); \ + @lines=; \ + close IN; \ + $$lines[0]=~s/1 ""/1 "$$date"/; \ + open (OUT,">$$f"); \ + print OUT @lines; \ + close OUT; \ + }' debian/tmp/usr/man/man1/*.1 # Fix up the debhelper.1 man page, substituting in a list of all # debhelper commands. eek! perl -ne ' \ @@ -48,13 +63,14 @@ binary-indep: build $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \ close(ARGV) if eof; \ END { \ - open(I,"debhelper.1"); \ + open(I,"debian/tmp/usr/man/man1/debhelper.1"); \ + @lines=; \ + close I; \ open(O,">debian/tmp/usr/man/man1/debhelper.1"); \ - while () { \ + foreach (@lines) { \ s/#LIST#/$$collect/; \ print O; \ } \ - close I; \ close O; \ }' *.1 ./dh_installchangelogs diff --git a/dh_md5sums b/dh_md5sums index 76b87e82..2b626292 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -27,7 +27,12 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } close CONFF; } - + + # See if we should exclude other files. + if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { + $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; + } + $olddir=getcwd(); complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir"); # If the file's empty, no reason to waste inodes on it. -- cgit v1.2.3 From f2e26db089daaeaa9e9821f01af0aab7b42b9dde Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:26 +0000 Subject: r194: Initial Import --- debhelper.1 | 15 +++++++++++++++ debian/changelog | 8 ++++++++ dh_installdocs.1 | 2 +- dh_md5sums.1 | 10 +++++++--- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/debhelper.1 b/debhelper.1 index 7bf55855..1562b2bf 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -12,6 +12,7 @@ document those options and to document debhelper as a whole. For additional options, and documentation for each individual command, see the commands' own man pages. .SH "SHARED DEBHLPER OPTIONS" +The following command line options are supported by all debhelper programs. .TP .B \-v, \--verbose Verbose mode: show all commands that modify the package build directory. @@ -44,6 +45,20 @@ the package as one that should be acted on. .TP .B \-Ptmpdir, \--tmpdir=tmpdir Use "tmpdir" for package build directory. +.SH "COMMON DEBHELPER OPTIONS" +The following command line options are supported by some debhelper programs. +See the man page of each program for a complete explination of what the +option does. +.TP +.B \-n +Do not modify postinst/postrm/etc scripts. +.TP +.B \-Xitem, \--exclude=item +Exclude an item from processing. +.TP +.B \-A, \-all +Makes files or other items that are specified on the command line take effect +in ALL packages acted on, not just the first. .SH NOTES .TP .B Multiple binary package support diff --git a/debian/changelog b/debian/changelog index 3a50778c..846eadf9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.55) unstable; urgency=low + + * Various man page enhancements. + * dh_md5sums: supports -X to make it skip including files in the + md5sums (#35819). + + -- Joey Hess Fri, 9 Apr 1999 18:21:58 -0700 + debhelper (1.2.54) unstable; urgency=low * dh_installinit.1: man page fixups (#34160). diff --git a/dh_installdocs.1 b/dh_installdocs.1 index 50f07e1f..afc481e6 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -56,7 +56,7 @@ Install all files specified by command line parameters in ALL packages acted on. .TP .B \-n, \--noscripts -DO not modify postinst/prerm scripts. +Do not modify postinst/prerm scripts. .TP .B file ... Install these files as documentation into the first package acted on. (Or in diff --git a/dh_md5sums.1 b/dh_md5sums.1 index 6489a6c4..61fb3b73 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -3,7 +3,7 @@ dh_md5sums \- generate DEBIAN/md5sums file (deprecated) .SH SYNOPSIS .B dh_md5sums -.I "[debhelper options] [-x]" +.I "[debhelper options] [-x] [-Xitem]" .SH "DESCRIPTION" dh_md5sums is a debhelper program that is responsible for generating a DEBIAN/md5sums file, which lists the md5sums of each file in the package. @@ -20,8 +20,12 @@ See for a list of options common to all debhelper commands. .TP .B \-x, \--include-conffiles -Include conffiles in the md5sums list. Note that this is redundant, and -included elsewhere in debian packages. +Include conffiles in the md5sums list. Note that this information is +redundant since it is included elsewhere in debian packages. +.TP +.B \-Xitem, --exclude=item +Exclude files that contain "item" anywhere in their filename from +being listed in the md5sums file. .SH ENVIRONMENT See .BR debhelper (1) -- cgit v1.2.3 From 6a33d33fd003b6d2f2864d700beb04b466c138b2 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:36 +0000 Subject: r195: Initial Import --- autoscripts/postinst-suid | 2 +- debian/changelog | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid index de638efe..83f2f09f 100644 --- a/autoscripts/postinst-suid +++ b/autoscripts/postinst-suid @@ -1,6 +1,6 @@ if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# -else +elif [ -e #FILE# ]; then chown #OWNER#.#GROUP# /#FILE# chmod #PERMS# /#FILE# fi diff --git a/debian/changelog b/debian/changelog index 846eadf9..2ece6258 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.56) unstable; urgency=low + + * dh_suidregister: make the chown/chmod only happen if the file actually + exists. This is useful if you have conffiles that have permissions and + may be deleted. (#35845) + + -- Joey Hess Sat, 10 Apr 1999 13:35:23 -0700 + debhelper (1.2.55) unstable; urgency=low * Various man page enhancements. -- cgit v1.2.3 From 4dcd2be0df92f2b63fe7a9f498e0bebc989f5ecc Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:42 +0000 Subject: r196: Initial Import --- debian/changelog | 6 ++++++ examples/rules | 2 +- examples/rules.multi | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2ece6258..5a1bd35f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.57) unstable; urgency=low + + * examples/*: killed trailing spaces after diff: target + + -- Joey Hess Mon, 12 Apr 1999 22:02:32 -0700 + debhelper (1.2.56) unstable; urgency=low * dh_suidregister: make the chown/chmod only happen if the file actually diff --git a/examples/rules b/examples/rules index a0806c1d..108e38cd 100755 --- a/examples/rules +++ b/examples/rules @@ -67,7 +67,7 @@ binary-arch: build install dh_md5sums dh_builddeb -source diff: +source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch diff --git a/examples/rules.multi b/examples/rules.multi index f03909f6..4b4c2a0a 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -91,7 +91,7 @@ binary-arch: build install dh_md5sums -a dh_builddeb -a -source diff: +source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch -- cgit v1.2.3 From 4a74fb7a4bbe662e54eeb13630ac190af64fcb25 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:12:49 +0000 Subject: r197: Initial Import --- autoscripts/postinst-suid | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid index 83f2f09f..dcc277fd 100644 --- a/autoscripts/postinst-suid +++ b/autoscripts/postinst-suid @@ -1,6 +1,6 @@ if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# -elif [ -e #FILE# ]; then +elif [ -e /#FILE# ]; then chown #OWNER#.#GROUP# /#FILE# chmod #PERMS# /#FILE# fi diff --git a/debian/changelog b/debian/changelog index 5a1bd35f..8208825c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.58) unstable; urgency=low + + * autoscripts/postinst-suid: use /#FILE# in elif test (#36297). + + -- Joey Hess Sun, 18 Apr 1999 22:33:52 -0700 + debhelper (1.2.57) unstable; urgency=low * examples/*: killed trailing spaces after diff: target -- cgit v1.2.3 From 4f78e58b4f803521d56c1b3c7e946128a14b7d6c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:00 +0000 Subject: r198: Initial Import --- Dh_Getopt.pm | 2 ++ debian/changelog | 7 +++++++ dh_builddeb | 7 ++++++- dh_builddeb.1 | 6 +++++- dh_installexamples.1 | 2 +- doc/PROGRAMMING | 2 ++ 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 5f43496b..0c28500d 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -114,6 +114,8 @@ sub parseopts { "init-script=s" => \$options{INIT_SCRIPT}, "sourcedir=s" => \$options{SOURCEDIR}, + + "destdir=s" => \$options{DESTDIR}, ); if (!$ret) { diff --git a/debian/changelog b/debian/changelog index 8208825c..a9c6a0b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.59) unstable; urgency=low + + * dh_builddeb: added --destdir option, which lets you tell it where + to put the generated .deb's. Default is .. of course. + + -- Joey Hess Thu, 22 Apr 1999 22:02:01 -0700 + debhelper (1.2.58) unstable; urgency=low * autoscripts/postinst-suid: use /#FILE# in elif test (#36297). diff --git a/dh_builddeb b/dh_builddeb index 06cc1beb..9d760b5e 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -6,7 +6,12 @@ BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); +# Set the default destination directory. +if (! defined $dh{DESTDIR}) { + $dh{DESTDIR}='..'; +} + foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); - doit("dpkg","--build",$TMP,".."); + doit("dpkg","--build",$TMP,$dh{DESTDIR}); } diff --git a/dh_builddeb.1 b/dh_builddeb.1 index cf492b4c..134cd883 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -3,7 +3,7 @@ dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[debhelper options]" +.I "[debhelper options] [--destdir=directory]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) @@ -14,6 +14,10 @@ to build a .deb package or packages. See .BR debhelper (1) for a list of options common to all debhelper commands. +.TP +.B --destdir=directory +Use this if you want the generated .deb files to be put in a directory other +than the default of ".." .SH ENVIRONMENT See .BR debhelper (1) diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 61ec0ea0..87ccd1ff 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -9,7 +9,7 @@ dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. .P Any file names specified as parameters will be installed into the first -package dh_installdirs is told to act on. By default, this is the first +package dh_installexamples 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 diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index e40f0421..5a47fc25 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -118,6 +118,8 @@ switch variable description dh_installinit will ever use this) --sourcedir SOURCEDIR will be set to a string (probably only dh_movefiles will ever use this) +--destdir DESTDIR will be set to a string (probably only + dh_builddeb 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. -- cgit v1.2.3 From 83cfb74faf9eb890956be5e580eeac636336d18a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:00 +0000 Subject: r199: Initial Import --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index a9c6a0b7..658dc4ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.60) unstable; urgency=low + + * dh_installexamples.1: recycled docs fix. + + -- Joey Hess Mon, 26 Apr 1999 17:19:07 -0700 + debhelper (1.2.59) unstable; urgency=low * dh_builddeb: added --destdir option, which lets you tell it where -- cgit v1.2.3 From b316fa9df45e97dcd6ad4a8d534537a0db2cef26 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:05 +0000 Subject: r200: Initial Import --- debian/changelog | 7 +++++++ dh_md5sums.1 | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 658dc4ea..ede72bf3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.61) unstable; urgency=low + + * dh_md5sums.1: dh_md5sums is not deprecated, AFAIK, but the manpage has + somehow been modified to say it was at version 1.2.45. + + -- Joey Hess Mon, 26 Apr 1999 19:54:04 -0700 + debhelper (1.2.60) unstable; urgency=low * dh_installexamples.1: recycled docs fix. diff --git a/dh_md5sums.1 b/dh_md5sums.1 index 61fb3b73..b044077c 100644 --- a/dh_md5sums.1 +++ b/dh_md5sums.1 @@ -1,6 +1,6 @@ .TH DH_MD5SUMS 1 "" "Debhelper Commands" "Debhelper Commands" .SH NAME -dh_md5sums \- generate DEBIAN/md5sums file (deprecated) +dh_md5sums \- generate DEBIAN/md5sums file .SH SYNOPSIS .B dh_md5sums .I "[debhelper options] [-x] [-Xitem]" -- cgit v1.2.3 From b5ee70bd5ac3bf45e892612fa0b51e26ff05b688 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:28 +0000 Subject: r201: Initial Import --- debian/changelog | 7 +++++++ dh_installemacsen | 17 ++++++++++++++++- dh_installemacsen.1 | 15 ++++++++++++--- doc/PROGRAMMING | 3 +++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index ede72bf3..61ce4b36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.62) unstable; urgency=low + + * dh_installemacsen: added support for site-start files. Added --flavor + and --number to control details of installation. (#36832) + + -- Joey Hess Sun, 2 May 1999 15:31:58 -0700 + debhelper (1.2.61) unstable; urgency=low * dh_md5sums.1: dh_md5sums is not deprecated, AFAIK, but the manpage has diff --git a/dh_installemacsen b/dh_installemacsen index 79c7dda9..0b2f6b80 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -6,11 +6,19 @@ BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); +if (! defined $dh{number}) { + $dh{number}=50; +} +if (! defined $dh{flavor}) { + $dh{flavor}='emacs'; +} + foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); + $emacsen_init=pkgfile($PACKAGE,"emacsen-init"); if ($emacsen_install ne '') { if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { @@ -25,6 +33,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } doit("install","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); } + + if ($emacsen_init ne '') { + if (! -d "$TMP/etc/$dh{flavor}/site-start.d/") { + doit("install","-d","$TMP/etc/$dh{flavor}/site-start.d/"); + } + doit("install",$emacsen_init,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); + } if ($emacsen_install ne '' || $emacsen_remove ne '') { if (! $dh{NOSCRIPTS}) { @@ -34,4 +49,4 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { "s/#PACKAGE#/$PACKAGE/"); } } -} +} diff --git a/dh_installemacsen.1 b/dh_installemacsen.1 index 15ec575a..df1512f5 100644 --- a/dh_installemacsen.1 +++ b/dh_installemacsen.1 @@ -3,7 +3,7 @@ dh_installemacsen \- register an emacs add on package .SH SYNOPSIS .B dh_installemacsen -.I "[debhelper options] [-n]" +.I "[debhelper options] [-n] [--number=n] [--flavor=foo]" .SH "DESCRIPTION" dh_installemacsen is a debhelper program that is responsible for installing files used by the debian emacsen-common package into package build directories. @@ -16,10 +16,12 @@ for an explanation of how this works. If a file named debian/package.emacsen-install exists, then it is installed into usr/lib/emacsen-common/packages/install/package in the package build directory. Similarly, debian/package.emacsen-remove is installed into -usr/lib/emacsen-common/packages/remove/package +usr/lib/emacsen-common/packages/remove/package . And similarly, +debian/package.emacsen-startup is installed into +etc/emacs/site-start.d/50.el (by default). .P For the first first binary package listed in the control file, you may use -debian/emacsen-install and debian/emacsen-remove instead. +debian/emacsen-install, debian/emacsen-remove, and debian/emacsen-startup instead. .SH OPTIONS .TP .B debhelper options @@ -29,6 +31,13 @@ for a list of options common to all debhelper commands. .TP .B \-n, \--noscripts Do not modify postinst/prerm scripts. +.TP +.B \--number=n +Sets the priority number of a site-start.d file. Default is 50. +.TP +.B \--flavor=foo +Sets the flavor a site-start.d file will be installed in. Default is +"emacs", alternatives include "xemacs" and "emacs20". .SH ENVIRONMENT See .BR debhelper (1) diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 5a47fc25..4f071496 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -120,6 +120,9 @@ switch variable description dh_movefiles will ever use this) --destdir DESTDIR will be set to a string (probably only dh_builddeb will ever use this) +--flavor FLAVOR will be set to a string (probably only + dh_installemacsen will ever use this) +--number NUMBER will be set to a number Any additional command line parameters that do not start with "-" will be ignored, and you can access them later just as you normally would. -- cgit v1.2.3 From a01f275855a88fc6e9a32029138d312de1b3c560 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:35 +0000 Subject: r202: Initial Import --- autoscripts/postinst-xaw | 3 +++ debian/changelog | 7 +++++++ dh_installxaw | 43 +++++++++++++++++++++++++++++++++++++++---- dh_installxaw.1 | 2 +- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/autoscripts/postinst-xaw b/autoscripts/postinst-xaw index b8d718ea..3d8e2d1b 100644 --- a/autoscripts/postinst-xaw +++ b/autoscripts/postinst-xaw @@ -1,3 +1,6 @@ if test -x /usr/sbin/update-xaw-wrappers; then /usr/sbin/update-xaw-wrappers fi +for opts in #OPTS#; do + update-alternatives --quiet --install $opts 25 +done diff --git a/debian/changelog b/debian/changelog index 61ce4b36..2938e7c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.63) unstable; urgency=low + + * dh_installxaw: updated to work with xaw-wrappers 0.90 and above. It + actually has to partially parse the xaw-wrappers config files now. + + -- Joey Hess Sun, 2 May 1999 19:13:34 -0700 + debhelper (1.2.62) unstable; urgency=low * dh_installemacsen: added support for site-start files. Added --flavor diff --git a/dh_installxaw b/dh_installxaw index 31867f15..849fbf00 100755 --- a/dh_installxaw +++ b/dh_installxaw @@ -16,14 +16,49 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $xaw=pkgfile($PACKAGE,'xaw'); if ($xaw ne '') { - if (! -d "$TMP/usr/lib/xaw-wrappers/conf") { - doit("install","-d","$TMP/usr/lib/xaw-wrappers/conf"); + if (! -d "$TMP/usr/lib/xaw-wrappers/config") { + doit("install","-d","$TMP/usr/lib/xaw-wrappers/config"); } doit("install","-p","-m644",$xaw, - "$TMP/usr/lib/xaw-wrappers/conf/$PACKAGE"); + "$TMP/usr/lib/xaw-wrappers/config/$PACKAGE"); if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-xaw"); + # Parse the xaw conf file to figure out what programs + # and link names are present in it. Have to pass + # those into the scripts. + my %data; + my $install_opts=''; + my $remove_opts=''; + my $stanza=''; + + open (IN,$xaw); + while () { + chomp; + s/\s+/ /g; + if (/^#/ eq '') { + if (/(.*?):\s?(.*)/) { + $data{lc($1)}=$2; + $stanza=1; + } + elsif ($stanza) { + $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'"; + $remove_opts.="'$data{'link-name'} $data{wrapped}'"; + undef %data; + $stanza=''; + } + } + } + close IN; + + if ($stanza) { + $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'"; + $remove_opts.="'$data{'link-name'} $data{wrapped}'"; + } + + autoscript($PACKAGE,"postinst","postinst-xaw", + "s:#OPTS#:$install_opts:"); + autoscript($PACKAGE,"prerm","prerm-xaw", + "s:#OPTS#:$remove_opts:"); autoscript($PACKAGE,"postrm","postrm-xaw"); } } diff --git a/dh_installxaw.1 b/dh_installxaw.1 index 19f47423..b0a82bb2 100644 --- a/dh_installxaw.1 +++ b/dh_installxaw.1 @@ -14,7 +14,7 @@ interface with the debian xaw-wrappers package. See for an explanation of how this works. .P If a file named debian/package.xaw exists, then it is installed into -usr/lib/xaw-wrappers/conf/package in the package build directory. +usr/lib/xaw-wrappers/config/package in the package build directory. .P For the first first binary package listed in the control file, you may use debian/xaw instead. -- cgit v1.2.3 From e12bd98f1a2ef5a919e108bc3be43d14be9adb21 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:42 +0000 Subject: r203: Initial Import --- debian/changelog | 6 ++++++ dh_installxaw.1 | 4 ++-- dh_suidregister.1 | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2938e7c0..7728335f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.64) unstable; urgency=low + + * dh_installmime: new command (#37093, #32684). + + -- Joey Hess Mon, 3 May 1999 13:37:34 -0700 + debhelper (1.2.63) unstable; urgency=low * dh_installxaw: updated to work with xaw-wrappers 0.90 and above. It diff --git a/dh_installxaw.1 b/dh_installxaw.1 index b0a82bb2..4fb9ebf6 100644 --- a/dh_installxaw.1 +++ b/dh_installxaw.1 @@ -8,7 +8,7 @@ dh_installxaw \- install xaw wrappers config files into package build directorie dh_installxaw is a debhelper program that is responsible for installing xaw wrappers config files into package build directories. .P -It also automatically generates the postinst and postrm commands needed to +It also automatically generates the postinst, prerm, and postrm commands needed to interface with the debian xaw-wrappers package. See .BR dh_installdeb (1) for an explanation of how this works. @@ -26,7 +26,7 @@ See for a list of options common to all debhelper commands. .TP .B \-n, \--noscripts -Do not modify postinst/postrm scripts. +Do not modify postinst/prerm/postrm scripts. .SH ENVIRONMENT See .BR debhelper (1) diff --git a/dh_suidregister.1 b/dh_suidregister.1 index ee804aff..4e0984b4 100644 --- a/dh_suidregister.1 +++ b/dh_suidregister.1 @@ -45,6 +45,10 @@ with other debhelper programs. .B file ... Register these files in the first package acted on. (Or in all packages if -A is specified.) +.SH NOTES +dh_suidregister does not make anything suid. It merely records the +permissions binaries already have. If you need to make something suid, you +must do so manually before calling dh_suidregister. .SH ENVIRONMENT See .BR debhelper (1) -- cgit v1.2.3 From 47c3b3b46460f567be990f3aad24b4542477c1fe Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:42 +0000 Subject: r204: Initial Import --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7728335f..42fc7a38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.65) unstable; urgency=low + + * Added to docs. + + -- Joey Hess Thu, 6 May 1999 21:46:03 -0700 + debhelper (1.2.64) unstable; urgency=low * dh_installmime: new command (#37093, #32684). -- cgit v1.2.3 From c02584b60ccccd6abec16130a41f9345f26b1fb5 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:47 +0000 Subject: r205: Initial Import --- debian/changelog | 7 +++++++ examples/rules.multi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 42fc7a38..dce70aa2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.66) unstable; urgency=low + + * examples/rules.multi: dh_shlibdeps must be run before dh_gencontrol + (#37346) + + -- Joey Hess Sun, 9 May 1999 14:03:05 -0700 + debhelper (1.2.65) unstable; urgency=low * Added to docs. diff --git a/examples/rules.multi b/examples/rules.multi index 4b4c2a0a..6292b8aa 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -86,8 +86,8 @@ binary-arch: build install dh_suidregister -a dh_installdeb -a # dh_makeshlibs -a - dh_gencontrol -a dh_shlibdeps -a + dh_gencontrol -a dh_md5sums -a dh_builddeb -a -- cgit v1.2.3 From 2e61621b6bade08db706272fa22b159b3154dfc8 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:14:33 +0000 Subject: r206: Initial Import --- debian/changelog | 6 ++++++ debian/control | 2 +- dh_installchangelogs | 9 ++++++--- dh_installmodules | 2 +- doc/README | 5 +++-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index dce70aa2..d0199464 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.67) unstable; urgency=low + + * dh_installmodules: fixed type that made the program not work. + + -- Joey Hess Wed, 12 May 1999 00:25:05 -0700 + debhelper (1.2.66) unstable; urgency=low * examples/rules.multi: dh_shlibdeps must be run before dh_gencontrol diff --git a/debian/control b/debian/control index 7254be98..3f546b8e 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.5.0.0 +Standards-Version: 2.5.1.0 Package: debhelper Architecture: all diff --git a/dh_installchangelogs b/dh_installchangelogs index 40a68f3d..877aa822 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -39,15 +39,18 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (! -d "$TMP/usr/doc/$PACKAGE") { doit("install","-d","$TMP/usr/doc/$PACKAGE"); } - doit("install","-p","-m644",$changelog,"$TMP/usr/doc/$PACKAGE/$changelog_name"); + doit("install","-o","root","-g","root","-p","-m644",$changelog, + "$TMP/usr/doc/$PACKAGE/$changelog_name"); if ($upstream) { if ($upstream=~m/\.html?$/i) { # HTML changelog - doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog.html"); + doit("install","-o","root","-g","root","-p","-m644", + $upstream,"$TMP/usr/doc/$PACKAGE/changelog.html"); } else { - doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + doit("install","-o","root","-g","root","-p","-m644", + $upstream,"$TMP/usr/doc/$PACKAGE/changelog"); } if ($dh{K_FLAG}) { # Install symlink to original name of the upstream changelog file. diff --git a/dh_installmodules b/dh_installmodules index 264ae9c0..1e111e5a 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -17,7 +17,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if ($file) { if (! -e "$TMP/etc/modutils") { doit("install","-d","$TMP/etc/modutils"); - doit("cp","-m0644",$file,"$TMP/etc/modutils/$PACKAGE"); + doit("install","-m","0644",$file,"$TMP/etc/modutils/$PACKAGE"); } if (! $dh{NOSCRIPTS}) { diff --git a/doc/README b/doc/README index c292c2ba..77362d3f 100644 --- a/doc/README +++ b/doc/README @@ -42,10 +42,11 @@ Note that it will be shell code, so you cannot directly use it in a perl script. If you would like to embed it into a perl script, here is one way to do that (note that I made sure that $1, $2, etc are set with the set command): -my $temp="set -- @ARGV\n" . << `EOF`; +my $temp="set -e\nset -- @ARGV\n" . << 'EOF'; #DEBHELPER# EOF -system $temp; +system ($temp) / 256 == 0 + or die "Problem with debhelper scripts: $!\n"; Other notes: ----------- -- cgit v1.2.3 From 4aefe73e1dbb7cf8039da959972ebaea53f693d0 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:14:33 +0000 Subject: r207: Initial Import --- debian/changelog | 15 +++++++++++++++ debian/rules | 8 +++++++- dh_link | 4 ++++ dh_link.1 | 6 ++---- doc/TODO | 3 +++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index d0199464..76596df0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +debhelper (1.2.68) unstable; urgency=low + + * doc/README: updated example of using #DEBHELPER# in a perl script, with + help from Julian Gilbey. + * dh_link: generate absolute symlinks where appropriate. The links + generated before were wrong simetimes (#37774) + * Started writing a regression test suite for debhelper. Currently covers + only the above bugfix and a few more dh_link tests. + * Tossed Test.pm into the package (for regression tests) until we get perl + 5.005 which contains that package. That file is licenced the same as perl. + * dh_installchangelogs: force all installed files to be owned by root + (#37655). + + -- Joey Hess Sun, 16 May 1999 17:18:44 -0700 + debhelper (1.2.67) unstable; urgency=low * dh_installmodules: fixed type that made the program not work. diff --git a/debian/rules b/debian/rules index 5995460f..181375c1 100755 --- a/debian/rules +++ b/debian/rules @@ -13,13 +13,19 @@ VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Ver export DH_VERBOSE=1 build: -# Nothing to do. + # Run regression tests. + $(MAKE) test clean: ./dh_testdir ./dh_testroot ./dh_clean +test: + ./dh_clean + perl -MTest::Harness -e 'runtests @ARGV' t/* + -rm -rf debian/tmp + # Build architecture-dependent files here. binary-arch: build # Nothing to do. diff --git a/dh_link b/dh_link index cc1b4954..f99aab73 100755 --- a/dh_link +++ b/dh_link @@ -61,6 +61,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } $src=~s:/$::; } + else { + # Make sure it's properly absolute. + $src="/$src"; + } doit("ln","-sf",$src,"$TMP/$dest"); } diff --git a/dh_link.1 b/dh_link.1 index 5a3fbbc2..eb2cce21 100644 --- a/dh_link.1 +++ b/dh_link.1 @@ -24,14 +24,12 @@ ackage dh_link 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 -Be sure to only use file names relative to the package build -directory. Ie, "/usr/bin/foo" should not be used, use "usr/bin/foo" instead. -Also, be sure you +Be sure you .B do specify the full filename to both the source and destination files (unlike you would do if you were using something like .BR ln (1) -) +). .P dh_link will generate symlinks that comply with debian policy - absolute when policy says they should be absolute, and relative links with as short a diff --git a/doc/TODO b/doc/TODO index b926737c..75006f05 100644 --- a/doc/TODO +++ b/doc/TODO @@ -22,6 +22,9 @@ Wishlist items: they might have; still it would be nice to check them too, just to make debhelper more flexible.) One easy fix is to add umask 022 to dh_lib, however, there may be unforeseen ramifications of such a change. +* All programs should also make sure the files they install are owned by + root.root. Situation is currently the same as with permissions above, plus + dh_installchangelogs is fixed. * 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 -- cgit v1.2.3 From 5c813ee9dd47601542cc7018ee88c538facf0aec Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:14:43 +0000 Subject: r208: Initial Import --- debian/changelog | 6 ++++++ debian/rules | 2 +- dh_installmanpages | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 76596df0..59e937ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.69) unstable; urgency=low + + * Don't include Test.pm in the binary package. + + -- Joey Hess Sun, 23 May 1999 19:29:27 -0700 + debhelper (1.2.68) unstable; urgency=low * doc/README: updated example of using #DEBHELPER# in a perl script, with diff --git a/debian/rules b/debian/rules index 181375c1..8a4ee355 100755 --- a/debian/rules +++ b/debian/rules @@ -40,7 +40,7 @@ binary-indep: build echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; - cp -a *.pm debian/tmp/usr/lib/debhelper + cp -a Dh_*.pm debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd diff --git a/dh_installmanpages b/dh_installmanpages index 1647d0a5..98386254 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -28,7 +28,7 @@ sub find_man { return; } foreach $dir (@allpackages) { - if ($File::Find::dir=~m:debian/$dir:) { + if ($File::Find::dir=~m:debian/\Q$dir\E:) { return; } } -- cgit v1.2.3 From deebc450fe6910459dbf4b7a4093108a531daee4 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:14:49 +0000 Subject: r209: Initial Import --- debian/changelog | 7 +++++++ doc/README | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 59e937ea..c367dafb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.70) unstable; urgency=low + + * dh_installmanpages: Properly quoted metacharacters in $dir in regexp. + (#38263). + + -- Joey Hess Tue, 25 May 1999 14:12:30 -0700 + debhelper (1.2.69) unstable; urgency=low * Don't include Test.pm in the binary package. diff --git a/doc/README b/doc/README index 77362d3f..7ba69863 100644 --- a/doc/README +++ b/doc/README @@ -1,7 +1,7 @@ Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks related to building debian binary packages. For further documentation, see the man pages for dh_* commands. For an overview -of debhelper, inclusing a list of all the available commands, see the +of debhelper, including a list of all the available commands, see the debhelper(1) man page. To help you get started, I've included examples of debian/rules files -- cgit v1.2.3 From 9a94805aeb2489da1a8f23b76b3ad2a9e85e343e Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:14:49 +0000 Subject: r210: Initial Import --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index c367dafb..297933eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.71) unstable; urgency=low + + * Fixed a typo (closes: #38881) + + -- Joey Hess Thu, 3 Jun 1999 13:23:23 -0700 + debhelper (1.2.70) unstable; urgency=low * dh_installmanpages: Properly quoted metacharacters in $dir in regexp. -- cgit v1.2.3 From dfa35b90e0703738c55e8cf177d28c9c83a46aba Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:14:54 +0000 Subject: r211: Initial Import --- debian/changelog | 8 ++++++++ dh_installemacsen | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 297933eb..9ea49a2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.72) unstable; urgency=low + + * dh_installemacsen: use debian/package.emacsen-startup, not + debian/package.emacsen-init. The former has always been documented to + work on the man page (closes: #38898). + + -- Joey Hess Thu, 3 Jun 1999 14:16:57 -0700 + debhelper (1.2.71) unstable; urgency=low * Fixed a typo (closes: #38881) diff --git a/dh_installemacsen b/dh_installemacsen index 0b2f6b80..778720a1 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -18,7 +18,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); - $emacsen_init=pkgfile($PACKAGE,"emacsen-init"); + $emacsen_startup=pkgfile($PACKAGE,"emacsen-startup"); if ($emacsen_install ne '') { if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { @@ -34,11 +34,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); } - if ($emacsen_init ne '') { + if ($emacsen_startup ne '') { if (! -d "$TMP/etc/$dh{flavor}/site-start.d/") { doit("install","-d","$TMP/etc/$dh{flavor}/site-start.d/"); } - doit("install",$emacsen_init,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); + doit("install",$emacsen_startup,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); } if ($emacsen_install ne '' || $emacsen_remove ne '') { -- cgit v1.2.3 From 2e2caf1f612889f7862b401f73ee7af685863011 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:10 +0000 Subject: r213: Initial Import --- debian/changelog | 8 ++++++++ dh_installemacsen | 6 +++--- dh_installmanpages | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9ea49a2e..03df5b3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (1.2.73) unstable; urgency=low + + * dh_installemacsen: make sure files are installed mode 0644. Not strictly + necessary since dh_fixperms fixes them if you have a wacky umask, but oh + well. (Closes: 38900) + + -- Joey Hess Thu, 3 Jun 1999 14:50:42 -0700 + debhelper (1.2.72) unstable; urgency=low * dh_installemacsen: use debian/package.emacsen-startup, not diff --git a/dh_installemacsen b/dh_installemacsen index 778720a1..f271338f 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -24,21 +24,21 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install"); } - doit("install",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"); + doit("install","-m0644",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"); } if ($emacsen_remove ne '') { if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") { doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove"); } - doit("install","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); + doit("install","-m0644","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); } if ($emacsen_startup ne '') { if (! -d "$TMP/etc/$dh{flavor}/site-start.d/") { doit("install","-d","$TMP/etc/$dh{flavor}/site-start.d/"); } - doit("install",$emacsen_startup,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); + doit("install","-m0644",$emacsen_startup,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); } if ($emacsen_install ne '' || $emacsen_remove ne '') { diff --git a/dh_installmanpages b/dh_installmanpages index 98386254..f4dca9a3 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -34,7 +34,7 @@ sub find_man { } # And file does think it's a real man page? - my $type=`file $_`; + my $type=`file -z $_`; if ($type !~ m/:.*roff/) { return; } -- cgit v1.2.3 From ba144b2f578ab3e94968c68b80044dde3e16501c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:10 +0000 Subject: r214: Initial Import --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 03df5b3b..4a201232 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.74) unstable; urgency=low + + * dh_installmanpages: recognizes gzipped man pages and installs them. + This is an experimental change, one problem is if your man page isn't + already gzip-9'd, it will be in violation of policy. (closes: #38673) + * The previous fix to dh_installemacsen was actually quite necessary - the + x bit was being set! + + -- Joey Hess Thu, 3 Jun 1999 15:14:27 -0700 + debhelper (1.2.73) unstable; urgency=low * dh_installemacsen: make sure files are installed mode 0644. Not strictly -- cgit v1.2.3 From 596417922fcedfa3e2cd4c74e517c36f8744d34d Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:17 +0000 Subject: r215: Initial Import --- debian/changelog | 7 +++++++ dh_installemacsen | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a201232..bc93c185 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.75) unstable; urgency=low + + * dh_installemacsen: fixed perms of install, remove scripts. + (closes: #39082) + + -- Joey Hess Mon, 7 Jun 1999 14:42:12 -0700 + debhelper (1.2.74) unstable; urgency=low * dh_installmanpages: recognizes gzipped man pages and installs them. diff --git a/dh_installemacsen b/dh_installemacsen index f271338f..462e3f38 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -24,14 +24,14 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install"); } - doit("install","-m0644",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"); + doit("install","-m0755",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"); } if ($emacsen_remove ne '') { if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") { doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove"); } - doit("install","-m0644","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); + doit("install","-m0755","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); } if ($emacsen_startup ne '') { -- cgit v1.2.3 From 013cc6ebcc3b3734498d61f056455d421f31f27a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:30 +0000 Subject: r216: Initial Import --- debian/changelog | 9 +++++++++ dh_fixperms | 21 +++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc93c185..a695ab83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (1.2.76) unstable; urgency=low + + * dh_fixperms: Do not use chmod/chown -R at all anymore, instead it uses + the (slower) find then chown method. Necessary because the -R methods will + happyily attempt to chown a dangling symlink, which makes them fail. + (Closes: #38911) + + -- Joey Hess Mon, 7 Jun 1999 20:20:01 -0700 + debhelper (1.2.75) unstable; urgency=low * dh_installemacsen: fixed perms of install, remove scripts. diff --git a/dh_fixperms b/dh_fixperms index 665becc3..e1ae6126 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -9,27 +9,20 @@ init(); foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); - # General permissions fixing. 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) { - doit("chown","-R","root.root",$TMP); - doit("chmod","-R","go=rX,u+rw,a-s",$TMP); - } - $find_options=""; } else { - # Do it the hard way. - complex_doit("find $TMP ! -type l ! \\( $dh{EXCLUDE_FIND} \\) -print0", - "2>/dev/null | xargs -0r chown root.root"); - complex_doit("find $TMP ! -type l ! \\( $dh{EXCLUDE_FIND} \\) -print0", - "2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s"); - $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; } + # General permissions fixing. + complex_doit("find $TMP ! -type l $find_options -print0", + "2>/dev/null | xargs -0r chown root.root"); + complex_doit("find $TMP ! -type l $find_options -print0", + "2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s"); + + # 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", -- cgit v1.2.3 From fa2a2d233b7de82a4c667eca3ff39110c4a0b6d3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:31 +0000 Subject: r217: Initial Import --- debian/changelog | 7 +++++++ examples/rules | 1 + examples/rules.indep | 1 + examples/rules.multi | 2 ++ 4 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index a695ab83..2d944aec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.77) unstable; urgency=low + + * dh_installpam: new program by Sean + * Wrote man page for same. + + -- Joey Hess Fri, 11 Jun 1999 13:08:04 -0700 + debhelper (1.2.76) unstable; urgency=low * dh_fixperms: Do not use chmod/chown -R at all anymore, instead it uses diff --git a/examples/rules b/examples/rules index 108e38cd..806092ca 100755 --- a/examples/rules +++ b/examples/rules @@ -49,6 +49,7 @@ binary-arch: build install dh_installexamples dh_installmenu # dh_installemacsen +# dh_installpam # dh_installinit dh_installcron dh_installmanpages diff --git a/examples/rules.indep b/examples/rules.indep index 34b78d89..688ba7f8 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -46,6 +46,7 @@ binary-indep: build install dh_installexamples dh_installmenu # dh_installemacsen +# dh_installpam # dh_installinit dh_installcron # dh_installmanpages diff --git a/examples/rules.multi b/examples/rules.multi index 6292b8aa..433c16fe 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -49,6 +49,7 @@ binary-indep: build install dh_installexamples -i dh_installmenu -i # dh_installemacsen -i +# dh_installpam -i # dh_installinit -i dh_installcron -i # dh_installmanpages -i @@ -73,6 +74,7 @@ binary-arch: build install dh_installexamples -a dh_installmenu -a # dh_installemacsen -a +# dh_installpam -a # dh_installinit -a dh_installcron -a dh_installmanpages -a -- cgit v1.2.3 From 79de8fbd7cecfca68e3cbef669cb3a2756318cc3 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:45 +0000 Subject: r218: Initial Import --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2d944aec..60ec3dd8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (1.2.78) unstable; urgency=low + + * Really include dh_installpam. + + -- Joey Hess Tue, 15 Jun 1999 09:00:36 -0700 + debhelper (1.2.77) unstable; urgency=low * dh_installpam: new program by Sean -- cgit v1.2.3 From 1245fb187e6f19f0a4c93d2d67fd13632e97a0e6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:45 +0000 Subject: r219: Initial Import --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 60ec3dd8..52ae7f35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.79) unstable; urgency=low + + * Added dh_perl by Raphael Hertzog . dh_perl handles + finding dependancies of perl scripts, plus deleting those annoying + .packlist files. + * I don't think dh_perl is going to be useful until the new version of + perl comes out. + + -- Joey Hess Thu, 24 Jun 1999 14:47:55 -0700 + debhelper (1.2.78) unstable; urgency=low * Really include dh_installpam. -- cgit v1.2.3 From e66a391f8008517c4c31873e9279a265aae0f180 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:15:51 +0000 Subject: r220: Initial Import --- debian/changelog | 7 +++++++ dh_perl | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 52ae7f35..8d402a73 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.80) unstable; urgency=low + + * Changed perl version detection. + * Changed call to find. + + -- Joey Hess Thu, 24 Jun 1999 16:48:53 -0700 + debhelper (1.2.79) unstable; urgency=low * Added dh_perl by Raphael Hertzog . dh_perl handles diff --git a/dh_perl b/dh_perl index 4136414f..c8aa6a01 100755 --- a/dh_perl +++ b/dh_perl @@ -7,8 +7,14 @@ BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); -my $perl = $ENV{'PERL'} || '/usr/bin/perl'; -$version=sprintf("%.3f", $]); +my $perl = $ENV{PERL} || '/usr/bin/perl'; + +# Figure out the version of perl. If $ENV{PERL} is set, query the perl binary +# it points to, otherwise query perl directly. +my $version=sprintf("%.3f", $]); +if (defined $ENV{PERL}) { + $version=`$ENV{PERL} -e 'printf "%.3f", \$]'`; +} foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); @@ -21,7 +27,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Look for perl modules and check where they are installed if (-d "$TMP/usr/lib/perl5") { - foreach $file (split(/\n/,`find $TMP/usr/lib/perl5 -type f -name "*.pm"`)) { + foreach $file (split(/\n/,`find $TMP/usr/lib/perl5 -type f \\( -name "*.pm" -or -name "*.so" \\)`)) { $found++; if ($file =~ m<^$TMP/usr/lib/perl5/(\d\.\d{3})/([^/]+)/>) { $v = $1; -- cgit v1.2.3 From 289f1de123932be984ef2a586cc792ae44332d29 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:02 +0000 Subject: r221: Initial Import --- debian/changelog | 7 +++++++ dh_installinit.1 | 7 ++++++- dh_link | 5 ++++- t/dh_link | 6 +++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8d402a73..e80107c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.81) unstable; urgency=low + + * dh_link: fixed bug #40159 and added a regression test for it. It was + failing if it was given absolute filenames. + + -- Joey Hess Fri, 25 Jun 1999 10:12:44 -0700 + debhelper (1.2.80) unstable; urgency=low * Changed perl version detection. diff --git a/dh_installinit.1 b/dh_installinit.1 index 5ec55fcd..cbb4b444 100644 --- a/dh_installinit.1 +++ b/dh_installinit.1 @@ -45,7 +45,12 @@ If not specified, "defaults" will be passed to .B \--init-script=scriptname Use "scriptname" as for the filename the init script is installed as in etc/init.d/ . This is useful if you need to have an init script with a name -different from the package's name. +different from the package's name. Note that if you use this parameter, +dh_installinit will look to see if a file in the debian/ directory exists +that looks like "scriptname" or "package.scriptname" and if so will install +it as the inist script in preference to the files it normally installs. This +feature is really only useful if you need a single package to install more +than one init script. .SH ENVIRONMENT See .BR debhelper (1) diff --git a/dh_link b/dh_link index f99aab73..919dc524 100755 --- a/dh_link +++ b/dh_link @@ -35,6 +35,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $dest=pop @links; $src=pop @links; + # Relivatize src and dest. + $src=~s:^/::; + $dest=~s:^/::; + # Make sure the directory the link will be in exists. $basedir=Dh_Lib::dirname("$TMP/$dest"); if (! -e $basedir) { @@ -50,7 +54,6 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Figure out how much of a path $src and $dest # share in common. for ($x=0; $x<$#src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {} - # Build up the new src. $src=""; for (1..$#dest_dirs - $x) { diff --git a/t/dh_link b/t/dh_link index 9f644e78..8c7bfeee 100644 --- a/t/dh_link +++ b/t/dh_link @@ -1,6 +1,6 @@ #!/usr/bin/perl use Test; -plan(tests => 3); +plan(tests => 4); # It used to not make absolute links in this situation, and it should. # #37774 @@ -14,3 +14,7 @@ ok("foo",readlink("debian/tmp/usr/bin/bar")); # ok, more complex relative links. system("./dh_link","usr/lib/1","usr/bin/2"); ok("../lib/1",readlink("debian/tmp/usr/bin/2")); + +# this was bug #40159. Absolute links passes to dh_link. +system("./dh_link","/etc/X11/dfm/system.dfmext","usr/share/dfm/dfmext"); +ok("/etc/X11/dfm/system.dfmext",readlink("debian/tmp/usr/share/dfm/dfmext")); -- 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(-) 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 db2831b1ccd9f2ecf064194724486367efcef4be Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:18 +0000 Subject: r223: Initial Import --- debian/changelog | 7 +++++++ examples/rules.indep | 3 +++ 2 files changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 04ba51a8..b4296a04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.83) unstable; urgency=medium + + * dh_perl: fixed substvars typo. Urgency medium since a lot of people will + be using this script RSN. + + -- Joey Hess Thu, 1 Jul 1999 11:44:05 -0700 + debhelper (1.2.82) unstable; urgency=low * dh_installinit: applied patch from Yann Dirson diff --git a/examples/rules.indep b/examples/rules.indep index 688ba7f8..b40281d9 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -5,6 +5,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# This is the debhelper compatability version to use. +export DH_COMPAT=1 + build: build-stamp build-stamp: dh_testdir -- cgit v1.2.3 From 84c6650150baff1dddc4205443995d75e1c0ec08 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:26 +0000 Subject: r224: Initial Import --- Dh_Lib.pm | 17 +++++++++++++++-- debhelper.1 | 8 ++++++++ debian/changelog | 10 ++++++++++ doc/PROGRAMMING | 4 ++++ doc/README | 7 +++++++ examples/rules | 3 +++ examples/rules.multi | 3 +++ 7 files changed, 50 insertions(+), 2 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 25174312..b7f281ba 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -187,14 +187,27 @@ sub dirname { my $fn=shift; return $fn; } +# Pass in a number, will return true iff the current compatability level +# is equal to that number. +sub compat { + my $num=shift; + + my $c=1; + if (defined $ENV{DH_COMPAT}) { + $c=$ENV{DH_COMPAT}; + } + + return ($c == $num); +} + # 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. sub tmpdir { my $package=shift; if ($dh{TMPDIR}) { return $dh{TMPDIR}; } - elsif ($package eq $dh{MAINPACKAGE}) { + elsif (compat(1) && $package eq $dh{MAINPACKAGE}) { + # This is for back-compatability with the debian/tmp tradition. return "debian/tmp"; } else { diff --git a/debhelper.1 b/debhelper.1 index 1562b2bf..6834594a 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -120,6 +120,14 @@ Here is the complete list of available debhelper commands. .I DH_VERBOSE Enables verbose mode. .TP +.I DH_COMPAT +Specifies what compatability level debhelper should run at. The default is 1, +which makes debhelper behave in a manner compatable with the 1.x series of +debhelper. If set to 2, debhelper's behavior will change to use the new +features of the 2.x series. Use this with caution, as the 2.x series makes +major changes that will break most packages. For documentation on these +changes, read /usr/doc/debhelper/v2 +.TP .I DH_NO_ACT Enables no-act mode. .TP diff --git a/debian/changelog b/debian/changelog index b4296a04..212c1ee5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.9.00) unstable; urgency=low + + * This is a release of debhelper in preparation for debhelper v2. + * doc/v2: added, documented status of v2 changes. + * README: mention doc/v2 + * debhelper.1: docuimented DH_COMPAT + * examples/*: added DH_COMAPT=1 to top of rules files + + -- Joey Hess Thu, 1 Jul 1999 13:16:41 -0700 + debhelper (1.2.83) unstable; urgency=medium * dh_perl: fixed substvars typo. Urgency medium since a lot of people will diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 4f071496..02b11a21 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -169,6 +169,10 @@ tmpdir() name of the tmp directory that will be used as this package's package build directory. Typically, this will be "debian/tmp" or "debian/package". +compat() + Pass this command a number, and if the current compatability level + equals that number, it will return true. Looks at DH_COMPAT to get + the compatability level. pkgfile() Pass this command the name of a binary package, and the base name of a file, and it will return the actual filename to use. This is used diff --git a/doc/README b/doc/README index 7ba69863..ff43553e 100644 --- a/doc/README +++ b/doc/README @@ -12,6 +12,13 @@ various debhelper scripts in (though other variations are possible). For a more gentle introduction, the maint-guide debian package contains a tutorial about making your first package using Debhelper. +Debhelper v2: +------------ + +Debhelper v2 is a major new version of Debhelper, still under development. +Debhelper will continue to work in v1 compatability mode for now, if you're +interested in trying the new versiln, read the file named "v2". + Starting a new package: ---------------------- diff --git a/examples/rules b/examples/rules index 806092ca..5e805edb 100755 --- a/examples/rules +++ b/examples/rules @@ -4,6 +4,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# This is the debhelper compatability version to use. +export DH_COMPAT=1 + build: build-stamp build-stamp: dh_testdir diff --git a/examples/rules.multi b/examples/rules.multi index 433c16fe..7a609e6c 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -7,6 +7,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# This is the debhelper compatability version to use. +export DH_COMPAT=1 + build: build-stamp build-stamp: dh_testdir -- cgit v1.2.3 From 44c5b3d589c31d7d03e6b4de8fd72f260eebbe93 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:26 +0000 Subject: r225: Initial Import --- debhelper.1 | 7 ++++--- debian/changelog | 17 +++++++++++++++++ debian/rules | 23 +++++++++++++---------- dh_debstd | 3 +++ doc/v2 | 2 +- t/dh_link | 8 ++++---- 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/debhelper.1 b/debhelper.1 index 6834594a..438c9505 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -94,7 +94,8 @@ for an example of how to use this. By default, all debhelper programs assume that the temporary directory used for assembling the tree of files in a package is debian/tmp for the first package listed in debian/control, and debian/ for each -additional package. +additional package. If DH_COMPAT=2, debian/ is always used, +even for the first package. .P Sometimes, you might want to use some other temporary directory. This is supported by the @@ -109,9 +110,9 @@ binary package the debhelper program will act on. .B Other notes In general, if any debhelper program needs a directory to exist under debian/, it will create it. I haven't bothered to document this in all the -man pages, but for example, dh_installdeb knows to make debian/tmp/DEBIAN/ +man pages, but for example, dh_installdeb knows to make debian//DEBIAN/ before trying to put files there, dh_installmenu knows you need a -debian/tmp/usr/lib/menu/ before installing the menu files, etc. +debian//usr/lib/menu/ before installing the menu files, etc. .SH "DEBHELPER COMMANDS" Here is the complete list of available debhelper commands. #LIST# diff --git a/debian/changelog b/debian/changelog index 212c1ee5..fb1a04f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +debhelper (2.0.00) unstable; urgency=low + + * Don't let the version number fool you. Debhelper v2 is here, but just + barely. That's what all the zero's mean. :-) + * If DH_COMPAT=2, then debian/ will be used for the temporary + build directory for all packages. debian/tmp is no more! (Well, except + dh_movefiles still uses it.) + * debhelper.1: documented this. + * Dh_lib.pm: added compat(), pass in a number, it returns true if the + current compatability level is equal to that number. + * doc/PROGRAMMING: documented that. + * debhelper itself now builds using DH_COMPAT=2. + * dh_debstd forces DH_COMPAT=1, because it needs to stay compatable with + debstd after all. + + -- Joey Hess Thu, 1 Jul 1999 13:37:58 -0700 + debhelper (1.9.00) unstable; urgency=low * This is a release of debhelper in preparation for debhelper v2. diff --git a/debian/rules b/debian/rules index 8a4ee355..d0d8ed05 100755 --- a/debian/rules +++ b/debian/rules @@ -7,6 +7,9 @@ # be sure to use the new templates from this package. export DH_AUTOSCRIPTDIR=autoscripts +# Living dangerously :-) +export DH_COMPAT=2 + # Figure out the current debhelper version. VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)') @@ -23,8 +26,8 @@ clean: test: ./dh_clean - perl -MTest::Harness -e 'runtests @ARGV' t/* - -rm -rf debian/tmp + DH_VERSION=10 perl -MTest::Harness -e 'runtests @ARGV' t/* + ./dh_clean # Build architecture-dependent files here. binary-arch: build @@ -37,11 +40,11 @@ binary-indep: build ./dh_clean -k ./dh_installdirs usr/bin usr/lib/debhelper - echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm + echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/debhelper/usr/lib/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ - -exec install -p {} debian/tmp/usr/bin \; - cp -a Dh_*.pm debian/tmp/usr/lib/debhelper - cp -a autoscripts debian/tmp/usr/lib/debhelper + -exec install -p {} debian/debhelper/usr/bin \; + cp -a Dh_*.pm debian/debhelper/usr/lib/debhelper + cp -a autoscripts debian/debhelper/usr/lib/debhelper ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd ./dh_installexamples examples/* @@ -61,7 +64,7 @@ binary-indep: build open (OUT,">$$f"); \ print OUT @lines; \ close OUT; \ - }' debian/tmp/usr/man/man1/*.1 + }' debian/debhelper/usr/man/man1/*.1 # Fix up the debhelper.1 man page, substituting in a list of all # debhelper commands. eek! perl -ne ' \ @@ -69,10 +72,10 @@ binary-indep: build $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \ close(ARGV) if eof; \ END { \ - open(I,"debian/tmp/usr/man/man1/debhelper.1"); \ + open(I,"debian/debhelper/usr/man/man1/debhelper.1"); \ @lines=; \ close I; \ - open(O,">debian/tmp/usr/man/man1/debhelper.1"); \ + open(O,">debian/debhelper/usr/man/man1/debhelper.1"); \ foreach (@lines) { \ s/#LIST#/$$collect/; \ print O; \ @@ -80,7 +83,7 @@ binary-indep: build close O; \ }' *.1 ./dh_installchangelogs - ./dh_movefiles +# ./dh_movefiles ./dh_link ./dh_compress ./dh_fixperms diff --git a/dh_debstd b/dh_debstd index 2a557ec9..1c2f1f05 100755 --- a/dh_debstd +++ b/dh_debstd @@ -10,6 +10,9 @@ # This has been gutted and extensively rewritten to function as a debhelper # command by Joey Hess. And then completly rewritten in perl. +# Need to stay compatable with debstd, so force use of level 1. +$ENV{DH_COMAPT}=1; + # Pre-parse command line before we load Dh_lib, becuase we use a # different style of arguments. @argv=(); diff --git a/doc/v2 b/doc/v2 index 4889c398..4db20d5a 100644 --- a/doc/v2 +++ b/doc/v2 @@ -10,7 +10,7 @@ prior discussion on debian-devel. Items marked with a + are done. All others will happen as soon as I can code them. -* Standardize on the name used for the temporary build directory of a ++ Standardize on the name used for the temporary build directory of a package. Currently it's debian/tmp/ for the first package and debian// for other packages of a multi-binary package. I've decided after much agonizing to to use debian/. The main thing this diff --git a/t/dh_link b/t/dh_link index 8c7bfeee..1e210558 100644 --- a/t/dh_link +++ b/t/dh_link @@ -5,16 +5,16 @@ plan(tests => 4); # It used to not make absolute links in this situation, and it should. # #37774 system("./dh_link","etc/foo","usr/lib/bar"); -ok("/etc/foo",readlink("debian/tmp/usr/lib/bar")); +ok("/etc/foo",readlink("debian/debhelper/usr/lib/bar")); # let's make sure it makes simple relative links ok. system("./dh_link","usr/bin/foo","usr/bin/bar"); -ok("foo",readlink("debian/tmp/usr/bin/bar")); +ok("foo",readlink("debian/debhelper/usr/bin/bar")); # ok, more complex relative links. system("./dh_link","usr/lib/1","usr/bin/2"); -ok("../lib/1",readlink("debian/tmp/usr/bin/2")); +ok("../lib/1",readlink("debian/debhelper/usr/bin/2")); # this was bug #40159. Absolute links passes to dh_link. system("./dh_link","/etc/X11/dfm/system.dfmext","usr/share/dfm/dfmext"); -ok("/etc/X11/dfm/system.dfmext",readlink("debian/tmp/usr/share/dfm/dfmext")); +ok("/etc/X11/dfm/system.dfmext",readlink("debian/debhelper/usr/share/dfm/dfmext")); -- cgit v1.2.3 From a9572589e2be59827e115360cb3139eb814fb880 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:37 +0000 Subject: r226: Initial Import --- Dh_Lib.pm | 8 +++++++- debian/changelog | 6 ++++++ debian/rules | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index b7f281ba..73fd44ad 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -15,6 +15,8 @@ use vars qw(@ISA @EXPORT %dh); &xargs %dh); +my $max_compat=2; + sub init { # If DH_OPTIONS is set, prepend it @ARGV. if (defined($ENV{DH_OPTIONS})) { @@ -196,7 +198,11 @@ sub compat { if (defined $ENV{DH_COMPAT}) { $c=$ENV{DH_COMPAT}; } - + + if ($c > $max_compat) { + error("Sorry, but $max_compat is the highest compatability level of debhelper currently supported."); + } + return ($c == $num); } diff --git a/debian/changelog b/debian/changelog index fb1a04f0..f66f96c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.01) unstable; urgency=low + + * Actually include doc/v2 this time round. + + -- Joey Hess Thu, 1 Jul 1999 14:01:55 -0700 + debhelper (2.0.00) unstable; urgency=low * Don't let the version number fool you. Debhelper v2 is here, but just diff --git a/debian/rules b/debian/rules index d0d8ed05..5fcf25f3 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ binary-indep: build cp -a Dh_*.pm debian/debhelper/usr/lib/debhelper cp -a autoscripts debian/debhelper/usr/lib/debhelper - ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd + ./dh_installdocs doc/* ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages -- cgit v1.2.3 From 4a795d1822c682a578328553b9e072c1b8e3b1e9 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:42 +0000 Subject: r227: Initial Import --- debian/changelog | 10 ++++++++++ debian/control | 2 +- debian/rules | 2 ++ doc/v2 | 8 +++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f66f96c3..1ef02943 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (2.0.02) unstable; urgency=low + + * If you're going to use v2, it's reccommended you call + "dh_testversion 2". Added a note about that to doc/v2. + * Dh_Lib.pm compat: if a version that is greater than the highest + supported compatability level is specified, abort with an error. Perhaps + there will be a debhelper v3 some day... + + -- Joey Hess Thu, 1 Jul 1999 14:08:14 -0700 + debhelper (2.0.01) unstable; urgency=low * Actually include doc/v2 this time round. diff --git a/debian/control b/debian/control index 3f546b8e..45834e1b 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 2.5.1.0 Package: debhelper Architecture: all -Depends: perl (>= 5.004), fileutils (>= 3.16-4), file +Depends: perl (>= 5.004), fileutils (>= 3.16-4), file (>= 3.23-1) Suggests: dh-make Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to diff --git a/debian/rules b/debian/rules index 5fcf25f3..e1f8d237 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,8 @@ # 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.pm and the current Dh_getopt.pm in this debian/ directory. +# +# This is _not_ a good example of a debhelper rules file. # If any automatic script generation is done in building this package, # be sure to use the new templates from this package. diff --git a/doc/v2 b/doc/v2 index 4db20d5a..b120d036 100644 --- a/doc/v2 +++ b/doc/v2 @@ -3,7 +3,13 @@ being worked on, and will change in drastic ways without notice. To keep this from breaking packages, debhelper will continue to operate in v1 compatability mode by default. -To enable debhelper v2 features (do this with *caution*), set DH_COMPAT=2 +To enable debhelper v2 features (do this with *caution*), set DH_COMPAT=2 in +your debian/rules. Also, it is a very good idea to add a call to your +debian/rules like this: + dh_testversion 2 +To ensure that your package won't be built with some old version of +debhelper that ignores the DH_COMPAT flag. + Here are the changes I'm planning to make to debhelper for v2, based on prior discussion on debian-devel. -- cgit v1.2.3 From 638b3dcc6f795a817a0fca1104af86ed8152bc38 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:48 +0000 Subject: r228: Initial Import --- debian/changelog | 7 +++++++ dh_perl.1 | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1ef02943..0ae47f80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (2.0.03) unstable; urgency=low + + * Depend on file >= 2.23-1, because dh_perl uses file -b, introduced at + that version. (Closes: #40589) + + -- Joey Hess Thu, 1 Jul 1999 14:41:12 -0700 + debhelper (2.0.02) unstable; urgency=low * If you're going to use v2, it's reccommended you call diff --git a/dh_perl.1 b/dh_perl.1 index f1277b0b..2d23bcb7 100644 --- a/dh_perl.1 +++ b/dh_perl.1 @@ -1,9 +1,9 @@ -.TH DH_PERLCHECK 1 "22 June 1999" "Debhelper Commands" "Debhelper Commands" +.TH DH_PERL 1 "22 June 1999" "Debhelper Commands" "Debhelper Commands" .SH NAME dh_perl \- calculates perl scripts & modules dependencies .SH SYNOPSIS .B dh_perl -.I "[debhelper options] [-k]" +.I "[debhelper options] [-k] [-d]" .SH "DESCRIPTION" dh_perl is a debhelper program that is responsible for generating the perl:Depends substitutions and adding them to substvars files. @@ -28,6 +28,14 @@ for a list of options common to all debhelper commands. .TP .B -k Keep .packlist files. +.TP +.B -d +In some specific cases you may want to depend on a -base package +(ie perl-5.00X-base or perl5-base). If so, you can pass +the -d option to make +.BR dh_perl +generate a dependency on the correct base package. This is only necessary +for some modules that are included in the base system. .SH ENVIRONMENT See .BR debhelper (1) -- cgit v1.2.3 From b56939b95e6f1efab433eba09ce5cb6020df1436 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:53 +0000 Subject: r229: Initial Import --- debian/changelog | 8 ++++++++ dh_clean | 2 ++ dh_perl | 12 ++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0ae47f80..20e02dc9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (2.0.04) unstable; urgency=low + + * Patch from Raphael Hertzog to make dh_perl support a + -d flag that makes it add a dependancy on the sppropriate perl-XXX-base + package. Few packages will really need this. (Closes: #40631) + + -- Joey Hess Fri, 2 Jul 1999 11:22:00 -0700 + debhelper (2.0.03) unstable; urgency=low * Depend on file >= 2.23-1, because dh_perl uses file -b, introduced at diff --git a/dh_clean b/dh_clean index 9ffb7437..a328d12e 100755 --- a/dh_clean +++ b/dh_clean @@ -42,3 +42,5 @@ if (! $dh{D_FLAG}) { -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) ) -exec rm -f {} ;")); } + +doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp'; diff --git a/dh_perl b/dh_perl index d66dfce5..0614b9b8 100755 --- a/dh_perl +++ b/dh_perl @@ -8,6 +8,7 @@ use Dh_Lib; init(); my $perl = $ENV{PERL} || '/usr/bin/perl'; +my $ext = ''; # Figure out the version of perl. If $ENV{PERL} is set, query the perl binary # it points to, otherwise query perl directly. @@ -16,6 +17,10 @@ if (defined $ENV{PERL}) { $version=`$ENV{PERL} -e 'printf "%.3f", \$]'`; } +# If -d is given, then we'll try to depend on one of the perl-5.00X-base +# package instead of perl-5.00X +$ext='-base' if ($dh{'D_FLAG'}); + foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $EXT=pkgext($PACKAGE); @@ -33,7 +38,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $v = $1; $arch = $2; check_module_version ($v, $version); - $v .= '-thread' if ($arch =~ /-thread/); + $v .= '-thread' if ($arch =~ /-thread/); $dep_arch = add_deps ($dep_arch, "perl-$v"); } elsif ($file =~ m<^$TMP/usr/lib/perl5/(\d.\d{3})/>) { $v = $1; @@ -44,7 +49,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } if ($found and not $dep_arch) { - $dep = "perl5"; + $dep = "perl5$ext"; } elsif ($dep_arch) { $dep = $dep_arch; } @@ -90,6 +95,9 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { sub add_deps { my ($dep, $new) = @_; + # If the $new-base package can exist then add $ext to $new + $new = "$new$ext" if ($new =~ m/^(?:perl5|perl-\d\.\d{3})$/); + # If $new = perl5 or perl5-thread check if perl-X.XXX(-thread)? # is not already in the dependencies if ($new eq "perl5") { -- cgit v1.2.3 From f61b5eebf802cb446a935e595c8a3e962ada66fa Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:54 +0000 Subject: r230: Initial Import --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 20e02dc9..f8e4f45d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (2.0.05) unstable; urgency=low + + * dh_clean: clean debian/tmp even if v2 is being used. If you're + using dh_movefiles, stuff may well be left in there, and it needs to be + cleaned up. + + -- Joey Hess Sat, 3 Jul 1999 13:23:46 -0700 + debhelper (2.0.04) unstable; urgency=low * Patch from Raphael Hertzog to make dh_perl support a -- cgit v1.2.3 From 92a3a307c88b231be4981ca4e76e85c515727a75 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:06 +0000 Subject: r231: Initial Import --- debian/changelog | 7 +++++++ debian/control | 2 +- examples/rules.indep | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f8e4f45d..1556aebc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (2.0.06) unstable; urgency=low + + * Now depends on perl5 | perl, I'll kill the | perl bit later on, but it + seems to make sense for the transition. + + -- Joey Hess Sun, 4 Jul 1999 10:56:03 -0700 + debhelper (2.0.05) unstable; urgency=low * dh_clean: clean debian/tmp even if v2 is being used. If you're diff --git a/debian/control b/debian/control index 45834e1b..7dc9496c 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 2.5.1.0 Package: debhelper Architecture: all -Depends: perl (>= 5.004), fileutils (>= 3.16-4), file (>= 3.23-1) +Depends: perl5 | perl (>= 5.004), fileutils (>= 3.16-4), file (>= 3.23-1) Suggests: dh-make Description: helper programs for debian/rules A collection of programs that can be used in a debian/rules file to diff --git a/examples/rules.indep b/examples/rules.indep index b40281d9..748fb629 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -61,6 +61,7 @@ binary-indep: build install # You may want to make some executables suid here. dh_suidregister dh_installdeb +# dh_perl dh_gencontrol dh_md5sums dh_builddeb -- cgit v1.2.3 From c5cca23df59c38a414d7b8ef4725f0533723d77c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:11 +0000 Subject: r232: Initial Import --- debian/changelog | 6 ++++++ dh_md5sums | 2 +- dh_movefiles | 6 +++--- examples/rules | 1 + examples/rules.multi | 2 ++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1556aebc..c5b997d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.07) unstable; urgency=low + + * Added dh_perl calls to example rules files. + + -- Joey Hess Sun, 4 Jul 1999 15:57:51 -0700 + debhelper (2.0.06) unstable; urgency=low * Now depends on perl5 | perl, I'll kill the | perl bit later on, but it diff --git a/dh_md5sums b/dh_md5sums index 2b626292..8015df79 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -34,7 +34,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } $olddir=getcwd(); - complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir"); + complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null"); # If the file's empty, no reason to waste inodes on it. if (-z "$TMP/DEBIAN/md5sums") { doit("rm","-f","$TMP/DEBIAN/md5sums"); diff --git a/dh_movefiles b/dh_movefiles index 2ed8e376..09159d3b 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -59,15 +59,15 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $file=$_; $ret=1 if (! -e $file && ! -l $file); $file=~s:^$sourcedir/+::; - complex_doit("(cd $sourcedir ; find $file ! -type d -and ! -type l -print || true) >> movelist"); + complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -and ! -type l -print || true) >> movelist"); } foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); $file=~s:^$sourcedir/+::; - complex_doit("(cd $sourcedir ; find $file ! -type d -and -type l -print || true) >> movelist"); + complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -and -type l -print || true) >> movelist"); } - complex_doit("(cd $sourcedir;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"); + complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP >/dev/null ;tar xpf -)"); doit("rm","-f","movelist"); } } diff --git a/examples/rules b/examples/rules index 5e805edb..5ad68924 100755 --- a/examples/rules +++ b/examples/rules @@ -66,6 +66,7 @@ binary-arch: build install dh_suidregister # dh_makeshlibs dh_installdeb +# dh_perl dh_shlibdeps dh_gencontrol dh_md5sums diff --git a/examples/rules.multi b/examples/rules.multi index 7a609e6c..034a4514 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -64,6 +64,7 @@ binary-indep: build install # You may want to make some executables suid here. dh_suidregister -i dh_installdeb -i +# dh_perl -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i @@ -91,6 +92,7 @@ binary-arch: build install dh_suidregister -a dh_installdeb -a # dh_makeshlibs -a +# dh_perl -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a -- cgit v1.2.3 From fb9f474eafd007c272a895b932c74ca9c2c7da45 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:19 +0000 Subject: r233: Initial Import --- debian/changelog | 7 +++++++ dh_compress | 4 ++-- dh_compress.1 | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index c5b997d1..d90dcbed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (2.0.08) unstable; urgency=low + + * dh_*: redirect cd output to /den/null, because CD can actually output + things if CDPATH is set. + + -- Joey Hess Tue, 6 Jul 1999 10:14:00 -0700 + debhelper (2.0.07) unstable; urgency=low * Added dh_perl calls to example rules files. diff --git a/dh_compress b/dh_compress index 1c1badeb..47e2ced2 100755 --- a/dh_compress +++ b/dh_compress @@ -37,8 +37,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # extentions. ".gz", ".z", ".taz", ".tgz", "-gz", "-z", "_z" push @files, split(/\n/,` - 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*" \\) \\ + find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/share/X11*/man -type f ! -name "*.gz" 2>/dev/null || true; + find usr/doc usr/share/doc -type f \\( -size +4k -or -name "changelog*" \\) \\ ! -name "*.htm*" ! -name "*.gif" ! -iname "*.gz" \\ ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\ ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\ diff --git a/dh_compress.1 b/dh_compress.1 index 77cd68f9..66f20122 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -27,8 +27,8 @@ Here is a sample debian/compress file that causes dh_compress to compress the same files as it would by default. This is a good starting point for customization of what files are compressed: .PP - find usr/info usr/man usr/X11*/man -type f - find usr/doc -type f \\ + find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/share/X11*/man -type f + find usr/doc usr/share/doc -type f \\ \\( -size +4k -or -name "changelog*" \\) \\ ! -name "*.htm*" ! -name "*.gif" ! -iname "*.gz" \\ ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\ -- cgit v1.2.3 From d970cce90a561feb9d92234d18ca72331c16444a Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:26 +0000 Subject: r234: Initial Import --- debian/changelog | 9 +++++++++ dh_compress | 5 +++-- dh_compress.1 | 5 +++-- dh_installchangelogs | 2 ++ dh_installchangelogs.1 | 3 ++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index d90dcbed..53242d0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (2.0.09) unstable; urgency=low + + * dh_compress: added some FHS support. Though debhelper doesn't put stuff + there (and won't until people come up with a general transition strategy or + decide to not have a clean transiotion), dh_compress now compresses + various files in /usr/share/{man,doc,info}. (Closes: #40892) + + -- Joey Hess Wed, 7 Jul 1999 09:55:03 -0700 + debhelper (2.0.08) unstable; urgency=low * dh_*: redirect cd output to /den/null, because CD can actually output diff --git a/dh_compress b/dh_compress index 47e2ced2..73b12ba6 100755 --- a/dh_compress +++ b/dh_compress @@ -37,9 +37,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # extentions. ".gz", ".z", ".taz", ".tgz", "-gz", "-z", "_z" push @files, split(/\n/,` - find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/share/X11*/man -type f ! -name "*.gz" 2>/dev/null || true; + find usr/info usr/share/info usr/man usr/share/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true; find usr/doc usr/share/doc -type f \\( -size +4k -or -name "changelog*" \\) \\ - ! -name "*.htm*" ! -name "*.gif" ! -iname "*.gz" \\ + \\( -name changelog.html -or ! -name "*.htm*" \\) \\ + ! -name "*.gif" ! -iname "*.gz" \\ ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\ ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\ ! -name "copyright" 2>/dev/null || true diff --git a/dh_compress.1 b/dh_compress.1 index 66f20122..b0eba3ea 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -27,10 +27,11 @@ Here is a sample debian/compress file that causes dh_compress to compress the same files as it would by default. This is a good starting point for customization of what files are compressed: .PP - find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/share/X11*/man -type f + find usr/info usr/share/info usr/man usr/share/man usr/X11*/man -type f find usr/doc usr/share/doc -type f \\ \\( -size +4k -or -name "changelog*" \\) \\ - ! -name "*.htm*" ! -name "*.gif" ! -iname "*.gz" \\ + \\( -name changelog.html -or ! -name "*.htm*" \\) \\ + ! -name "*.gif" ! -iname "*.gz" \\ ! -iname "*.taz" ! -iname "*.tgz" ! -iname "*.z" \\ ! -name "copyright" .SH OPTIONS diff --git a/dh_installchangelogs b/dh_installchangelogs index 877aa822..4be52020 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -47,6 +47,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # HTML changelog doit("install","-o","root","-g","root","-p","-m644", $upstream,"$TMP/usr/doc/$PACKAGE/changelog.html"); + doit("ln", "-sf", 'changelog.html', + "$TMP/usr/doc/$PACKAGE/changelog"); } else { doit("install","-o","root","-g","root","-p","-m644", diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 436ba947..b346eef7 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -19,7 +19,8 @@ If an upstream changelog file is specified as an option, and the package is not a native debian package, then this upstream changelog will be installed as usr/doc/package/changelog in the package build directory. If the changelog is a html file (determined by file extention), it will be -installed as usr/doc/package/changelog.html instead. +installed as usr/doc/package/changelog.html instead (with a link to +usr/doc/package/changelog). .SH OPTIONS .TP .B debhelper options -- cgit v1.2.3 From 77ec5eed71bb5dc83dbfa856a586ce15614c6cc6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:35 +0000 Subject: r235: Initial Import --- debian/changelog | 10 ++++++++++ dh_compress.1 | 2 +- doc/TODO | 2 -- examples/rules.indep | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 53242d0c..0e1bea1c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (2.0.10) unstable; urgency=low + + * dh_compress: compress changelog.html files. (Closes: #40626) + * dh_installchangelogs: installs a link from changelog.html.gz to changelog.gz, + because I think it's important that upstream changelogs always be accessable + at that name. + * dh_compress: removed the usr/share/X11R6/man bit. Note part of FHS. + + -- Joey Hess Wed, 7 Jul 1999 10:46:03 -0700 + debhelper (2.0.09) unstable; urgency=low * dh_compress: added some FHS support. Though debhelper doesn't put stuff diff --git a/dh_compress.1 b/dh_compress.1 index b0eba3ea..bab5c199 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -68,6 +68,6 @@ for a list of environment variables that affect all debhelper commands. .SH BUGS Filenames with spaces in them may not properly be compressed. .SH "CONFORMS TO" -Debian policy, version 2.5.0.0 +Debian policy, version 3.0.0.0 .SH AUTHOR Joey Hess diff --git a/doc/TODO b/doc/TODO index 75006f05..e3b999bc 100644 --- a/doc/TODO +++ b/doc/TODO @@ -6,8 +6,6 @@ Wishlist items: * Make dh_* "use strict". * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). -* info support for debhelper (currently implemented, but I hate how I did it, - so it's not in the package.) (#15717) * enhance dh_installmanpages so it associates binaries and man pages and installs the man pages into the correct areas to suit the binaries they document. I may need to make this only happen when a switch is given, to diff --git a/examples/rules.indep b/examples/rules.indep index 748fb629..e8a2b5d5 100755 --- a/examples/rules.indep +++ b/examples/rules.indep @@ -53,6 +53,7 @@ binary-indep: build install # dh_installinit dh_installcron # dh_installmanpages + dh_installinfo # dh_undocumented dh_installchangelogs dh_link -- cgit v1.2.3 From a0061c2bdf1020c3475604422755eabd3a46da76 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:43 +0000 Subject: r236: Initial Import --- debian/changelog | 7 +++++++ debian/rules | 1 + dh_installinfo | 2 +- examples/rules | 1 + examples/rules.multi | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0e1bea1c..0906c8d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (2.0.11) unstable; urgency=low + + * At long, long last, dh_installinfo is written. It takes a simple list of + info files and figures out the rest for you. (Closes: #15717) + + -- Joey Hess Wed, 7 Jul 1999 17:04:48 -0700 + debhelper (2.0.10) unstable; urgency=low * dh_compress: compress changelog.html files. (Closes: #40626) diff --git a/debian/rules b/debian/rules index e1f8d237..ef833d1c 100755 --- a/debian/rules +++ b/debian/rules @@ -52,6 +52,7 @@ binary-indep: build ./dh_installexamples examples/* ./dh_installmenu ./dh_installmanpages + ./dh_installinfo # Fix up all man pages, filling in the modification time for them. # Note this runs beofre the command below so debhelper.1 gets the right # date on it. diff --git a/dh_installinfo b/dh_installinfo index b6ae40f9..20d5e003 100755 --- a/dh_installinfo +++ b/dh_installinfo @@ -49,7 +49,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if ($section ne '') { autoscript($PACKAGE,"postinst","postinst-info", - "s/#SECTION#/$section/;s:#FILE#:$fn:"); + "s/#SECTION#/$section/g;s:#FILE#:$fn:"); } else { autoscript($PACKAGE,"postinst","postinst-info-nosection", diff --git a/examples/rules b/examples/rules index 5ad68924..78cfed49 100755 --- a/examples/rules +++ b/examples/rules @@ -56,6 +56,7 @@ binary-arch: build install # dh_installinit dh_installcron dh_installmanpages + dh_installinfo # dh_undocumented dh_installchangelogs dh_link diff --git a/examples/rules.multi b/examples/rules.multi index 034a4514..7329437a 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -56,6 +56,7 @@ binary-indep: build install # dh_installinit -i dh_installcron -i # dh_installmanpages -i + dh_installinfo -i # dh_undocumented dh_installchangelogs -i dh_link -i @@ -82,6 +83,7 @@ binary-arch: build install # dh_installinit -a dh_installcron -a dh_installmanpages -a + dh_installinfo -a # dh_undocumented dh_installchangelogs -a dh_strip -a -- cgit v1.2.3 From 5481b20fd42cd413c6c87531a3cc9ed5398e9d23 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:17:53 +0000 Subject: r237: Initial Import --- debian/changelog | 6 ++++++ dh_fixperms | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0906c8d5..ec5c5058 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.12) unstable; urgency=low + + * dh_installinfo: fixed #SECTION# substitution. + + -- Joey Hess Wed, 7 Jul 1999 17:51:59 -0700 + debhelper (2.0.11) unstable; urgency=low * At long, long last, dh_installinfo is written. It takes a simple list of diff --git a/dh_fixperms b/dh_fixperms index e1ae6126..f74a269c 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -25,13 +25,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # 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", + complex_doit("find $TMP/usr/share/doc $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", + complex_doit("find $TMP/usr/share/doc $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", + complex_doit("find $TMP/usr/share/man $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 -- 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(-) 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 From 1bfed6299ebbb344a756bf1eae47aea4d93499eb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:16 +0000 Subject: r239: Initial Import --- debian/changelog | 11 +++++++++++ debian/rules | 8 ++++---- dh_clean | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index d8ced366..b9f9ba52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +debhelper (2.0.14) unstable; urgency=low + + * Moved /usr/lib/debhelper to /usr/share/debhelper for FHS compliance + (#41174). If you used Dh_lib or something in another package, be sure to + update your "use" line and declare an appropriate dependancy. (Closes: + #41174) + * dh_installxaw: Patch from Josip Rodin to fix + multiple-stanza xaw file support. (Closes: #41173) + + -- Joey Hess Mon, 12 Jul 1999 11:49:57 -0700 + debhelper (2.0.13) unstable; urgency=low * dh_fixperms: FHS fixes (#41058) diff --git a/debian/rules b/debian/rules index ef833d1c..68d6eb05 100755 --- a/debian/rules +++ b/debian/rules @@ -40,13 +40,13 @@ binary-indep: build ./dh_testdir ./dh_testroot ./dh_clean -k - ./dh_installdirs usr/bin usr/lib/debhelper + ./dh_installdirs usr/bin usr/share/debhelper - echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/debhelper/usr/lib/debhelper/Dh_Version.pm + echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/debhelper/usr/share/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/debhelper/usr/bin \; - cp -a Dh_*.pm debian/debhelper/usr/lib/debhelper - cp -a autoscripts debian/debhelper/usr/lib/debhelper + cp -a Dh_*.pm debian/debhelper/usr/share/debhelper + cp -a autoscripts debian/debhelper/usr/share/debhelper ./dh_installdocs doc/* ./dh_installexamples examples/* diff --git a/dh_clean b/dh_clean index e87688de..8ba45d3a 100755 --- a/dh_clean +++ b/dh_clean @@ -43,4 +43,4 @@ if (! $dh{D_FLAG}) { ) -exec rm -f {} ;")); } -doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp'; +doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1); -- cgit v1.2.3 From d950296f8b54c6e10ea39a00ee6cfa32ab7545bb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:22 +0000 Subject: r240: Initial Import --- Dh_Lib.pm | 4 ++-- debian/changelog | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Dh_Lib.pm b/Dh_Lib.pm index c5146b91..e74e8ccb 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -228,10 +228,10 @@ sub tmpdir { my $package=shift; # the main package, it will look for debian/foo, and if found, return that. # Failing that, it will return nothing. sub pkgfile { my $package=shift; my $filename=shift; - if (-e "debian/$package.$filename") { + if (-f "debian/$package.$filename") { return "debian/$package.$filename"; } - elsif ($package eq $dh{MAINPACKAGE} && -e "debian/$filename") { + elsif ($package eq $dh{MAINPACKAGE} && -f "debian/$filename") { return "debian/$filename"; } return ""; diff --git a/debian/changelog b/debian/changelog index b9f9ba52..cfe8937b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (2.0.15) unstable; urgency=low + + * dh_clean: only force-remove debian/tmp if in v2 mode. In v1 mode, we + shouldn't remove it because we may only be acting on a single package. + (Closes: #41689) + + -- Joey Hess Tue, 20 Jul 1999 19:00:15 -0700 + debhelper (2.0.14) unstable; urgency=low * Moved /usr/lib/debhelper to /usr/share/debhelper for FHS compliance -- cgit v1.2.3 From b7e14a5eff72fffb13f5d58a81d7974671079671 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:27 +0000 Subject: r241: Initial Import --- debian/changelog | 9 +++++++++ dh_clean | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index cfe8937b..b26eb15f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (2.0.16) unstable; urgency=low + + * Dh_lib.pm: when looking for debhelper files in debian/, test with -f, + not with -e, because it might fail if you're building a package named, + say, 'docs', with a temp dir of debian/docs. I don't anticipate this + ever happenning, but it pays to be safe. + + -- Joey Hess Tue, 20 Jul 1999 21:00:04 -0700 + debhelper (2.0.15) unstable; urgency=low * dh_clean: only force-remove debian/tmp if in v2 mode. In v1 mode, we diff --git a/dh_clean b/dh_clean index 8ba45d3a..9c6f4f3d 100755 --- a/dh_clean +++ b/dh_clean @@ -43,4 +43,4 @@ if (! $dh{D_FLAG}) { ) -exec rm -f {} ;")); } -doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1); +doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! Dh_Lib::compat(1); -- cgit v1.2.3 From 1a5315595b2f06feab10168825442f651cb11947 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:44 +0000 Subject: r242: Initial Import --- debian/changelog | 6 ++++++ dh_installinfo | 4 ++-- dh_installxaw | 8 ++++---- dh_perl | 23 ++++++++++++++++++----- dh_perl.1 | 10 +++++++++- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index b26eb15f..784b3ca3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.17) unstable; urgency=low + + * dh_clean: compat() wasn't exported. + + -- Joey Hess Wed, 21 Jul 1999 12:49:52 -0700 + debhelper (2.0.16) unstable; urgency=low * Dh_lib.pm: when looking for debhelper files in debian/, test with -f, diff --git a/dh_installinfo b/dh_installinfo index 8ef2bab3..2983d28f 100755 --- a/dh_installinfo +++ b/dh_installinfo @@ -35,7 +35,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # a tree of info files. if ($file=~/\.info$/ && ! $dh{NOSCRIPTS}) { # Figure out what section this file goes in. - my $section; + my $section=''; open (IN, "<$file") || die "$file: $!"; while () { if (/INFO-DIR-SECTION\s+(.*)/) { @@ -53,7 +53,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } else { autoscript($PACKAGE,"postinst","postinst-info-nosection", - "s/#FILE#/$fn/"); + "s:#FILE#:$fn:"); } autoscript($PACKAGE,"prerm","prerm-info", "s:#FILE#:$fn:"); } diff --git a/dh_installxaw b/dh_installxaw index f9980a6e..d71be544 100755 --- a/dh_installxaw +++ b/dh_installxaw @@ -41,8 +41,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $stanza=1; } elsif ($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}' "; undef %data; $stanza=''; } @@ -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_perl b/dh_perl index 735711c3..fa9c8eb0 100755 --- a/dh_perl +++ b/dh_perl @@ -7,8 +7,8 @@ BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); -my $perl = $ENV{PERL} || '/usr/bin/perl'; my $ext = ''; +my $lib_dir = 'usr/lib/perl5'; # Figure out the version of perl. If $ENV{PERL} is set, query the perl binary # it points to, otherwise query perl directly. @@ -17,6 +17,12 @@ if (defined $ENV{PERL}) { $version=`$ENV{PERL} -e 'printf "%.3f", \$]'`; } +# Cleaning the paths given on the command line +foreach (@ARGV) { + s#/$##; + s#^/##; +} + # If -d is given, then we'll try to depend on one of the perl-5.00X-base # package instead of perl-5.00X $ext='-base' if ($dh{'D_FLAG'}); @@ -30,17 +36,24 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { my $dep = ''; my $found = 0; + # Check also for alternate locations given on the command line + my $dirs = ''; + foreach ($lib_dir, @ARGV) { + $dirs .= "$TMP/$_ " if (-d "$TMP/$_"); + } + my $re = '(?:' . join('|', ($lib_dir, @ARGV)) . ')'; + # Look for perl modules and check where they are installed - if (-d "$TMP/usr/lib/perl5") { - foreach $file (split(/\n/,`find $TMP/usr/lib/perl5 -type f \\( -name "*.pm" -or -name "*.so" \\)`)) { + if ($dirs) { + foreach $file (split(/\n/,`find $dirs -type f \\( -name "*.pm" -or -name "*.so" \\)`)) { $found++; - if ($file =~ m<^$TMP/usr/lib/perl5/(\d\.\d{3})/([^/]+)/>) { + if ($file =~ m<^$TMP/$re/(\d\.\d{3})/([^/]+)/>) { $v = $1; $arch = $2; check_module_version ($v, $version); $v .= '-thread' if ($arch =~ /-thread/); $dep_arch = add_deps ($dep_arch, "perl-$v"); - } elsif ($file =~ m<^$TMP/usr/lib/perl5/(\d.\d{3})/>) { + } elsif ($file =~ m<^$TMP/$re/(\d.\d{3})/>) { $v = $1; check_module_version ($v, $version); $dep_arch = add_deps ($dep_arch, "perl-$v"); diff --git a/dh_perl.1 b/dh_perl.1 index 2d23bcb7..cc2bb503 100644 --- a/dh_perl.1 +++ b/dh_perl.1 @@ -3,7 +3,7 @@ dh_perl \- calculates perl scripts & modules dependencies .SH SYNOPSIS .B dh_perl -.I "[debhelper options] [-k] [-d]" +.I "[debhelper options] [-k] [-d] [library dirs ...]" .SH "DESCRIPTION" dh_perl is a debhelper program that is responsible for generating the perl:Depends substitutions and adding them to substvars files. @@ -36,6 +36,14 @@ the -d option to make .BR dh_perl generate a dependency on the correct base package. This is only necessary for some modules that are included in the base system. +.TP +.B library dirs +If your package does install perl modules in non-standard +directories, you can make +.BR dh_perl +check those directories by passing their names on the command line. +.BR dh_perl +will only check usr/lib/perl5 by default. .SH ENVIRONMENT See .BR debhelper (1) -- cgit v1.2.3 From 661c532ccc17f2b1d5f01be9a851dc30448cda2f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:50 +0000 Subject: r243: Initial Import --- debian/changelog | 21 +++++++++++++++++++++ debian/control | 2 +- dh_installdocs.1 | 16 +++++++--------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 784b3ca3..3a2666cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +debhelper (2.0.20) unstable; urgency=low + + * dh_perl: Patch from Raphael Hertzog to allow + specification on the command line of alternate paths to search for perl + modules. (Closes: #42171) + + -- Joey Hess Fri, 30 Jul 1999 09:42:08 -0700 + +debhelper (2.0.19) unstable; urgency=low + + * dh_installinfo: fixed bug if a info file had no section. + + -- Joey Hess Thu, 29 Jul 1999 11:41:11 -0700 + +debhelper (2.0.18) unstable; urgency=low + + * dh_installxaw: fixed multiple stanza problem, for real this time (patch + misapplied last time). (Closes: #41862) + + -- Joey Hess Mon, 26 Jul 1999 13:00:09 -0700 + debhelper (2.0.17) unstable; urgency=low * dh_clean: compat() wasn't exported. diff --git a/debian/control b/debian/control index 7dc9496c..5a5b45b2 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.5.1.0 +Standards-Version: 3.0.1.0 Package: debhelper Architecture: all diff --git a/dh_installdocs.1 b/dh_installdocs.1 index afc481e6..e2bc845d 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -31,19 +31,17 @@ 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. .P A file named debian/package.doc-base (debian/doc-base may be used for the -first binary package in debian/control), if it exists, will make -dh_installdocs use that file as a doc-base control file, and will -automatically generate the postinst and prerm commands needed to -interface with the doc-base package. See +first binary package in debian/control), if it exists, will be installed as +a doc-base control file, and will make this program automatically generate the +postinst and prerm commands needed to interface with the doc-base package. See .BR dh_installdeb (1) -for an explanation of how this works. Note that the package name will be -used as the doc-base document id. +for an explanation of how this works. +Note that the doc-id will be determined from the doc-base control file +in question. .PP If your package needs to register more than one document, you need multiple files. To accomplish this, you can use -files named debian/package.doc-base.docid. The "docid" on the end is a -string that is combined with the package name to generate a unique doc-base -document id. +files named debian/package.doc-base.* .SH OPTIONS .TP .B debhelper options -- cgit v1.2.3 From 63e45075003b1d9fcff097b5644a81131c346653 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:50 +0000 Subject: r245: Initial Import --- debian/changelog | 9 +++++++++ dh_installdocs | 52 +++++++++++++++++++++++----------------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3a2666cf..ad08e488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (2.0.21) unstable; urgency=low + + * Wow. It turns out dh_installdocs has been doing it wrong and doc-base + files have the doc-id inside them. Applied and modified a patch from + Peter Moulder to make it use those id's instead + of coming up with it's own. (Closes: #42650) + + -- Joey Hess Sun, 8 Aug 1999 10:24:10 -0700 + debhelper (2.0.20) unstable; urgency=low * dh_perl: Patch from Raphael Hertzog to allow diff --git a/dh_installdocs b/dh_installdocs index b82b21c2..101110da 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -62,51 +62,45 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); } - # Handle doc-base files. There are two filename formats, the usual plus - # an extended format (debian/package.doc-base.). Have to - # come up with good document-id's too. + # Handle doc-base files. There are two filename formats, the usual + # plus an extended format (debian/package.*). my %doc_ids; opendir(DEB,"debian/") || error("can't read debian directory: $!"); - foreach (grep {/^\Q$PACKAGE\E\.doc-base\..*$/} readdir(DEB)) { - $id=$_; - $id=~s/\.doc-base\./-/; - $doc_ids{$id}="debian/$_"; - } - closedir(DEB); - - # These next lines handle the format debian/doc-base., - # which is in for completeness. + # If this is the main package, we need to handle unprefixed filenames. + # For all packages, we must support both the usual filename format plus + # that format with a period an something appended. + my $regexp="\Q$PACKAGE\E\."; if ($PACKAGE eq $dh{MAINPACKAGE}) { - opendir(DEB,"debian/") || error("can't read debian directory: $!"); - foreach (grep {/^doc-base\..*$/} readdir(DEB)) { - $id=$_; - $id=~s/doc-base\./$PACKAGE-/; - $doc_ids{$id}="debian/$_"; - } - closedir(DEB); + $regexp="(|$regexp)"; } - - # And this handles the normal format of course. - $file=pkgfile($PACKAGE,"doc-base"); - if ($file ne '') { - $doc_ids{$PACKAGE}=$file; + foreach my $fn (grep {/^${regexp}doc-base(\..*)?$/} readdir(DEB)) { + # Parse the file to get the doc id. + open (IN, "debian/$fn") || die "Cannot read debian/$fn."; + while () { + if (/^Document:\s+(.*)/) { + $doc_ids{$fn}=$1; + last; + } + } + close IN; } + closedir(DEB); if (%doc_ids) { if (! -d "$TMP/usr/share/doc-base/") { doit("install","-d","$TMP/usr/share/doc-base/"); } } - foreach $doc_id (keys %doc_ids) { - doit("install","-m644","-p",$doc_ids{$doc_id}, - "$TMP/usr/share/doc-base/$doc_id"); + foreach my $fn (keys %doc_ids) { + doit("install","-m644","-p","debian/$fn", + "$TMP/usr/share/doc-base/$doc_ids{$fn}"); if (! $dh{NOSCRIPTS}) { autoscript($PACKAGE,"postinst","postinst-doc-base", - "s/#DOC-ID#/$doc_id/", + "s/#DOC-ID#/$doc_ids{$fn}/", ); autoscript($PACKAGE,"prerm","prerm-doc-base", - "s/#DOC-ID#/$doc_id/", + "s/#DOC-ID#/$doc_ids{$fn}/", ); } } -- cgit v1.2.3