From: unknown Date: Mon, 28 Jul 2003 18:45:47 +0000 (+0000) Subject: r933: This commit was manufactured by cvs2svn to create tag X-Git-Tag: version_2.0.73^0 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d0f5e343ec49729828671005b8a322836cb654a7;p=debhelper.git r933: This commit was manufactured by cvs2svn to create tag 'debian_version_2_0_73'. --- d0f5e343ec49729828671005b8a322836cb654a7 diff --cc debian/copyright index 931864d,50256a8..0000000 deleted file mode 100644,100644 --- a/debian/copyright +++ /dev/null @@@ -1,24 -1,9 +1,0 @@@ - Debhelper is written by and copyright 1997-2003 Joey Hess . -Debhelper is written by Joey Hess . -- - Increasinly miniscule parts of the code (and certainly my inspiration from the - whole thing) came from debmake, by Christoph Lameter . -Parts of the code (and certainly my inspiration from the whole thing) came -from debmake, by Christoph Lameter . -- - Some of the dh_md5sums command is from a program by Charles -Some of the dh_md5sums and dh_du commands is from a program by Charles --Briscoe-Smith . - - dh_perl is by Brendan O'Dea . - dh_python is by Josselin Mouette . - dh_installcatalogs is by Adam Di Carlo . - dh_scrollkeeper is by Ross Burton . - dh_usrlocal is by Andrew Stribblehill . - dh_installlogcheck is by Jon Middleton . - - The copyright of this package is GPL, version 2 or later. Files in the - examples/ directory are in the public domain[1]. On Debian systems the - complete text of the GPL is in /usr/share/common-licenses/GPL - - [1] Pendants who belive I cannot legally say that code I have written is in - the public domain may consider them instead to be licensed as follows: -- - Redistribution and use in source and binary forms, with or without - modification, are permitted under any circumstances. No warranty. -The copyright of this package is GPL, version 2 or later. diff --cc dh_gencontrol index 4e9ff3e,a2d152c..0000000 deleted file mode 100755,100755 --- a/dh_gencontrol +++ /dev/null @@@ -1,80 -1,30 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_gencontrol - generate and install control file - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [S I>] - - =head1 DESCRIPTION - - dh_gencontrol is a debhelper program that is responsible for generating - control files, and installing them into the DEBIAN directory with the - proper permissions. - - This program is merely a wrapper around L, which calls - it once for each package being acted on, and passes in some additional - useful flags including "-isp". - - =head1 OPTIONS - - =over 4 - - =item B<-u>I, B<--dpkg-gencontrol-params>I - - =item B<--> I - - Pass "params" to L. - - =back - - =cut -# -# Generate and install the control file. Simple dpkg-gencontrol wrapper. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $ext=pkgext($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $EXT=pkgext($PACKAGE); -- - my $changelog=pkgfile($package,'changelog'); - $changelog=pkgfile($PACKAGE,'changelog'); -- if (! $changelog) { -- $changelog='debian/changelog'; -- } -- - if ( ! -d "$tmp/DEBIAN" ) { - doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN"); - if ( ! -d '$TMP/DEBIAN' ) { - doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); -- } -- -- # Generate and install control file. - my @command="dpkg-gencontrol"; - if (GetPackages() > 1) { - push @command, "-p$package"; - } - doit(@command, "-l$changelog", "-isp", "-Tdebian/${ext}substvars", - "-P$tmp",@{$dh{U_PARAMS}}); - doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE", - "-Tdebian/$EXT\substvars","-P$TMP",@{$dh{U_PARAMS}}); -- - # This chmod is only necessary if the user sets the umask to - # something odd. - doit("chmod","644","$tmp/DEBIAN/control"); - # This chmod is only necessary if the user sets the umask to something odd. - doit("chmod","644","$TMP/DEBIAN/control"); -- - doit("chown","0.0","$tmp/DEBIAN/control"); - doit("chown","root.root","$TMP/DEBIAN/control"); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installcron index d28277c,5b872ac..0000000 deleted file mode 100755,100755 --- a/dh_installcron +++ /dev/null @@@ -1,58 -1,28 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installcron - install cron scripts into etc/cron.* - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] - - =head1 DESCRIPTION - - dh_installcron is a debhelper program that is responsible for installing - cron scripts into etc/cron.*/ in package build directories. The files - debian/package.cron.daily, debian/package.cron.weekly, - debian/package.cron.monthly, and debian/package.cron.d are installed. - - =cut -# -# Install cron scripts into the appropriate places. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - foreach my $type (qw{daily weekly monthly}) { - my $cron=pkgfile($package,"cron.$type"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - foreach $type (qw{daily weekly monthly}) { - $cron=pkgfile($PACKAGE,"cron.$type"); -- if ($cron) { - if (! -d "$tmp/etc/cron.$type") { - doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type"); - if (! -d "$TMP/etc/cron.$type") { - doit("install","-o","root","-g","root","-d","$TMP/etc/cron.$type"); -- } - doit("install",$cron,"$tmp/etc/cron.$type/$package"); - doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE"); -- } -- } -- # Seperate because this needs to be mode 644. - my $cron=pkgfile($package,"cron.d"); - $cron=pkgfile($PACKAGE,"cron.d"); -- if ($cron) { - if (! -d "$tmp/etc/cron.d") { - doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d"); - if (! -d "$TMP/etc/cron.d") { - doit("install","-o","root","-g","root","-d","$TMP/etc/cron.d"); -- } - doit("install","-m",644,$cron,"$tmp/etc/cron.d/$package"); - doit("install","-m",644,$cron,"$TMP/etc/cron.d/$PACKAGE"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installdirs index 3bd4ea8,7d5e49c..0000000 deleted file mode 100755,100755 --- a/dh_installdirs +++ /dev/null @@@ -1,97 -1,42 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installdirs - create subdirectories in package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-A>] [S>] - - =head1 DESCRIPTION - - dh_installdirs is a debhelper program that is responsible for creating - subdirectories in package build directories. - - Any directory names specified as parameters will be created in the package - build directory of the first package dh_installdirs is told to act on. By - default, this is the first binary package in debian/control, but if you use - -p, -i, or -a flags, it will be the first package specified by those flags. - - A file named debian/package.dirs can list other directories to be created. - Separate the directory names with whitespace. - - Be sure to only use directory names relative to the package build - directory. Ie, "/usr/bin" should not be used, use "usr/bin" instead. - - =head1 OPTIONS - - =over 4 - - =item B<-A>, B<--all> - - Create any directories specified by command line parameters in ALL packages - acted on, not just the first. - - =item I - - Create these directories in the package build directory of the first - package acted on. (Or in all packages if -A is specified.) - - =back - - =cut -# -# Reads debian/dirs, creates the directories listed there -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"dirs"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"dirs"); -- - if (! -e $tmp) { - doit("install","-d",$tmp); - if (! -e $TMP) { - doit("install","-d",$TMP); -- } -- - my @dirs; - undef @dirs; -- -- if ($file) { -- @dirs=filearray($file) -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @dirs, @ARGV; -- } -- -- if (@dirs) { - # Stick the $tmp onto the front of all the dirs. - # Stick the $TMP onto the front of all the dirs. -- # This is necessary, for 2 reasons, one to make them -- # be in the right directory, but more importantly, it -- # protects against the danger of absolute dirs being -- # specified. -- @dirs=map { - $_="$tmp/$_"; - $_="$TMP/$_"; -- tr:/:/:s; # just beautification. -- $_ -- } @dirs; -- -- # Create dirs. -- doit("install","-d",@dirs); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installemacsen index 80b83e6,3fbaf8b..0000000 deleted file mode 100755,100755 --- a/dh_installemacsen +++ /dev/null @@@ -1,118 -1,52 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installemacsen - register an emacs add on package - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] [B<--priority=>I] [B<--flavor=>I] - - =head1 DESCRIPTION - - dh_installemacsen is a debhelper program that is responsible for installing - files used by the debian emacsen-common package into package build - directories. - - It also automatically generates the postinst and prerm commands needed to - register a package as an emacs add on package. See L - for an explanation of how this works. - - If a file named debian/package.emacsen-install exists, then it is installed - into - usr/lib/emacsen-common/packages/install/package in the package build - directory. Similarly, debian/package.emacsen-remove is installed into - usr/lib/emacsen-common/packages/remove/package . And similarly, - debian/package.emacsen-startup is installed into - etc/emacs/site-start.d/50.el (by default). - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/prerm scripts. - - =item B<--priority=>I - - Sets the priority number of a site-start.d file. Default is 50. - - =item B<--flavor=>I - - Sets the flavor a site-start.d file will be installed in. Default is - "emacs", alternatives include "xemacs" and "emacs20". - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -# -# Registration with emacsen-common. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - if (! defined $dh{PRIORITY}) { - $dh{PRIORITY}=50; -if (! defined $dh{number}) { - $dh{number}=50; --} - if (! defined $dh{FLAVOR}) { - $dh{FLAVOR}='emacs'; -if (! defined $dh{flavor}) { - $dh{flavor}='emacs'; --} -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- - my $emacsen_install=pkgfile($package,"emacsen-install"); - my $emacsen_remove=pkgfile($package,"emacsen-remove"); - my $emacsen_startup=pkgfile($package,"emacsen-startup"); - $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); - $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); - $emacsen_startup=pkgfile($PACKAGE,"emacsen-startup"); -- -- if ($emacsen_install ne '') { - if (! -d "$tmp/usr/lib/emacsen-common/packages/install") { - doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install"); - if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { - doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install"); -- } - doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package"); - doit("install","-m0755",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE"); -- } -- -- if ($emacsen_remove ne '') { - if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") { - doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove"); - if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") { - doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove"); -- } - doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package"); - doit("install","-m0755","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); -- } -- -- if ($emacsen_startup ne '') { - if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") { - doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/"); - if (! -d "$TMP/etc/$dh{flavor}/site-start.d/") { - doit("install","-d","$TMP/etc/$dh{flavor}/site-start.d/"); -- } - doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el"); - doit("install","-m0644",$emacsen_startup,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); -- } -- -- if ($emacsen_install ne '' || $emacsen_remove ne '') { -- if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-emacsen", - "s/#PACKAGE#/$package/"); - autoscript($package,"prerm","prerm-emacsen", - "s/#PACKAGE#/$package/"); - autoscript($PACKAGE,"postinst","postinst-emacsen", - "s/#PACKAGE#/$PACKAGE/"); - autoscript($PACKAGE,"prerm","prerm-emacsen", - "s/#PACKAGE#/$PACKAGE/"); -- } -- } - } - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut -} diff --cc dh_installinit index 5e4e1f3,c43d24d..0000000 deleted file mode 100755,100755 --- a/dh_installinit +++ /dev/null @@@ -1,181 -1,74 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installinit - install init scripts into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<--init-script=>I] [B<-n>] [B<-r>] [B<-d>] [S I>] - - =head1 DESCRIPTION - - dh_installinit is a debhelper program that is responsible for installing - init scripts and associated defaults files into package build directories. - - It also automatically generates the postinst and postrm and prerm commands - needed to set up the symlinks in /etc/rc*.d/ and to start and stop the init - scripts. - - If a file named debian/package.init exists, then it is installed into - etc/init.d/package in the package build directory, with "package" replaced - by the package name. - - If a file named debian/package.default exists, then it is installed into - etc/default/package in the package build directory, with "package" replaced - by the package name. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm/prerm scripts. - - =item B<-r>, B<--no-restart-on-upgrade> - - Do not restart init script on upgrade. - - =item B<--no-start> - - Do not start the init script on install or upgrade, or stop it on removal. - Only call update-rc.d. Useful for rcS scripts. - - =item B<-d>, B<--remove-d> - - Remove trailing "d" from the name of the package, and use the result for the - filename the init script is installed as in etc/init.d/ , and the default file - is installed as in etc/default/ . This may be useful for daemons with names - ending in "d". (Note: this takes precedence over the --init-script parameter - described below.) - - =item B<-u>I B<--update-rcd-params=>I - - =item B<--> I - - Pass "params" to L. If not specified, "defaults" will be - passed to L. - - =item B<--init-script=>I - - Use "scriptname" as for the filename the init script is installed as in - etc/init.d/ (and also use it as the filename for the defaults file, if it - is installed). This is useful if you need to have an init script with a name - different from the package's name. Note that if you use this parameter, - dh_installinit will look to see if a file in the debian/ directory exists - that looks like "package.scriptname" and if so will install it as the init - script in preference to the files it normally installs. This feature is really - only useful if you need a single package to install more than one init script. - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -# -# Install debian/init[.d], and set up the postinst and postrm for init -# scripts. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- -- # Figure out what filename to install it as. -- my $script; -- if ($dh{D_FLAG}) { -- # -d on the command line sets D_FLAG. We will -- # remove a trailing 'd' from the package name and -- # use that as the name. - $script=$package; - $script=$PACKAGE; -- if ($script=~m/(.*)d$/) { -- $script=$1; -- } -- else { - warning("\"$package\" has no final d' in its name, but -d was specified."); - warning("\"$PACKAGE\" has no final d' in its name, but -d was specified."); -- } -- } -- elsif ($dh{INIT_SCRIPT}) { -- $script=$dh{INIT_SCRIPT}; -- } -- else { - $script=$package; - $script=$PACKAGE; -- } - - my $init=pkgfile($package,$script) || pkgfile($package,"init") || - pkgfile($package,"init.d"); - my $default=pkgfile($package,'default'); -- - if ($default ne '') { - if (! -d "$tmp/etc/default") { - doit("install","-d","$tmp/etc/default"); - } - doit("install","-p","-m644",$default,"$tmp/etc/default/$script"); - } - $init=pkgfile($PACKAGE,$script) || pkgfile($PACKAGE,"init") || - pkgfile($PACKAGE,"init.d"); -- -- if ($init ne '') { - if (! -d "$tmp/etc/init.d") { - doit("install","-d","$tmp/etc/init.d"); - if (! -d "$TMP/etc/init.d") { - doit("install","-d","$TMP/etc/init.d"); -- } -- - doit("install","-p","-m755",$init,"$tmp/etc/init.d/$script"); - doit("install","-p","-m755",$init,"$TMP/etc/init.d/$script"); -- -- # This is set by the -u "foo" command line switch, it's -- # the parameters to pass to update-rc.d. If not set, -- # we have to say "defaults". -- my $params=''; -- if (defined($dh{U_PARAMS})) { -- $params=join(' ',@{$dh{U_PARAMS}}); -- } -- if ($params eq '') { -- $params="defaults"; -- } -- -- if (! $dh{NOSCRIPTS}) { - if (! $dh{NO_START}) { - # update-rc.d, and start script - autoscript($package,"postinst", "postinst-init", - # -r on the command line sets R_FLAG. If it's set, there - # is no restart on upgrade. - if ($dh{R_FLAG}) { - autoscript($PACKAGE,"postinst","postinst-init-norestart", -- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - - if ($dh{R_FLAG}) { - # stops script only on remove - autoscript($package,"prerm","prerm-init-norestart", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - } - else { - # always stops script - autoscript($package,"prerm","prerm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - } - autoscript($PACKAGE,"postrm","postrm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); -- } -- else { - # just update-rc.d - autoscript($package,"postinst", "postinst-init-nostart", - autoscript($PACKAGE,"postinst","postinst-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($PACKAGE,"postrm","postrm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($PACKAGE,"prerm","prerm-init", -- "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); -- } - - # removes rc.d links - autoscript($package,"postrm","postrm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmenu index 420b216,c077f21..0000000 deleted file mode 100755,100755 --- a/dh_installmenu +++ /dev/null @@@ -1,91 -1,45 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmenu - install debian menu files into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installmenu is a debhelper program that is responsible for installing - files used by the debian menu package into package build directories. - - It also automatically generates the postinst and postrm commands needed to - interface with the debian menu package. See L for an - explanation of how this works. - - If a file named debian/package.menu exists, then it is installed into - usr/lib/menu/package in the package build directory. This is a debian menu - file. See L for its format. - - If a file named debian/package.menu-method exits, then it is installed into - etc/menu-methods/package in the package build directory. This is a debian - menu method file. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =back - - =cut -# -# Integration with debian menu system: -# -# If debian/menu file exists, save it to $TMP/usr/lib/menu/$PACKAGE -# If debian/menu-method file exists, save it to -# $TMP/etc/menu-methods/$PACKAGE -# -# Also, add to postinst and postrm. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $menu=pkgfile($package,"menu"); - my $menu_method=pkgfile($package,"menu-method"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $menu=pkgfile($PACKAGE,"menu"); - $menu_method=pkgfile($PACKAGE,"menu-method"); -- -- if ($menu ne '') { - if (! -d "$tmp/usr/lib/menu") { - doit("install","-d","$tmp/usr/lib/menu"); - if (! -d "$TMP/usr/lib/menu") { - doit("install","-d","$TMP/usr/lib/menu"); -- } - doit("install","-p","-m644",$menu,"$tmp/usr/lib/menu/$package"); - doit("install","-p","-m644",$menu,"$TMP/usr/lib/menu/$PACKAGE"); -- -- # Add the scripts if a menu-method file doesn't exist. -- # The scripts for menu-method handle everything these do, too. -- if ($menu_method eq "" && ! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-menu"); - autoscript($package,"postrm","postrm-menu") - autoscript($PACKAGE,"postinst","postinst-menu"); - autoscript($PACKAGE,"postrm","postrm-menu") -- } -- } -- -- if ($menu_method ne '') { - if (!-d "$tmp/etc/menu-methods") { - doit("install","-d","$tmp/etc/menu-methods"); - if (!-d "$TMP/etc/menu-methods") { - doit("install","-d","$TMP/etc/menu-methods"); -- } - doit("install","-p",$menu_method,"$tmp/etc/menu-methods/$package"); - doit("install","-p",$menu_method,"$TMP/etc/menu-methods/$PACKAGE"); -- -- if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/"); - autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/"); - autoscript($PACKAGE,"postinst","postinst-menu-method","s/#PACKAGE#/$PACKAGE/"); - autoscript($PACKAGE,"postrm","postrm-menu-method","s/#PACKAGE#/$PACKAGE/"); -- } -- } --} - - =head1 SEE ALSO - - L - L - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmime index 8ffd523,7cada57..0000000 deleted file mode 100755,100755 --- a/dh_installmime +++ /dev/null @@@ -1,75 -1,22 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmime - install mime files into package build directories - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installmime is a debhelper program that is responsible for installing - mime files into package build directories. - - It also automatically generates the postinst and postrm commands needed to - interface with the debian mime-support package. See L for - an explanation of how this works. - - If a file named debian/package.mime exists, then it is installed into - usr/lib/mime/packages/package in the package build directory. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $mime=pkgfile($package,"mime"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $mime=pkgfile($PACKAGE,"mime"); -- -- if ($mime ne '') { - if (! -d "$tmp/usr/lib/mime/packages") { - doit("install","-d","$tmp/usr/lib/mime/packages"); - if (! -d "$TMP/usr/lib/mime/packages") { - doit("install","-d","$TMP/usr/lib/mime/packages"); -- } - doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package"); - doit("install","-p","-m644",$mime,"$TMP/usr/lib/mime/packages/$PACKAGE"); -- -- if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-mime"); - autoscript($package,"postrm","postrm-mime") - autoscript($PACKAGE,"postinst","postinst-mime"); - autoscript($PACKAGE,"postrm","postrm-mime") -- } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installmodules index 13fd8f5,0ee00dc..0000000 deleted file mode 100755,100755 --- a/dh_installmodules +++ /dev/null @@@ -1,94 -1,28 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installmodules - register modules with modutils - - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - use File::Find; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installmodules is a debhelper program that is responsible for - registering kernel modules with modutils. - - Files named debian/package.modules will be installed as - etc/modutils/package in the package build directory. - - Then postinst and postrm commands are automatically generated to register - the modules when the package is installed. See L for an - explanation of how this works. Note that this will be done for any - package this program acts on which has either the above-mentioned file, or - has .o files in /lib/modules. - - =head1 OPTIONS - - =over 4 - - =item B<-n>, B<--noscripts> - - Do not modify postinst/postrm scripts. - - =back - - =head1 NOTES - - Note that this command is not idempotent. "dh_clean -k" should be called - between invocations of this command. Otherwise, it may cause multiple - instances of the same text to be added to maintainer scripts. - - =cut -# -# Register modules with modutils. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - # Returns true if there are any .o files in the passed directory. - sub find_kernel_modules { - my $searchdir=shift; - my @results=(); - - return unless -d $searchdir; - find(sub { push @results, $_ if /\.o$/ }, $searchdir); - return @results > 0; - } -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"modules"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"modules"); -- - if (! -e $tmp) { - doit("install","-d",$tmp); - if (! -e $TMP) { - doit("install","-d",$TMP); -- } -- -- if ($file) { - if (! -e "$tmp/etc/modutils") { - doit("install","-d","$tmp/etc/modutils"); - if (! -e "$TMP/etc/modutils") { - doit("install","-d","$TMP/etc/modutils"); - doit("install","-m","0644",$file,"$TMP/etc/modutils/$PACKAGE"); -- } - doit("install","-m","0644",$file,"$tmp/etc/modutils/$package"); - } - - if (! $dh{NOSCRIPTS} && - ($file || find_kernel_modules("$tmp/lib/modules"))) { - autoscript($package,"postinst","postinst-modules","s/#PACKAGE#/$package/"); - autoscript($package,"postrm","postrm-modules","s/#PACKAGE#/$package/"); - - if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-modules","s/#PACKAGE#/$PACKAGE/"); - autoscript($PACKAGE,"postrm","postrm-modules","s/#PACKAGE#/$PACKAGE/"); - } -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_installpam index 0f25179,897fd7d..0000000 deleted file mode 100755,100755 --- a/dh_installpam +++ /dev/null @@@ -1,50 -1,21 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_installpam - install pam support files - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-n>] - - =head1 DESCRIPTION - - dh_installpam is a debhelper program that is responsible for installing - files used by PAM into package build directories. - - If a file named debian/package.pam exists, then it is installed into - etc/pam.d/package in the package build directory. - - =cut -# -# Integration with debian pam system: -# -# If debian/pam file exists, save it to $TMP/etc/pam.d/$PACKAGE -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $pam=pkgfile($package,"pam"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $pam=pkgfile($PACKAGE,"pam"); -- -- if ($pam ne '') { - if (! -d "$tmp/etc/pam.d") { - doit("install","-d","$tmp/etc/pam.d"); - if (! -d "$TMP/etc/pam.d") { - doit("install","-d","$TMP/etc/pam.d"); -- } - doit("install","-p","-m644",$pam,"$tmp/etc/pam.d/$package"); - doit("install","-p","-m644",$pam,"$TMP/etc/pam.d/$PACKAGE"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_link index 6cb889c,1f6299a..0000000 deleted file mode 100755,100755 --- a/dh_link +++ /dev/null @@@ -1,181 -1,74 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_link - create symlinks in package build directories - - =cut - - use strict; - use File::Find; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-A>] [S>] - - =head1 DESCRIPTION - - dh_link is a debhelper program that creates symlinks in package build - directories. - - dh_link accepts a list of pairs of source and destination files. The source - files are the already existing files that will be symlinked from. The - destination files are the symlinks that will be created. There B be - an equal number of source and destination files specified. - - The list can be specified in two ways. A file named debian/package.links - can list pairs of files. If you use this file, you should put each pair - of files on its own line, and separate the files within the pair with - whitespace. Also, pairs of files can be specified as parameters - these - pairs will only be created in the package build directory of the first - package dh_link is told to act on. By default, this is the first binary - package in debian/control, but if you use -p, -i, or -a flags, it will be - the first package specified by those flags. - - Be sure you B specify the full filename to both the source and - destination files (unlike you would do if you were using something like - L). - - dh_link will generate symlinks that comply with debian policy - absolute - when policy says they should be absolute, and relative links with as short - a path as possible. It will also create any subdirectories it needs to to put - the symlinks in. - - dh_link also scans the package build tree for existing symlinks which do not - conform to debian policy, and corrects them (v4 only). - - =head1 OPTIONS - - =over 4 - - =item B<-A>, B<--all> - - Create any links specified by command line parameters in ALL packages - acted on, not just the first. - - =item I - - Create a file named "destination" as a link to a file named "source". Do - this in the package build directory of the first package acted on. - (Or in all packages if -A is specified.) - - =back - - =head1 EXAMPLES - - dh_link usr/share/man/man1/foo.1 usr/share/man/man1/bar.1 - - Make bar.1 be a symlink to foo.1 - - dh_link var/lib/foo usr/lib/foo \ - usr/X11R6/man/man1/foo.1x usr/share/man/man1/bar.1 - - Make /usr/lib/foo/ be a link to /var/lib/foo/, and bar.1 be a symlink to - the X man page foo.1x - - =cut -# -# Generate symlinks in debian packages, reading debian/links. The -# file contains pairs of files and symlinks. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $file=pkgfile($package,"links"); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $file=pkgfile($PACKAGE,"links"); -- - my @links; - undef @links; -- if ($file) { -- @links=filearray($file); -- } -- -- # Make sure it has pairs of symlinks and destinations. If it -- # doesn't, $#links will be _odd_ (not even, -- it's zero-based). -- if (int($#links/2) eq $#links/2) { -- error("$file lists a link without a destination."); -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @links, @ARGV; -- } -- -- # Same test as above, including arguments this time. -- if (int($#links/2) eq $#links/2) { -- error("parameters list a link without a destination."); -- } -- - # v4 only and only if there is a temp dir already - if (! compat(3) && -e $tmp) { - # Scan for existing links and add them to @links, so they - # are recreated policy conformant. - find( - sub { - return unless -l; - my $dir=$File::Find::dir; - $dir=~s/^\Q$tmp\E//; - my $target = readlink($_); - if ($target=~/^\//) { - push @links, $target; - } - else { - push @links, "$dir/$target"; - } - push @links, "$dir/$_"; - doit("rm","-f",$_); - - }, - $tmp); - } - -- while (@links) { - my $dest=pop @links; - my $src=pop @links; - $dest=pop @links; - $src=pop @links; -- - # Relavatize src and dest. - # Relivatize src and dest. -- $src=~s:^/::; -- $dest=~s:^/::; -- -- # Make sure the directory the link will be in exists. - my $basedir=dirname("$tmp/$dest"); - $basedir=Dh_Lib::dirname("$TMP/$dest"); -- if (! -e $basedir) { -- doit("install","-d",$basedir); -- } -- -- # Policy says that if the link is all within one toplevel -- # directory, it should be relative. If it's between -- # top level directories, leave it absolute. - my @src_dirs=split(m:/+:,$src); - my @dest_dirs=split(m:/+:,$dest); - @src_dirs=split(m:/+:,$src); - @dest_dirs=split(m:/+:,$dest); -- if ($src_dirs[0] eq $dest_dirs[0]) { -- # Figure out how much of a path $src and $dest -- # share in common. - my $x; -- for ($x=0; $x<$#src_dirs && $src_dirs[$x] eq $dest_dirs[$x]; $x++) {} -- # Build up the new src. -- $src=""; -- for (1..$#dest_dirs - $x) { -- $src.="../"; -- } -- for ($x .. $#src_dirs) { -- $src.=$src_dirs[$_]."/"; -- } -- $src=~s:/$::; -- } -- else { -- # Make sure it's properly absolute. -- $src="/$src"; -- } -- - doit("ln","-sf",$src,"$tmp/$dest"); - doit("ln","-sf",$src,"$TMP/$dest"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_listpackages index f919ef6,3ce48e0..0000000 deleted file mode 100755,100755 --- a/dh_listpackages +++ /dev/null @@@ -1,38 -1,8 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_listpackages - list binary packages debhelper will act on - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] - - =head1 DESCRIPTION - - dh_listpackages is a debhelper program that outputs a list of all binary - packages debhelper commands will act on. If you pass it some options, it - will change the list to match the packages other debhelper commands would - act on if passed the same options. - - =cut -# -# Output a list of all packages debhelper will act on. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); --print join("\n",@{$dh{DOPACKAGES}})."\n"; - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_md5sums index 6f794e7,80b5f47..0000000 deleted file mode 100755,100755 --- a/dh_md5sums +++ /dev/null @@@ -1,95 -1,46 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_md5sums - generate DEBIAN/md5sums file - - =cut -# -# Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the -# package. -- - use strict; --use Cwd; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-x>] [B<-X>I] [B<--include-conffiles>] - - =head1 DESCRIPTION - - dh_md5sums is a debhelper program that is responsible for generating - a DEBIAN/md5sums file, which lists the md5sums of each file in the package. - These files are used by the debsums package. - - All files in DEBIAN/ are omitted from the md5sums file, as are all - conffiles (unless you use the --include-conffiles switch). - - The md5sums file is installed with proper permissions and ownerships. - - =head1 OPTIONS - - =over 4 - - =item B<-x>, B<--include-conffiles> - - Include conffiles in the md5sums list. Note that this information is - redundant since it is included elsewhere in debian packages. - - =item B<-X>I, B<--exclude=>I - - Exclude files that contain "item" anywhere in their filename from - being listed in the md5sums file. - - =back - - =cut - -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- - if (! -d "$tmp/DEBIAN") { - doit("install","-d","$tmp/DEBIAN"); - if (! -d "$TMP/DEBIAN") { - doit("install","-d","$TMP/DEBIAN"); -- } -- -- # Check if we should exclude conffiles. -- my $exclude=""; - if (! $dh{INCLUDE_CONFFILES} && -r "$tmp/DEBIAN/conffiles") { - if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") { -- # Generate exclude regexp. - open (CONFF,"$tmp/DEBIAN/conffiles"); - open (CONFF,"$TMP/DEBIAN/conffiles"); -- while () { -- chomp; -- s/^\///; -- $exclude.="! -path \"$_\" "; -- } -- close CONFF; -- } -- -- # See if we should exclude other files. -- if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') { -- $exclude.="! \\( $dh{EXCLUDE_FIND} \\) "; -- } -- - my $olddir=getcwd(); - complex_doit("cd $tmp >/dev/null ; find . -type f $exclude ! -regex '.*/DEBIAN/.*' -printf '%P\\0' | xargs -r0 md5sum > DEBIAN/md5sums ; cd '$olddir' >/dev/null"); - $olddir=getcwd(); - complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null"); -- # If the file's empty, no reason to waste inodes on it. - if (-z "$tmp/DEBIAN/md5sums") { - doit("rm","-f","$tmp/DEBIAN/md5sums"); - if (-z "$TMP/DEBIAN/md5sums") { - doit("rm","-f","$TMP/DEBIAN/md5sums"); -- } -- else { - doit("chmod",644,"$tmp/DEBIAN/md5sums"); - doit("chown","0.0","$tmp/DEBIAN/md5sums"); - doit("chmod",644,"$TMP/DEBIAN/md5sums"); - doit("chown","root.root","$TMP/DEBIAN/md5sums"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_strip index 9e107f4,9d6ab05..0000000 deleted file mode 100755,100755 --- a/dh_strip +++ /dev/null @@@ -1,154 -1,71 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_strip - strip executables, shared libraries, and some static libraries - - =cut -# -# Strip files. -- - use strict; --use File::Find; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [B<-X>I] - - =head1 DESCRIPTION - - dh_strip is a debhelper program that is responsible for stripping - executables, shared libraries, and static libraries that are not used for - debugging. - - This program examines your package build directories and works out what - to strip on its own. It uses L and file permisions and filenames - to figure out what files are shared libraries (*.so), executable binaries, - and static (lib*.a) and debugging libraries (lib*_g.a, debug/*.so), and - strips each as much as is possible. (Which is not at all for debugging - libraries.) In general it seems to make very good guesses, and will do the - right thing in almost all cases. - - Since it is very hard to automatically guess if a file is a - module, and hard to determine how to strip a module, dh_strip does not - currently deal with stripping binary modules such as .o files. - - =head1 OPTIONS - - =over 4 - - =item B<-X>I, B<--exclude=>I - - Exclude files that contain "item" anywhere in their filename from being - stripped. You may use this option multiple times to build up a list of - things to exclude. - - =back - - =head1 NOTES - - If the DEB_BUILD_OPTIONS environment variable contains "nostrip", nothing - will be stripped, in accordance with Debian policy. - - =head1 CONFORMS TO - - Debian policy, version 3.0.1 - - =cut - -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - # This variable can be used to turn off stripping (see Policy). - if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS} =~ /nostrip/) { - exit; - } - - # I could just use `file $_[0]`, but this is safer - sub get_file_type { - my $file=shift; - open (FILE, '-|') # handle all filenames safely - || exec('file', $file) - || die "can't exec file: $!"; - my $type=; - close FILE; - return $type; - } -- --# Check if a file is an elf binary, shared library, or static library, --# for use by File::Find. It'll fill the following 3 arrays with anything --# it finds: --my (@shared_libs, @executables, @static_libs); --sub testfile { -- return if -l $_ or -d $_; # Skip directories and symlinks always. -- -- # See if we were asked to exclude this file. -- # Note that we have to test on the full filename, including directory. - my $fn="$File::Find::dir/$_"; - foreach my $f (@{$dh{EXCLUDE}}) { - $fn="$File::Find::dir/$_"; - foreach $f (@{$dh{EXCLUDE}}) { -- return if ($fn=~m/\Q$f\E/); -- } - - # Is it a debug library in a debug subdir? - return if $fn=~m/debug\/.*\.so/; -- -- # Does its filename look like a shared library? -- if (m/.*\.so.*?/) { -- # Ok, do the expensive test. - my $type=get_file_type($_); - my $type=`file $_`; -- if ($type=~m/.*ELF.*shared.*/) { -- push @shared_libs, $fn; -- return; -- } -- } -- -- # Is it executable? -x isn't good enough, so we need to use stat. - my (undef,undef,$mode,undef)=stat(_); - (undef,undef,$mode,undef)=stat(_); -- if ($mode & 0111) { -- # Ok, expensive test. - my $type=get_file_type($_); - if ($type=~m/.*ELF.*(executable|shared).*/) { - my $type=`file $_`; - if ($type=~m/.*ELF.*executable.*/) { -- push @executables, $fn; -- return; -- } -- } -- -- # Is it a static library, and not a debug library? - if (m/lib.*\.a$/ && ! m/.*_g\.a$/) { - if (m/lib.*\.a/ && ! m/.*_g\.a/) { -- push @static_libs, $fn; -- return; -- } --} -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); -- -- @shared_libs=@executables=@static_libs=(); - find(\&testfile,$tmp); - find(\&testfile,$TMP); -- -- foreach (@shared_libs) { -- # Note that all calls to strip on shared libs -- # *must* inclde the --strip-unneeded. - doit("strip","--remove-section=.comment", - "--remove-section=.note","--strip-unneeded",$_); - doit("strip","--remove-section=.comment","--remove-section=.note","--strip-unneeded",$_); -- } -- -- foreach (@executables) { - doit("strip","--remove-section=.comment", - "--remove-section=.note",$_); - doit("strip","--remove-section=.comment","--remove-section=.note",$_); -- } -- -- foreach (@static_libs) { -- doit("strip","--strip-debug",$_); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_suidregister index 3bc9bd9,dd01c2c..0000000 deleted file mode 100755,100755 --- a/dh_suidregister +++ /dev/null @@@ -1,127 -1,72 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_suidregister - obsolete suid registration program - - =head1 SYNOPSIS - - Do not run! - - =head1 DESCRIPTION - - This program used to register suid and sgid files with L, - but with the introduction of L, registration of files - in this way is unnecessary, and even harmful, so this program should not be - used. - - =head1 CONVERTING TO STATOVERRIDE - - Converting a package that uses this program to use the new statoverride - mechanism is easy. Just remove the call to dh_suidregister from - debian/rules, and add a versioned conflicts into your control file, as - follows: - - Conflicts: suidmanager (<< 0.50) - - The conflicts is only necessary if your package used to register things - with suidmanager; if it did not, you can just remove the call to this - program from your rules file. - - =cut -# -# If no parameters are given, and no debian/suid files exists, scan for -# suid/sgid files and suidregister them. -# -# If there are parameters, or there is a debian/suid, register the files -# listed there. -- - use strict; - use Debian::Debhelper::Dh_Lib; -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); - - my $notused=1; -- - foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp=tmpdir($package); - my $suid=pkgfile($package,"suid"); - my $tostrip=''; -foreach $PACKAGE (@{$dh{DOPACKAGES}}) { - $TMP=tmpdir($PACKAGE); - $suid=pkgfile($PACKAGE,"suid"); -- - my @files; - @files=(); -- if ($suid) { - @files=filearray($suid, $tmp); - @files=filearray($suid); -- } -- - if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { - if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { -- push @files, @ARGV; -- } -- -- if (! @files && ! $suid) { -- # No files specified (and no empty debian/suid file), so -- # guess what files to process. - @files=split(/\n/,`find $tmp -type f -perm +6000`); - @files=split(/\n/,`find $TMP -type f -perm +6000`); -- - # Strip the debian working directory off of the filenames. - $tostrip="$tmp/"; - # We will strip the debian working directory off of the - # filenames. - $tostrip="$TMP/"; -- } -- else { -- # We will strip leading /'s, so the user can feed this -- # program either absolute filenames, or relative filenames, -- # and it will do the right thing either way. -- $tostrip="/"; -- } -- - # Register files with suidregister. - foreach my $file (@files) { - foreach $file (@files) { -- # Strip leading $tostrip from $file. -- $file=~s/^$tostrip//; -- - # Create the sed string that will be used to - # Create the sed string that will be used to -- # fill in the blanks in the autoscript files. -- # Fill with the owner, group, and perms of the file. - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$tmp/$file"); - # Now come up with the user and group names for the uid and - # gid. - my $user=getpwuid($uid); - (undef,undef,$mode,undef,$uid,$gid,undef) = stat("$TMP/$file"); - # Now come up with the user and group names for the uid and gid. - $user=getpwuid($uid); -- if (! defined $user) { -- warning("$file has odd uid $uid, not in /etc/passwd"); -- $user=$uid; -- } - my $group=getgrgid($gid); - $group=getgrgid($gid); -- if (! defined $group) { -- warning("$file has odd gid $gid not in /etc/group"); -- $group=$gid; -- } - # Note that I have to print mode in ocal, stripping file - # type. - my $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$package/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", - $mode & 07777); - autoscript($package,"postinst","postinst-suid",$sedstr); - autoscript($package,"postrm","postrm-suid","$sedstr"); - } - # Note that I have to print mode in ocal, stripping file type. - $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$user/;s/#GROUP#/$group/;s/#PERMS#/%#o/", - $mode & 07777); -- - # Remove suid bits from files. This is delayed to this point, because - # of a situation with hard linked files if it is done earlier. - # See changelog for 2.0.77. - foreach my $file (@files) { - if ( -e "$tmp/$file") { - doit("chmod","a-s","$tmp/$file"); - autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); - autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); - - if ( -e "$TMP/$file") { - doit("chmod","a-s","$TMP/$file"); -- } - } - - if (@files) { - warning("This program should no longer be used. Please read the dh_suidregister(1) man page."); - $notused=0; -- } - } - - # Although they called it, it's not going to do anything. - if ($notused) { - warning("This program is obsolete, does nothing, and may be safely removed from your rules file."); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_testdir index 451b9ae,6d9258d..0000000 deleted file mode 100755,100755 --- a/dh_testdir +++ /dev/null @@@ -1,53 -1,15 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_testdir - test directory before building debian package - - =cut - - use strict; - use Debian::Debhelper::Dh_Lib; - - =head1 SYNOPSIS - - B [S>] [S>] - - =head1 DESCRIPTION - - dh_testdir tries to make sure that you are in the correct directory when - building a debian package. It makes sure that the file debian/control - exists, as well as any other files you specify. If not, - it exits with an error. - - =head1 OPTIONS - - =over 4 - - =item I - - Test for the existence of these files too. - - =back - - =cut -# -# Checks to make sure we are building the package in the right directory. -# Tests for the existance of debian/control, and for the existance -# of any other files you specify on the command line. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; --init(); -- - foreach my $file ('debian/control', @ARGV) { -foreach $file ('debian/control',@ARGV) { -- if (! -e $file) { -- error("\"$file\" not found. Are you sure you are in the correct directory?"); -- } --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut diff --cc dh_testversion index a17f22e,096aa9e..0000000 deleted file mode 100755,100755 --- a/dh_testversion +++ /dev/null @@@ -1,84 -1,24 +1,0 @@@ --#!/usr/bin/perl -w - - =head1 NAME - - dh_testversion - ensure that the correct version of debhelper is installed - - =cut - - use Debian::Debhelper::Dh_Lib; - use Debian::Debhelper::Dh_Version; # contains the version number of debhelper. - - =head1 SYNOPSIS - - B [S>] [I] [I] - - =head1 DESCRIPTION - - Note: This program is deprecated. You should use build dependencies - instead. - - dh_testversion compares the version of debhelper against the version you - specify, and if the condition is not met, exits with an error message. - - You can use this in your debian/rules files if a new debhelper feature is - introduced, and your package requires that feature to build correctly. Use - debhelper's changelog to figure out the version you need. - - Be sure not to overuse dh_testversion. If debhelper version 9.5 - introduces a new dh_autofixbugs command, and your package uses it, then if - someone tries to build it with debhelper 1.0, the build will fail anyway when - dh_autofixbugs cannot be found, so there is no need for you to use - dh_testversion. - - =head1 OPTIONS - - =over 4 - - =item I - - Optional comparison operator used in comparing the versions. If not - specified, ">=" is used. For descriptions of the comparison operators, see - dpkg --help. - - =item I - - Version number to compare against the current version of debhelper. If not - specified, dh_testversion does nothing. - - =back - - =cut -# -# Debhelper version check. -- -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; -use Dh_Version; # contains the version number of debhelper. --init(); -- --my($compare, $ver); -- --if ($#ARGV > 0) { -- $compare=shift; -- $ver=shift; --} --elsif ($#ARGV eq 0) { -- $compare=">="; -- $ver=shift; --} - - warning("This program is deprecated, you should use build dependencies instead."); -- --if (defined $compare and defined $ver) { - warning("Something like: \"Build-Depends: debhelper ($compare $ver)\""); - system('dpkg','--compare-versions',$Debian::Debhelper::Dh_Version::version,$compare,$ver) == 0 || - error("debhelper version $Debian::Debhelper::Dh_Version::version is installed, but a version $compare $ver is needed to build this package."); - system('dpkg','--compare-versions',$Dh_Version::version,$compare,$ver) == 0 || - error("debhelper version $Dh_Version::version is installed, but a version $compare $ver is needed to build this package."); --} - - =head1 SEE ALSO - - L - - This program is a part of debhelper. - - =head1 AUTHOR - - Joey Hess - - =cut