]> git.donarmstrong.com Git - debhelper.git/blob - dh_installcron
r338: * Patch from Jorgen `forcer' Schaefer <forcer at mindless.com> (much
[debhelper.git] / dh_installcron
1 #!/usr/bin/perl -w
2 #
3 # Install cron scripts into the appropriate places.
4
5 use Debian::Debhelper::Dh_Lib;
6 init();
7
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
9         $TMP=tmpdir($PACKAGE);
10         foreach $type (qw{daily weekly monthly}) {
11                 $cron=pkgfile($PACKAGE,"cron.$type");
12                 if ($cron) {
13                         if (! -d "$TMP/etc/cron.$type") {
14                                 doit("install","-o","root","-g","root","-d","$TMP/etc/cron.$type");
15                         }
16                         doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE");
17                 }
18         }
19         # Seperate because this needs to be mode 644.
20         $cron=pkgfile($PACKAGE,"cron.d");
21         if ($cron) {
22                 if (! -d "$TMP/etc/cron.d") {
23                         doit("install","-o","root","-g","root","-d","$TMP/etc/cron.d");
24                 }       
25                 doit("install","-m",644,$cron,"$TMP/etc/cron.d/$PACKAGE");
26         }
27 }