]> git.donarmstrong.com Git - debhelper.git/blob - dh_installcron
Spanish translation update. Closes: #636245 Thanks, Omar Campagne
[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>>] [B<--name=>I<name>]
15
16 =head1 DESCRIPTION
17
18 B<dh_installcron> is a debhelper program that is responsible for installing
19 cron scripts.
20
21 =head1 FILES
22
23 =over 4
24
25 =item debian/I<package>.cron.daily
26
27 =item debian/I<package>.cron.weekly
28
29 =item debian/I<package>.cron.monthly
30
31 =item debian/I<package>.cron.hourly
32
33 =item debian/I<package>.cron.d
34
35 Installed into the appropriate F<etc/cron.*/> directory in the package
36 build directory.
37
38 =back
39
40 =head1 OPTIONS
41
42 =over 4
43
44 =item B<--name=>I<name>
45
46 Look for files named F<debian/package.name.cron.*> and install them as
47 F<etc/cron.*/name>, instead of using the usual files and installing them
48 as the package name.
49
50 =back
51
52 =cut
53
54 init();
55
56 foreach my $package (@{$dh{DOPACKAGES}}) {
57         my $tmp=tmpdir($package);
58         foreach my $type (qw{hourly daily weekly monthly}) {
59                 my $cron=pkgfile($package,"cron.$type");
60                 if ($cron) {
61                         if (! -d "$tmp/etc/cron.$type") {
62                                 doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.$type");
63                         }
64                         doit("install",$cron,"$tmp/etc/cron.$type/".pkgfilename($package));
65                 }
66         }
67         # Seperate because this needs to be mode 644.
68         my $cron=pkgfile($package,"cron.d");
69         if ($cron) {
70                 if (! -d "$tmp/etc/cron.d") {
71                         doit("install","-o",0,"-g",0,"-d","$tmp/etc/cron.d");
72                 }       
73                 doit("install","-m",644,$cron,"$tmp/etc/cron.d/".pkgfilename($package));
74         }
75 }
76
77 =head1 SEE ALSO
78
79 L<debhelper(7)>
80
81 This program is a part of debhelper.
82
83 =head1 AUTHOR
84
85 Joey Hess <joeyh@debian.org>
86
87 =cut