diff options
-rwxr-xr-x | dh_builddeb | 22 | ||||
-rwxr-xr-x | dh_gencontrol | 72 | ||||
-rwxr-xr-x | dh_md5sums | 18 | ||||
-rwxr-xr-x | dh_strip | 46 |
4 files changed, 80 insertions, 78 deletions
diff --git a/dh_builddeb b/dh_builddeb index f314e5ad..a39a716e 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -16,8 +16,8 @@ B<dh_builddeb> [S<I<debhelper options>>] [B<--destdir=>I<directory>] [B<--filena =head1 DESCRIPTION -B<dh_builddeb> simply calls L<dpkg-deb(1)> to build a Debian package or -packages. It will also build packages for ddebs when L<dh_strip(1)> +B<dh_builddeb> simply calls L<dpkg-deb(1)> to build a Debian package +or packages. It will also build dbgsym packages when L<dh_strip(1)> and L<dh_gencontrol(1)> have prepared them. It supports building multiple binary packages in parallel, when enabled by @@ -133,7 +133,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # child my $tmp=tmpdir($package); - my $ddeb_tmpdir = "debian/.debhelper/${package}/ddeb-root"; + my $dbgsym_tmpdir = "debian/.debhelper/${package}/dbgsym-root"; if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) { if (! compat(5)) { complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf"); @@ -145,20 +145,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) { foreach split(":", $ENV{DH_ALWAYS_EXCLUDE}); } } - if ( -d $ddeb_tmpdir) { - my $ddeb_control = "${ddeb_tmpdir}/DEBIAN/control"; - # Only build the ddeb if it has a control file. People might - # have skipped dh_gencontrol. - if ( -f $ddeb_control ) { + if ( -d $dbgsym_tmpdir) { + my $dbgsym_control = "${dbgsym_tmpdir}/DEBIAN/control"; + # Only build the dbgsym package if it has a control file. + # People might have skipped dh_gencontrol. + if ( -f $dbgsym_control ) { # XXX: Should we blindly overrule the maintainer here? It # is not apparent that their explicit -z was intended for - # the ddeb. + # the dbgsym package. my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"], @{$dh{U_PARAMS}}); doit("dpkg-deb", @args, - "--build", $ddeb_tmpdir, $dh{DESTDIR}); + "--build", $dbgsym_tmpdir, $dh{DESTDIR}); } elsif (not is_udeb($package)) { - warning("Not building ddeb for ${package} as it has no control file"); + warning("Not building dbgsym package for ${package} as it has no control file"); warning("Please use dh_gencontrol to avoid this issue"); } } diff --git a/dh_gencontrol b/dh_gencontrol index 1d35f893..0b92fd54 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -21,14 +21,15 @@ control files, and installing them into the I<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 (plus related ddebs), -and passes in some additional useful flags. +calls it once for each package being acted on (plus related dbgsym +packages), and passes in some additional useful flags. B<Note> that if you use B<dh_gencontrol>, you must also use L<dh_builddeb(1)> to build the packages. Otherwise, your build may fail to build as B<dh_gencontrol> (via L<dpkg-gencontrol(1)>) declares -which packages are built. As debhelper automatically generates ddebs, -it some times adds additional packages, which will be built by L<dh_builddeb(1)>. +which packages are built. As debhelper automatically generates dbgsym +packages, it some times adds additional packages, which will be built +by L<dh_builddeb(1)>. =head1 OPTIONS @@ -56,8 +57,8 @@ init(options => { foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); - my $ddeb_info_dir = "debian/.debhelper/${package}"; - my $ddeb_tmp = "${ddeb_info_dir}/ddeb-root"; + my $dbgsym_info_dir = "debian/.debhelper/${package}"; + my $dbgsym_tmp = "${dbgsym_info_dir}/dbgsym-root"; my $substvars="debian/${ext}substvars"; @@ -80,17 +81,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } my (@debug_info_params, $build_ids); - if ( -d $ddeb_info_dir ) { - $build_ids = read_ddeb_build_ids($ddeb_info_dir); + if ( -d $dbgsym_info_dir ) { + $build_ids = read_dbgsym_build_ids($dbgsym_info_dir); } - # Temporary workaround: Do not build ddebs for udebs as + # Temporary workaround: Do not build dbgsym packages for udebs as # dpkg-gencontrol and dpkg-deb does not agree on the file # extension. - if ( -d $ddeb_tmp and not is_udeb($package)) { + if ( -d $dbgsym_tmp and not is_udeb($package)) { my $multiarch = package_multiarch($package); my $section = package_section($package); - my $replaces = read_ddeb_migration($ddeb_info_dir); + my $replaces = read_dbgsym_migration($dbgsym_info_dir); my $component = ''; if ($section =~ m{^(.*)/[^/]+$}) { $component = "${1}/"; @@ -100,7 +101,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } # Remove and override more or less every standard field. - my @ddeb_options = (qw( + my @dbgsym_options = (qw( -UPre-Depends -URecommends -USuggests -UEnhances -UProvides -UEssential -UConflicts -DPriority=extra -DAuto-Built-Package=debug-symbols @@ -115,28 +116,29 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # multi-arch: same package. In all other cases, we do not # need a multi-arch value. if ($multiarch ne 'same') { - push(@ddeb_options, '-UMulti-Arch'); + push(@dbgsym_options, '-UMulti-Arch'); } - # If the ddeb is replacing an existing -dbg package, then - # declare the necessary Breaks + Replaces. Otherwise, clear - # the fields. + # If the dbgsym package is replacing an existing -dbg package, + # then declare the necessary Breaks + Replaces. Otherwise, + # clear the fields. if ($replaces) { - push(@ddeb_options, "-DReplaces=${replaces}", + push(@dbgsym_options, "-DReplaces=${replaces}", "-DBreaks=${replaces}"); } else { - push(@ddeb_options, '-UReplaces', '-UBreaks'); + push(@dbgsym_options, '-UReplaces', '-UBreaks'); } - if ( ! -d "${ddeb_tmp}/DEBIAN" ) { - install_dir("${ddeb_tmp}/DEBIAN"); + if ( ! -d "${dbgsym_tmp}/DEBIAN" ) { + install_dir("${dbgsym_tmp}/DEBIAN"); } doit("dpkg-gencontrol", "-p${package}", "-l$changelog", "-T$substvars", - "-P${ddeb_tmp}",@{$dh{U_PARAMS}}, @ddeb_options); + "-P${dbgsym_tmp}",@{$dh{U_PARAMS}}, @dbgsym_options); - doit("chmod","0644","${ddeb_tmp}/DEBIAN/control"); - doit("chown","0:0","${ddeb_tmp}/DEBIAN/control"); + doit("chmod","0644","${dbgsym_tmp}/DEBIAN/control"); + doit("chown","0:0","${dbgsym_tmp}/DEBIAN/control"); } elsif ($build_ids) { - # Only include the build-id if there is no ddeb (if there is a - # ddeb, the build-ids into the ddeb's control file) + # Only include the build-id if there is no dbgsym package (if + # there is a dbgsym package, the build-ids into the control + # file of the dbgsym package) push(@debug_info_params, "-DBuild-Ids=${build_ids}"); } @@ -151,25 +153,25 @@ foreach my $package (@{$dh{DOPACKAGES}}) { doit("chown","0:0","$tmp/DEBIAN/control"); } -sub read_ddeb_file { - my ($ddeb_info_file, $ddeb_info_dir) = @_; - my $ddeb_path = "${ddeb_info_dir}/${ddeb_info_file}"; +sub read_dbgsym_file { + my ($dbgsym_info_file, $dbgsym_info_dir) = @_; + my $dbgsym_path = "${dbgsym_info_dir}/${dbgsym_info_file}"; my $result; - if (-f $ddeb_path) { - open(my $fd, '<', $ddeb_path) - or error("open $ddeb_path failed: $!"); + if (-f $dbgsym_path) { + open(my $fd, '<', $dbgsym_path) + or error("open $dbgsym_path failed: $!"); chomp($result = <$fd>); close($fd); } return $result; } -sub read_ddeb_migration { - return read_ddeb_file('ddeb-migration', @_); +sub read_dbgsym_migration { + return read_dbgsym_file('dbgsym-migration', @_); } -sub read_ddeb_build_ids { - return read_ddeb_file('ddeb-build-ids', @_); +sub read_dbgsym_build_ids { + return read_dbgsym_file('dbgsym-build-ids', @_); } =head1 SEE ALSO @@ -52,7 +52,7 @@ init(options => { foreach my $package (@{$dh{DOPACKAGES}}) { next if is_udeb($package); - my $ddeb_tmp = "debian/.debhelper/${package}/ddeb-root"; + my $dbgsym_tmp = "debian/.debhelper/${package}/dbgsym-root"; my $tmp=tmpdir($package); if (! -d "$tmp/DEBIAN") { @@ -87,20 +87,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) { doit("chmod", "0644", "$tmp/DEBIAN/md5sums"); doit("chown", "0:0", "$tmp/DEBIAN/md5sums"); } - if ( -d $ddeb_tmp) { - if (! -d "${ddeb_tmp}/DEBIAN") { - install_dir("${ddeb_tmp}/DEBIAN"); + if ( -d $dbgsym_tmp) { + if (! -d "${dbgsym_tmp}/DEBIAN") { + install_dir("${dbgsym_tmp}/DEBIAN"); } $find = "find . -type f ! -regex './DEBIAN/.*' -printf '%P\\0'"; - complex_doit("(cd $ddeb_tmp >/dev/null ; $find | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null"); + complex_doit("(cd $dbgsym_tmp >/dev/null ; $find | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null"); # If the file's empty, no reason to waste inodes on it. - if (-z "${ddeb_tmp}/DEBIAN/md5sums") { - doit('rm', '-f', "${ddeb_tmp}/DEBIAN/md5sums"); + if (-z "${dbgsym_tmp}/DEBIAN/md5sums") { + doit('rm', '-f', "${dbgsym_tmp}/DEBIAN/md5sums"); } else { - doit('chmod', '0644', "${ddeb_tmp}/DEBIAN/md5sums"); - doit('chown', '0:0', "${ddeb_tmp}/DEBIAN/md5sums"); + doit('chmod', '0644', "${dbgsym_tmp}/DEBIAN/md5sums"); + doit('chown', '0:0', "${dbgsym_tmp}/DEBIAN/md5sums"); } } } @@ -116,7 +116,7 @@ Historical name for B<--automatic-dbgsym> and B<--no-automatic-dbgsym>. =item B<--ddeb-migration=>I<package-relation> -Historical name for B<--ddeb-migration>. +Historical name for B<--dbgsym-migration>. =back @@ -128,8 +128,8 @@ nothing will be stripped, in accordance with Debian policy (section debug symbol packages. The automatic creation of debug symbol packages can also be prevented -by adding B<noautodbgsym> (or B<noddebs>) to the B<DEB_BUILD_OPTIONS> -environment variable. +by adding B<noautodbgsym> to the B<DEB_BUILD_OPTIONS> environment +variable. =head1 CONFORMS TO @@ -139,22 +139,22 @@ Debian policy, version 3.0.1 init(options => { "keep-debug" => \$dh{K_FLAG}, - 'dbgsym-migration=s' => \$dh{MIGRATE_DDEB}, - 'automatic-dbgsym!' => \$dh{ENABLE_DDEBS}, + 'dbgsym-migration=s' => \$dh{MIGRATE_DBGSYM}, + 'automatic-dbgsym!' => \$dh{ENABLE_DBGSYM}, # Deprecated variants - 'ddeb-migration=s' => \$dh{MIGRATE_DDEB}, - 'ddebs!' => \$dh{ENABLE_DDEBS}, + 'ddeb-migration=s' => \$dh{MIGRATE_DBGSYM}, + 'ddebs!' => \$dh{ENABLE_DBGSYM}, }); -if ($dh{K_FLAG} and $dh{MIGRATE_DDEB}) { +if ($dh{K_FLAG} and $dh{MIGRATE_DBGSYM}) { error("--keep-debug and --dbgsym-migration are mutually exclusive"); } -if ($dh{DEBUGPACKAGES} and $dh{MIGRATE_DDEB}) { +if ($dh{DEBUGPACKAGES} and $dh{MIGRATE_DBGSYM}) { error("--dbg-package and --dbgsym-migration are mutually exclusive"); } -if ($dh{ENABLE_DDEBS} and $dh{ENABLE_DDEBS} ne 'auto') { +if ($dh{ENABLE_DBGSYM} and $dh{ENABLE_DBGSYM} ne 'auto') { if ($dh{K_FLAG}) { error("--keep-debug and explicit --automatic-dbgsym are mutually exclusive"); } @@ -163,10 +163,10 @@ if ($dh{ENABLE_DDEBS} and $dh{ENABLE_DDEBS} ne 'auto') { } } -$dh{ENABLE_DDEBS} = 1 if not defined($dh{ENABLE_DDEBS}); +$dh{ENABLE_DBGSYM} = 1 if not defined($dh{ENABLE_DBGSYM}); -if ($dh{MIGRATE_DDEB} and not $dh{ENABLE_DDEBS}) { - error("--ddeb-migration and --no-automatic-dbgsym are mutually exclusive"); +if ($dh{MIGRATE_DBGSYM} and not $dh{ENABLE_DBGSYM}) { + error("--dbgsym-migration and --no-automatic-dbgsym are mutually exclusive"); } # This variable can be used to turn off stripping (see Policy). @@ -176,7 +176,7 @@ if (get_buildoption('nostrip')) { my $objcopy = cross_command("objcopy"); my $strip = cross_command("strip"); -$dh{ENABLE_DDEBS} = 0 if get_buildoption('noautodbgsym') or get_buildoption('noddebs'); +$dh{ENABLE_DBGSYM} = 0 if get_buildoption('noautodbgsym') or get_buildoption('noddebs'); # I could just use `file $_[0]`, but this is safer sub get_file_type { @@ -318,11 +318,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) { $debugtmp=tmpdir($package."-dbg"); } } - if ($dh{ENABLE_DDEBS} and not $keep_debug and package_arch($package) ne 'all') { + if ($dh{ENABLE_DBGSYM} and not $keep_debug and package_arch($package) ne 'all') { # Avoid creating a dbgsym that would clash with a registered # package or looks like a manual -dbg package. if (!$all_packages{"${package}-dbgsym"} or $package =~ m/-dbg$/) { - $debugtmp = "debian/.debhelper/${package}/ddeb-root"; + $debugtmp = "debian/.debhelper/${package}/dbgsym-root"; $keep_debug = 1; $use_build_id = 2; } @@ -360,16 +360,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } } if ($use_build_id > 1 and -d $debugtmp) { - my $ddeb_docdir = "${debugtmp}/usr/share/doc"; - my $doc_symlink = "${ddeb_docdir}/${package}-dbgsym"; + my $dbgsym_docdir = "${debugtmp}/usr/share/doc"; + my $doc_symlink = "${dbgsym_docdir}/${package}-dbgsym"; if ( not -l $doc_symlink and not -e $doc_symlink ) { - install_dir($ddeb_docdir) if not -d $ddeb_docdir; + install_dir($dbgsym_docdir) if not -d $dbgsym_docdir; doit('ln', '-s', $package, $doc_symlink); } - if ($dh{MIGRATE_DDEB}) { - my $path = "debian/.debhelper/${package}/ddeb-migration"; + if ($dh{MIGRATE_DBGSYM}) { + my $path = "debian/.debhelper/${package}/dbgsym-migration"; open(my $fd, '>', $path) or error("open $path failed: $!"); - print {$fd} "$dh{MIGRATE_DDEB}\n"; + print {$fd} "$dh{MIGRATE_DBGSYM}\n"; close($fd) or error("close $path failed: $!"); } } @@ -381,7 +381,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $dbg_pkg = @{$dh{DEBUGPACKAGES}}[0]; $dir = "debian/.debhelper/${dbg_pkg}"; } - $path = "${dir}/ddeb-build-ids"; + $path = "${dir}/dbgsym-build-ids"; install_dir($dir) if ! -d $dir; open(my $fd, '>>', $path) or error("open $path failed: $!"); print {$fd} join(q{ }, sort(@build_ids)) . "\n"; |