]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r431: pod over for the night
[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
30 =item B<--> I<params>
31
32 Pass "params" to L<dpkg-gencontrol(1)>.
33
34 =back
35
36 =cut
37
38 init();
39
40 foreach my $package (@{$dh{DOPACKAGES}}) {
41         my $tmp=tmpdir($package);
42         my $ext=pkgext($package);
43         
44         my $changelog=pkgfile($package,'changelog');
45         if (! $changelog) {
46                 $changelog='debian/changelog';
47         }
48
49         if ( ! -d "$tmp/DEBIAN" ) {
50                 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
51         }
52
53         # Generate and install control file.
54         doit("dpkg-gencontrol","-l$changelog","-isp","-p$package",
55                 "-Tdebian/${ext}substvars","-P$tmp",@{$dh{U_PARAMS}});
56
57         # This chmod is only necessary if the user sets the umask to something odd.
58         doit("chmod","644","$tmp/DEBIAN/control");
59         
60         doit("chown","0.0","$tmp/DEBIAN/control");
61 }
62
63 =head1 SEE ALSO
64
65 L<debhelper(1)>
66
67 This program is a part of debhelper.
68
69 =head1 AUTHOR
70
71 Joey Hess <joeyh@debian.org>
72
73 =cut