'debian_version_2_0_25'.
+++ /dev/null
- Debhelper is written by and copyright 1997-2003 Joey Hess <joeyh@debian.org>.
-Debhelper is written by Joey Hess <joeyh@master.debian.org>.
--
- Increasinly miniscule parts of the code (and certainly my inspiration from the
- whole thing) came from debmake, by Christoph Lameter <clameter@debian.org>.
-Parts of the code (and certainly my inspiration from the whole thing) came
-from debmake, by Christoph Lameter <clameter@debian.org>.
--
- 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 <cpb4@ukc.ac.uk>.
-
- dh_perl is by Brendan O'Dea <bod@debian.org>.
- dh_python is by Josselin Mouette <josselin.mouette@ens-lyon.org>.
- dh_installcatalogs is by Adam Di Carlo <aph@debian.org>.
- dh_scrollkeeper is by Ross Burton <ross@burtonini.com>.
- dh_usrlocal is by Andrew Stribblehill <ads@debian.org>.
- dh_installlogcheck is by Jon Middleton <jjm@debian.org>.
-
- 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.
+++ /dev/null
--#!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_builddeb - build debian packages
-
- =cut
-
- use strict;
- use Debian::Debhelper::Dh_Lib;
-
- =head1 SYNOPSIS
-
- B<dh_builddeb> [S<I<debhelper options>>] [B<--destdir=>I<directory>] [B<--filename=>I<name>] [S<B<--> I<params>>]
-
- =head1 DESCRIPTION
-
- dh_builddeb simply calls L<dpkg-deb(8)> to build a debian package or
- packages.
-
- =head1 OPTIONS
-
- =over 4
-
- =item B<--destdir=>I<directory>
-
- Use this if you want the generated .deb files to be put in a directory
- other than the default of ".."
-
- =item B<--filename=>I<name>
-
- 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<params>
-
- =item B<--> I<params>
-
- Pass I<params> to L<dpkg-deb(1)> 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_compress> [S<I<debhelper options>>] [B<-X>I<item>] [B<-A>] [S<I<file ...>>]
-
- =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<item>, B<--exclude=>I<item>
-
- Exclude files that contain "item" anywhere in their filename from being
- compressed. For example, -X.jpeg will exclude jpeg's from compression.
- You may use this option multiple times to build up a list of things to
- 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<file ...>
-
- 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 (<FIND>) {
-- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_fixperms> [S<I<debhelper options>>] [B<-X>I<item>]
-
- =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<item>, B<--exclude> I<item>
-
- Exclude files that contain "item" anywhere in their filename from having
- their permissions changed. You may use this option multiple times to build
- up a list of things to exclude.
-
- =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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_gencontrol - generate and install control file
-
- =cut
-
- use strict;
- use Debian::Debhelper::Dh_Lib;
-
- =head1 SYNOPSIS
-
- B<dh_gencontrol> [S<I<debhelper options>>] [S<B<--> I<params>>]
-
- =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<dpkg-gencontrol(1)>, 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<params>, B<--dpkg-gencontrol-params>I<params>
-
- =item B<--> I<params>
-
- Pass "params" to L<dpkg-gencontrol(1)>.
-
- =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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installchangelogs> [<S<I<debhelper options>>] [B<-k>] [I<upstream>]
-
- =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<upstream>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installcron> [S<B<debhelper options>>]
-
- =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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installdeb> [S<I<debhelper options>>]
-
- =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<dh_installmenu(1)>, 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installdirs> [S<I<debhelper options>>] [B<-A>] [S<I<dir ...>>]
-
- =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<dir ...>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installemacsen> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [B<--flavor=>I<foo>]
-
- =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<dh_installdeb(1)>
- 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<package>.el (by default).
-
- =head1 OPTIONS
-
- =over 4
-
- =item B<-n>, B<--noscripts>
-
- Do not modify postinst/prerm scripts.
-
- =item B<--priority=>I<n>
-
- Sets the priority number of a site-start.d file. Default is 50.
-
- =item B<--flavor=>I<foo>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
-}
+++ /dev/null
--#!/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<dh_installexamples> [S<I<debhelper options>>] [B<-A>] [B<-X>I<item>] [S<I<file ...>>]
-
- =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<file ...>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installinit> [S<I<debhelper options>>] [B<--init-script=>I<scriptname>] [B<-n>] [B<-r>] [B<-d>] [S<B<--> I<params>>]
-
- =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<params> B<--update-rcd-params=>I<params>
-
- =item B<--> I<params>
-
- Pass "params" to L<update-rc.d(8)>. If not specified, "defaults" will be
- passed to L<update-rc.d(8)>.
-
- =item B<--init-script=>I<scriptname>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installmanpages> [S<I<debhelper options>>] [S<I<file ...>>]
-
- =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<dh_installman(1)> 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<file(1)> to verify that the files are
- in the correct format. Then, based on the files' extensions, it installs
- them into the correct man directory.
-
- 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<file ...>
-
- 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<all> 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<dh_installman(1)> 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=<SOTEST>;
-- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installmenu> [S<B<debhelper options>>] [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<dh_installdeb(1)> 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<menufile(5L)> 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<debhelper(7)>
- L<update-menus(1)>
- L<menufile(5)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installmime> [S<I<debhelper options>>] [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<dh_installdeb(1)> 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_installmodules> [S<I<debhelper options>>] [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<dh_installdeb(1)> 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_installpam - install pam support files
-
- =cut
-
- use strict;
- use Debian::Debhelper::Dh_Lib;
-
- =head1 SYNOPSIS
-
- B<dh_installpam> [S<I<debhelper options>>] [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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_installwm - register a window manager
-
- =cut
-
- use strict;
- use Debian::Debhelper::Dh_Lib;
-
- =head1 SYNOPSIS
-
- B<dh_installwm> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [S<I<wm ...>>]
-
- =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<update-alternatives(8)>
-
- 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<n>
-
- 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<wm ...>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_link> [S<I<debhelper options>>] [B<-A>] [S<I<source destination ...>>]
-
- =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<must> 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<do> specify the full filename to both the source and
- destination files (unlike you would do if you were using something like
- L<ln(1)>).
-
- 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<source destination ...>
-
- Create a file named "destination" as a link to a file named "source". Do
- this in the package build directory of the first package acted on.
- (Or in all packages if -A is specified.)
-
- =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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_listpackages> [S<I<debhelper options>>]
-
- =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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_makeshlibs - automatically create shlibs file
-
- =cut
-
- use strict;
- use Debian::Debhelper::Dh_Lib;
-
- =head1 SYNOPSIS
-
- B<dh_makeshlibs> [S<I<debhelper options>>] [B<-m>I<major>] [B<-V>I<[dependancies]>] [B<-n>] [B<-X>I<item>]
-
- =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<major>, B<--major=>I<major>
-
- 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<dependancies>
-
- =item B<--version-info>, B<--version-info=>I<dependancies>
-
- By default, the shlibs file generated by this program does not make packages
- depend on any particular version of the package containing the shared
- library. It may be necessary for you to add some version dependancy
- information to the shlibs file. If -V is specified with no dependancy
- information, the current version of the package is plugged into a
- dependancy that looks like "packagename (>= packageversion)". If -V is
- specified with parameters, the parameters can be used to specify the exact
- dependancy information needed (be sure to include the package name).
-
- 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<item>, B<--exclude=>I<item>
-
- 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 (<FIND>) {
- 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 (<FIND>) {
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_md5sums> [S<I<debhelper options>>] [B<-x>] [B<-X>I<item>] [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<item>, B<--exclude=>I<item>
-
- 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 (<CONFF>) {
-- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_movefiles> [S<I<debhelper options>>] [B<--sourcedir=>I<dir>] [B<-X>I<item>] S<I<file ...>>]
-
- =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<dir>
-
- 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<file ...>
-
- Lists files to move. The filenames listed should be relative to
- debian/tmp/. You can also list directory names, and the whole directory will
- be moved. 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_shlibdeps> [S<I<debhelper options>>] [B<-L>I<package>] [B<-l>I<directory>] [B<-X>I<item>] [S<B<--> I<params>>]
-
- =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<dpkg-shlibdeps(1)> 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<params>, B<--dpkg-shlibdeps-params=>I<params>
-
- =item B<--> I<params>
-
- Pass "params" to L<dpkg-shlibdeps(1)>.
-
- =item B<-X>I<item>, B<--exclude=>I<item>
-
- 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: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<package>, B<--libpackage=>I<package>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_strip> [S<I<debhelper options>>] [B<-X>I<item>]
-
- =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<file(1)> 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<item>, B<--exclude=>I<item>
-
- Exclude files that contain "item" anywhere in their filename from being
- stripped. You may use this option multiple times to build up a list of
- things to exclude.
-
- =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=<FILE>;
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<suidregister(1)>,
- but with the introduction of L<dpkg-statoverride(8)>, 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_testdir> [S<I<debhelper options>>] [S<I<file ...>>]
-
- =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<file ...>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_testroot - ensure that a package is built as root
-
- =head1 SYNOPSIS
-
- B<dh_testroot> [S<I<debhelper options>>]
-
- =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<fakeroot(1)>
-
- =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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<dh_testversion> [S<I<debhelper options>>] [I<operator>] [I<version>]
-
- =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<operator>
-
- 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>
-
- 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<debhelper(7)>
-
- This program is a part of debhelper.
-
- =head1 AUTHOR
-
- Joey Hess <joeyh@debian.org>
-
- =cut
+++ /dev/null
--#!/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<debhelper(7)>
- @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 <joeyh@debian.org>
- # 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");
- }
-}
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
--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.
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
- 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 <joeyh@master.debian.org>
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 <doko@cs.tu-berlin.de>)
++* 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!