summaryrefslogtreecommitdiffstats
path: root/lib/Debian/Debhelper/Sequence
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Debian/Debhelper/Sequence')
-rw-r--r--lib/Debian/Debhelper/Sequence/build_stamp.pm10
-rw-r--r--lib/Debian/Debhelper/Sequence/dwz.pm14
-rw-r--r--lib/Debian/Debhelper/Sequence/elf_tools.pm14
-rw-r--r--lib/Debian/Debhelper/Sequence/installinitramfs.pm14
-rw-r--r--lib/Debian/Debhelper/Sequence/installsysusers.pm9
-rw-r--r--lib/Debian/Debhelper/Sequence/movetousr.pm10
-rw-r--r--lib/Debian/Debhelper/Sequence/root_sequence.pm120
-rw-r--r--lib/Debian/Debhelper/Sequence/single_binary.pm34
-rw-r--r--lib/Debian/Debhelper/Sequence/systemd.pm19
9 files changed, 244 insertions, 0 deletions
diff --git a/lib/Debian/Debhelper/Sequence/build_stamp.pm b/lib/Debian/Debhelper/Sequence/build_stamp.pm
new file mode 100644
index 0000000..5c05975
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/build_stamp.pm
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+add_command_at_end('create-stamp debian/debhelper-build-stamp', 'build');
+add_command_at_end('create-stamp debian/debhelper-build-stamp', 'build-arch');
+add_command_at_end('create-stamp debian/debhelper-build-stamp', 'build-indep');
+
+1
diff --git a/lib/Debian/Debhelper/Sequence/dwz.pm b/lib/Debian/Debhelper/Sequence/dwz.pm
new file mode 100644
index 0000000..2e89ffa
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/dwz.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+# Enable dh_dwz
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib qw(compat error);
+
+if (not compat(11)) {
+ error("In compat 12, dh_dwz is run by default and the dwz-sequence is no longer required.");
+}
+
+insert_before('dh_strip', 'dh_dwz');
+
+1;
diff --git a/lib/Debian/Debhelper/Sequence/elf_tools.pm b/lib/Debian/Debhelper/Sequence/elf_tools.pm
new file mode 100644
index 0000000..56bb07c
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/elf_tools.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib qw(compat);
+
+insert_after('dh_missing', 'dh_strip');
+if (not compat(11)) {
+ insert_before('dh_strip', 'dh_dwz');
+}
+insert_after('dh_strip', 'dh_makeshlibs');
+insert_after('dh_makeshlibs', 'dh_shlibdeps');
+
+1; \ No newline at end of file
diff --git a/lib/Debian/Debhelper/Sequence/installinitramfs.pm b/lib/Debian/Debhelper/Sequence/installinitramfs.pm
new file mode 100644
index 0000000..365f283
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/installinitramfs.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+# Enable dh_installinitramfs
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib qw(compat error);
+
+if (not compat(11)) {
+ error("In compat 12, dh_installinitramfs is run by default and the installinitramfs-sequence is no longer required.");
+}
+
+insert_after('dh_installgsettings', 'dh_installinitramfs');
+
+1;
diff --git a/lib/Debian/Debhelper/Sequence/installsysusers.pm b/lib/Debian/Debhelper/Sequence/installsysusers.pm
new file mode 100644
index 0000000..47c38e5
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/installsysusers.pm
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+# Enable dh_installsysusers
+
+use strict;
+use warnings;
+
+insert_after('dh_install', 'dh_installsysusers');
+
+1;
diff --git a/lib/Debian/Debhelper/Sequence/movetousr.pm b/lib/Debian/Debhelper/Sequence/movetousr.pm
new file mode 100644
index 0000000..4f81c55
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/movetousr.pm
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+# Enable dh_movetousr
+
+use strict;
+use warnings;
+
+$ENV{DH_INTERNAL_MOVETOUSR_IS_ADDON} = '1';
+insert_before('dh_installdeb', 'dh_movetousr');
+
+1;
diff --git a/lib/Debian/Debhelper/Sequence/root_sequence.pm b/lib/Debian/Debhelper/Sequence/root_sequence.pm
new file mode 100644
index 0000000..45d908c
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/root_sequence.pm
@@ -0,0 +1,120 @@
+use strict;
+use warnings;
+
+use Debian::Debhelper::Dh_Lib qw(compat);
+use Debian::Debhelper::SequencerUtil;
+
+my $include_if_compat_X_or_newer = sub {
+ my ($compat, @commands) = @_;
+ return if compat($compat - 1, 1);
+ return @commands;
+};
+
+my @obsolete_command = (
+ [13, $include_if_compat_X_or_newer->(11, 'dh_systemd_enable', 'dh_systemd_start')],
+ [14, 'dh_gconf'],
+);
+
+my @commands_controlled_by_deb_build_options = (
+ $include_if_compat_X_or_newer->(13, ['dh_auto_test', 'nocheck'], ['dh_dwz', 'nostrip'], ['dh_strip', 'nostrip']),
+);
+
+my @bd_minimal = qw{
+ dh_testdir
+};
+my @bd = (@bd_minimal, qw{
+ dh_update_autotools_config
+ dh_auto_configure
+ dh_auto_build
+ dh_auto_test
+});
+my @i = (qw{
+ dh_testroot
+ dh_prep
+ dh_installdirs
+ dh_auto_install
+
+ dh_install
+ dh_installdocs
+ dh_installchangelogs
+ dh_installexamples
+ dh_installman
+
+ dh_installcatalogs
+ dh_installcron
+ dh_installdebconf
+ dh_installemacsen
+ dh_installifupdown
+ dh_installinfo
+ dh_installinit
+},
+ $include_if_compat_X_or_newer->(14, 'dh_installsysusers'),
+ $include_if_compat_X_or_newer->(13, 'dh_installtmpfiles'),
+ $include_if_compat_X_or_newer->(11, 'dh_installsystemd'),
+ $include_if_compat_X_or_newer->(12, 'dh_installsystemduser'),
+qw{
+ dh_installmenu
+ dh_installmime
+ dh_installmodules
+ dh_installlogcheck
+ dh_installlogrotate
+ dh_installpam
+ dh_installppp
+ dh_installudev
+ dh_installgsettings
+},
+ (!compat(11) ? qw(dh_installinitramfs) : qw()),
+ (compat(13) ? qw(dh_installalternatives) : qw()),
+qw{
+ dh_bugfiles
+ dh_ucf
+ dh_lintian
+ dh_icons
+ dh_perl
+ dh_usrlocal
+
+ dh_link
+},
+ (!compat(13) ? qw(dh_installalternatives) : qw()),
+qw{
+ dh_installwm
+ dh_installxfonts
+ dh_strip_nondeterminism
+ dh_compress
+ dh_fixperms
+ dh_missing
+});
+
+# Looking for dh_dwz, dh_strip, dh_makeshlibs, dh_shlibdeps (et al)? They are
+# in the elf-tools addon.
+my @b=qw{
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+};
+
+_add_sequence('build', SEQUENCE_ARCH_INDEP_SUBSEQUENCES, @bd);
+_add_sequence('install', SEQUENCE_ARCH_INDEP_SUBSEQUENCES, to_rules_target("build"), @i);
+_add_sequence('binary', SEQUENCE_ARCH_INDEP_SUBSEQUENCES, to_rules_target("install"), @b);
+_add_sequence('clean', SEQUENCE_NO_SUBSEQUENCES, @bd_minimal, qw{
+ dh_auto_clean
+ dh_clean
+});
+
+for my $obsolete_command_spec (@obsolete_command) {
+ my ($error_compat, @cmds) = @{$obsolete_command_spec};
+ for my $command (@cmds) {
+ declare_command_obsolete($error_compat, $command);
+ }
+}
+
+for my $entry (@commands_controlled_by_deb_build_options) {
+ my ($command, $dbo_flag) = @{$entry};
+ # Dear reader; Should you be in doubt, then this is internal API that is
+ # subject to change without notice. If you need this feature, please
+ # make an explicit feature request, so we can implement a better solution.
+ _skip_cmd_if_deb_build_options_contains($command, $dbo_flag);
+}
+
+1;
diff --git a/lib/Debian/Debhelper/Sequence/single_binary.pm b/lib/Debian/Debhelper/Sequence/single_binary.pm
new file mode 100644
index 0000000..68d8db1
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/single_binary.pm
@@ -0,0 +1,34 @@
+use strict;
+use warnings;
+
+use Debian::Debhelper::Dh_Lib qw(getpackages error warning tmpdir);
+use Debian::Debhelper::SequencerUtil;
+
+my @packages = getpackages();
+my $pkg = $packages[0];
+my $tmp = tmpdir($pkg);
+if (@packages != 1) {
+ warning('Detected multiple binary packages (Package paragraphs) in debian/control, which is incompatible');
+ warning('with the single-binary dh add-on.');
+ warning();
+ warning('Please:');
+ warning(' 1) Remove the single-binary add-on ("dh-sequence-single-binary" in Build-Depends)');
+ warning(' 2) Update the packaging to cope with dh_auto_install using \"debian/tmp\" as default dest dir');
+ warning(" (Previously, it would probably have used \"${tmp}\")");
+ warning(' 3) Add Breaks/Replaces if you are moving existing files into a new package.');
+ warning(' 4) Double check that the resulting binaries have content.');
+ warning();
+ warning("IF YOU ARE ADDING A TRANSITIONAL PACKAGE: Then you probably want to pass --destdir=${tmp} to");
+ warning(' dh_auto_install. Most likely you will need Breaks + Replaces as renaming a package counts as');
+ warning(' moving files between two packages.');
+ warning();
+ warning('IF YOU ARE "SPLITTING" THE CONTENT INTO MULTIPLE PACKAGES: Then remember to install the content');
+ warning(" into them (by creating debian/${pkg}.install, etc.). Also remember to add Breaks + Replaces if");
+ warning(' you are moving files from one package into another.');
+ warning();
+ error("The single-binary add-on cannot be used for source packages that build multiple binary packages.");
+}
+
+add_command_options('dh_auto_install', "--destdir=${tmp}/");
+
+1;
diff --git a/lib/Debian/Debhelper/Sequence/systemd.pm b/lib/Debian/Debhelper/Sequence/systemd.pm
new file mode 100644
index 0000000..484e764
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/systemd.pm
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib qw(compat error);
+
+if (not compat(10)) {
+ error("The systemd-sequence is no longer provided in compat >= 11, please rely on dh_installsystemd instead");
+}
+
+
+# dh_systemd_enable runs unconditionally, and before dh_installinit, so that
+# the latter can use invoke-rc.d and all symlinks are already in place.
+insert_before("dh_installinit", "dh_systemd_enable");
+
+# dh_systemd_start handles the case where there is no corresponding init
+# script, so it runs after dh_installinit.
+insert_after("dh_installinit", "dh_systemd_start");
+
+1