]> git.donarmstrong.com Git - debhelper.git/blob - dh_installcron
r496: * Man page cleanups, Closes: #119335
[debhelper.git] / dh_installcron
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_installcron - install cron scripts into etc/cron.*
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_installcron> [S<B<debhelper options>>]
15
16 =head1 DESCRIPTION
17
18 dh_installcron is a debhelper program that is responsible for installing
19 cron scripts into etc/cron.*/ in package build directories. The files
20 debian/package.cron.daily, debian/package.cron.weekly,
21 debian/package.cron.monthly, and debian/package.cron.d are installed.
22
23 =cut
24
25 init();
26
27 foreach my $package (@{$dh{DOPACKAGES}}) {
28         my $tmp=tmpdir($package);
29         foreach my $type (qw{daily weekly monthly}) {
30                 my $cron=pkgfile($package,"cron.$type");
31                 if ($cron) {
32                         if (! -d "$tmp/etc/cron.$type") {
33                                 doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type");
34                         }
35                         doit("install",$cron,"$tmp/etc/cron.$type/$package");
36                 }
37         }
38         # Seperate because this needs to be mode 644.
39         my $cron=pkgfile($package,"cron.d");
40         if ($cron) {
41                 if (! -d "$tmp/etc/cron.d") {
42                         doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d");
43                 }       
44                 doit("install","-m",644,$cron,"$tmp/etc/cron.d/$package");
45         }
46 }
47
48 =head1 SEE ALSO
49
50 L<debhelper(1)>
51
52 This program is a part of debhelper.
53
54 =head1 AUTHOR
55
56 Joey Hess <joeyh@debian.org>
57
58 =cut