override_dh_auto_build:
make universe-explode-in-delight
-If running a configure script, it may be necessary to prevent it being
-run twice, once for architecture-independent packages, and again for
-architecture-dependent packages. This may be accomplished by
-overriding L<dh_autoconfigure(1)>:
-
- override_dh_auto_configure: config.status
-
- config.status:
- dh_auto_configure -- $configure_options
-
Another common case is wanting to do something manually before or
after a particular debhelper command is run.
endif
Finally, remember that you are not limited to using override targets in the
-rules file when using B<dh>. You can also explicitly define the regular
+rules file when using B<dh>. You can also explicitly define any of the regular
rules file targets when it makes sense to do so. A common reason to do this
-is if your package needs different B<build-arch> and B<build-indep> targets.
+is when your package needs different B<build-arch> and B<build-indep> targets.
For example, a package with a long document build process can put it in
B<build-indep>.
%:
dh $@
- binary: binary-arch binary-indep ;
- binary-arch:: build-arch
- binary-indep:: build-indep
- build: build-arch build-indep ;
build-indep:
$(MAKE) docs
build-arch:
$(MAKE) bins
+Note that in the example above, dh will arrange for "debian/rules build"
+to call your build-indep and build-arch targets. You do not need to
+explicitly define the dependencies in the rules file when using dh.
+
=head1 INTERNALS
If you're curious about B<dh>'s internals, here's how it works under the hood.
options can override this behavior.
A sequence can also run dependent targets in debian/rules. For
-example, the "binary" sequence runs the "install" target. This will
-show up in the dh output as "debian/rules install", but internally
-will be called "rules:install" in the sequence. The "install"
-sequence likewise runs "debian/rules build", internally named
-"rules:build".
+example, the "binary" sequence runs the "install" target.
B<dh> uses the B<DH_INTERNAL_OPTIONS> environment variable to pass information
through to debhelper commands that are run inside override targets. The
my %sequences;
my @bd_minimal = qw{
dh_testdir
- dh_auto_configure
};
-my @bd = (@bd_minimal, qw{
+my @bd = qw{
+ dh_testdir
+ dh_auto_configure
dh_auto_build
dh_auto_test
-});
-# The build sequences will call 'debian/rules build-arch' and
-# 'debian/rules build-indep' after running the standard sequence;
-# these will typically be no-ops but this permits the standard targets
-# to be customised by the user and still run as a side-effect of the
-# build target.
-$sequences{build} = [@bd, 'rules:build-arch', 'rules:build-indep'];
+ };
+# rules:build-arch and rules:build-indep are not called by build,
+# as an optimisation (code below will adjust this if explicit targets exist).
+$sequences{build} = [@bd];
$sequences{'build-indep'} = [@bd];
$sequences{'build-arch'} = [@bd];
$sequences{clean} = [qw{
my @i_minimal = qw{
dh_testroot
};
-my @i = (@i_minimal, qw{
+my @i = qw{
+ dh_testroot
dh_prep
dh_installdirs
dh_auto_install
dh_link
dh_compress
dh_fixperms
-});
-# The install sequences will call 'debian/rules build' before running
-# the standard sequence, and 'debian/rules install-arch' and
-# 'debian/rules install-indep' after running the standard sequence;
-# these will typically be no-ops but this permits the install-arch and
-# install-indep targets to be customised by the user and still run as
-# a side-effect of the install target.
+};
+# The install sequences will call rules:build before running
+# the standard sequence. rules:install-arch and rules:install-indep
+# are not called by install, as an optimisation (code below will adjust
+# this if explicit targets exist).
$sequences{'install'} = ['rules:build', @i, 'rules:install-arch', 'rules:install-indep'];
$sequences{'install-indep'} = ['rules:build-indep', @i];
$sequences{'install-arch'} = ['rules:build-arch', @i];