5 dh_gencontrol - generate and install control file
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_gencontrol> [S<I<debhelper options>>] [S<B<--> I<params>>]
18 dh_gencontrol is a debhelper program that is responsible for generating
19 control files, and installing them into the DEBIAN directory with the
22 This program is merely a wrapper around L<dpkg-gencontrol(1)>, which calls
23 it once for each package being acted on, and passes in some additional
32 Pass "params" to L<dpkg-gencontrol(1)>.
34 =item B<-u>I<params>, B<--dpkg-gencontrol-params>=I<params>
36 This is another way to pass I<params> to L<dpkg-deb(1)>.
37 It is deprecated; use B<--> instead.
44 "dpkg-gencontrol-params=s", => \$dh{U_PARAMS},
47 foreach my $package (@{$dh{DOPACKAGES}}) {
48 my $tmp=tmpdir($package);
49 my $ext=pkgext($package);
51 my $substvars="debian/${ext}substvars";
53 my $changelog=pkgfile($package,'changelog');
55 $changelog='debian/changelog';
58 if ( ! -d "$tmp/DEBIAN" ) {
59 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
62 # avoid gratuitous warning
63 if (! -e $substvars || system("grep -q '^misc:Depends=' $substvars") != 0) {
64 complex_doit("echo misc:Depends= >> $substvars");
67 # Generate and install control file.
68 my @command="dpkg-gencontrol";
69 if (getpackages() > 1) {
70 push @command, "-p$package";
72 doit(@command, "-l$changelog", "-T$substvars",
73 "-P$tmp",@{$dh{U_PARAMS}});
75 # This chmod is only necessary if the user sets the umask to
77 doit("chmod","644","$tmp/DEBIAN/control");
79 doit("chown","0:0","$tmp/DEBIAN/control");
86 This program is a part of debhelper.
90 Joey Hess <joeyh@debian.org>