summaryrefslogtreecommitdiffstats
path: root/lib/Debian/Debhelper/Sequence/root_sequence.pm
blob: 45d908c119b395df12a7145177f8549de94900fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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;