B<dh_builddeb> simply calls L<dpkg-deb(1)> to build a Debian package or
packages.
+It supports building multiple binary packages in parallel, when enabled by
+DEB_BUILD_OPTIONS.
+
=head1 OPTIONS
=over 4
$dh{FILENAME}="/$dh{FILENAME}";
}
-my $max_procs=1;
-if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS}=~/parallel=(\d+)/) {
- $max_procs=$1;
-}
+my $max_procs=get_buildoption("parallel") || 1;
my $processes=1;
my $exit=0;
if (! defined $pid) {
error("fork failed! $!");
}
- $processes++;
if ($pid) { # parent
+ $processes++;
reap while $processes > $max_procs;
next;
}
if (! $filename) {
$filename="/".udeb_filename($package);
}
- doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$filename);
+ doit("dpkg-deb", "-z1", "-Zxz", "-Sextreme",
+ @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$filename);
}
exit 0;
}