summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey>2004-02-09 05:24:40 +0000
committerjoey <joey>2004-02-09 05:24:40 +0000
commit4f162e192c3563d740490cc99ced1513104ac34c (patch)
treeb521746cbacfde4afc5af4031b767d1f87101a83
parentad3f34f9653fe848816f2af915b9cdd260fc4421 (diff)
downloaddebhelper-version_4.2.0.tar.gz
r1655: * Added udeb support, as pioneered by di-packages-build. Understandsversion_4.2.0
"XC-Package-Type: udeb" in debian/control. See debhelper(1) for details. * Dh_Lib: add and export is_udeb and udeb_filename * dh_builddeb: name udebs with proper extension * dh_gencontrol: pass -n and filename to dpkg-gencontrol * dh_installdocs, dh_makeshlibs, dh_md5sums, dh_installchangelogs, dh_installexamples, dh_installman, dh_installmanpages: skip udebs * dh_shlibdeps: skip udebs. This may be temporary. * dh_installdeb: do not process conffiles, shlibs, preinsts, postrms, or prerms for udebs. Do not substiture #DEBHELPER# tokens in postinst scripts for udebs. * dh_installdebconf: skip config script for udebs, still do templates
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm8
-rw-r--r--Debian/Debhelper/Dh_Lib.pm38
-rw-r--r--debhelper.pod9
-rw-r--r--debian/changelog18
-rwxr-xr-xdh_builddeb11
-rwxr-xr-xdh_gencontrol5
-rwxr-xr-xdh_installchangelogs2
-rwxr-xr-xdh_installdeb10
-rwxr-xr-xdh_installdebconf2
-rwxr-xr-xdh_installdocs2
-rwxr-xr-xdh_installexamples2
-rwxr-xr-xdh_installman2
-rwxr-xr-xdh_installmanpages4
-rwxr-xr-xdh_makeshlibs2
-rwxr-xr-xdh_md5sums2
-rwxr-xr-xdh_python2
-rwxr-xr-xdh_shlibdeps2
-rw-r--r--doc/PROGRAMMING5
18 files changed, 113 insertions, 13 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index c610963b..1da5afd2 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -29,18 +29,18 @@ sub showhelp {
# order.
sub AddPackage { my($option,$value)=@_;
if ($option eq 'i' or $option eq 'indep') {
- push @{$options{DOPACKAGES}}, GetPackages('indep');
+ push @{$options{DOPACKAGES}}, getpackages('indep');
$options{DOINDEP}=1;
}
elsif ($option eq 'a' or $option eq 'arch') {
- push @{$options{DOPACKAGES}}, GetPackages('arch');
+ push @{$options{DOPACKAGES}}, getpackages('arch');
$options{DOARCH}=1;
}
elsif ($option eq 'p' or $option eq 'package') {
push @{$options{DOPACKAGES}}, $value;
}
elsif ($option eq 's' or $option eq 'same-arch') {
- push @{$options{DOPACKAGES}}, GetPackages('same');
+ push @{$options{DOPACKAGES}}, getpackages('same');
$options{DOSAME}=1;
}
else {
@@ -184,7 +184,7 @@ sub parseopts {
# built, and there are none of that type.
error("I have no package to build");
}
- push @{$options{DOPACKAGES}},GetPackages();
+ push @{$options{DOPACKAGES}},getpackages();
}
# Remove excluded packages from the list of packages to act on.
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 0eea0180..f42f8bd2 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -12,8 +12,9 @@ use vars qw(@ISA @EXPORT %dh);
@ISA=qw(Exporter);
@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
&pkgfile &pkgext &pkgfilename &isnative &autoscript &filearray
- &filedoublearray &GetPackages &basename &dirname &xargs %dh
- &compat &addsubstvar &delsubstvar &excludefile);
+ &filedoublearray &getpackages &basename &dirname &xargs %dh
+ &compat &addsubstvar &delsubstvar &excludefile &is_udeb
+ &udeb_filename);
my $max_compat=4;
@@ -72,7 +73,7 @@ sub init {
$dh{NO_ACT}=1;
}
- my @allpackages=GetPackages();
+ my @allpackages=getpackages();
# Get the name of the main binary package (first one listed in
# debian/control). Only if the main package was not set on the
# command line.
@@ -533,8 +534,14 @@ sub excludefile {
# Must pass "arch" or "indep" or "same" to specify arch-dependant or
# -independant or same arch packages. If nothing is specified, returns all
# packages.
-sub GetPackages {
+# As a side effect, populates %package_arches and %package_types with the
+# types of all packages (not only those returned).
+my (%package_types, %package_arches);
+sub getpackages {
my $type=shift;
+
+ %package_types=();
+ %package_arches=();
$type="" if ! defined $type;
@@ -546,6 +553,7 @@ sub GetPackages {
my $package="";
my $arch="";
+ my $package_type;
my @list=();
my %seen;
open (CONTROL, 'debian/control') ||
@@ -562,12 +570,20 @@ sub GetPackages {
else {
error("debian/control has a duplicate entry for $package");
}
+ $package_type="deb";
}
if (/^Architecture:\s*(.*)/) {
$arch=$1;
}
+ if (/^X[BC]*-Package-Type:\s*(.*)/) {
+ $package_type=$1;
+ }
if (!$_ or eof) { # end of stanza.
+ if ($package) {
+ $package_types{$package}=$package_type;
+ $package_arches{$package}=$arch;
+ }
if ($package &&
(($type eq 'indep' && $arch eq 'all') ||
($type eq 'arch' && $arch ne 'all') ||
@@ -584,4 +600,18 @@ sub GetPackages {
return @list;
}
+sub is_udeb {
+ my $package=shift;
+
+ return $package_types{$package} eq 'udeb';
+}
+
+sub udeb_filename {
+ my $package=shift;
+
+ my $filearch=$package_arches{$package} eq 'all' ? "all" : buildarch();
+ isnative($package); # side effect
+ return "${package}_$dh{VERSION}_$filearch.udeb";
+}
+
1
diff --git a/debhelper.pod b/debhelper.pod
index 8b26ca61..83e67830 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -325,6 +325,15 @@ files into the package, and use dh_link to set up the symlink (or do it by
hand), and debhelper should do the right thing: notice it is a dangling
symlink and not try to install a copyright file or changelog.
+=head2 udebs
+
+Debhelper includes support for udebs. To create a udeb with debhelper,
+add "XC-Package-Type: udeb" to the package's stanza in debian/control, and
+build-depend on debhelper (>= 4.2). Debhelper will try to create udebs that
+comply with debian-installer policy, by making the generated package files
+end in ".udeb", not installing any documentation into a udeb, skipping over
+preinst, postrm, prerm, and config scripts, etc.
+
=head2 Other notes
In general, if any debhelper program needs a directory to exist under
diff --git a/debian/changelog b/debian/changelog
index 9e780a3d..5f01e177 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+debhelper (4.2.0) unstable; urgency=low
+
+ * Added udeb support, as pioneered by di-packages-build. Understands
+ "XC-Package-Type: udeb" in debian/control. See debhelper(1) for
+ details.
+ * Dh_Lib: add and export is_udeb and udeb_filename
+ * dh_builddeb: name udebs with proper extension
+ * dh_gencontrol: pass -n and filename to dpkg-gencontrol
+ * dh_installdocs, dh_makeshlibs, dh_md5sums, dh_installchangelogs,
+ dh_installexamples, dh_installman, dh_installmanpages: skip udebs
+ * dh_shlibdeps: skip udebs. This may be temporary.
+ * dh_installdeb: do not process conffiles, shlibs, preinsts, postrms,
+ or prerms for udebs. Do not substiture #DEBHELPER# tokens in
+ postinst scripts for udebs.
+ * dh_installdebconf: skip config script for udebs, still do templates
+
+ -- Joey Hess <joeyh@debian.org> Sun, 8 Feb 2004 22:51:57 -0500
+
debhelper (4.1.90) unstable; urgency=low
* dh_strip: Add note to man page that the detached debugging symbols options
diff --git a/dh_builddeb b/dh_builddeb
index 3d9f9d86..31bcdc67 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -63,7 +63,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
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});
+ if (! is_udeb($package)) {
+ doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
+ }
+ else {
+ my $filename=$dh{FILENAME};
+ if (! $filename) {
+ $filename="/".udeb_filename($package);
+ }
+ doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$filename);
+ }
}
=head1 SEE ALSO
diff --git a/dh_gencontrol b/dh_gencontrol
index b9aaefb4..7614fa69 100755
--- a/dh_gencontrol
+++ b/dh_gencontrol
@@ -54,9 +54,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
# Generate and install control file.
my @command="dpkg-gencontrol";
- if (GetPackages() > 1) {
+ if (getpackages() > 1) {
push @command, "-p$package";
}
+ if (is_udeb($package)) {
+ push @command, "-n".udeb_filename($package);
+ }
doit(@command, "-l$changelog", "-isp", "-Tdebian/${ext}substvars",
"-P$tmp",@{$dh{U_PARAMS}});
diff --git a/dh_installchangelogs b/dh_installchangelogs
index 7de170aa..7bb235cb 100755
--- a/dh_installchangelogs
+++ b/dh_installchangelogs
@@ -68,6 +68,8 @@ if (isnative($dh{MAINPACKAGE}) && ! defined $upstream) {
my $news_name="NEWS.Debian";
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
my $changelog=pkgfile($package,"changelog");
my $news=pkgfile($package,"NEWS");
diff --git a/dh_installdeb b/dh_installdeb
index e25e1753..9832d102 100755
--- a/dh_installdeb
+++ b/dh_installdeb
@@ -52,6 +52,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
}
+ if (is_udeb($package)) {
+ # For udebs, only do the postinst, and no #DEBHELPER#.
+ my $f=pkgfile($package,"postinst");
+ if ($f) {
+ doit("install", "-o", 0, "-g", 0, "-m", 755,
+ $f, "$tmp/DEBIAN/postinst");
+ }
+ next;
+ }
+
# Install debian install scripts.
# If any .debhelper files exist, add them into the scripts.
foreach my $file (qw{postinst preinst prerm postrm}) {
diff --git a/dh_installdebconf b/dh_installdebconf
index 66dafd0c..ebf6a131 100755
--- a/dh_installdebconf
+++ b/dh_installdebconf
@@ -83,7 +83,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
}
- if ($config ne '') {
+ if (! is_udeb($package) && $config ne '') {
doit("install", "-o", 0, "-g", 0, "-m", 755, "-p",
$config, "$tmp/DEBIAN/config");
}
diff --git a/dh_installdocs b/dh_installdocs
index 3fe3d0c4..f7291860 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -88,6 +88,8 @@ instances of the same text to be added to maintainer scripts.
init();
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
my $file=pkgfile($package,"docs");
diff --git a/dh_installexamples b/dh_installexamples
index 8934e2fb..dcd37ad5 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -58,6 +58,8 @@ directory, it will install the complete contents of the directory.
init();
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
my $file=pkgfile($package,"examples");
diff --git a/dh_installman b/dh_installman
index 3d03d264..b626e33d 100755
--- a/dh_installman
+++ b/dh_installman
@@ -82,6 +82,8 @@ my @sofiles;
my @sodests;
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
my $file=pkgfile($package,"manpages");
my @manpages;
diff --git a/dh_installmanpages b/dh_installmanpages
index 39946f6a..415c86b7 100755
--- a/dh_installmanpages
+++ b/dh_installmanpages
@@ -126,11 +126,13 @@ sub find_so_man {
}
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
# Find all filenames that look like man pages.
@manpages=();
- @allpackages=GetPackages('');
+ @allpackages=getpackages('');
find(\&find_man,'.'); # populates @manpages
foreach my $page (@manpages) {
diff --git a/dh_makeshlibs b/dh_makeshlibs
index a888aeca..1d57b01e 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -86,6 +86,8 @@ Generates a shlibs file that looks something like:
init();
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
my %seen;
diff --git a/dh_md5sums b/dh_md5sums
index 7d313220..0619a3ba 100755
--- a/dh_md5sums
+++ b/dh_md5sums
@@ -46,6 +46,8 @@ being listed in the md5sums file.
init();
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
if (! -d "$tmp/DEBIAN") {
diff --git a/dh_python b/dh_python
index 02afea89..eb32fd46 100755
--- a/dh_python
+++ b/dh_python
@@ -132,7 +132,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
$strong_dep = 1;
my $pack = $package;
$pack =~ s/^python/python$python_version/;
- if (grep { "$_" eq "$pack" } GetPackages()) {
+ if (grep { "$_" eq "$pack" } getpackages()) {
addsubstvar($package, "python:Depends", $pack);
}
}
diff --git a/dh_shlibdeps b/dh_shlibdeps
index 3192b189..c92d1bf1 100755
--- a/dh_shlibdeps
+++ b/dh_shlibdeps
@@ -101,6 +101,8 @@ if ($dh{L_PARAMS}) {
}
foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
my $tmp=tmpdir($package);
my $ext=pkgext($package);
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 239f53e7..5a3156e1 100644
--- a/doc/PROGRAMMING
+++ b/doc/PROGRAMMING
@@ -237,5 +237,10 @@ delsubstvar($package, $substvar)
excludefile($filename)
This function returns true if -X has been used to ask for the file
to be excluded.
+is_udeb($package)
+ Returns true if the package is marked as a udeb in the control
+ file.
+udeb_filename($package)
+ Returns the filename of the udeb package.
-- Joey Hess <joeyh@debian.org>