diff options
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | Makefile.PL | 17 | ||||
-rw-r--r-- | etc/crontab | 1 | ||||
-rw-r--r-- | mga-mirrors.spec.in | 1 |
4 files changed, 20 insertions, 0 deletions
@@ -90,3 +90,4 @@ t/controller_Validate.t t/model_Mirrors.t t/view_GraphViz.t t/view_TT.t +etc/crontab diff --git a/Makefile.PL b/Makefile.PL index f7777b6..eb796b9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -32,6 +32,23 @@ WriteAll; package MY; +sub install { + my ($self) = @_; + + my $install = $self->SUPER::install; + + $install =~ s/^(install ::.*)/$1 cron_install/m; + + $install .= <<EOF; + +cron_install :: +\t[ -d \$(DESTDIR)/etc/cron.d ] || mkdir -p \$(DESTDIR)/etc/cron.d +\tinstall -m644 etc/crontab \$(DESTDIR)/etc/cron.d/mga_mirrors +EOF + + $install +} + sub postamble { " diff --git a/etc/crontab b/etc/crontab new file mode 100644 index 0000000..77a0ef4 --- /dev/null +++ b/etc/crontab @@ -0,0 +1 @@ +0 * * * * apache /usr/bin/check_mirror diff --git a/mga-mirrors.spec.in b/mga-mirrors.spec.in index 801176f..04b0f5e 100644 --- a/mga-mirrors.spec.in +++ b/mga-mirrors.spec.in @@ -75,6 +75,7 @@ rm -rf %buildroot %defattr(-,root,root) %doc Changes README %attr(0640,root,apache) %config(noreplace) %_sysconfdir/mga-mirrors.ini +%_sysconfdir/cron.d/mga_mirrors %_bindir/* %_var/www/cgi-bin/mga_mirrors_cgi.pl %{_mandir}/man3/* |