diff options
Diffstat (limited to 'dh_gencontrol')
-rwxr-xr-x | dh_gencontrol | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/dh_gencontrol b/dh_gencontrol index e2a4e701..df53a753 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -1,19 +1,30 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +use Debian::Debhelper::Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); + + $changelog=pkgfile($PACKAGE,'changelog'); + if (! $changelog) { + $changelog='debian/changelog'; + } - if [ ! -d $TMP/DEBIAN ]; then - doit "install -o root -g root -d $TMP/DEBIAN" - fi + if ( ! -d '$TMP/DEBIAN' ) { + doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); + } # Generate and install control file. - doit "dpkg-gencontrol -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" - doit "chown root.root $TMP/DEBIAN/control" -done + 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","root.root","$TMP/DEBIAN/control"); +} + |