]> git.donarmstrong.com Git - debhelper.git/blob - dh_installcron
r420: big monsta changes
[debhelper.git] / dh_installcron
1 #!/usr/bin/perl -w
2 #
3 # Install cron scripts into the appropriate places.
4
5 use strict;
6 use Debian::Debhelper::Dh_Lib;
7 init();
8
9 foreach my $package (@{$dh{DOPACKAGES}}) {
10         my $tmp=tmpdir($package);
11         foreach my $type (qw{daily weekly monthly}) {
12                 my $cron=pkgfile($package,"cron.$type");
13                 if ($cron) {
14                         if (! -d "$tmp/etc/cron.$type") {
15                                 doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type");
16                         }
17                         doit("install",$cron,"$tmp/etc/cron.$type/$package");
18                 }
19         }
20         # Seperate because this needs to be mode 644.
21         my $cron=pkgfile($package,"cron.d");
22         if ($cron) {
23                 if (! -d "$tmp/etc/cron.d") {
24                         doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d");
25                 }       
26                 doit("install","-m",644,$cron,"$tmp/etc/cron.d/$package");
27         }
28 }