From 1153ddb381f7e854b125791a5ff9be6b81d87cc3 Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 13 Jun 2005 19:59:53 +0000 Subject: r1763: releasing version 4.9.0 --- Debian/Debhelper/Dh_Lib.pm | 59 +++++++++++++++++++++++++++---------------- debhelper.pod | 29 ++++++++++++++++++++- debian/changelog | 27 +++++++++++++++++--- debian/compat | 2 +- debian/control | 1 - debian/rules | 63 +++++++++++++++++++--------------------------- dh_compress | 2 +- dh_desktop | 0 dh_installdocs | 1 + dh_installmenu | 8 +++--- dh_strip | 37 ++++++++++++++++----------- doc/TODO | 7 +++--- run | 18 +++++++++++++ 13 files changed, 167 insertions(+), 87 deletions(-) mode change 100644 => 100755 dh_desktop create mode 100755 run diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 5ae611c6..eba314d8 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -16,7 +16,7 @@ use vars qw(@ISA @EXPORT %dh); &compat &addsubstvar &delsubstvar &excludefile &package_arch &is_udeb &udeb_filename &debhelper_script_subst); -my $max_compat=4; +my $max_compat=5; sub init { # If DH_OPTIONS is set, prepend it @ARGV. @@ -245,31 +245,43 @@ sub dirname { # Pass in a number, will return true iff the current compatibility level # is less than or equal to that number. -sub compat { - my $num=shift; +{ + my $warned_compat=0; + my $c; + + sub compat { + my $num=shift; - my $c=1; - if (defined $ENV{DH_COMPAT}) { - $c=$ENV{DH_COMPAT}; - } - elsif (-e 'debian/compat') { - # Try the file.. - open (COMPAT_IN, "debian/compat") || error "debian/compat: $!"; - my $l=; - if (! defined $l || ! length $l) { - warning("debian/compat is empty, assuming level $c"); + if (! defined $c) { + $c=1; + if (defined $ENV{DH_COMPAT}) { + $c=$ENV{DH_COMPAT}; + } + elsif (-e 'debian/compat') { + # Try the file.. + open (COMPAT_IN, "debian/compat") || error "debian/compat: $!"; + my $l=; + if (! defined $l || ! length $l) { + warning("debian/compat is empty, assuming level $c"); + } + else { + chomp $l; + $c=$l; + } + } } - else { - chomp $l; - $c=$l + + if ($c < 3 && ! $warned_compat) { + warning("Compatibility levels before 4 are deprecated."); + $warned_compat=1; + } + + if ($c > $max_compat) { + error("Sorry, but $max_compat is the highest compatibility level supported by this debhelper."); } - } - if ($c > $max_compat) { - error("Sorry, but $max_compat is the highest compatibility level of debhelper currently supported."); + return ($c <= $num); } - - return ($c <= $num); } # Pass it a name of a binary package, it returns the name of the tmp dir to @@ -492,6 +504,11 @@ sub filedoublearray { my @ret; open (DH_FARRAY_IN, $file) || error("cannot read $file: $1"); while () { + chomp; + # Only ignore comments and empty lines in v5 mode. + if (! compat(4)) { + next if /^#/ || /^$/; + } my @line; # Only do glob expansion in v3 mode. # diff --git a/debhelper.pod b/debhelper.pod index 1aeec099..76ee5eb6 100644 --- a/debhelper.pod +++ b/debhelper.pod @@ -72,6 +72,9 @@ files. Documentation or example files to install, files to move, and so on. When appropriate, in cases like these, you can use standard shell wildcard characters ('?' and '*' and '[..]' character classes) in the files. +You can also put comments in these files; lines beginning with "#" are +ignored. + =head1 SHARED DEBHELPER OPTIONS The following command line options are supported by all debhelper programs. @@ -256,6 +259,7 @@ This is the original debhelper compatibility level, and so it is the default one. In this mode, debhelper will use debian/tmp as the package tree directory for the first binary package listed in the control file, while using debian/ for all other packages listed in the control file. + This mode is deprecated. =item V2 @@ -263,6 +267,8 @@ This mode is deprecated. In this mode, debhelper will consistently use debian/ as the package tree directory for every package that is built. +This mode is deprecated. + =item V3 This mode works like V2, with the following additions: @@ -312,6 +318,27 @@ dh_link will correct existing links to conform with policy. =back +=item V5 + +This mode is still under development. Its changes from V4 are: + +=over 8 + +=item - + +Comments are ignored in debhelper config files. + +=item - + +dh_strip --dbg-package now specifies the name of a package to put debugging +symbols in, not the packages to take the symbols from. + +=item - + +dh_installdocs skips installing empty files. + +=back + =back =head2 Doc directory symlinks @@ -340,7 +367,7 @@ 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//DEBIAN/ before trying to put files there, dh_installmenu knows you need a -debian//usr/lib/menu/ before installing the menu files, etc. +debian//usr/share/menu/ before installing the menu files, etc. Once your package uses debhelper to build, be sure to add debhelper to your Build-Depends line in debian/control. You should diff --git a/debian/changelog b/debian/changelog index 48bf2090..ec536070 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,31 @@ -debhelper (4.2.38) UNRELEASED; urgency=low - +debhelper (4.9.0) unstable; urgency=low + + * Begin work on compatability level 5. The set of changes in this mode is + still being determined, and will be until debhelper version 5.0 is + released, so use at your own risk. + * dh_strip: In v5, make --dbg-package specify a single debugging package + that gets the debugging symbols from the other packages acted on. + Closes: #230588 + * In v5, ignore comments in config files. Only comments at the start of + lines are ignored. Closes: #206422 + * In v5, also ignore empty lines in config files. Closes: #212162 + * In v5, empty files are skipped by dh_installdocs. + * Use v5 to build debhelper. + * Add deprecation warnings for debhelper v1 and v2. * Document getpackages in PROGRAMMING. * Add another test-case for dh_link. * dh_python: Minimal fix from Joss for -V to make it search the right site-packages directories. Closes: #312661 - * + * Make compat() cache the expensive bits, since we run it more and more, + including twice per config file line now.. + * Add a "run" program to source tree to make local testing easier + and simplfy the rules file. + * Man page typo fixes. Closes: #305806, #305816 + * dh_installmenu: menus moved to /usr/share/menu. Closes: #228618 + Anyone with a binary executable menu file is SOL but there are none in + debian currently. + * Removed old versioned build deps for stuff that shipped in sarge or + earlier, mostly to shut up linda and lintian's stupid messages. -- Joey Hess Thu, 9 Jun 2005 10:01:20 -0400 diff --git a/debian/compat b/debian/compat index b8626c4c..7ed6ff82 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -4 +5 diff --git a/debian/control b/debian/control index ec19e89b..6d9d74e6 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,6 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Build-Depends: perl (>= 5.6.1), coreutils | fileutils (>= 4.0-2.1), file (>= 3.23-1), dpkg-dev (>= 1.9.0) Standards-Version: 3.6.1.0 Package: debhelper diff --git a/debian/rules b/debian/rules index 08f8e5d2..dbd7bf61 100755 --- a/debian/rules +++ b/debian/rules @@ -1,20 +1,9 @@ #!/usr/bin/make -f -# Note that I have to refer to debhelper programs with ./, to make sure -# I run the most current ones. -# # This is _not_ a good example of a debhelper rules file. # See examples/ for some good examples. -# Ensure that builds are self-hosting, which means I have to use the .pm -# files in this package, not any that may be on the system. -export PERL5LIB=. - -# 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 - # This generates a list of synopses of debhelper commands, and substitutes -# it in to the #LIST# line on the man page fed to it on stdin. Must be passes +# it in to the #LIST# line on the man page fed to it on stdin. Must be passed # parameters of all the executables or pod files to get the synopses from. # (Like I said, this is not a good example of a debhelper rules file..) MAKEMANLIST=perl -e ' \ @@ -65,37 +54,37 @@ build-stamp: touch build-stamp clean: - ./dh_testdir - ./dh_testroot - ./dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm + ./run dh_testdir + ./run dh_testroot + ./run dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm test: test-stamp test-stamp: - ./dh_clean - DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/* - ./dh_clean + ./run dh_clean + ./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/* + ./run dh_clean touch test-stamp binary-indep: build - ./dh_testdir - ./dh_testroot - ./dh_clean -k - ./dh_install -X .1 dh_* usr/bin - ./dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/ - ./dh_install autoscripts usr/share/debhelper - ./dh_installdocs doc/* - ./dh_installexamples examples/* - ./dh_installman *.1 *.7 - ./dh_installchangelogs - ./dh_shlibdeps - ./dh_link - ./dh_compress - ./dh_fixperms - ./dh_perl - ./dh_installdeb - ./dh_gencontrol - ./dh_md5sums - ./dh_builddeb + ./run dh_testdir + ./run dh_testroot + ./run dh_clean -k + ./run dh_install -X .1 dh_* usr/bin + ./run dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/ + ./run dh_install autoscripts usr/share/debhelper + ./run dh_installdocs doc/* + ./run dh_installexamples examples/* + ./run dh_installman *.1 *.7 + ./run dh_installchangelogs + ./run dh_shlibdeps + ./run dh_link + ./run dh_compress + ./run dh_fixperms + ./run dh_perl + ./run dh_installdeb + ./run dh_gencontrol + ./run dh_md5sums + ./run dh_builddeb # Update the debhelper web page. Not intended for use by anyone except the # author. diff --git a/dh_compress b/dh_compress index cbdf627c..e8d5fcb7 100755 --- a/dh_compress +++ b/dh_compress @@ -42,7 +42,7 @@ if you really have to. =item B<-X>I, B<--exclude=>I 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 files 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. diff --git a/dh_desktop b/dh_desktop old mode 100644 new mode 100755 diff --git a/dh_installdocs b/dh_installdocs index f1c66197..52d1675f 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -127,6 +127,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } foreach my $doc (@docs) { next if excludefile($doc); + next if ! -s $doc && ! compat(4); # ignore empty BUGS, etc if (-d $doc && $exclude) { my ($dir_basename) = basename($doc); # Pity there's no cp --exclude .. diff --git a/dh_installmenu b/dh_installmenu index e61b9adf..bf827782 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -23,7 +23,7 @@ interface with the debian menu package. See L for an explanation of how this works. 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 +usr/share/menu/package in the package build directory. This is a debian menu file. See L for its format. If a file named debian/package.menu-method exits, then it is installed into @@ -50,10 +50,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $menu_method=pkgfile($package,"menu-method"); if ($menu ne '') { - if (! -d "$tmp/usr/lib/menu") { - doit("install","-d","$tmp/usr/lib/menu"); + if (! -d "$tmp/usr/share/menu") { + doit("install","-d","$tmp/usr/share/menu"); } - doit("install","-p","-m644",$menu,"$tmp/usr/lib/menu/$package"); + doit("install","-p","-m644",$menu,"$tmp/usr/share/menu/$package"); # Add the scripts if a menu-method file doesn't exist. # The scripts for menu-method handle everything these do, too. diff --git a/dh_strip b/dh_strip index edab8b9b..dd21a8ca 100755 --- a/dh_strip +++ b/dh_strip @@ -44,19 +44,18 @@ things to exclude. =item B<--dbg-package=>I -This option tells dh_strip that the given package has an associated "-dbg" -package. dh_strip will, when stripping off the debug symbols of files in -the given package, save them to independent files in the package build -directory for the "-dbg" package. +Causes dh_strip to save debug symbols stripped from the packages it acts on +as independent files in the package build directory of the specified debugging +package. -For example, you might have a package named libfoo, and want to include a -libfoo-dbg package that contains debugging symbols. The command "dh_strip ---dbg-package=libfoo" will make dh_strip save the debugging symbols for -usr/lib/libfoo.so.0 into usr/lib/debug/usr/lib/libfoo.so.0 in the package -build directory for libfoo-dbg. If libfoo-dbg is installed, gdb will -automatically load up the debugging symbols from it when debugging libfoo. +For example, if your packages are lifoo and foo and you want to include a +foo-dbg package with debugging symbols, use dh_strip --dbg-to=foo-dbg. -This option may be repeated to list more than one package. +Note that this option behaves significantly different in debhelper +compatibility levels 4 and below. Instead of specifying the name of a debug +package to put symbols in, it specifies a package (or packages) which +should have separated debug symbols, and the separated symbols are placed +in packages with "-dbg" added to their name. Note that if you use this option, your package should build-depend on binutils (>= 2.14.90.0.7). @@ -180,9 +179,19 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # Support for keeping the debugging symbols in a detached file. my $keep_debug=$dh{KEEP_DEBUG}; my $debugtmp=$tmp; - if (ref $dh{DEBUGPACKAGES} && grep { $_ eq $package } @{$dh{DEBUGPACKAGES}}) { - $keep_debug=1; - $debugtmp=tmpdir($package."-dbg"); + if (! compat(4)) { + if (ref $dh{DEBUGPACKAGES}) { + $keep_debug=1; + # Note that it's only an array for the v4 stuff; + # for v5 only one value is used. + $debugtmp=tmpdir(@{$dh{DEBUGPACKAGES}}[0]); + } + } + else + if (ref $dh{DEBUGPACKAGES} && grep { $_ eq $package } @{$dh{DEBUGPACKAGES}}) { + $keep_debug=1; + $debugtmp=tmpdir($package."-dbg"); + } } @shared_libs=@executables=@static_libs=(); diff --git a/doc/TODO b/doc/TODO index bb05d923..94aa95af 100644 --- a/doc/TODO +++ b/doc/TODO @@ -36,7 +36,6 @@ Wishlist items: v5: -* comments in config files * escaping in config files (for whitespace)? * make dh_installman set up slave links, always assuming wm and man page are in same area (/usr/bin and /usr/share/man, or /usr/X11/). Or, if the @@ -45,9 +44,9 @@ v5: Deprecated: -* DH_COMPAT 1. Can be removed once all packages are seen to be using 2 or - higher. I won't hold my breath. -* Also, grep the entire archive for all dh_* command lines (I do this now), +* DH_COMPAT 1, 2. Can be removed once all packages are seen to be using 3 or + higher. I won't hold my breath. Now with evil warning messages though. +* Also, grep the entire archive for all dh_* command lines, and check to see what other switches are not being used, and maybe remove some of them. I'd also like to deprecate/remove debian/compress files, -X is a better idea. diff --git a/run b/run new file mode 100755 index 00000000..00449b04 --- /dev/null +++ b/run @@ -0,0 +1,18 @@ +#!/bin/sh +# Run a debhelper command using files from this directory. + +# Run items from current directory by preference. +PATH=.:$PATH + +# Ensure that builds are self-hosting, which means I have to use the .pm +# files in this package, not any that may be on the system. +export PERL5LIB=$(pwd) + +# If any automatic script generation is done in building this package, +# be sure to use the new templates from this package. +export DH_AUTOSCRIPTDIR=$(pwd)/autoscripts + +prog=$1 +shift 1 + +exec $prog "$@" -- cgit v1.2.3