summaryrefslogtreecommitdiff
path: root/dh_installcron
blob: 5b872aca96f6bac3f95ffb3fbf55e0565aa1a937 (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
#!/usr/bin/perl -w
#
# Install cron scripts into the appropriate places.

BEGIN { push @INC, "debian", "/usr/share/debhelper" }
use Dh_Lib;
init();

foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
	$TMP=tmpdir($PACKAGE);
	foreach $type (qw{daily weekly monthly}) {
		$cron=pkgfile($PACKAGE,"cron.$type");
		if ($cron) {
			if (! -d "$TMP/etc/cron.$type") {
				doit("install","-o","root","-g","root","-d","$TMP/etc/cron.$type");
			}
			doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE");
		}
	}
	# Seperate because this needs to be mode 644.
	$cron=pkgfile($PACKAGE,"cron.d");
	if ($cron) {
		if (! -d "$TMP/etc/cron.d") {
			doit("install","-o","root","-g","root","-d","$TMP/etc/cron.d");
		}	
		doit("install","-m",644,$cron,"$TMP/etc/cron.d/$PACKAGE");
	}
}