From: unknown Date: Mon, 28 Jul 2003 18:44:08 +0000 (+0000) Subject: r728: This commit was manufactured by cvs2svn to create tag X-Git-Tag: version_2.0.27^0 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e61948f21896b176ba5acafd5aa9fdc144a5c40a;p=debhelper.git r728: This commit was manufactured by cvs2svn to create tag 'debian_version_2_0_27'. --- e61948f21896b176ba5acafd5aa9fdc144a5c40a diff --cc debian/copyright index 931864d,50256a8..0000000 deleted file mode 100644,100644 --- a/debian/copyright +++ /dev/null @@@ -1,24 -1,9 +1,0 @@@ - Debhelper is written by and copyright 1997-2003 Joey Hess . -Debhelper is written by Joey Hess . -- - Increasinly miniscule parts of the code (and certainly my inspiration from the - whole thing) came from debmake, by Christoph Lameter . -Parts of the code (and certainly my inspiration from the whole thing) came -from debmake, by Christoph Lameter . -- - Some of the dh_md5sums command is from a program by Charles -Some of the dh_md5sums and dh_du commands is from a program by Charles --Briscoe-Smith . - - dh_perl is by Brendan O'Dea . - dh_python is by Josselin Mouette . - dh_installcatalogs is by Adam Di Carlo . - dh_scrollkeeper is by Ross Burton . - dh_usrlocal is by Andrew Stribblehill . - dh_installlogcheck is by Jon Middleton . - - The copyright of this package is GPL, version 2 or later. Files in the - examples/ directory are in the public domain[1]. On Debian systems the - complete text of the GPL is in /usr/share/common-licenses/GPL - - [1] Pendants who belive I cannot legally say that code I have written is in - the public domain may consider them instead to be licensed as follows: -- - Redistribution and use in source and binary forms, with or without - modification, are permitted under any circumstances. No warranty. -The copyright of this package is GPL, version 2 or later. diff --cc dh_builddeb index 3d9f9d8,04c3570..0000000 deleted file mode 100755,100755 --- a/dh_builddeb +++ /dev/null @@@ -1,79 -1,17 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_builddeb - build debian packages - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<--destdir=>I] [B<--filename=>I] [S I>] - - =head1 DESCRIPTION - - dh_builddeb simply calls L to build a debian package or - packages. - - =head1 OPTIONS - - =over 4 - - =item B<--destdir=>I - - Use this if you want the generated .deb files to be put in a directory - other than the default of ".." - - =item B<--filename=>I - - Use this if you want to force the generated .deb file to have a particular - file name. Does not work well if more than one .deb is generated! - - =item B<-u>I - - =item B<--> I - - Pass I to L when it is used to build the - package. - - =back - - =cut -# -# Build the .deb package, assuming all the files are set up. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- --# Set the default destination directory. --if (! defined $dh{DESTDIR}) { -- $dh{DESTDIR}='..'; - } - - if (! defined $dh{FILENAME}) { - $dh{FILENAME}=''; - } - else { - $dh{FILENAME}="/$dh{FILENAME}"; --} -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) { - complex_doit("find $tmp -name $_ | xargs rm -rf") - foreach split(":", $ENV{DH_ALWAYS_EXCLUDE}); - } - doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME}); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - doit("dpkg","--build",$TMP,$dh{DESTDIR}); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_compress index 9d287af,040291f..0000000 deleted file mode 100755,100755 --- a/dh_compress +++ /dev/null @@@ -1,191 -1,115 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_compress - compress files and fix symlinks in package build directories - - =cut -# -# Compresses files and makes sure that symlinks pointing to the -# compressed files get fixed. -- - use strict; --use Cwd; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-X>I] [B<-A>] [S>] - - =head1 DESCRIPTION - - dh_compress is a debhelper program that is responsible for compressing - the files in package build directories, and makes sure that any symlinks - that pointed to the files before they were compressed are updated to point - to the new files. - - By default, dh_compress compresses files that debian policy mandates should - be compressed, namely all files in usr/share/info, usr/share/man, - usr/X11R6/man, files in usr/share/doc that are larger than 4k in size, - (except the copyright file, .html and .css files, and files that appear to be - already compressed based on their extensions), and all changelog files. Plus - PCF fonts underneath usr/X11R6/lib/X11/fonts/ - - If a debian/package.compress file exists, 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. The shell script will be run from - inside the package build directory. Note though that using -X is a much - better idea in general; you should only use a debian/package.compress file - if you really have to. - - =head1 OPTIONS - - =over 4 - - =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. - 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. - - =item B<-A>, B<--all> - - Compress all files specified by command line parameters in ALL packages - acted on. - - =item I - - Add these files to the list of files to compress. - - =back - - =head1 CONFORMS TO - - Debian policy, version 3.0 - - =cut - -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $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. - my $olddir=getcwd(); - verbose_print("cd $tmp"); - chdir($tmp) || error("Can't cd to $tmp: $!"); - $olddir=getcwd(); - verbose_print("cd $TMP"); - chdir($TMP) || error("Can't cd to $TMP: $!"); -- -- # Figure out what files to compress. - my @files; - @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 (($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 { - # 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 extensions: ".gz", ".z", ".taz", - # ".tgz", "-gz", "-z", "_z" - # 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/share/info usr/man usr/share/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true; - find usr/share/doc -type f \\( -size +4k -or -name "changelog*" -or -name "NEWS*" \\) \\ - \\( -name changelog.html -or ! -iname "*.htm*" \\) \\ - ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\ - ! -iname "*.jpeg" ! -iname "*.gz" ! -iname "*.taz" \\ - ! -iname "*.tgz" ! -iname "*.z" ! -iname "*.bz2" \\ - ! -iname "*-gz" ! -iname "*-z" ! -iname "*_z" \\ - ! -iname "*.jar" ! -iname "*.zip" ! -iname "*.css" \\ - ! -name "copyright" 2>/dev/null || true; - find usr/X11R6/lib/X11/fonts -type f -name "*.pcf" 2>/dev/null || true; - find usr/doc usr/share/doc -type f \\( -size +4k -or -name "changelog*" \\) \\ - \\( -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 -- `); -- } -- -- # Exclude files from compression. -- if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) { - my @new=(); - @new=(); -- foreach (@files) { - my $ok=1; - foreach my $x (@{$dh{EXCLUDE}}) { - $ok=1; - foreach $x (@{$dh{EXCLUDE}}) { -- if (/\Q$x\E/) { -- $ok=''; -- last; -- } -- } -- push @new,$_ if $ok; -- } -- @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. -- my @f=(); -- my %hardlinks; - my %seen; -- foreach (@files) { - my ($dev, $inode, undef, $nlink)=stat($_); - ($dev, $inode, undef, $nlink)=stat($_); -- if ($nlink > 1) { -- if (! $seen{"$inode.$dev"}) { -- $seen{"$inode.$dev"}=$_; -- push @f, $_; -- } -- else { -- # This is a hardlink. -- $hardlinks{$_}=$seen{"$inode.$dev"}; -- } -- } -- else { -- push @f, $_; -- } -- } -- -- if (@f) { - # Make executables not be anymore. - xargs(\@f,"chmod","a-x"); - -- xargs(\@f,"gzip","-9f"); -- } -- -- # Now change over any files we can that used to be hard links so -- # they are again. -- foreach (keys %hardlinks) { -- # Remove old file. -- doit("rm","-f","$_"); -- # Make new hardlink. -- doit("ln","$hardlinks{$_}.gz","$_.gz"); -- } -- - verbose_print("cd '$olddir'"); - verbose_print("cd $olddir"); -- chdir($olddir); -- -- # Fix up symlinks that were pointing to the uncompressed files. - open (FIND,"find $tmp -type l |"); - open (FIND,"find $TMP -type l |"); -- while () { -- chomp; - my ($directory)=m:(.*)/:; - my $linkval=readlink($_); - ($directory)=m:(.*)/:; - $linkval=readlink($_); -- if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") { -- doit("rm","-f",$_); -- doit("ln","-sf","$linkval.gz","$_.gz"); -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_fixperms index 1a35c78,ba4e74d..0000000 deleted file mode 100755,100755 --- a/dh_fixperms +++ /dev/null @@@ -1,105 -1,42 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_fixperms - fix permissions of files in package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-X>I] - - =head1 DESCRIPTION - - dh_fixperms is a debhelper program that is responsible for setting the - permissions of files and directories in package build directories to a - sane state -- a state that complies with Debian policy. - - dh_fixperms makes all files in usr/share/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. - It removes execute permissions from any libraries that have it set. It makes - all files in bin/ directories and etc/init.d executable (v4 only). Finally, - it removes the setuid and setgid bits from all files in the package. - - =head1 OPTIONS - - =over 4 - - =item B<-X>I, B<--exclude> I - - 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. - - =back - - =cut -# -# Do some general file permission fixups. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- - my $find_options=''; - if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { - if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') { - $find_options=""; - } - else { -- $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; -- } -- -- # General permissions fixing. - complex_doit("find $tmp $find_options -print0", - "2>/dev/null | xargs -0r chown --no-dereference 0.0"); - complex_doit("find $tmp ! -type l $find_options -print0", - 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/share/doc, setting everything to not - # executable by default, but leave examples directories alone. - complex_doit("find $tmp/usr/share/doc -type f $find_options ! -regex '$tmp/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null", - "| xargs -0r chmod 644"); - complex_doit("find $tmp/usr/share/doc -type d $find_options -print0 2>/dev/null", - "| xargs -0r chmod 755"); - - # Fix up premissions in usr/doc, setting everything to not exectable - # by default, but leave examples directories alone. - 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/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/share/man $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 - # (and .la files from libtool) .. - complex_doit("find $tmp -perm -5 -type f", - # (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 644"); - - # .. and perl modules. - complex_doit("find $tmp/usr/lib/perl5 $tmp/usr/share/perl5 -type f", - "-perm -5 -name '*.pm' $find_options -print0", -- "2>/dev/null | xargs -0r chmod a-X"); - - # v4 only - if (! compat(3)) { - # Programs in the bin and init.d dirs should be executable.. - for my $dir (qw{usr/bin bin usr/sbin sbin etc/init.d}) { - if (-d "$tmp/$dir") { - complex_doit("find $tmp/$dir -type f $find_options -print0 2>/dev/null", - "| xargs -0r chmod +x"); - } - } - } - --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_gencontrol index 4e9ff3e,a2d152c..0000000 deleted file mode 100755,100755 --- a/dh_gencontrol +++ /dev/null @@@ -1,80 -1,30 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_gencontrol - generate and install control file - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [S I>] - - =head1 DESCRIPTION - - dh_gencontrol is a debhelper program that is responsible for generating - control files, and installing them into the DEBIAN directory with the - proper permissions. - - This program is merely a wrapper around L, which calls - it once for each package being acted on, and passes in some additional - useful flags including "-isp". - - =head1 OPTIONS - - =over 4 - - =item B<-u>I, B<--dpkg-gencontrol-params>I - - =item B<--> I - - Pass "params" to L. - - =back - - =cut -# -# Generate and install the control file. Simple dpkg-gencontrol wrapper. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $ext=pkgext($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); -- - my $changelog=pkgfile($package,'changelog'); - $changelog=pkgfile($PACKAGE,'changelog'); -- if (! $changelog) { -- $changelog='debian/changelog'; -- } -- - if ( ! -d "$tmp/DEBIAN" ) { - doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN"); - if ( ! -d '$TMP/DEBIAN' ) { - doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); -- } -- -- # Generate and install control file. - my @command="dpkg-gencontrol"; - if (GetPackages() > 1) { - push @command, "-p$package"; - } - doit(@command, "-l$changelog", "-isp", "-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"); - # This chmod is only necessary if the user sets the umask to something odd. - doit("chmod","644","$TMP/DEBIAN/control"); -- - doit("chown","0.0","$tmp/DEBIAN/control"); - doit("chown","root.root","$TMP/DEBIAN/control"); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installchangelogs index 66a0255,3ebb04e..0000000 deleted file mode 100755,100755 --- a/dh_installchangelogs +++ /dev/null @@@ -1,143 -1,63 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installchangelogs - install changelogs into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [>] [B<-k>] [I] - - =head1 DESCRIPTION - - dh_installchangelogs is a debhelper program that is responsible for - installing 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/share/doc/package/changelog - in the package build directory. Otherwise, it installs debian/changelog - into usr/share/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.) - - Parallelling the debian changelog handling, this program also takes care of - NEWS.Debian files. If there is a debian/NEWS file, it is installed as - usr/share/doc/package/NEWS.Debian. debian/package.NEWS files can also be - used. - - 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/share/doc/package/changelog in the package build directory. If the - changelog is a html file (determined by file extension), it will be - installed as usr/share/doc/package/changelog.html instead, and will be - converted to plain text with html2text to generate - usr/share/doc/package/changelog. - - =head1 OPTIONS - - =over 4 - - =item B<-k>, B<--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. - - =item I - - Install this file as the upstream changelog. - - =back - - =head1 NOTES - - It is an error to specify an upstream changelog file for a debian native - package. - - =cut -# -# Installs debian/changelog. If another filename is passed to it, installs -# that file as the upstream changelog. -# -# Looks at debian/control to determine if this is a native debian package, -# 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/share/debhelper" } -use Dh_Lib; --init(); -- - my $upstream=shift; -$upstream=shift; -- --if (isnative($dh{MAINPACKAGE}) && defined $upstream) { -- error("Cannot specify an upstream changelog for a native debian package."); --} -- - my $changelog_name="changelog.Debian"; --if (isnative($dh{MAINPACKAGE})) { -- $changelog_name='changelog'; --} - my $news_name="NEWS.Debian"; -else { - $changelog_name='changelog.Debian'; -} -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $changelog=pkgfile($package,"changelog"); - my $news=pkgfile($package,"NEWS"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $changelog=pkgfile($PACKAGE,"changelog"); -- -- if (!$changelog) { -- $changelog="debian/changelog"; - } - if (!$news) { - $news="debian/NEWS"; -- } -- -- if (! -e $changelog) { -- error("could not find changelog $changelog"); -- } - - if (! -d "$tmp/usr/share/doc/$package") { - # If it is a dangling symlink, then don't do anything. - # Think multi-binary packages that depend on each other and - # want to link doc dirs. - next if -l "$tmp/usr/share/doc/$package"; -- - doit("install","-d","$tmp/usr/share/doc/$package"); - } - doit("install","-o",0,"-g",0,"-p","-m644",$changelog, - "$tmp/usr/share/doc/$package/$changelog_name"); - if (-e $news) { - doit("install","-o",0,"-g",0,"-p","-m644",$news, - "$tmp/usr/share/doc/$package/$news_name"); - if (! -d "$TMP/usr/doc/$PACKAGE") { - doit("install","-d","$TMP/usr/doc/$PACKAGE"); -- } - doit("install","-o","root","-g","root","-p","-m644",$changelog, - "$TMP/usr/doc/$PACKAGE/$changelog_name"); -- -- if ($upstream) { - my $link_to; -- if ($upstream=~m/\.html?$/i) { -- # HTML changelog - doit("install","-o",0,"-g",0,"-p","-m644", - $upstream,"$tmp/usr/share/doc/$package/changelog.html"); - doit("html2text","-nobs","-o","$tmp/usr/share/doc/$package/changelog",$upstream); - $link_to='changelog.html'; - 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",0,"-g",0,"-p","-m644", - $upstream,"$tmp/usr/share/doc/$package/changelog"); - $link_to='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. -- # Use basename in case original file was in a subdirectory or something. - doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream)); - doit("ln","-sf","changelog","$TMP/usr/doc/$PACKAGE/".Dh_Lib::basename($upstream)); -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installcron index d28277c,5b872ac..0000000 deleted file mode 100755,100755 --- a/dh_installcron +++ /dev/null @@@ -1,58 -1,28 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installcron - install cron scripts into etc/cron.* - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] - - =head1 DESCRIPTION - - dh_installcron is a debhelper program that is responsible for installing - cron scripts into etc/cron.*/ in package build directories. The files - debian/package.cron.daily, debian/package.cron.weekly, - debian/package.cron.monthly, and debian/package.cron.d are installed. - - =cut -# -# Install cron scripts into the appropriate places. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - foreach my $type (qw{daily weekly monthly}) { - my $cron=pkgfile($package,"cron.$type"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - foreach $type (qw{daily weekly monthly}) { - $cron=pkgfile($PACKAGE,"cron.$type"); -- if ($cron) { - if (! -d "$tmp/etc/cron.$type") { - doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type"); - 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"); - doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE"); -- } -- } -- # Seperate because this needs to be mode 644. - my $cron=pkgfile($package,"cron.d"); - $cron=pkgfile($PACKAGE,"cron.d"); -- if ($cron) { - if (! -d "$tmp/etc/cron.d") { - doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d"); - if (! -d "$TMP/etc/cron.d") { - doit("install","-o","root","-g","root","-d","$TMP/etc/cron.d"); -- } - doit("install","-m",644,$cron,"$tmp/etc/cron.d/$package"); - doit("install","-m",644,$cron,"$TMP/etc/cron.d/$PACKAGE"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installdeb index 9527ff2,d3eebe7..0000000 deleted file mode 100755,100755 --- a/dh_installdeb +++ /dev/null @@@ -1,117 -1,55 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installdeb - install files into the DEBIAN directory - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] - - =head1 DESCRIPTION - - dh_installdeb is a debhelper program that is responsible for installing - files into the DEBIAN directories in package build directories with the - correct permissions. - - dh_installdeb automatically installs the following files from debian/ into - the DEBIAN directory: - package.postinst - package.preinst - package.postrm - package.prerm - package.shlibs - package.conffiles - - The postinst, preinst, postrm, and prerm are handled specially: If a - corresponding file named debian/package.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 L, and are shell script fragments. - - In V3 compatibility mode and higher, all files in the etc/ directory in a - package will automatically be flagged as conffiles by this program, so - there is no need to list them manually in package.conffiles. - - =cut -# -# Install files from debian/ into the package's DEBIAN directory. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $ext=pkgext($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); -- - if (! -d "$tmp/DEBIAN") { - doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN"); - 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. - foreach my $file (qw{postinst preinst prerm postrm}) { - my $f=pkgfile($package,$file); - foreach $file (qw{postinst preinst prerm postrm}) { - $f=pkgfile($PACKAGE,$file); -- if ($f) { - if (-f "debian/$ext$file.debhelper") { - 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"); - # 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"); - complex_doit("sed s/#DEBHELPER#// < $f > $TMP/DEBIAN/$file"); -- } - doit("chown","0.0","$tmp/DEBIAN/$file"); - doit("chmod",755,"$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") { - complex_doit("printf '#!/bin/sh\nset -e\n' > $tmp/DEBIAN/$file"); - complex_doit("cat debian/$ext$file.debhelper >> $tmp/DEBIAN/$file"); - doit("chown","0.0","$tmp/DEBIAN/$file"); - doit("chmod",755,"$tmp/DEBIAN/$file"); - 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 - foreach my $file (qw{shlibs conffiles}) { - my $f=pkgfile($package,$file); - foreach $file (qw{shlibs conffiles}) { - $f=pkgfile($PACKAGE,$file); -- if ($f) { - doit("install","-o",0,"-g",0,"-m",644,"-p",$f,"$tmp/DEBIAN/$file"); - } - } - - # Automatic conffiles registration: If it is in /etc, it is a - # conffile. - if (! compat(2) && -d "$tmp/etc") { - complex_doit("find $tmp/etc -type f -printf '/etc/%P\n' >> $tmp/DEBIAN/conffiles"); - # Anything found? - if (-z "$tmp/DEBIAN/conffiles") { - doit("rm", "-f", "$tmp/DEBIAN/conffiles"); - } - else { - doit("chmod", 644, "$tmp/DEBIAN/conffiles"); - doit("install","-o","root","-g","root","-m",644,"-p",$f,"$TMP/DEBIAN/$file"); -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installdirs index 3bd4ea8,7d5e49c..0000000 deleted file mode 100755,100755 --- a/dh_installdirs +++ /dev/null @@@ -1,97 -1,42 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installdirs - create subdirectories in package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-A>] [S>] - - =head1 DESCRIPTION - - dh_installdirs is a debhelper program that is responsible for creating - subdirectories in package build directories. - - Any directory names specified as parameters will be created in the 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. - - A file named debian/package.dirs can list other directories to be created. - Separate the directory names with whitespace. - - Be sure to only use directory names relative to the package build - directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead. - - =head1 OPTIONS - - =over 4 - - =item B<-A>, B<--all> - - Create any directories specified by command line parameters in ALL packages - acted on, not just the first. - - =item I - - Create these directories in the package build directory of the first - package acted on. (Or in all packages if -A is specified.) - - =back - - =cut -# -# Reads debian/dirs, creates the directories listed there -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"dirs"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"dirs"); -- - if (! -e $tmp) { - doit("install","-d",$tmp); - if (! -e $TMP) { - doit("install","-d",$TMP); -- } -- - my @dirs; - undef @dirs; -- -- if ($file) { -- @dirs=filearray($file) -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @dirs, @ARGV; -- } -- -- if (@dirs) { - # Stick the $tmp onto the front of all the 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/$_"; - $_="$TMP/$_"; -- tr:/:/:s; # just beautification. -- $_ -- } @dirs; -- -- # Create dirs. -- doit("install","-d",@dirs); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installemacsen index 80b83e6,3fbaf8b..0000000 deleted file mode 100755,100755 --- a/dh_installemacsen +++ /dev/null @@@ -1,118 -1,52 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installemacsen - register an emacs add on package - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] [B<--priority=>I] [B<--flavor=>I] - - =head1 DESCRIPTION - - dh_installemacsen is a debhelper program that is responsible for installing - files used by the debian emacsen-common package into package build - directories. - - It also automatically generates the postinst and prerm commands needed to - register a package as an emacs add on package. See L - 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 . And similarly, - debian/package.emacsen-startup is installed into - etc/emacs/site-start.d/50.el (by default). - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/prerm scripts. - - =item B<--priority=>I - - Sets the priority number of a site-start.d file. Default is 50. - - =item B<--flavor=>I - - Sets the flavor a site-start.d file will be installed in. Default is - "emacs", alternatives include "xemacs" and "emacs20". - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -# -# Registration with emacsen-common. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - if (! defined $dh{PRIORITY}) { - $dh{PRIORITY}=50; -if (! defined $dh{number}) { - $dh{number}=50; --} - if (! defined $dh{FLAVOR}) { - $dh{FLAVOR}='emacs'; -if (! defined $dh{flavor}) { - $dh{flavor}='emacs'; --} -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- - my $emacsen_install=pkgfile($package,"emacsen-install"); - my $emacsen_remove=pkgfile($package,"emacsen-remove"); - my $emacsen_startup=pkgfile($package,"emacsen-startup"); - $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); - $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); - $emacsen_startup=pkgfile($PACKAGE,"emacsen-startup"); -- -- if ($emacsen_install ne '') { - if (! -d "$tmp/usr/lib/emacsen-common/packages/install") { - doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install"); - if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { - doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install"); -- } - doit("install","-m0755",$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"); - if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") { - doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove"); -- } - doit("install","-m0755","$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 '') { - if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") { - doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/"); - if (! -d "$TMP/etc/$dh{flavor}/site-start.d/") { - doit("install","-d","$TMP/etc/$dh{flavor}/site-start.d/"); -- } - doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$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 '') { -- if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-emacsen", - "s/#PACKAGE#/$package/"); - autoscript($package,"prerm","prerm-emacsen", - "s/#PACKAGE#/$package/"); - autoscript($PACKAGE,"postinst","postinst-emacsen", - "s/#PACKAGE#/$PACKAGE/"); - autoscript($PACKAGE,"prerm","prerm-emacsen", - "s/#PACKAGE#/$PACKAGE/"); -- } -- } - } - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut -} diff --cc dh_installexamples index 8934e2f,e8e5e3d..0000000 deleted file mode 100755,100755 --- a/dh_installexamples +++ /dev/null @@@ -1,110 -1,31 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installexamples - install example files into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-A>] [B<-X>I] [S>] - - =head1 DESCRIPTION - - dh_installexamples is a debhelper program that is responsible for - installing examples into usr/share/doc/package/examples in package - build directories. - - Any file names specified as parameters will be installed into 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. - - Files named debian/package.examples can list other files to be installed. - - =head1 OPTIONS - - =over 4 - - =item B<-A>, B<--all> - - Install any files specified by command line parameters in ALL packages - acted on. - - =item I - - Install these files as examples into the first package acted on. (Or into - all packages if -A is specified.) - - =item B<-Xitem>, B<--exclude=item> - - Exclude files that contain "item" anywhere in their filename from - being installed. - - =back - - =head1 NOTES - - Note that dh_installexamples will happily copy entire directory hierarchies - if you ask it to (similar to cp -a). If it is asked to install a - directory, it will install the complete contents of the directory. - - =cut -# -# Reads debian/examples, installs all files listed there into -# /usr/doc/$PACKAGE/examples -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"examples"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"examples"); -- - my @examples; - undef @examples; -- -- if ($file) { - @examples=filearray($file, "."); - @examples=filearray($file); -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @examples, @ARGV; -- } - - -- if (@examples) { - if (! -d "$tmp/usr/share/doc/$package/examples") { - doit("install","-d","$tmp/usr/share/doc/$package/examples"); - } - - my $exclude = ''; - if ($dh{EXCLUDE_FIND}) { - $exclude = ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)'; - if (! -d "$TMP/usr/doc/$PACKAGE/examples") { - doit("install","-d","$TMP/usr/doc/$PACKAGE/examples"); -- } -- - foreach my $example (@examples) { - next if excludefile($example); - if (-d $example && $exclude) { - my ($dir_basename) = basename($example); - # Pity there's no cp --exclude .. - my $pwd=`pwd`; - chomp $pwd; - complex_doit("cd $example/.. && find $dir_basename -type f$exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples \\;"); - } - else { - doit("cp", "-a", $example, "$tmp/usr/share/doc/$package/examples"); - } - } - doit("cp","-a",@examples,"$TMP/usr/doc/$PACKAGE/examples"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installinit index 5e4e1f3,c43d24d..0000000 deleted file mode 100755,100755 --- a/dh_installinit +++ /dev/null @@@ -1,181 -1,74 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installinit - install init scripts into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<--init-script=>I] [B<-n>] [B<-r>] [B<-d>] [S I>] - - =head1 DESCRIPTION - - dh_installinit is a debhelper program that is responsible for installing - init scripts and associated defaults files into package build directories. - - 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. - - 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 package name. - - If a file named debian/package.default exists, then it is installed into - etc/default/package in the package build directory, with "package" replaced - by the package name. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm/prerm scripts. - - =item B<-r>, B<--no-restart-on-upgrade> - - Do not restart init script on upgrade. - - =item B<--no-start> - - Do not start the init script on install or upgrade, or stop it on removal. - Only call update-rc.d. Useful for rcS scripts. - - =item B<-d>, B<--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/ , and the default file - is installed as in etc/default/ . This may be useful for daemons with names - ending in "d". (Note: this takes precedence over the --init-script parameter - described below.) - - =item B<-u>I B<--update-rcd-params=>I - - =item B<--> I - - Pass "params" to L. If not specified, "defaults" will be - passed to L. - - =item B<--init-script=>I - - Use "scriptname" as for the filename the init script is installed as in - etc/init.d/ (and also use it as the filename for the defaults file, if it - is installed). This is useful if you need to have an init script with a 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 "package.scriptname" and if so will install it as the init - 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. - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -# -# Install debian/init[.d], and set up the postinst and postrm for init -# scripts. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- -- # 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; - $script=$PACKAGE; -- if ($script=~m/(.*)d$/) { -- $script=$1; -- } -- else { - warning("\"$package\" has no final d' in its name, but -d was specified."); - warning("\"$PACKAGE\" has no final d' in its name, but -d was specified."); -- } -- } -- elsif ($dh{INIT_SCRIPT}) { -- $script=$dh{INIT_SCRIPT}; -- } -- else { - $script=$package; - $script=$PACKAGE; -- } - - my $init=pkgfile($package,$script) || pkgfile($package,"init") || - pkgfile($package,"init.d"); - my $default=pkgfile($package,'default'); -- - if ($default ne '') { - if (! -d "$tmp/etc/default") { - doit("install","-d","$tmp/etc/default"); - } - doit("install","-p","-m644",$default,"$tmp/etc/default/$script"); - } - $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"); - if (! -d "$TMP/etc/init.d") { - doit("install","-d","$TMP/etc/init.d"); -- } -- - doit("install","-p","-m755",$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, -- # we have to say "defaults". -- my $params=''; -- if (defined($dh{U_PARAMS})) { -- $params=join(' ',@{$dh{U_PARAMS}}); -- } -- if ($params eq '') { -- $params="defaults"; -- } -- -- if (! $dh{NOSCRIPTS}) { - if (! $dh{NO_START}) { - # update-rc.d, and start script - autoscript($package,"postinst", "postinst-init", - # -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/"); - - if ($dh{R_FLAG}) { - # stops script only on remove - autoscript($package,"prerm","prerm-init-norestart", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - } - else { - # always stops script - autoscript($package,"prerm","prerm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - } - autoscript($PACKAGE,"postrm","postrm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); -- } -- else { - # just update-rc.d - autoscript($package,"postinst", "postinst-init-nostart", - 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/"); -- } - - # removes rc.d links - autoscript($package,"postrm","postrm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmanpages index 39946f6,6d615a1..0000000 deleted file mode 100755,100755 --- a/dh_installmanpages +++ /dev/null @@@ -1,206 -1,131 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmanpages - old-style man page installer - - =cut -# -# Automatically find and install man pages. However, do not install any man -# pages listed on the command line. -# Also change man pages with .so commands in them into symlinks. -# -# This is a little bit (hah!) DWIMish, but still very handy. -- - use strict; --use File::Find; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [S>] - - =head1 DESCRIPTION - - dh_installmanpages is a debhelper program that is responsible for - automatically installing man pages into usr/share/man/ and usr/X11R6/man/ - in package build directories. - - This is a DWIM-style program, with an interface unlike the rest of - debhelper. You are encouraged to use L instead. - - dh_installmanpages scans the current directory and all subdirectories for - filenames that look like man pages. (Note that only real files are looked - at; symlinks are ignored.) It uses L to verify that the files are - in the correct format. Then, based on the 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. - - 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. - - =head1 OPTIONS - - =over 4 - - =item I - - Do not install these files as man pages, even if they look like valid man - pages. - - =back - - =head1 BUGS - - dh_installmanpages will install the man pages it finds into B packages - you tell it to act on, since it can't tell what package the man - pages belong in. This is almost never what you really want (use -p to work - around this, or use the much better L program instead). - - Files ending in I<.man> will be ignored. - - Files specified as parameters that contain spaces in their filenames will - not be processed properly. - - =cut - -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --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, -- # we don't want those, or .in files, which are - # from configure, nor do we want CVS .#* files. - if (! (-f $_ && /^.*\.[1-9].*$/ && ! /\.(ex|in)$/ && ! /^\.#/)) { - # 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; -- } - foreach my $dir (@allpackages) { - foreach $dir (@allpackages) { -- if ($File::Find::dir=~m:debian/\Q$dir\E:) { -- return; -- } -- } -- -- # And file does think it's a real man page? -- my $type=`file -z $_`; -- if ($type !~ m/:.*roff/) { -- return; -- } -- -- # 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 (basename($File::Find::dir) eq - dirname($solink)) { - $solink=basename($solink); - 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 my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- -- # Find all filenames that look like man pages. -- @manpages=(); -- @allpackages=GetPackages(''); -- find(\&find_man,'.'); # populates @manpages -- - foreach my $page (@manpages) { - foreach $page (@manpages) { -- $page=~s:^\./::; # just for looks -- - my $basename=basename($page); - $basename=Dh_Lib::basename($page); -- -- # Skip all files listed on command line. -- my $install=1; - foreach my $skip (@ARGV) { - foreach $skip (@ARGV) { -- # Look at basename of what's on connect line - # for backwards compatibility. - if ($basename eq basename($skip)) { - # for backwards compatability. - if ($basename eq Dh_Lib::basename($skip)) { -- $install=undef; -- last; -- } -- } -- -- if ($install) { - my $extdir="share"; - 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/"; - - # Handle translated man pages. - my $instname=$basename; - my ($langcode)=$basename=~m/.*\.([a-z][a-z])\.([1-9])/; - if (defined $langcode && $langcode ne '') { - $destdir="$tmp/usr/$extdir/man/$langcode/man$section/"; - $instname=~s/\.$langcode\./\./; - } -- - 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.$instname; - doit "install","-p","-m644",$page,$destdir; -- } -- } -- } -- -- # Now the .so conversion. -- @sofiles=@sodests=(); - foreach my $dir (qw{usr/share/man usr/X11R6/man}) { - if (-e "$tmp/$dir") { - find(\&find_so_man, "$tmp/$dir"); - foreach $dir (qw{usr/man usr/X11R6/man}) { - if (-e "$TMP/$dir") { - find(\&find_so_man, "$TMP/$dir"); -- } -- } - foreach my $sofile (@sofiles) { - foreach $sofile (@sofiles) { -- my $sodest=shift(@sodests); -- doit "rm","-f",$sofile; -- doit "ln","-sf",$sodest,$sofile; -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmenu index 420b216,c077f21..0000000 deleted file mode 100755,100755 --- a/dh_installmenu +++ /dev/null @@@ -1,91 -1,45 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmenu - install debian menu files into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installmenu is a debhelper program that is responsible for installing - files used by the debian menu package into package build directories. - - It also automatically generates the postinst and postrm commands needed to - 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 - file. See L for its format. - - 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. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =back - - =cut -# -# Integration with debian menu system: -# -# If debian/menu file exists, save it to $TMP/usr/lib/menu/$PACKAGE -# If debian/menu-method file exists, save it to -# $TMP/etc/menu-methods/$PACKAGE -# -# Also, add to postinst and postrm. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $menu=pkgfile($package,"menu"); - my $menu_method=pkgfile($package,"menu-method"); -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"); - if (! -d "$TMP/usr/lib/menu") { - doit("install","-d","$TMP/usr/lib/menu"); -- } - doit("install","-p","-m644",$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 ($menu_method eq "" && ! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-menu"); - autoscript($package,"postrm","postrm-menu") - autoscript($PACKAGE,"postinst","postinst-menu"); - autoscript($PACKAGE,"postrm","postrm-menu") -- } -- } -- -- if ($menu_method ne '') { - if (!-d "$tmp/etc/menu-methods") { - doit("install","-d","$tmp/etc/menu-methods"); - if (!-d "$TMP/etc/menu-methods") { - doit("install","-d","$TMP/etc/menu-methods"); -- } - doit("install","-p",$menu_method,"$tmp/etc/menu-methods/$package"); - doit("install","-p",$menu_method,"$TMP/etc/menu-methods/$PACKAGE"); -- -- if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/"); - autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/"); - autoscript($PACKAGE,"postinst","postinst-menu-method","s/#PACKAGE#/$PACKAGE/"); - autoscript($PACKAGE,"postrm","postrm-menu-method","s/#PACKAGE#/$PACKAGE/"); -- } -- } --} - - =head1 SEE ALSO - - L - L - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmime index 8ffd523,7cada57..0000000 deleted file mode 100755,100755 --- a/dh_installmime +++ /dev/null @@@ -1,75 -1,22 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmime - install mime files into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installmime is a debhelper program that is responsible for installing - mime files into package build directories. - - It also automatically generates the postinst and postrm commands needed to - interface with the debian mime-support package. See L for - an explanation of how this works. - - If a file named debian/package.mime exists, then it is installed into - usr/lib/mime/packages/package in the package build directory. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $mime=pkgfile($package,"mime"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $mime=pkgfile($PACKAGE,"mime"); -- -- if ($mime ne '') { - if (! -d "$tmp/usr/lib/mime/packages") { - doit("install","-d","$tmp/usr/lib/mime/packages"); - if (! -d "$TMP/usr/lib/mime/packages") { - doit("install","-d","$TMP/usr/lib/mime/packages"); -- } - doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package"); - doit("install","-p","-m644",$mime,"$TMP/usr/lib/mime/packages/$PACKAGE"); -- -- if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-mime"); - autoscript($package,"postrm","postrm-mime") - autoscript($PACKAGE,"postinst","postinst-mime"); - autoscript($PACKAGE,"postrm","postrm-mime") -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmodules index 13fd8f5,0ee00dc..0000000 deleted file mode 100755,100755 --- a/dh_installmodules +++ /dev/null @@@ -1,94 -1,28 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmodules - register modules with modutils - - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - use File::Find; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installmodules is a debhelper program that is responsible for - registering kernel modules with modutils. - - Files named debian/package.modules will be installed as - etc/modutils/package in the package build directory. - - Then postinst and postrm commands are automatically generated to register - the modules when the package is installed. See L for an - explanation of how this works. Note that this will be done for any - package this program acts on which has either the above-mentioned file, or - has .o files in /lib/modules. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -# -# Register modules with modutils. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - # Returns true if there are any .o files in the passed directory. - sub find_kernel_modules { - my $searchdir=shift; - my @results=(); - - return unless -d $searchdir; - find(sub { push @results, $_ if /\.o$/ }, $searchdir); - return @results > 0; - } -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"modules"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"modules"); -- - if (! -e $tmp) { - doit("install","-d",$tmp); - if (! -e $TMP) { - doit("install","-d",$TMP); -- } -- -- if ($file) { - if (! -e "$tmp/etc/modutils") { - doit("install","-d","$tmp/etc/modutils"); - if (! -e "$TMP/etc/modutils") { - doit("install","-d","$TMP/etc/modutils"); - doit("install","-m","0644",$file,"$TMP/etc/modutils/$PACKAGE"); -- } - doit("install","-m","0644",$file,"$tmp/etc/modutils/$package"); - } - - if (! $dh{NOSCRIPTS} && - ($file || find_kernel_modules("$tmp/lib/modules"))) { - autoscript($package,"postinst","postinst-modules","s/#PACKAGE#/$package/"); - autoscript($package,"postrm","postrm-modules","s/#PACKAGE#/$package/"); - - if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-modules","s/#PACKAGE#/$PACKAGE/"); - autoscript($PACKAGE,"postrm","postrm-modules","s/#PACKAGE#/$PACKAGE/"); - } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installpam index 0f25179,897fd7d..0000000 deleted file mode 100755,100755 --- a/dh_installpam +++ /dev/null @@@ -1,50 -1,21 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installpam - install pam support files - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installpam is a debhelper program that is responsible for installing - files used by PAM into package build directories. - - If a file named debian/package.pam exists, then it is installed into - etc/pam.d/package in the package build directory. - - =cut -# -# Integration with debian pam system: -# -# If debian/pam file exists, save it to $TMP/etc/pam.d/$PACKAGE -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $pam=pkgfile($package,"pam"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $pam=pkgfile($PACKAGE,"pam"); -- -- if ($pam ne '') { - if (! -d "$tmp/etc/pam.d") { - doit("install","-d","$tmp/etc/pam.d"); - if (! -d "$TMP/etc/pam.d") { - doit("install","-d","$TMP/etc/pam.d"); -- } - doit("install","-p","-m644",$pam,"$tmp/etc/pam.d/$package"); - doit("install","-p","-m644",$pam,"$TMP/etc/pam.d/$PACKAGE"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installwm index 31ce63c,21ee630..0000000 deleted file mode 100755,100755 --- a/dh_installwm +++ /dev/null @@@ -1,104 -1,22 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installwm - register a window manager - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] [B<--priority=>I] [S>] - - =head1 DESCRIPTION - - dh_installwm is a debhelper program that is responsible for - generating the postinst and postrm commands that register a window manager - with L - - Any window manager programs specified as parameters will be registered in - the first package dh_installwm 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. - - Files named debian/package.wm can list other window manager programs to - register. - - =head1 OPTIONS - - =over 4 - - =item B<--priority=>I - - Set the priority of the window manager. Default is 20, which is too low for - most window managers; see the Debian Policy document for instructions on - calculating the correct value. - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. Turns this command into a no-op. - - =item I - - The commands used to run the window manager or window managers you want to - register. - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =back - - =cut -# -# Add to postinst and postrm to register a window manager. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - if (! defined $dh{PRIORITY}) { - $dh{PRIORITY}=20; - } -$wm=shift; -- - if (@ARGV) { - # This is here for backwards compatibility. If the filename doesn't - # include a path, assume it's in /usr/X11R6/bin. - if ($ARGV[0] !~ m:/:) { - $ARGV[0]="/usr/X11R6/bin/$ARGV[0]"; - } -if ($wm eq '') { - error("No window manager filename was specified."); --} - - foreach my $package (@{$dh{DOPACKAGES}}) { - # my $tmp=tmpdir($package); - my $file=pkgfile($package,"wm"); - - my @wm; - if ($file) { - @wm=filearray($file, '.'); - } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - push @wm, @ARGV; - } -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { -# $TMP=tmpdir($PACKAGE); -- -- if (! $dh{NOSCRIPTS}) { - foreach (@wm) { - autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",); - autoscript($package,"prerm","prerm-wm","s:#WM#:$_:"); - } - autoscript($PACKAGE,"postinst","postinst-wm","s/#WM#/$wm/"); - autoscript($PACKAGE,"postrm","postrm-wm","s/#WM#/$wm/"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_link index 6cb889c,1f6299a..0000000 deleted file mode 100755,100755 --- a/dh_link +++ /dev/null @@@ -1,181 -1,74 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_link - create symlinks in package build directories - - =cut - - use strict; - use File::Find; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-A>] [S>] - - =head1 DESCRIPTION - - dh_link is a debhelper program that creates symlinks in package build - directories. - - 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 be - an equal number of source and destination files specified. - - The list can be specified in two ways. A file named debian/package.links - 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 - package 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. - - Be sure you B specify the full filename to both the source and - destination files (unlike you would do if you were using something like - L). - - 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. - - dh_link also scans the package build tree for existing symlinks which do not - conform to debian policy, and corrects them (v4 only). - - =head1 OPTIONS - - =over 4 - - =item B<-A>, B<--all> - - Create any links specified by command line parameters in ALL packages - acted on, not just the first. - - =item I - - 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.) - - =back - - =head1 EXAMPLES - - dh_link usr/share/man/man1/foo.1 usr/share/man/man1/bar.1 - - Make bar.1 be a symlink to foo.1 - - dh_link var/lib/foo usr/lib/foo \ - usr/X11R6/man/man1/foo.1x usr/share/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 - - =cut -# -# Generate symlinks in debian packages, reading debian/links. The -# file contains pairs of files and symlinks. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"links"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"links"); -- - my @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) { - 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."); -- } -- - # v4 only and only if there is a temp dir already - if (! compat(3) && -e $tmp) { - # Scan for existing links and add them to @links, so they - # are recreated policy conformant. - find( - sub { - return unless -l; - my $dir=$File::Find::dir; - $dir=~s/^\Q$tmp\E//; - my $target = readlink($_); - if ($target=~/^\//) { - push @links, $target; - } - else { - push @links, "$dir/$target"; - } - push @links, "$dir/$_"; - doit("rm","-f",$_); - - }, - $tmp); - } - -- while (@links) { - my $dest=pop @links; - my $src=pop @links; - $dest=pop @links; - $src=pop @links; -- - # Relavatize src and dest. - # Relivatize src and dest. -- $src=~s:^/::; -- $dest=~s:^/::; -- -- # Make sure the directory the link will be in exists. - my $basedir=dirname("$tmp/$dest"); - $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. - my @src_dirs=split(m:/+:,$src); - my @dest_dirs=split(m:/+:,$dest); - @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. - my $x; -- 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.="../"; -- } -- for ($x .. $#src_dirs) { -- $src.=$src_dirs[$_]."/"; -- } -- $src=~s:/$::; -- } -- else { -- # Make sure it's properly absolute. -- $src="/$src"; -- } -- - doit("ln","-sf",$src,"$tmp/$dest"); - doit("ln","-sf",$src,"$TMP/$dest"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_listpackages index f919ef6,3ce48e0..0000000 deleted file mode 100755,100755 --- a/dh_listpackages +++ /dev/null @@@ -1,38 -1,8 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_listpackages - list binary packages debhelper will act on - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] - - =head1 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. - - =cut -# -# Output a list of all packages debhelper will act on. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); --print join("\n",@{$dh{DOPACKAGES}})."\n"; - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_makeshlibs index de9f782,41bf161..0000000 deleted file mode 100755,100755 --- a/dh_makeshlibs +++ /dev/null @@@ -1,183 -1,49 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_makeshlibs - automatically create shlibs file - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-m>I] [B<-V>I<[dependancies]>] [B<-n>] [B<-X>I] - - =head1 DESCRIPTION - - dh_makeshlibs is a debhelper program that automatically scans for shared - libraries, and generates a shlibs file for the libraries it finds. - - It also adds a call to ldconfig in the postinst and postrm scripts (in - V3 mode and above only) to any packages which it finds shared libraries in. - - =head1 OPTIONS - - =over 4 - - =item B<-m>I, B<--major=>I - - Instead of trying to guess the major number of the library with objdump, - use the major number specified after the -m parameter. This is much less - useful than it used to be, back in the bad old days when this program - looked at library filenames rather than using objdump. - - =item B<-V>, B<-V>I - - =item B<--version-info>, B<--version-info=>I - - 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). - - Beware of using -V without any parameters; this is a conservative setting - that always ensures that other packages' shared library dependencies are at - least as tight as they need to be, so that if the maintainer screws up then - they won't break. The flip side is that packages might end up with - dependencies that are too tight and so find it harder to be upgraded. - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =item B<-X>I, B<--exclude=>I - - Exclude files that contain "item" anywhere in their filename or directory - from being treated as shared libraries. - - =back - - =head1 EXAMPLES - - dh_makeshlibs - - Assuming this is a package named libfoobar1, generates a shlibs file that - looks something like: - libfoobar 1 libfoobar1 - - 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) - - dh_makeshlibs -V 'libfoobar1 (>= 1.0)' - - Generates a shlibs file that looks something like: - libfoobar 1 libfoobar1 (>= 1.0) - - =cut -# -# Automatically generate shlibs files. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - - my %seen; - my $need_ldconfig = 0; -- - doit("rm", "-f", "$tmp/DEBIAN/shlibs"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- - # So, we look for files or links to existing files with names that - # match "*.so*". Matching *.so.* is not good enough because of - # broken crap like db3. And we only look at real files not - # symlinks, so we don't accidentually add shlibs data to -dev - # packages. This may have a few false positives, which is ok, - # because only if we can get a library name and a major number from - # objdump is anything actually added. - my $exclude=''; - if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { - $exclude="! \\( $dh{EXCLUDE_FIND} \\) "; - if (-e "$TMP/DEBIAN/shlibs") { - error("$TMP/DEBIAN/shlibs already exists."); -- } - open (FIND, "find $tmp -type f -name '*.so*' $exclude |"); - while () { - my ($library, $major); - my $objdump=`objdump -p $_`; - if ($objdump=~m/\s+SONAME\s+(.+)\.so\.(.+)/) { - # proper soname format - $library=$1; - $major=$2; - } - elsif ($objdump=~m/\s+SONAME\s+(.+)-(.+)\.so/) { - # idiotic crap soname format - $library=$1; - $major=$2; - } -- - 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"); - if (! -d "$TMP/DEBIAN") { - doit("install","-d","$TMP/DEBIAN"); -- } - my $deps=$package; - $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($package); - my $version = $dh{VERSION}; - # Old compatability levels include the - # debian revision, while new do not. - if (! compat(3)) { - # Remove debian version, if any. - $version =~ s/-[^-]+$//; - } - $deps="$package (>= $version)"; - isnative($PACKAGE); - $deps="$PACKAGE (>= $dh{VERSION})"; -- } -- } - if (defined($library) && defined($major) && defined($deps) && - if (defined($library) && defined($major) && defined($deps) && -- $library ne '' && $major ne '' && $deps ne '') { - $need_ldconfig=1; - # Prevent duplicate lines from entering the file. - my $line="$library $major $deps"; - if (! $seen{$line}) { - $seen{$line}=1; - complex_doit("echo '$line' >>$tmp/DEBIAN/shlibs"); - } - complex_doit("echo '$library $major $deps' >>$TMP/DEBIAN/shlibs"); -- } -- } -- close FIND; - - # New as of dh_v3. - if (! compat(2) && ! $dh{NOSCRIPTS} && $need_ldconfig) { - autoscript($package,"postinst","postinst-makeshlibs"); - autoscript($package,"postrm","postrm-makeshlibs"); - } -- - if (-e "$tmp/DEBIAN/shlibs") { - doit("chmod",644,"$tmp/DEBIAN/shlibs"); - doit("chown","0.0","$tmp/DEBIAN/shlibs"); - if (-e "$TMP/DEBIAN/shlibs") { - doit("chmod",644,"$TMP/DEBIAN/shlibs"); - doit("chown","root.root","$TMP/DEBIAN/shlibs"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_md5sums index 6f794e7,80b5f47..0000000 deleted file mode 100755,100755 --- a/dh_md5sums +++ /dev/null @@@ -1,95 -1,46 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_md5sums - generate DEBIAN/md5sums file - - =cut -# -# Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the -# package. -- - use strict; --use Cwd; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-x>] [B<-X>I] [B<--include-conffiles>] - - =head1 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. - These files are used by the debsums package. - - All files in DEBIAN/ are omitted from the md5sums file, as are all - conffiles (unless you use the --include-conffiles switch). - - The md5sums file is installed with proper permissions and ownerships. - - =head1 OPTIONS - - =over 4 - - =item B<-x>, B<--include-conffiles> - - Include conffiles in the md5sums list. Note that this information is - redundant since it is included elsewhere in debian packages. - - =item B<-X>I, B<--exclude=>I - - Exclude files that contain "item" anywhere in their filename from - being listed in the md5sums file. - - =back - - =cut - -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- - if (! -d "$tmp/DEBIAN") { - doit("install","-d","$tmp/DEBIAN"); - if (! -d "$TMP/DEBIAN") { - doit("install","-d","$TMP/DEBIAN"); -- } -- -- # Check if we should exclude conffiles. -- my $exclude=""; - if (! $dh{INCLUDE_CONFFILES} && -r "$tmp/DEBIAN/conffiles") { - if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") { -- # Generate exclude regexp. - open (CONFF,"$tmp/DEBIAN/conffiles"); - open (CONFF,"$TMP/DEBIAN/conffiles"); -- while () { -- chomp; -- s/^\///; -- $exclude.="! -path \"$_\" "; -- } -- close CONFF; -- } -- -- # See if we should exclude other files. -- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { -- $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; -- } -- - my $olddir=getcwd(); - complex_doit("cd $tmp >/dev/null ; find . -type f $exclude ! -regex '.*/DEBIAN/.*' -printf '%P\\0' | xargs -r0 md5sum > DEBIAN/md5sums ; cd '$olddir' >/dev/null"); - $olddir=getcwd(); - 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"); - if (-z "$TMP/DEBIAN/md5sums") { - doit("rm","-f","$TMP/DEBIAN/md5sums"); -- } -- else { - doit("chmod",644,"$tmp/DEBIAN/md5sums"); - doit("chown","0.0","$tmp/DEBIAN/md5sums"); - doit("chmod",644,"$TMP/DEBIAN/md5sums"); - doit("chown","root.root","$TMP/DEBIAN/md5sums"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_movefiles index 2c8a63f,7978163..0000000 deleted file mode 100755,100755 --- a/dh_movefiles +++ /dev/null @@@ -1,170 -1,82 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_movefiles - move files out of debian/tmp into subpackages - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<--sourcedir=>I] [B<-X>I] S>] - - =head1 DESCRIPTION - - dh_movefiles is a debhelper program that is responsible for moving files - out 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. - - 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. If you - prefer, you can list the files to move on the command line and this will - apply to the first package dh_movefiles is told to act on. - - Note: dh_install is a much better program that can do everything this one can, - and more. - - =head1 OPTIONS - - =over 4 - - =item B<--sourcedir=>I - - Instead of moving 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 `/'. - - =item B<-Xitem>, B<--exclude=item> - - Exclude files that contain "item" anywhere in their filename from - being installed. - - =item I - - 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. 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. - - =back - - =head1 NOTES - - Note that files are always moved out of debian/tmp by default (even if you - have instructed debhelper to use a compatibility level higher than one, - which does not otherwise use debian/tmp for anything at all). The idea - behind this is that the package that is being built can be told to install - into debian/tmp, and then files can be moved by dh_movefiles from that - directory. Any files or directories that remain are ignored, and get - deleted by dh_clean later. - - =cut -# -# Move files out of debian/tmp, into subpackages. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - my $ret=0; -$ret=0; -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $files=pkgfile($package,"files"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $files=pkgfile($PACKAGE,"files"); -- - my $sourcedir="debian/tmp"; -- 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."); -- } -- - my @tomove; - @tomove=(); -- -- # debian/files has a different purpose, so ignore it. - if ($files && $files ne "debian/files" ) { - @tomove=filearray($files, $sourcedir); - if ( $files && $files ne "debian/files" ) { - @tomove=filearray($files); -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @tomove, @ARGV; -- } -- - if (@tomove && $tmp eq $sourcedir) { - error("I was asked to move files from $sourcedir to $sourcedir. Perhaps you should set DH_COMPAT=2?"); - if (@tomove && $TMP eq $sourcedir) { - error("I was asked to move files from $sourcedir to $sourcedir."); -- } -- - # Now we need to expand wildcards in @tomove. - # This is only necessary in pre-v3 land -- as of v3, the - # expension is automatically done by filearray(). - if (@tomove && compat(2)) { - my @filelist=(); - if (@tomove) { - if (! -d $TMP) { - doit("install","-d",$TMP); - } - # Now we need to expand wildcards in @tomove. - @filelist=(); -- foreach (@tomove) { -- push @filelist, glob("$sourcedir/$_"); -- } - @tomove=@filelist; - } - else { - # However, filearray() does not add the sourcedir, - # which we need. - @tomove = map { "$sourcedir/$_" } @tomove; - } - - if (@tomove) { - if (! -d $tmp) { - doit("install","-d",$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. - doit("rm","-f","movelist"); - foreach (@filelist) { - $file=$_; - $ret=1 if (! -e $file && ! -l $file); - $file=~s:^$sourcedir/+::; - complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -and ! -type l -print || true) >> movelist"); -- } - - doit("rm","-f","debian/movelist"); - foreach (@tomove) { - my $file=$_; - if (! -e $file && ! -l $file && ! $dh{NO_ACT}) { - $ret=1; - warning("$file not found (supposed to put it in $package)"); - } - $file=~s:^\Q$sourcedir\E/+::; - my $cmd="(cd $sourcedir >/dev/null ; find $file ! -type d "; - if ($dh{EXCLUDE_FIND}) { - $cmd.="-a ! \\( $dh{EXCLUDE_FIND} \\) "; - } - $cmd.="-print || true) >> debian/movelist"; - complex_doit($cmd); - foreach (@filelist) { - $file=$_; - $ret=1 if (! -e $file && ! -l $file); - $file=~s:^$sourcedir/+::; - complex_doit("(cd $sourcedir >/dev/null ; find $file ! -type d -and -type l -print || true) >> movelist"); -- } - my $pwd=`pwd`; - chomp $pwd; - complex_doit("(cd $sourcedir >/dev/null ; tar --create --files-from=$pwd/debian/movelist --file -) | (cd $tmp >/dev/null ;tar xpf -)"); - # --remove-files is not used above because tar then doesn't - # preserve hard links - complex_doit("(cd $sourcedir >/dev/null ; cat $pwd/debian/movelist | xargs rm -f)"); - doit("rm","-f","debian/movelist"); - complex_doit("(cd $sourcedir >/dev/null ; tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP >/dev/null ;tar xpf -)"); - doit("rm","-f","movelist"); -- } --} -- --# 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 $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 $ret; - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_shlibdeps index 3fae6a6,69047dc..0000000 deleted file mode 100755,100755 --- a/dh_shlibdeps +++ /dev/null @@@ -1,145 -1,28 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_shlibdeps - calculate shared library dependancies - - =cut - - use strict; - use Cwd; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-L>I] [B<-l>I] [B<-X>I] [S I>] - - =head1 DESCRIPTION - - dh_shlibdeps is a debhelper program that is responsible for calculating - shared library dependancies for packages. - - This program is merely a wrapper around L that calls it - once for each package listed in the control file, passing it - a list of ELF executables and shared libraries it has found. - - =head1 OPTIONS - - =over 4 - - =item B<-u>I, B<--dpkg-shlibdeps-params=>I - - =item B<--> I - - Pass "params" to L. - - =item B<-X>I, B<--exclude=>I - - Exclude files that contain "item" anywhere in their filename from being - passed to dpkg-shlibdeps. This will make their dependancies be ignored. - This may be useful in some situations, but use it with caution. This option - may be used more than once to exclude more than one thing. - - =item B<-l>I[:directory:directory:..] - - Before dpkg-shlibdeps is run, LD_LIBRARY_PATH will have added to it the - specified directory (or directories -- separate with colons). This is - useful for multi-binary packages where a library is built in one - package and another package contains binaries linked against said - library. Relative paths will be made absolute for the benefit of - dpkg-shlibdeps. - - Note that the directory given should be the complete or relative path to - a directory that contains the library. See example below. - - =item B<-L>I, B<--libpackage=>I - - Use the shlibs file automatically generated by dh_makeshlibs for the named - package as a kind of automatically generated shlibs.local file. You can us - this switch in concert with the -l switch to make dpkg-shlibdeps find a - library built as part of the current package, and get the shlibs information. - See example below. - - =back - - =head1 EXAMPLES - - Suppose that your source package produces libfoo1, libfoo-dev, and - libfoo-bin binary packages. libfoo-bin links against libfoo1, and should - depend on it. In your rules file, first run dh_makeshlibs, then dh_shlibdeps: - - dh_makeshlibs - dh_shlibdeps -L libfoo1 -l debian/libfoo1/usr/lib - - This will have the effect of generating automatically a shlibs file for - libfoo1, and using that file and the libfoo1 library in the - debian/libfoo1/usr/lib directory to calculate shared library dependency - information. - - =cut -# -# Find dependancies. Simple dpkg-shlibdeps wrapper. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - # Add directory to library search path. - if ($dh{L_PARAMS}) { - my @paths=(); - # Add to existing paths, if set. - push @paths, $ENV{'LD_LIBRARY_PATH'} - if exists $ENV{'LD_LIBRARY_PATH'}; - foreach (split(/:/, $dh{L_PARAMS})) { - # Force the path absolute. - if (m:^/:) { - push @paths, $_; - } - else { - push @paths, getcwd()."/$_"; - } - } - $dh{L_PARAMS}=join(':', @paths); - $ENV{'LD_LIBRARY_PATH'}=$dh{L_PARAMS}; - verbose_print("LD_LIBRARY_PATH=$dh{L_PARAMS}"); - } -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $ext=pkgext($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); -- -- my @filelist; -- my $ff; -- - # Generate a list of ELF binaries in the package, ignoring any - # we were told to exclude. - my $find_options=''; - if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { - $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; - } - foreach my $file (split(/\n/,`find $tmp -type f \\( -perm +111 -or -name "*.so*" \\) $find_options`)) { - # TODO this is slow, optimize. Ie, file can run once on - # multiple files.. - $ff=`file "$file"`; - if ($ff=~m/ELF/ && $ff!~/statically linked/) { - # 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) { - my @opts; - if (defined $dh{LIBPACKAGE} && length $dh{LIBPACKAGE}) { - @opts=("-L".tmpdir($dh{LIBPACKAGE}."/DEBIAN/shlibs")); - } - doit("dpkg-shlibdeps","-Tdebian/${ext}substvars", - @opts,@{$dh{U_PARAMS}},@filelist); - doit("dpkg-shlibdeps","-Tdebian/$EXT\substvars",@{$dh{U_PARAMS}},@filelist); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_strip index 9e107f4,9d6ab05..0000000 deleted file mode 100755,100755 --- a/dh_strip +++ /dev/null @@@ -1,154 -1,71 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_strip - strip executables, shared libraries, and some static libraries - - =cut -# -# Strip files. -- - use strict; --use File::Find; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-X>I] - - =head1 DESCRIPTION - - dh_strip is a debhelper program that is responsible for stripping - executables, shared libraries, and static libraries that are not used for - debugging. - - This program examines your package build directories and works out what - to strip on its own. It uses L and file permisions and filenames - to figure out what files are shared libraries (*.so), executable binaries, - and static (lib*.a) and debugging libraries (lib*_g.a, debug/*.so), and - strips each as much as is possible. (Which is not at all for debugging - libraries.) In general it seems to make very good guesses, and will do the - right thing in almost all cases. - - Since it is very hard to automatically guess if a file is a - module, and hard to determine how to strip a module, dh_strip does not - currently deal with stripping binary modules such as .o files. - - =head1 OPTIONS - - =over 4 - - =item B<-X>I, B<--exclude=>I - - 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. - - =back - - =head1 NOTES - - If the DEB_BUILD_OPTIONS environment variable contains "nostrip", nothing - will be stripped, in accordance with Debian policy. - - =head1 CONFORMS TO - - Debian policy, version 3.0.1 - - =cut - -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - # This variable can be used to turn off stripping (see Policy). - if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS} =~ /nostrip/) { - exit; - } - - # I could just use `file $_[0]`, but this is safer - sub get_file_type { - my $file=shift; - open (FILE, '-|') # handle all filenames safely - || exec('file', $file) - || die "can't exec file: $!"; - my $type=; - close FILE; - return $type; - } -- --# 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. - my $fn="$File::Find::dir/$_"; - foreach my $f (@{$dh{EXCLUDE}}) { - $fn="$File::Find::dir/$_"; - foreach $f (@{$dh{EXCLUDE}}) { -- return if ($fn=~m/\Q$f\E/); -- } - - # Is it a debug library in a debug subdir? - return if $fn=~m/debug\/.*\.so/; -- -- # Does its filename look like a shared library? -- if (m/.*\.so.*?/) { -- # Ok, do the expensive test. - my $type=get_file_type($_); - 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. - my (undef,undef,$mode,undef)=stat(_); - (undef,undef,$mode,undef)=stat(_); -- if ($mode & 0111) { -- # Ok, expensive test. - my $type=get_file_type($_); - if ($type=~m/.*ELF.*(executable|shared).*/) { - 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$/) { - if (m/lib.*\.a/ && ! m/.*_g\.a/) { -- push @static_libs, $fn; -- return; -- } --} -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- -- @shared_libs=@executables=@static_libs=(); - find(\&testfile,$tmp); - 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",$_); - doit("strip","--remove-section=.comment","--remove-section=.note","--strip-unneeded",$_); -- } -- -- foreach (@executables) { - doit("strip","--remove-section=.comment", - "--remove-section=.note",$_); - doit("strip","--remove-section=.comment","--remove-section=.note",$_); -- } -- -- foreach (@static_libs) { -- doit("strip","--strip-debug",$_); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_suidregister index 3bc9bd9,dd01c2c..0000000 deleted file mode 100755,100755 --- a/dh_suidregister +++ /dev/null @@@ -1,127 -1,72 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_suidregister - obsolete suid registration program - - =head1 SYNOPSIS - - Do not run! - - =head1 DESCRIPTION - - This program used to register suid and sgid files with L, - but with the introduction of L, registration of files - in this way is unnecessary, and even harmful, so this program should not be - used. - - =head1 CONVERTING TO STATOVERRIDE - - Converting a package that uses this program to use the new statoverride - mechanism is easy. Just remove the call to dh_suidregister from - debian/rules, and add a versioned conflicts into your control file, as - follows: - - Conflicts: suidmanager (<< 0.50) - - The conflicts is only necessary if your package used to register things - with suidmanager; if it did not, you can just remove the call to this - program from your rules file. - - =cut -# -# 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. -- - use strict; - use Debian::Debhelper::Dh_Lib; -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - my $notused=1; -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $suid=pkgfile($package,"suid"); - my $tostrip=''; -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $suid=pkgfile($PACKAGE,"suid"); -- - my @files; - @files=(); -- if ($suid) { - @files=filearray($suid, $tmp); - @files=filearray($suid); -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @files, @ARGV; -- } -- -- if (! @files && ! $suid) { -- # No files specified (and no empty debian/suid file), so -- # guess what files to process. - @files=split(/\n/,`find $tmp -type f -perm +6000`); - @files=split(/\n/,`find $TMP -type f -perm +6000`); -- - # Strip the debian working directory off of the filenames. - $tostrip="$tmp/"; - # We will strip the debian working directory off of the - # filenames. - $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="/"; -- } -- - # Register files with suidregister. - foreach my $file (@files) { - foreach $file (@files) { -- # Strip leading $tostrip from $file. -- $file=~s/^$tostrip//; -- - # Create the sed string that will be used to - # 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. - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$tmp/$file"); - # Now come up with the user and group names for the uid and - # gid. - my $user=getpwuid($uid); - (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; -- } - my $group=getgrgid($gid); - $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. - my $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); - autoscript($package,"postrm","postrm-suid","$sedstr"); - } - # 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); -- - # Remove suid bits from files. This is delayed to this point, because - # of a situation with hard linked files if it is done earlier. - # See changelog for 2.0.77. - foreach my $file (@files) { - if ( -e "$tmp/$file") { - doit("chmod","a-s","$tmp/$file"); - autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); - autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); - - if ( -e "$TMP/$file") { - doit("chmod","a-s","$TMP/$file"); -- } - } - - if (@files) { - warning("This program should no longer be used. Please read the dh_suidregister(1) man page."); - $notused=0; -- } - } - - # Although they called it, it's not going to do anything. - if ($notused) { - warning("This program is obsolete, does nothing, and may be safely removed from your rules file."); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_testdir index 451b9ae,6d9258d..0000000 deleted file mode 100755,100755 --- a/dh_testdir +++ /dev/null @@@ -1,53 -1,15 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_testdir - test directory before building debian package - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [S>] - - =head1 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 - exists, as well as any other files you specify. If not, - it exits with an error. - - =head1 OPTIONS - - =over 4 - - =item I - - Test for the existence of these files too. - - =back - - =cut -# -# 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. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $file ('debian/control', @ARGV) { -foreach $file ('debian/control',@ARGV) { -- if (! -e $file) { -- error("\"$file\" not found. Are you sure you are in the correct directory?"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_testroot index 3468476,6ce2a13..0000000 deleted file mode 100755,100755 --- a/dh_testroot +++ /dev/null @@@ -1,36 -1,13 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_testroot - ensure that a package is built as root - - =head1 SYNOPSIS - - B [S>] - - =head1 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 - L - - =cut -# -# Checks to make sure you are root. -- - use strict; - use Debian::Debhelper::Dh_Lib; -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; -init(); -- -# Test for uid = 0, not username of root, becuase -# some people rename root. --if ($< != 0) { - error("You must run this as root (or use fakeroot)."); - error("You must run this as root."); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_testversion index a17f22e,096aa9e..0000000 deleted file mode 100755,100755 --- a/dh_testversion +++ /dev/null @@@ -1,84 -1,24 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_testversion - ensure that the correct version of debhelper is installed - - =cut - - use Debian::Debhelper::Dh_Lib; - use Debian::Debhelper::Dh_Version; # contains the version number of debhelper. - - =head1 SYNOPSIS - - B [S>] [I] [I] - - =head1 DESCRIPTION - - Note: This program is deprecated. You should use build dependencies - instead. - - dh_testversion compares the version of debhelper against the version you - specify, and if the condition is not met, exits with an error message. - - You can 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. - - 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. - - =head1 OPTIONS - - =over 4 - - =item I - - Optional comparison operator used in comparing the versions. If not - specified, ">=" is used. For descriptions of the comparison operators, see - dpkg --help. - - =item I - - Version number to compare against the current version of debhelper. If not - specified, dh_testversion does nothing. - - =back - - =cut -# -# Debhelper version check. -- -BEGIN { push @INC, "debian", "/usr/share/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; --} - - warning("This program is deprecated, you should use build dependencies instead."); -- --if (defined $compare and defined $ver) { - warning("Something like: \"Build-Depends: debhelper ($compare $ver)\""); - system('dpkg','--compare-versions',$Debian::Debhelper::Dh_Version::version,$compare,$ver) == 0 || - error("debhelper version $Debian::Debhelper::Dh_Version::version is installed, but a version $compare $ver is needed to build this package."); - 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."); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_undocumented index 5596485,77ee3f5..0000000 deleted file mode 100755,100755 --- a/dh_undocumented +++ /dev/null @@@ -1,38 -1,54 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_undocumented - obsolete undocumented.7 symlink program - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - Do not run! - - =head1 DESCRIPTION - - This program used to make symlinks to the undocumented.7 man page for man - pages not present in a package. Debian policy now frowns on use of the - undocumented.7 man page, and so this program does nothing, and should not - be used. - - =cut -# -# Passed a list of undocumented man pages, generates symlinks to -# undocumented.7.gz for those man pages. -# -# Also, it looks for debian/undocumented files for more lists of -# undocumented man pages. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - warning("This program does nothing and should no longer be used."); -- - =head1 SEE ALSO -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $undocumented=pkgfile($PACKAGE,"undocumented"); -- - L - @undoc=(); - if ($undocumented) { - @undoc=filearray($undocumented); - } -- - This program is a part of debhelper. - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - push @undoc, @ARGV; - } -- - =head1 AUTHOR - foreach $file (@undoc) { - $file=~s/.gz$//; # .gz extention is optional in input. -- - Joey Hess - # 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=""; - } -- - =cut - if (! -d "$TMP/$dir") { - doit("install","-d","$TMP/$dir"); - } - doit("ln","-sf","${reldir}undocumented.7.gz","$TMP/$dir/$file.gz"); - } -} diff --cc doc/PROGRAMMING index 6cae08a,891d31b..da21ea9 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@@ -57,9 -49,10 +49,10 @@@ shell scripts. If you want to write a d script, I can dig up that old library for you. Only the perl one is supported now, though.) - Use Dh_Lib.pm like this: + Use Dh_lib.pm like this: - use Debian::Debhelper::Dh_Lib -BEGIN { push @INC, "debian", "/usr/share/debhelper" } ++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 @@@ -125,15 -116,13 +116,6 @@@ switch variable descriptio --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) ----destdir DESTDIR will be set to a string (probably only -- dh_builddeb will ever use this) - --filename FILENAME will be set to a string ----flavor FLAVOR will be set to a string (probably only -- dh_installemacsen will ever use this) - --number PRIORITY will be set to a number (deprecated) - --priority PRIORITY will be set to a number ---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. @@@ -167,23 -156,24 +149,20 @@@ complex_doit( similarly to how doit() does. You can pass more complicated commands to this (ie, commands involving piping redirection), however, you have to worry about things like escaping shell metacharacters. - verbose_print($message) + verbose_print() Pass this command a string, and it will echo it if $dh{VERBOSE} is set. - error($errormsg) + error() Pass this command a string, it will output it to standard error and exit. - warning($message) + warning() Pass this command a string, and it will output it to standard error as a warning message. - tmpdir($dir) + 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/package". - compat($num) - Pass this command a number, and if the current compatibility level - is less than or equal to that number, it will return true. - Looks at DH_COMPAT to get the compatibility level. - pkgfile($package, $basename) + 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 for allowing debhelper programs to have configuration files in the diff --cc doc/README index cffbea2,ff43553..b283af2 --- a/doc/README +++ b/doc/README @@@ -1,1 -1,70 +1,58 @@@ - Please see the debhelper(7) man page for documentation. + 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, including a list of all the available commands, see the -debhelper(1) 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/ . + 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-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: + ---------------------- + + 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 dh-make package, which contains a ++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: + ----------------------------------- + + See the file "from-debstd" for documentation on how to do this. + + 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 + 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. + + 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): ++do that (note the tricky use of backquotes) (also note that I made sure that ++$1, $2, etc are set with the set command): + -my $temp="set -e\nset -- @ARGV\n" . << 'EOF'; ++print << `EOF` ++set -- @ARGV + #DEBHELPER# + EOF -system ($temp) / 256 == 0 - or die "Problem with debhelper scripts: $!\n"; + + Other notes: + ----------- + + Note that if you are generating a debian package that has arch-indep and + 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-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. + + Debhelper's home page is at http://kitenet.net/programs/debhelper/ + + -- Joey Hess diff --cc doc/TODO index 7dc57ff,e3b999b..282c24e --- a/doc/TODO +++ b/doc/TODO @@@ -1,52 -1,56 +1,62 @@@ This is the TODO for debhelper. As more and more people use debhelper, this list grows - I welcome patches to fix items on it! - Wishlist items: - - * All debhelper programs should only accept the options they are documented - to accept (rather than accepting all debhelper options). They should - be able to print brief usage summaries. - - I think this calls for a restucturing. Make a Debhelper.pm class. Each - program subclasses the class. The class provides command line parsing, - useful functions, and so on. Skeleton of a debhelper command would then - be: - - use base qw{Debhelper}; ++Bugs: + - sub startup { - # Add initialization stuff here. - } ++* 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). + - sub perpackage { - my $package=shift; - - # Stuff to do for each package here. - } - - sub fini { - # And final stuff here, if any. - } + Wishlist items: - This needs more thought. - - * install-info, as of dpkg 1.10, parses the info file for section if - --section is not given. So I should be able to stop parsing it myself for - section, after dpkg 1.10 has been around long enough. -* 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 + 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. + * 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 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 + dh_installdeb, so the fragments wouldn't go into the postinst. So maybe a - new script is called for. But it's probably be best to just have a switch - to enable this. ++ 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 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 + 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 defined + substitutions. OTOH, maybe it's better if people just sed + postinst.in before debhelper gets it's hands on it... (#25235) 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), - 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. - * dh_suidregister. Once nothing in the archive uses it. - * dh_installmanpages. Only mildly deprecated right now. Once dh_installman - catches on, make it emit a warning, and then wait for it to go away. - * dh_testversion. Remove as soon as nothing uses it. - * dh_movefiles. I won't hold my breath. - * debconf-mergetemplates support and the debian/template.ll files and the - debconf-utils dependency. - * dh_undocumented -* 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!