]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r150: Initial Import
[debhelper.git] / dh_gencontrol
1 #!/usr/bin/perl -w
2 #
3 # Generate and install the control file. Simple dpkg-gencontrol wrapper.
4
5 BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
6 use Dh_Lib;
7 init();
8
9 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
10         $TMP=tmpdir($PACKAGE);
11         $EXT=pkgext($PACKAGE);
12         
13         $changelog=pkgfile($PACKAGE,'changelog');
14         if (! $changelog) {
15                 $changelog='debian/changelog';
16         }
17
18         if ( ! -d '$TMP/DEBIAN' ) {
19                 doit("install","-o","root","-g","root","-d","$TMP/DEBIAN");
20         }
21
22         # Generate and install control file.
23         doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE",
24                 "-Tdebian/$EXT\substvars","-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","root.root","$TMP/DEBIAN/control");
30 }