[debhelper-devel] [debhelper] 01/01: Merge tag 'debian/9.20160115'
Niels Thykier
nthykier at moszumanska.debian.org
Sun Jan 7 21:38:17 UTC 2018
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to annotated tag Release_3.0.0
in repository debhelper.
commit faa9618d916652ade0bd6de5c74f50806079d5b9
Merge: 62388da 0498ebb
Author: Daniel Drake <drake at endlessm.com>
Date: Fri Mar 11 09:14:19 2016 -0600
Merge tag 'debian/9.20160115'
Release debhelper/9.20160115 into unstable
Format: 1.8
Date: Fri, 15 Jan 2016 20:28:37 +0000
Source: debhelper
Binary: debhelper
Architecture: source
Version: 9.20160115
Distribution: unstable
Urgency: medium
Maintainer: Debhelper Maintainers <debhelper-devel at lists.alioth.debian.org>
Changed-By: Niels Thykier <niels at thykier.net>
Description:
debhelper - helper programs for debian/rules
Closes: 811038 811052
Changes:
debhelper (9.20160115) unstable; urgency=medium
.
* Fix brown paper bag bug that caused many packages to
FTBFS when dh_update_autotools_config was called.
(Closes: #811052)
* Revert removal of autoscripts/*-makeshlibs. Some packages
injected them directly into their maintainer scripts.
(Closes: #811038)
Checksums-Sha1:
5a3b702497d561296020e7933e202678733d813c 1703 debhelper_9.20160115.dsc
31859b0465b1e9ada4a0bffb5b4f957fe180413f 334540 debhelper_9.20160115.tar.xz
Checksums-Sha256:
4624faeb88c272edaba005587008427dde4aeda3e7535bc4d09831a9d8baa7aa 1703 debhelper_9.20160115.dsc
80f2c86caa5878bd41029f96c06ec709bc05fe6f83a366b74e14d4dd989f9302 334540 debhelper_9.20160115.tar.xz
Files:
6e941d91d8f7082b704193cdc9a18046 1703 devel optional debhelper_9.20160115.dsc
47d6e8e12aaf1961779f17e658c212ee 334540 devel optional debhelper_9.20160115.tar.xz
Conflicts:
Debian/Debhelper/Buildsystem/autoconf.pm
Debian/Debhelper/Buildsystem/cmake.pm
Debian/Debhelper/Buildsystem/perl_build.pm
Debian/Debhelper/Buildsystem/perl_makemaker.pm
Debian/Debhelper/Buildsystem/python_distutils.pm
Debian/Debhelper/Buildsystem/qmake.pm
Debian/Debhelper/Dh_Lib.pm
debian/control
dh_fixperms
dh_gencontrol
dh_installdirs
man/po4a/po/de.po
man/po4a/po/debhelper.pot
man/po4a/po/es.po
man/po4a/po/fr.po
.gitignore | 1 +
Debian/Debhelper/Buildsystem.pm | 66 +-
Debian/Debhelper/Buildsystem/ant.pm | 23 +-
Debian/Debhelper/Buildsystem/autoconf.pm | 16 +-
Debian/Debhelper/Buildsystem/cmake.pm | 54 +-
Debian/Debhelper/Buildsystem/makefile.pm | 9 +-
Debian/Debhelper/Buildsystem/perl_build.pm | 11 +-
Debian/Debhelper/Buildsystem/perl_makemaker.pm | 15 +-
Debian/Debhelper/Buildsystem/python_distutils.pm | 9 +-
Debian/Debhelper/Buildsystem/qmake.pm | 9 +-
Debian/Debhelper/Buildsystem/qmake_qt4.pm | 8 +-
Debian/Debhelper/Dh_Buildsystems.pm | 12 +-
Debian/Debhelper/Dh_Getopt.pm | 9 +-
Debian/Debhelper/Dh_Lib.pm | 575 +++-
Debian/Debhelper/Sequence/python_support.pm | 6 +
Makefile | 4 +-
autoscripts/postinst-emacsen | 2 +-
autoscripts/postinst-init | 8 +-
autoscripts/postinst-init-nostart | 6 +-
autoscripts/postinst-init-restart | 16 +-
autoscripts/postinst-init-tmpfiles | 10 +-
autoscripts/postinst-python | 7 -
autoscripts/preinst-emacsen | 2 +-
autoscripts/prerm-emacsen | 2 +-
autoscripts/prerm-python | 3 -
debhelper.pod | 146 +-
debian/changelog | 510 +++
debian/control | 12 +-
debian/copyright | 9 +-
debian/rules | 4 -
debian/source/format | 1 +
debian/source/local-options | 2 +
dh | 121 +-
dh_auto_build | 9 +-
dh_auto_clean | 9 +-
dh_auto_configure | 9 +-
dh_auto_install | 11 +-
dh_auto_test | 12 +-
dh_bugfiles | 31 +-
dh_builddeb | 88 +-
dh_clean | 64 +-
dh_compress | 33 +-
dh_desktop | 9 +-
dh_fixperms | 81 +-
dh_gconf | 29 +-
dh_gencontrol | 123 +-
dh_icons | 20 +-
dh_install | 74 +-
dh_installcatalogs | 17 +-
dh_installchangelogs | 46 +-
dh_installcron | 21 +-
dh_installdeb | 57 +-
dh_installdebconf | 16 +-
dh_installdirs | 21 +-
dh_installdocs | 60 +-
dh_installemacsen | 34 +-
dh_installexamples | 18 +-
dh_installgsettings | 14 +-
dh_installifupdown | 15 +-
dh_installinfo | 13 +-
dh_installinit | 105 +-
dh_installlogcheck | 13 +-
dh_installlogrotate | 13 +-
dh_installman | 14 +-
dh_installmanpages | 23 +-
dh_installmenu | 23 +-
dh_installmime | 18 +-
dh_installmodules | 15 +-
dh_installpam | 15 +-
dh_installppp | 13 +-
dh_installudev | 13 +-
dh_installwm | 19 +-
dh_installxfonts | 13 +-
dh_link | 102 +-
dh_lintian | 15 +-
dh_listpackages | 9 +-
dh_makeshlibs | 86 +-
dh_md5sums | 34 +-
dh_movefiles | 41 +-
dh_perl | 9 +-
dh_prep | 11 +-
dh_scrollkeeper | 9 +-
dh_shlibdeps | 26 +-
dh_strip | 212 +-
dh_suidregister | 11 +-
dh_testdir | 9 +-
dh_testroot | 9 +-
dh_ucf | 13 +-
dh_undocumented | 9 +-
dh_update_autotools_config | 77 +
dh_usrlocal | 10 +-
doc/PROGRAMMING | 74 +-
lib | 1 +
man/po4a/po/de.po | 3258 ++++++++++---------
man/po4a/po/debhelper.pot | 2176 +++++++------
man/po4a/po/es.po | 2953 ++++++++++-------
man/po4a/po/fr.po | 3774 +++++++++++++---------
man/po4a/po/pt.po | 2704 ++++++++++------
t/buildsystems/autoconf/configure | 1 +
t/dh-lib | 6 +
t/dh_compress.t | 93 +
t/dh_install | 6 +
t/dh_link | 6 +
t/maintscript | 6 +
t/override_target | 8 +-
t/pod | 6 +
t/size | 8 +-
t/syntax | 6 +
108 files changed, 11866 insertions(+), 6831 deletions(-)
diff --cc Debian/Debhelper/Buildsystem/autoconf.pm
index dfee24c,62ff8b3..0e367ca
--- a/Debian/Debhelper/Buildsystem/autoconf.pm
+++ b/Debian/Debhelper/Buildsystem/autoconf.pm
@@@ -7,9 -7,9 +7,9 @@@
package Debian::Debhelper::Buildsystem::autoconf;
use strict;
- use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage compat
- get_buildprefix);
- use base 'Debian::Debhelper::Buildsystem::makefile';
+ use warnings;
-use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage compat);
++use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage compat get_buildprefix);
+ use parent qw(Debian::Debhelper::Buildsystem::makefile);
sub DESCRIPTION {
"GNU Autoconf (configure)"
@@@ -37,14 -36,11 +37,16 @@@ sub configure
push @opts, "--includedir=\${prefix}/include";
push @opts, "--mandir=\${prefix}/share/man";
push @opts, "--infodir=\${prefix}/share/info";
- push @opts, "--sysconfdir=/etc";
- push @opts, "--localstatedir=/var";
+ if ($prefix eq "/usr") {
+ push @opts, "--sysconfdir=/etc";
+ push @opts, "--localstatedir=/var";
+ } else {
+ push @opts, "--sysconfdir=\${prefix}/etc";
+ push @opts, "--localstatedir=\${prefix}/var";
+ }
- if (defined $ENV{DH_VERBOSE} && $ENV{DH_VERBOSE} ne "") {
+ if (defined $ENV{DH_QUIET} && $ENV{DH_QUIET} ne "") {
+ push @opts, "--enable-silent-rules";
+ } else {
push @opts, "--disable-silent-rules";
}
my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
diff --cc Debian/Debhelper/Buildsystem/cmake.pm
index 3d80e3c,f4d5c3c..4171038
--- a/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/Debian/Debhelper/Buildsystem/cmake.pm
@@@ -7,8 -7,23 +7,22 @@@
package Debian::Debhelper::Buildsystem::cmake;
use strict;
- use Debian::Debhelper::Dh_Lib qw(compat get_buildprefix);
- use base 'Debian::Debhelper::Buildsystem::makefile';
+ use warnings;
-use Debian::Debhelper::Dh_Lib qw(compat dpkg_architecture_value error is_cross_compiling);
++use Debian::Debhelper::Dh_Lib qw(compat dpkg_architecture_value error is_cross_compiling get_buildprefix);
+ use parent qw(Debian::Debhelper::Buildsystem::makefile);
+
+ my @STANDARD_CMAKE_FLAGS = qw(
- -DCMAKE_INSTALL_PREFIX=/usr
+ -DCMAKE_VERBOSE_MAKEFILE=ON
+ -DCMAKE_BUILD_TYPE=None
+ -DCMAKE_INSTALL_SYSCONFDIR=/etc
+ -DCMAKE_INSTALL_LOCALSTATEDIR=/var
+ );
+
+ my %DEB_HOST2CMAKE_SYSTEM = (
+ 'linux' => 'Linux',
+ 'kfreebsd' => 'FreeBSD',
+ 'hurd' => 'GNU',
+ );
sub DESCRIPTION {
"CMake (CMakeLists.txt)"
@@@ -38,18 -53,29 +52,36 @@@ sub new
sub configure {
my $this=shift;
- my @flags;
+ my $prefix=get_buildprefix();
-
# Standard set of cmake flags
+ my @flags = @STANDARD_CMAKE_FLAGS;
+ push @flags, "-DCMAKE_INSTALL_PREFIX=$prefix";
- push @flags, "-DCMAKE_VERBOSE_MAKEFILE=ON";
- push @flags, "-DCMAKE_BUILD_TYPE=None";
++
+ if ($prefix ne "/usr") {
+ # Always include the RPATH from the app link paths.
+ push @flags, "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON";
+ }
+ if (is_cross_compiling()) {
+ my $deb_host = dpkg_architecture_value("DEB_HOST_ARCH_OS");
+ if (my $cmake_system = $DEB_HOST2CMAKE_SYSTEM{$deb_host}) {
+ push(@flags, "-DCMAKE_SYSTEM_NAME=${cmake_system}");
+ } else {
+ error("Cannot cross-compile - CMAKE_SYSTEM_NAME not known for ${deb_host}");
+ }
+ push @flags, "-DCMAKE_SYSTEM_PROCESSOR=" . dpkg_architecture_value("DEB_HOST_GNU_CPU");
+ if ($ENV{CC}) {
+ push @flags, "-DCMAKE_C_COMPILER=" . $ENV{CC};
+ } else {
+ push @flags, "-DCMAKE_C_COMPILER=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-cc";
+ }
+ if ($ENV{CXX}) {
+ push @flags, "-DCMAKE_CXX_COMPILER=" . $ENV{CXX};
+ } else {
+ push @flags, "-DCMAKE_CXX_COMPILER=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-c++";
+ }
+ }
+
# CMake doesn't respect CPPFLAGS, see #653916.
if ($ENV{CPPFLAGS} && ! compat(8)) {
$ENV{CFLAGS} .= ' ' . $ENV{CPPFLAGS};
diff --cc Debian/Debhelper/Buildsystem/perl_build.pm
index 1382b67,39c79e2..13a558a
--- a/Debian/Debhelper/Buildsystem/perl_build.pm
+++ b/Debian/Debhelper/Buildsystem/perl_build.pm
@@@ -7,8 -7,9 +7,9 @@@
package Debian::Debhelper::Buildsystem::perl_build;
use strict;
+ use warnings;
-use Debian::Debhelper::Dh_Lib qw(compat);
+use Debian::Debhelper::Dh_Lib qw(compat get_buildprefix);
- use base 'Debian::Debhelper::Buildsystem';
+ use parent qw(Debian::Debhelper::Buildsystem);
use Config;
sub DESCRIPTION {
diff --cc Debian/Debhelper/Buildsystem/perl_makemaker.pm
index b178437,a98e9e9..5195984
--- a/Debian/Debhelper/Buildsystem/perl_makemaker.pm
+++ b/Debian/Debhelper/Buildsystem/perl_makemaker.pm
@@@ -7,8 -7,9 +7,9 @@@
package Debian::Debhelper::Buildsystem::perl_makemaker;
use strict;
+ use warnings;
-use Debian::Debhelper::Dh_Lib qw(compat);
+use Debian::Debhelper::Dh_Lib qw(compat get_buildprefix);
- use base 'Debian::Debhelper::Buildsystem::makefile';
+ use parent qw(Debian::Debhelper::Buildsystem::makefile);
use Config;
sub DESCRIPTION {
diff --cc Debian/Debhelper/Buildsystem/python_distutils.pm
index d557802,0eef8f1..8d08d69
--- a/Debian/Debhelper/Buildsystem/python_distutils.pm
+++ b/Debian/Debhelper/Buildsystem/python_distutils.pm
@@@ -8,9 -8,10 +8,10 @@@
package Debian::Debhelper::Buildsystem::python_distutils;
use strict;
+ use warnings;
use Cwd ();
-use Debian::Debhelper::Dh_Lib qw(error);
+use Debian::Debhelper::Dh_Lib qw(error get_buildprefix);
- use base 'Debian::Debhelper::Buildsystem';
+ use parent qw(Debian::Debhelper::Buildsystem);
sub DESCRIPTION {
"Python Distutils (setup.py)"
diff --cc Debian/Debhelper/Buildsystem/qmake.pm
index abf8a53,0bc53e6..de63691
--- a/Debian/Debhelper/Buildsystem/qmake.pm
+++ b/Debian/Debhelper/Buildsystem/qmake.pm
@@@ -8,8 -8,8 +8,8 @@@ package Debian::Debhelper::Buildsystem:
use strict;
use warnings;
-use Debian::Debhelper::Dh_Lib qw(error);
+use Debian::Debhelper::Dh_Lib qw(error get_buildprefix);
- use base 'Debian::Debhelper::Buildsystem::makefile';
+ use parent qw(Debian::Debhelper::Buildsystem::makefile);
our $qmake="qmake";
@@@ -66,8 -66,9 +66,9 @@@ sub configure
push @flags, "QMAKE_LFLAGS_DEBUG=$ENV{LDFLAGS}";
}
push @flags, "QMAKE_STRIP=:";
- push @flags, "PREFIX=/usr";
+ push @flags, "PREFIX=" . get_buildprefix();
+ $this->mkdir_builddir();
$this->doit_in_builddir($qmake, @options, @flags, @_);
}
diff --cc Debian/Debhelper/Dh_Lib.pm
index a3d3f0a,da20b76..db9d137
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@@ -15,12 -26,17 +26,18 @@@ use vars qw(@EXPORT %dh)
&autoscript &filearray &filedoublearray
&getpackages &basename &dirname &xargs %dh
&compat &addsubstvar &delsubstvar &excludefile &package_arch
- &is_udeb &udeb_filename &debhelper_script_subst &escape_shell
+ &is_udeb &debhelper_script_subst &escape_shell
&inhibit_log &load_log &write_log &commit_override_log
- &dpkg_architecture_value &sourcepackage
+ &dpkg_architecture_value &sourcepackage &make_symlink
&is_make_jobserver_unavailable &clean_jobserver_makeflags
&cross_command &set_buildflags &get_buildoption
- &get_buildprofile &get_buildprefix &package_eos_app_id);
+ &install_dh_config_file &error_exitcode &package_multiarch
+ &install_file &install_prog &install_lib &install_dir
+ &get_source_date_epoch &is_cross_compiling
+ &generated_file &autotrigger &package_section
+ &restore_file_on_clean &restore_all_files
++ &get_buildprofile &get_buildprefix &package_eos_app_id
+ );
my $max_compat=10;
@@@ -790,24 -913,27 +914,29 @@@ sub sourcepackage
#
# 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, %package_eos_app_ids);
+ my (%package_types, %package_arches, %package_multiarches, %packages_by_type,
- %package_sections);
++ %package_sections, %package_eos_app_ids);
sub getpackages {
- my $type=shift;
+ my ($type) = @_;
+ error("getpackages: First argument must be one of \"arch\", \"indep\", or \"both\"")
+ if defined($type) and $type ne 'both' and $type ne 'indep' and $type ne 'arch';
+
+ $type //= 'all-listed-in-control-file';
- %package_types=();
- %package_arches=();
+ if (%packages_by_type) {
+ return @{$packages_by_type{$type}};
+ }
+
+ $packages_by_type{$_} = [] for qw(both indep arch all-listed-in-control-file);
+ %package_eos_app_ids=();
- $type="" if ! defined $type;
my $package="";
my $arch="";
- my $package_type;
+ my $eos_app_id;
- my @list=();
- my %seen;
- my @profiles=();
- my $included_in_build_profile;
+ my $section="";
+ my ($package_type, $multiarch, %seen, @profiles, $source_section,
+ $included_in_build_profile);
if (exists $ENV{'DEB_BUILD_PROFILES'}) {
@profiles=split /\s+/, $ENV{'DEB_BUILD_PROFILES'};
}
@@@ -828,16 -954,18 +957,22 @@@
$package_type="deb";
$included_in_build_profile=1;
}
- if (/^Architecture:\s*(.*)/) {
+ if (/^Section:\s(.*)\s*$/i) {
+ $section = $1;
+ }
+ if (/^Architecture:\s*(.*)/i) {
$arch=$1;
}
- if (/^(?:X[BC]*-)?Package-Type:\s*(.*)/) {
+ if (/^(?:X[BC]*-)?Package-Type:\s*(.*)/i) {
$package_type=$1;
}
+ if (/^Multi-Arch: \s*(.*)\s*/i) {
+ $multiarch = $1;
+ }
+ if (/^(?:X[CBS]*-)?Eos-Appid:\s*(.*)/i) {
+ $eos_app_id=$1;
+ }
-
++
# rely on libdpkg-perl providing the parsing functions because
# if we work on a package with a Build-Profiles field, then a
# high enough version of dpkg-dev is needed anyways
@@@ -859,22 -987,25 +994,27 @@@
if ($package) {
$package_types{$package}=$package_type;
$package_arches{$package}=$arch;
+ $package_eos_app_ids{$package}=$eos_app_id;
+ $package_multiarches{$package} = $multiarch;
+ $package_sections{$package} = $section || $source_section;
+ if ($included_in_build_profile) {
+ push(@{$packages_by_type{'all-listed-in-control-file'}}, $package);
+ if ($arch eq 'all') {
+ push(@{$packages_by_type{'indep'}}, $package);
+ push(@{$packages_by_type{'both'}}, $package);
+ } elsif ($arch eq 'any' ||
+ ($arch ne 'all' && samearch(buildarch(), $arch))) {
+ push(@{$packages_by_type{'arch'}}, $package);
+ push(@{$packages_by_type{'both'}}, $package);
+ }
+ }
+ } elsif ($section and not defined($source_section)) {
+ $source_section = $section;
}
-
- if ($package && $included_in_build_profile &&
- ((($type eq 'indep' || $type eq 'both') && $arch eq 'all') ||
- (($type eq 'arch' || $type eq 'both') &&
- ($arch eq 'any' ||
- ($arch ne 'all' && samearch(buildarch(), $arch))
- )
- ) || ! $type)
- ) {
- push @list, $package;
- $package="";
- $arch="";
- $eos_app_id="";
- }
+ $package='';
+ $arch='';
+ $section='';
++ $eos_app_id="";
}
}
close CONTROL;
@@@ -893,36 -1024,33 +1033,63 @@@ sub package_arch
return $package_arches{$package} eq 'all' ? "all" : buildarch();
}
+# Returns the EOS AppID for a package.
+sub package_eos_app_id {
+ my $package=shift;
+
+ $package = $dh{MAINPACKAGE} if ! defined $package;
+ verbose_print("Checking for app ID ${package}");
+ if (! exists $package_eos_app_ids{$package}) {
+ warning "package $package is not in control info";
+ return $package;
+ }
+ if (! $package_eos_app_ids{$package}) {
+ # Return the ID of the main package if there is not a
+ # specific ID for this package.
+ my $app_id;
+
+ if ($package eq $dh{MAINPACKAGE}) {
+ # Just return the package name if no ID set on
+ # the main package.
+ $app_id=$package;
+ }
+ else {
+ $app_id=package_eos_app_id($dh{MAINPACKAGE});
+ }
+ verbose_print("No app ID set, returning ${app_id}");
+ return $app_id;
+ }
+ verbose_print("Found app ID $package_eos_app_ids{$package}");
+ return $package_eos_app_ids{$package};
+}
+
+ # Returns the multiarch value of a package.
+ sub package_multiarch {
+ my $package=shift;
+
+ # Test the architecture field instead, as it is common for a
+ # package to not have a multi-arch value.
+ if (! exists $package_arches{$package}) {
+ warning "package $package is not in control info";
+ # The only sane default
+ return 'no';
+ }
+ return $package_multiarches{$package} // 'no';
+ }
+
+ # Returns the (raw) section value of a package (possibly including component).
+ sub package_section {
+ my ($package) = @_;
+
+ # Test the architecture field instead, as it is common for a
+ # package to not have a multi-arch value.
+ if (! exists $package_sections{$package}) {
+ warning "package $package is not in control info";
+ return 'unknown';
+ }
+ return $package_sections{$package} // 'unknown';
+ }
+
# Return true if a given package is really a udeb.
sub is_udeb {
my $package=shift;
@@@ -1054,35 -1292,118 +1331,149 @@@ sub get_buildoption
}
}
+# Gets a DEB_BUILD_PROFILES profile, if set.
+sub get_buildprofile {
+ my $wanted=shift;
+
+ verbose_print("Checking for build profile ${wanted}");
+ return undef unless exists $ENV{DEB_BUILD_PROFILES};
+
+ foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_PROFILES})) {
+ verbose_print("Found build profile ${opt}");
+ if ($opt eq $wanted) {
+ return 1;
+ }
+ }
+}
+
+# Determine the prefix for the build based on the build profile. This is
+# /usr except for app builds.
+sub get_buildprefix {
+ my $package=shift;
+ my $prefix="/usr";
+
+ if (get_buildprofile("xdg-app")) {
+ # Xdg-App always uses /app for prefix
+ $prefix="/app";
+ } elsif (get_buildprofile("eos-app")) {
+ $prefix="/endless/" . package_eos_app_id($package);
+ }
+
+ return $prefix;
+}
+
+ # install a dh config file (e.g. debian/<pkg>.lintian-overrides) into
+ # the package. Under compat 9+ it may execute the file and use its
+ # output instead.
+ #
+ # install_dh_config_file(SOURCE, TARGET[, MODE])
+ sub install_dh_config_file {
+ my ($source, $target, $mode) = @_;
+ $mode = 0644 if not defined($mode);
+
+ if (!compat(8) and -x $source) {
+ my @sstat = stat($source) || error("cannot stat $source: $!");
+ open(my $tfd, '>', $target) || error("cannot open $target: $!");
+ chmod($mode, $tfd) || error("cannot chmod $target: $!");
+ open(my $sfd, '-|', $source) || error("cannot run $source: $!");
+ while (my $line = <$sfd>) {
+ print ${tfd} $line;
+ }
+ if (!close($sfd)) {
+ error("cannot close handle from $source: $!") if $!;
+ error_exitcode($source);
+ }
+ close($tfd) || error("cannot close $target: $!");
+ # Set the mtime (and atime) to ensure reproducibility.
+ utime($sstat[9], $sstat[9], $target);
+ } else {
+ my $str_mode = sprintf('%#4o', $mode);
+ doit('install', '-p', "-m${str_mode}", $source, $target);
+ }
+ return 1;
+ }
+
+ sub restore_file_on_clean {
+ my ($file) = @_;
+ my $bucket_index = 'debian/.debhelper/bucket/index';
+ my $bucket_dir = 'debian/.debhelper/bucket/files';
+ my $checksum;
+ if (not -d $bucket_dir) {
+ install_dir($bucket_dir);
+ }
+ if ($file =~ m{^/}) {
+ error("restore_file_on_clean requires a path relative to the package dir");
+ }
+ $file =~ s{^\./}{}g;
+ $file =~ s{//++}{}g;
+ if ($file =~ m{^\.} or $file =~ m{/CVS/} or $file =~ m{/\.svn/}) {
+ # We do not want to smash a Vcs repository by accident.
+ warning("Attempt to store $file, which looks like a VCS file or");
+ warning("a hidden package file (like quilt's \".pc\" directory");
+ error("This tool probably contains a bug.");
+ }
+ if (-l $file or not -f _) {
+ error("Cannot store $file, which is a non-file (incl. a symlink)");
+ }
+ require Digest::SHA;
+
+ $checksum = Digest::SHA->new('256')->addfile($file, 'b')->hexdigest;
+
+ if (not $dh{NO_ACT}) {
+ my ($in_index);
+ open(my $fd, '+>>', $bucket_index)
+ or error("open($bucket_index, a+) failed: $!");
+ seek($fd, 0, 0);
+ while (my $line = <$fd>) {
+ my ($cs, $stored_file);
+ chomp($line);
+ ($cs, $stored_file) = split(m/ /, $line, 2);
+ next if ($stored_file ne $file);
+ $in_index = 1;
+ }
+ if (not $in_index) {
+ # Copy and then rename so we always have the full copy of
+ # the file in the correct place (if any at all).
+ doit('cp', '-an', '--reflink=auto', $file, "${bucket_dir}/${checksum}.tmp");
+ doit('mv', '-f', "${bucket_dir}/${checksum}.tmp", "${bucket_dir}/${checksum}");
+ print {$fd} "${checksum} ${file}\n";
+ }
+ close($fd) or error("close($bucket_index) failed: $!");
+ }
+
+ return 1;
+ }
+
+ sub restore_all_files {
+ my $bucket_index = 'debian/.debhelper/bucket/index';
+ my $bucket_dir = 'debian/.debhelper/bucket/files';
+
+ return if not -f $bucket_index;
+ open(my $fd, '<', $bucket_index)
+ or error("open($bucket_index) failed: $!");
+
+ while (my $line = <$fd>) {
+ my ($cs, $stored_file, $bucket_file);
+ chomp($line);
+ ($cs, $stored_file) = split(m/ /, $line, 2);
+ $bucket_file = "${bucket_dir}/${cs}";
+ # Restore by copy and then rename. This ensures that:
+ # 1) If dh_clean is interrupted, we can always do a full restore again
+ # (otherwise, we would be missing some of the files and have to handle
+ # that with scary warnings)
+ # 2) The file is always fully restored or in its "pre-restore" state.
+ doit('cp', '-an', '--reflink=auto', $bucket_file, "${bucket_file}.tmp");
+ doit('mv', '-Tf', "${bucket_file}.tmp", $stored_file);
+ }
+ close($fd);
+ return;
+ }
+
+
1
+
+ # Local Variables:
+ # indent-tabs-mode: t
+ # tab-width: 4
+ # cperl-indent-level: 4
+ # End:
diff --cc debian/control
index f363f94,546cc88..9022571
--- a/debian/control
+++ b/debian/control
@@@ -11,9 -10,8 +10,8 @@@ Vcs-Browser: https://anonscm.debian.org
Package: debhelper
Architecture: all
- Depends: ${perl:Depends}, ${misc:Depends}, file (>= 3.23), dpkg (>= 1.16.2), dpkg-dev (>= 1.17.0), binutils, po-debconf, man-db (>= 2.5.1-1), libdpkg-perl (>= 1.17.14), dh-apparmor
-Depends: ${perl:Depends}, ${misc:Depends}, file (>= 3.23), dpkg (>= 1.16.2), dpkg-dev (>= 1.18.2~), binutils, po-debconf, man-db (>= 2.5.1-1), libdpkg-perl (>= 1.17.14), dh-strip-nondeterminism, autotools-dev
++Depends: ${perl:Depends}, ${misc:Depends}, file (>= 3.23), dpkg (>= 1.16.2), dpkg-dev (>= 1.18.2~), binutils, po-debconf, man-db (>= 2.5.1-1), libdpkg-perl (>= 1.17.14), dh-strip-nondeterminism, autotools-dev, dh-apparmor
Suggests: dh-make
- Conflicts: dpkg-cross (<< 1.18), python-support (<< 0.5.3), python-central (<< 0.5.6), automake (<< 1.11.2)
Multi-Arch: foreign
Description: helper programs for debian/rules
A collection of programs that can be used in a debian/rules file to
diff --cc dh
index d04ebeb,b05efde..8f70945
--- a/dh
+++ b/dh
@@@ -381,8 -396,8 +396,7 @@@ my @i = (qw
dh_installpam
dh_installppp
dh_installudev
- dh_installwm
dh_installgsettings
- dh_bugfiles
dh_ucf
dh_lintian
dh_gconf
diff --cc dh_fixperms
index f165268,214a091..56b90fc
--- a/dh_fixperms
+++ b/dh_fixperms
@@@ -50,25 -48,25 +51,40 @@@ init()
my $vendorlib = substr $Config{vendorlib}, 1;
my $vendorarch = substr $Config{vendorarch}, 1;
+ my @mode_0644_patterns = (
+ # Libraries and related files
+ '*.so.*', '*.so', '*.la', '*.a',
+ # Web application related files
+ '*.js', '*.css',
+ # Images
+ '*.jpeg', '*.jpg', '*.png', '*.gif',
+ # OCaml native-code shared objects
+ '*.cmxs',
+ );
+ # Turn the patterns in to a find pattern
+ my $mode_0644_find_pattern = sprintf('\\( -name %s \\)',
+ join(' -o -name ',
+ map { "'$_'" } @mode_0644_patterns));
+
foreach my $package (@{$dh{DOPACKAGES}}) {
+ my @prefixes=("usr");
+ my $prefix=substr get_buildprefix(), 1;
+ push @prefixes, $prefix if $prefix ne "usr";
+
+ foreach my $prefix (@prefixes) {
my $tmp=tmpdir($package);
+ # Adjust a few other non-/usr paths
+ my $etcdir="etc";
+ my $perlvendorlib=$vendorlib;
+ my $perlvendorarch=$vendorarch;
+ if ($prefix ne "usr") {
+ $etcdir="$prefix/etc";
+ $perlvendorlib=~s,^usr/,$prefix/,;
+ $perlvendorarch=~s,^usr/,$prefix/,;
+ }
+
my $find_options='';
if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
$find_options="! \\( $dh{EXCLUDE_FIND} \\)";
@@@ -82,47 -80,37 +98,37 @@@
# Fix up permissions in usr/share/doc, setting everything to not
# executable by default, but leave examples directories alone.
- complex_doit("find $tmp/$prefix/share/doc -type f $find_options ! -regex '$tmp/$prefix/share/doc/[^/]*/examples/.*' -print0 2>/dev/null",
- "| xargs -0r chmod 644");
- complex_doit("find $tmp/usr/share/doc -type f $find_options ! -regex '$tmp/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null",
++ complex_doit("find $tmp/$prefix/share/doc -type f $find_options ! -regex '$tmp/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null",
+ "| xargs -0r chmod 0644");
- complex_doit("find $tmp/usr/share/doc -type d $find_options -print0 2>/dev/null",
+ complex_doit("find $tmp/$prefix/share/doc -type d $find_options -print0 2>/dev/null",
- "| xargs -0r chmod 755");
+ "| xargs -0r chmod 0755");
# 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/$prefix/share/man $tmp/$prefix/man/ $tmp/$prefix/X11*/man/ -type f",
- "$find_options -print0 2>/dev/null | xargs -0r chmod 644");
+ "$find_options -print0 2>/dev/null | xargs -0r chmod 0644");
- # ..and so are executable shared and static libraries
- # (and .la files from libtool) ..
- complex_doit("find $tmp -perm -5 -type f",
- "\\( -name '*.so.*' -or -name '*.so' -or -name '*.la' -or -name '*.a' \\) $find_options -print0",
- "2>/dev/null | xargs -0r chmod 644");
-
# ..and header files ..
- complex_doit("find $tmp/usr/include -type f $find_options -print0",
+ complex_doit("find $tmp/$prefix/include -type f $find_options -print0",
- "2>/dev/null | xargs -0r chmod 644");
+ "2>/dev/null | xargs -0r chmod 0644");
# ..and desktop files ..
- complex_doit("find $tmp/usr/share/applications -type f $find_options -print0",
+ complex_doit("find $tmp/$prefix/share/applications -type f $find_options -print0",
- "2>/dev/null | xargs -0r chmod 644");
-
- # ..and OCaml native-code shared objects ..
- complex_doit("find $tmp -perm -5 -type f",
- "\\( -name '*.cmxs' \\) $find_options -print0",
- "2>/dev/null | xargs -0r chmod 644");
+ "2>/dev/null | xargs -0r chmod 0644");
# .. and perl modules.
- complex_doit("find $tmp/$vendorarch $tmp/$vendorlib -type f",
+ complex_doit("find $tmp/$perlvendorarch $tmp/$perlvendorlib -type f",
"-perm -5 -name '*.pm' $find_options -print0",
"2>/dev/null | xargs -0r chmod a-X");
+
+ complex_doit("find $tmp -perm -5 -type f ${mode_0644_find_pattern}",
+ "${find_options} -print0 2>/dev/null",
+ "| xargs -0r chmod 0644");
- # v4 and up
- if (! compat(3)) {
- # Programs in the bin and init.d dirs should be executable..
- for my $dir ("$prefix/bin", "bin", "$prefix/sbin", "sbin", "$prefix/games", "$etcdir/init.d") {
- if (-d "$tmp/$dir") {
- complex_doit("find $tmp/$dir -type f $find_options -print0 2>/dev/null",
- "| xargs -0r chmod a+x");
- }
+ # Programs in the bin and init.d dirs should be executable..
- for my $dir (qw{usr/bin bin usr/sbin sbin usr/games etc/init.d}) {
++ for my $dir ("$prefix/bin", "bin", "$prefix/sbin", "sbin", "$prefix/games", "etc/init.d") {
+ if (-d "$tmp/$dir") {
+ complex_doit("find $tmp/$dir -type f $find_options -print0 2>/dev/null",
+ "| xargs -0r chmod a+x");
}
}
@@@ -131,20 -119,30 +137,31 @@@
"-name '*.ali' $find_options -print0",
"2>/dev/null | xargs -0r chmod uga-w");
+ if ( -d "$tmp/usr/share/bug/$package") {
+ complex_doit("find $tmp/usr/share/bug/$package -type f",
+ "! -name 'script' $find_options -print0",
+ "2>/dev/null | xargs -0r chmod 644");
+ if ( -f "$tmp/usr/share/bug/$package/script" ) {
+ doit('chmod', '0755', "$tmp/usr/share/bug/$package/script");
+ }
+ } elsif ( -f "$tmp/usr/share/bug/$package" ) {
+ doit('chmod', '0755', "$tmp/usr/share/bug/$package");
+ }
+
# Lintian overrides should never be executable, too.
- if (-d "$tmp/usr/share/lintian") {
- complex_doit("find $tmp/usr/share/lintian/overrides",
+ if (-d "$tmp/$prefix/share/lintian") {
+ complex_doit("find $tmp/$prefix/share/lintian/overrides",
"-type f $find_options -print0",
- "2>/dev/null | xargs -0r chmod 644");
+ "2>/dev/null | xargs -0r chmod 0644");
}
- # Files in $tmp/etc/sudoers.d/ must be mode 440.
+ # Files in $tmp/etc/sudoers.d/ must be mode 0440.
- if (-d "$tmp/etc/sudoers.d") {
- complex_doit("find $tmp/etc/sudoers.d",
+ if (-d "$tmp/$etcdir/sudoers.d") {
+ complex_doit("find $tmp/$etcdir/sudoers.d",
"-type f ! -perm 440 $find_options -print0",
- "2>/dev/null | xargs -0r chmod 440");
+ "2>/dev/null | xargs -0r chmod 0440");
}
+ }
}
=head1 SEE ALSO
diff --cc dh_gencontrol
index 6103d71,0b92fd5..09cad13
--- a/dh_gencontrol
+++ b/dh_gencontrol
@@@ -19,13 -20,18 +20,21 @@@ B<dh_gencontrol> is a debhelper progra
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, and passes in some additional
- useful flags.
+ This program is merely a wrapper around L<dpkg-gencontrol(1)>, which
+ 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 dbgsym
+ packages, it some times adds additional packages, which will be built
+ by L<dh_builddeb(1)>.
+
+When the environment variable B<DEB_BUILD_PROFILES> contains B<eos-app>,
+each package will have the Eos-Appid field added to the control file.
+
=head1 OPTIONS
=over 4
@@@ -66,15 -75,76 +78,81 @@@ foreach my $package (@{$dh{DOPACKAGES}}
if (! -e $substvars || system("grep -q '^misc:Depends=' $substvars") != 0) {
complex_doit("echo misc:Depends= >> $substvars");
}
-
+ # avoid (another) gratuitous warning
+ if (! -e $substvars || system("grep -q '^misc:Pre-Depends=' $substvars") != 0) {
+ complex_doit("echo misc:Pre-Depends= >> $substvars");
+ }
+
+ my (@debug_info_params, $build_ids);
+ if ( -d $dbgsym_info_dir ) {
+ $build_ids = read_dbgsym_build_ids($dbgsym_info_dir);
+ }
+
+ # Temporary workaround: Do not build dbgsym packages for udebs as
+ # dpkg-gencontrol and dpkg-deb does not agree on the file
+ # extension.
+ if ( -d $dbgsym_tmp and not is_udeb($package)) {
+ my $multiarch = package_multiarch($package);
+ my $section = package_section($package);
+ my $replaces = read_dbgsym_migration($dbgsym_info_dir);
+ my $component = '';
+ if ($section =~ m{^(.*)/[^/]+$}) {
+ $component = "${1}/";
+ # This should not happen, but lets not propogate the error
+ # if does.
+ $component = '' if $component eq 'main/';
+ }
+
+ # Remove and override more or less every standard field.
+ my @dbgsym_options = (qw(
+ -UPre-Depends -URecommends -USuggests -UEnhances -UProvides -UEssential
+ -UConflicts -DPriority=extra
+ -DAuto-Built-Package=debug-symbols
+ ),
+ "-DPackage=${package}-dbgsym",
+ "-DDepends=${package} (= \${binary:Version})",
+ "-DDescription=Debug symbols for ${package}",
+ "-DBuild-Ids=${build_ids}",
+ "-DSection=${component}debug",
+ );
+ # Disable multi-arch unless the original package is an
+ # multi-arch: same package. In all other cases, we do not
+ # need a multi-arch value.
+ if ($multiarch ne 'same') {
+ push(@dbgsym_options, '-UMulti-Arch');
+ }
+ # If the dbgsym package is replacing an existing -dbg package,
+ # then declare the necessary Breaks + Replaces. Otherwise,
+ # clear the fields.
+ if ($replaces) {
+ push(@dbgsym_options, "-DReplaces=${replaces}",
+ "-DBreaks=${replaces}");
+ } else {
+ push(@dbgsym_options, '-UReplaces', '-UBreaks');
+ }
+ if ( ! -d "${dbgsym_tmp}/DEBIAN" ) {
+ install_dir("${dbgsym_tmp}/DEBIAN");
+ }
+ doit("dpkg-gencontrol", "-p${package}", "-l$changelog", "-T$substvars",
+ "-P${dbgsym_tmp}",@{$dh{U_PARAMS}}, @dbgsym_options);
+
+ 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 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}");
+ }
+
# Generate and install control file.
- doit("dpkg-gencontrol", "-p$package", "-l$changelog", "-T$substvars",
+ my @command="dpkg-gencontrol";
+ if (get_buildprofile("eos-app")) {
+ # Add the app id field.
+ push @command, "-DEos-Appid=" . package_eos_app_id($package);
+ }
- doit(@command, "-p$package", "-l$changelog", "-T$substvars",
- "-P$tmp",@{$dh{U_PARAMS}});
++ doit(@command, "-p$package", "-l$changelog", "-T$substvars",
+ "-P$tmp", @debug_info_params, @{$dh{U_PARAMS}});
# This chmod is only necessary if the user sets the umask to
# something odd.
diff --cc dh_installdeb
index 07606de,70bb1e6..bac463f
--- a/dh_installdeb
+++ b/dh_installdeb
@@@ -80,21 -81,9 +84,21 @@@ foreach my $package (@{$dh{DOPACKAGES}}
my $tmp=tmpdir($package);
if (! -d "$tmp/DEBIAN") {
- doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
+ install_dir("$tmp/DEBIAN");
}
+ # Migrate files to non-/usr prefix
+ my $prefix=substr get_buildprefix($package), 1;
+ if ($prefix ne "usr" && -d "$tmp/usr") {
+ # Create the prefix if necessary
+ doit("install", "-d", "-o", 0, "-g", 0, "$tmp/$prefix");
+
+ # Move files from /usr to prefix and delete /usr
+ my $cmd="tar -C $tmp/usr -cf- . | tar -C $tmp/$prefix -xpf-";
+ complex_doit($cmd);
+ doit("rm", "-rf", "$tmp/usr");
+ }
+
if (is_udeb($package)) {
# For udebs, only do the postinst, and no #DEBHELPER#.
# Udebs also support menutest and isinstallable scripts.
diff --cc dh_installdirs
index 3cc5935,d3bce35..099b0ef
--- a/dh_installdirs
+++ b/dh_installdirs
@@@ -18,9 -19,10 +19,13 @@@ B<dh_installdirs> [S<I<debhelper option
B<dh_installdirs> is a debhelper program that is responsible for creating
subdirectories in package build directories.
+If a build profile within B<DEB_BUILD_PROFILES> specifies a non-/usr
+prefix, the directories will be adjusted to use that prefix.
+
+ Many packages can get away with omitting the call to B<dh_installdirs>
+ completely. Notably, other B<dh_*> commands are expected to create
+ directories as needed.
+
=head1 FILES
=over 4
diff --cc dh_installinit
index 6576321,b9fc7d6..b67bb03
--- a/dh_installinit
+++ b/dh_installinit
@@@ -153,10 -163,9 +163,10 @@@ init(options =>
"init-script=s" => \$dh{INIT_SCRIPT},
"update-rcd-params=s", => \$dh{U_PARAMS},
"remove-d" => \$dh{D_FLAG},
+ "upstart-only" => \$dh{UPSTART_ONLY},
});
- # PROMISE: DH NOOP WITHOUT service tmpfile default upstart init init.d
+ # PROMISE: DH NOOP WITHOUT service tmpfile default upstart init init.d tmp(usr/lib/tmpfiles.d) tmp(etc/tmpfiles.d)
foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp=tmpdir($package);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list