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

use Debian::Debhelper::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",0,"-g",0,"-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",0,"-g",0,"-d","$TMP/etc/cron.d");
		}	
		doit("install","-m",644,$cron,"$TMP/etc/cron.d/$PACKAGE");
	}
}