diff options
author | joey <joey> | 1999-08-17 04:51:17 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:51:17 +0000 |
commit | 473b811394da493f2643d196d3ea2316b6ea034f (patch) | |
tree | ebf14354e3a2cd136fb56fbaad09f25aff394eca | |
parent | fa0b6b8309672b44488dfef0891de99ef6f09d30 (diff) | |
download | debhelper-473b811394da493f2643d196d3ea2316b6ea034f.tar.gz |
r86: Initial Import
-rw-r--r-- | PROGRAMMING | 3 | ||||
-rw-r--r-- | README | 53 | ||||
-rw-r--r-- | TODO | 11 | ||||
-rw-r--r-- | debian/changelog | 12 | ||||
-rwxr-xr-x | debian/rules | 2 | ||||
-rwxr-xr-x | dh_compress | 11 | ||||
-rwxr-xr-x | dh_fixperms | 45 | ||||
-rwxr-xr-x | dh_installdebfiles | 2 | ||||
-rwxr-xr-x | dh_installinit | 6 | ||||
-rw-r--r-- | dh_lib | 5 | ||||
-rwxr-xr-x | dh_movefiles | 2 | ||||
-rwxr-xr-x | 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 @@ -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: -------------------------------------------- @@ -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 <joeyh@master.debian.org> 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" @@ -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 |