]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r348: * Fixes for perl 5.6.
[debhelper.git] / dh_gencontrol
1 #!/usr/bin/perl -w
2 #
3 # Generate and install the control file. Simple dpkg-gencontrol wrapper.
4
5 use Debian::Debhelper::Dh_Lib;
6 init();
7
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
9         $TMP=tmpdir($PACKAGE);
10         $EXT=pkgext($PACKAGE);
11         
12         $changelog=pkgfile($PACKAGE,'changelog');
13         if (! $changelog) {
14                 $changelog='debian/changelog';
15         }
16
17         if ( ! -d '$TMP/DEBIAN' ) {
18                 doit("install","-o","root","-g","root","-d","$TMP/DEBIAN");
19         }
20
21         # Generate and install control file.
22         doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE",
23                 "-Tdebian/${EXT}substvars","-P$TMP",@{$dh{U_PARAMS}});
24
25         # This chmod is only necessary if the user sets the umask to something odd.
26         doit("chmod","644","$TMP/DEBIAN/control");
27         
28         doit("chown","root.root","$TMP/DEBIAN/control");
29 }
30