5 dh_builddeb - build Debian binary packages
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_builddeb> [S<I<debhelper options>>] [B<--destdir=>I<directory>] [B<--filename=>I<name>] [S<B<--> I<params>>]
18 B<dh_builddeb> simply calls L<dpkg-deb(1)> to build a Debian package or
21 It supports building multiple binary packages in parallel, when enabled by
28 =item B<--destdir=>I<directory>
30 Use this if you want the generated F<.deb> files to be put in a directory
31 other than the default of "F<..>".
33 =item B<--filename=>I<name>
35 Use this if you want to force the generated .deb file to have a particular
36 file name. Does not work well if more than one .deb is generated!
40 Pass I<params> to L<dpkg-deb(1)> when it is used to build the
45 This is another way to pass I<params> to L<dpkg-deb(1)>.
46 It is deprecated; use B<--> instead.
53 "filename=s" => \$dh{FILENAME},
54 "destdir=s" => \$dh{DESTDIR},
57 # Set the default destination directory.
58 if (! defined $dh{DESTDIR}) {
62 if (! defined $dh{FILENAME}) {
66 $dh{FILENAME}="/$dh{FILENAME}";
69 my $max_procs=get_buildoption("parallel") || 1;
83 foreach my $package (@{$dh{DOPACKAGES}}) {
86 error("fork failed! $!");
90 reap while $processes > $max_procs;
95 my $tmp=tmpdir($package);
96 if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) {
98 complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf");
101 # Old broken code here for compatibility. Does not
103 complex_doit("find $tmp -name $_ | xargs rm -rf")
104 foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
107 if (! is_udeb($package)) {
108 doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
111 my $filename=$dh{FILENAME};
113 $filename="/".udeb_filename($package);
115 doit("dpkg-deb", "-z1", "-Zxz", "-Sextreme",
116 @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$filename);
121 reap while $processes;
128 This program is a part of debhelper.
132 Joey Hess <joeyh@debian.org>