]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r427: converting to pod is getting old..
[debhelper.git] / dh_gencontrol
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_gencontrol - generate and install control file
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14   dh_gencontrol [debhelper options] [-uparams] [-- params]
15
16 =head1 DESCRIPTION
17
18 dh_gencontrol is a debhelper program that is responsible for generating
19 control files, and installing them into the DEBIAN directory with the
20 proper permissions.
21
22 This program is merely a wrapper around L<dpkg-gencontrol(1)>.
23
24 =head1 OPTIONS
25
26 =over 4
27
28 =item B<-u>I<params>, B<--dpkg-gencontrol-params>I<params>
29 =item B<--> I<params>
30
31 Pass "params" to L<dpkg-gencontrol(1)>.
32
33 =back
34
35 =cut
36
37 init();
38
39 foreach my $package (@{$dh{DOPACKAGES}}) {
40         my $tmp=tmpdir($package);
41         my $ext=pkgext($package);
42         
43         my $changelog=pkgfile($package,'changelog');
44         if (! $changelog) {
45                 $changelog='debian/changelog';
46         }
47
48         if ( ! -d "$tmp/DEBIAN" ) {
49                 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
50         }
51
52         # Generate and install control file.
53         doit("dpkg-gencontrol","-l$changelog","-isp","-p$package",
54                 "-Tdebian/${ext}substvars","-P$tmp",@{$dh{U_PARAMS}});
55
56         # This chmod is only necessary if the user sets the umask to something odd.
57         doit("chmod","644","$tmp/DEBIAN/control");
58         
59         doit("chown","0.0","$tmp/DEBIAN/control");
60 }
61
62 =head1 SEE ALSO
63
64 L<debhelper(1)>
65
66 This program is a part of debhelper.
67
68 =head1 AUTHOR
69
70 Joey Hess <joeyh@debian.org>
71
72 =cut