5 dh_gencontrol - generate and install control file
10 use Debian::Debhelper::Dh_Lib;
14 dh_gencontrol [debhelper options] [-uparams] [-- 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
24 useful flags including "-isp".
26 Note that L<dpkg-gencontrol(1)> expands certian substirution variables
27 when generating the control file (for details, see its man page). Those
28 variables are typically generated by L<dh_shlibdeps(1)> and like programs.
29 However, if you want to specify some of your own manually, you may do so,
30 by creating files named debian/package.substvars (where package is the
31 package these variables apply to). The files should be of the same form
32 output by L<dpkg-shlibdeps(1)>
38 =item B<-u>I<params>, B<--dpkg-gencontrol-params>I<params>
42 Pass "params" to L<dpkg-gencontrol(1)>.
50 foreach my $package (@{$dh{DOPACKAGES}}) {
51 my $tmp=tmpdir($package);
52 my $ext=pkgext($package);
54 my $changelog=pkgfile($package,'changelog');
56 $changelog='debian/changelog';
59 if ( ! -d "$tmp/DEBIAN" ) {
60 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
63 # Merge in user-specified substvars file with debhelper generated
65 my $substvars=pkgfile($package,"substvars");
67 complex_doit("cat $substvars >> debian/${ext}substvars.debhelper");
70 # Generate and install control file.
71 doit("dpkg-gencontrol","-l$changelog","-isp","-p$package",
72 "-Tdebian/${ext}substvars.debhelper",
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>