]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r420: big monsta changes
[debhelper.git] / dh_gencontrol
1 #!/usr/bin/perl -w
2 #
3 # Generate and install the control file. Simple dpkg-gencontrol wrapper.
4
5 use strict;
6 use Debian::Debhelper::Dh_Lib;
7 init();
8
9 foreach my $package (@{$dh{DOPACKAGES}}) {
10         my $tmp=tmpdir($package);
11         my $ext=pkgext($package);
12         
13         my $changelog=pkgfile($package,'changelog');
14         if (! $changelog) {
15                 $changelog='debian/changelog';
16         }
17
18         if ( ! -d "$tmp/DEBIAN" ) {
19                 doit("install","-o",0,"-g",0,"-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","0.0","$tmp/DEBIAN/control");
30 }
31