]> git.donarmstrong.com Git - debhelper.git/blob - dh_gencontrol
r2008: * dh_gencontrol: Fix man page typo. Closes: #431232
[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 B<dh_gencontrol> [S<I<debhelper options>>] [S<B<--> I<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)>, which calls
23 it once for each package being acted on, and passes in some additional
24 useful flags including "-isp". 
25
26 =head1 OPTIONS
27
28 =over 4
29
30 =item B<-u>I<params>, B<--dpkg-gencontrol-params>=I<params>
31
32 =item B<--> I<params>
33
34 Pass "params" to L<dpkg-gencontrol(1)>.
35
36 =back
37
38 =cut
39
40 init();
41
42 foreach my $package (@{$dh{DOPACKAGES}}) {
43         my $tmp=tmpdir($package);
44         my $ext=pkgext($package);
45         
46         my $changelog=pkgfile($package,'changelog');
47         if (! $changelog) {
48                 $changelog='debian/changelog';
49         }
50
51         if ( ! -d "$tmp/DEBIAN" ) {
52                 doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
53         }
54
55         # Generate and install control file.
56         my @command="dpkg-gencontrol";
57         if (getpackages() > 1) {
58                 push @command, "-p$package";
59         }
60         if (is_udeb($package)) {
61                 push @command, "-n".udeb_filename($package);
62         }
63         doit(@command, "-l$changelog", "-isp", "-Tdebian/${ext}substvars", 
64                 "-P$tmp",@{$dh{U_PARAMS}});
65
66         # This chmod is only necessary if the user sets the umask to
67         # something odd.
68         doit("chmod","644","$tmp/DEBIAN/control");
69         
70         doit("chown","0:0","$tmp/DEBIAN/control");
71 }
72
73 =head1 SEE ALSO
74
75 L<debhelper(7)>
76
77 This program is a part of debhelper.
78
79 =head1 AUTHOR
80
81 Joey Hess <joeyh@debian.org>
82
83 =cut