]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r410: * Added the ability to make debhelper read a different file than
[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",0,"-g",0,"-d","$TMP/DEBIAN");
19         }
20
21         # Generate and install control file.
22         doit("dpkg-gencontrol","-c".Debian::Debhelper::Dh_Lib::getcontrol(),
23                 "-l$changelog","-isp","-p$PACKAGE","-Tdebian/${EXT}substvars",
24                 "-P$TMP",@{$dh{U_PARAMS}});
25
26         # This chmod is only necessary if the user sets the umask to something odd.
27         doit("chmod","644","$TMP/DEBIAN/control");
28         
29         doit("chown","0.0","$TMP/DEBIAN/control");
30 }
31