summaryrefslogtreecommitdiff
path: root/dh_gencontrol
blob: 15e082034d6e35fa19d4b9af7ecb8097525c458c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl -w
#
# Generate and install the control file. Simple dpkg-gencontrol wrapper.

use Debian::Debhelper::Dh_Lib;
init();

foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
	$TMP=tmpdir($PACKAGE);
	$EXT=pkgext($PACKAGE);
	
	$changelog=pkgfile($PACKAGE,'changelog');
	if (! $changelog) {
		$changelog='debian/changelog';
	}

	if ( ! -d '$TMP/DEBIAN' ) {
		doit("install","-o",0,"-g",0,"-d","$TMP/DEBIAN");
	}

	# Generate and install control file.
	doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE",
		"-Tdebian/${EXT}substvars","-P$TMP",@{$dh{U_PARAMS}});

	# This chmod is only necessary if the user sets the umask to something odd.
	doit("chmod","644","$TMP/DEBIAN/control");
	
	doit("chown","0.0","$TMP/DEBIAN/control");
}