summaryrefslogtreecommitdiff
path: root/community/fcron
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/fcron
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/fcron')
-rwxr-xr-xcommunity/fcron/PKGBUILD73
-rwxr-xr-xcommunity/fcron/fcron.install23
-rwxr-xr-xcommunity/fcron/fcron.rc36
-rwxr-xr-xcommunity/fcron/run-cron14
-rwxr-xr-xcommunity/fcron/systabbin0 -> 478 bytes
-rw-r--r--community/fcron/systab.orig4
6 files changed, 150 insertions, 0 deletions
diff --git a/community/fcron/PKGBUILD b/community/fcron/PKGBUILD
new file mode 100755
index 000000000..4bb0100c0
--- /dev/null
+++ b/community/fcron/PKGBUILD
@@ -0,0 +1,73 @@
+# $Id: PKGBUILD 42747 2011-03-20 15:07:32Z ttopper $
+# Contributor: Giorgio Lando <lando at imap dot cc>
+# Contributor: Sergej Pupykin
+# Contributor: Thomas Bächler
+# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
+
+pkgname=fcron
+pkgver=3.0.6
+pkgrel=4
+pkgdesc="feature-rich cron implementation"
+arch=(i686 x86_64)
+url="http://fcron.free.fr"
+license=('GPL')
+depends=('sh')
+makedepends=('smtp-server')
+optdepends=('smtp-server: to receive mails from cron jobs')
+provides=('cron')
+conflicts=('dcron')
+backup=(etc/fcron/fcron.conf etc/fcron/fcron.allow etc/fcron/fcron.deny \
+ var/spool/fcron/systab var/spool/fcron/systab.orig)
+install=fcron.install
+options=('emptydirs' '!makeflags')
+source=(http://fcron.free.fr/archives/$pkgname-$pkgver.src.tar.gz fcron.rc \
+ systab systab.orig run-cron)
+md5sums=('69ebcb41921e2a282f41ebecb3a27053'
+ 'e0c3f0bdc3c98fbbe46eff19001c18f2'
+ '938722c6654ef7b07f4aa10001905ba1'
+ 'bfb7daa22ebe22b9917e455c1ca4a382'
+ '5ff0cdcb9ec99778938ac6ef26800327')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc/fcron \
+ --with-answer-all=no \
+ --with-boot-install=no \
+ --with-username=cron \
+ --with-groupname=cron \
+ --datarootdir=/usr/share \
+ --datadir=/usr/share \
+ --with-docdir=/usr/share/doc \
+ --localstatedir=/var \
+ --with-editor=/usr/bin/vi \
+ --with-sendmail=/usr/sbin/sendmail
+ make
+}
+
+package() {
+ # Create necessary user and group
+ getent group cron || /usr/sbin/groupadd -g 22 cron
+ getent passwd cron || /usr/sbin/useradd -d / -g cron -u 22 -s /bin/false cron
+
+ cd "$srcdir/$pkgname-$pkgver"
+ mkdir -p "$pkgdir/var/spool"
+ make DESTDIR="$pkgdir/" install
+ install -D -m755 "$srcdir/fcron.rc" "$pkgdir/etc/rc.d/fcron"
+ install -D -m644 "$srcdir/$pkgname-$pkgver/files/fcron.pam" "$pkgdir/etc/pam.d/fcron"
+ install -D -m644 "$srcdir/$pkgname-$pkgver/files/fcrontab.pam" "$pkgdir/etc/pam.d/fcrontab"
+ # Install default fcrontab so that fcron can completely replace dcron
+ install -D -m600 "$srcdir/systab" "$pkgdir/var/spool/fcron/systab"
+ # In order to preserve the systab crontab in any case it is better to have
+ # it in non-binary form too
+ install -D -m600 "$srcdir/systab.orig" "$pkgdir/var/spool/fcron/systab.orig"
+ # Add cron.* directories
+ install -d -m755 "$pkgdir/etc/cron.daily"
+ install -d -m755 "$pkgdir/etc/cron.hourly"
+ install -d -m755 "$pkgdir/etc/cron.monthly"
+ install -d -m755 "$pkgdir/etc/cron.weekly"
+ # Install run-cron script to make fcron run without dcron
+ install -D -m755 "$srcdir/run-cron" "$pkgdir/usr/sbin/run-cron"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/fcron/fcron.install b/community/fcron/fcron.install
new file mode 100755
index 000000000..a1223138e
--- /dev/null
+++ b/community/fcron/fcron.install
@@ -0,0 +1,23 @@
+pre_install() {
+ # Create necessary user and group
+ getent group cron || /usr/sbin/groupadd -g 22 cron
+ getent passwd cron || /usr/sbin/useradd -d / -g cron -u 22 -s /bin/false cron
+}
+
+post_install() {
+ cat << "EOF"
+
+ Use fcrontab -u systab -e to edit the system crontab and change the defaults.
+
+ By default fcron uses vi as an editor for your crontab. If you want to use another editor
+ you can define it in /etc/fcron/fcron.conf. If for some odd reason you want to uninstall
+ vi and recompile fcron, you need to edit the PKGBUILD and pass
+ --with-editor=<pathtoyoureditor> to configure.
+
+ By default fcron uses /usr/sbin/sendmail (as in the packages providing smtp-sever, such as
+ exim and postfix) to send mails about your cron jobs. If there is no /usr/sbin/sendmail you
+ won't get mails. If you want to use a MTA with a different path you can define it
+ /etc/fcron/fcron.conf.
+
+EOF
+}
diff --git a/community/fcron/fcron.rc b/community/fcron/fcron.rc
new file mode 100755
index 000000000..880439a1d
--- /dev/null
+++ b/community/fcron/fcron.rc
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/fcron`
+case "$1" in
+ start)
+ stat_busy "Starting Fcron Daemon"
+ [ -z "$PID" ] && /usr/sbin/fcron -b
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon fcron
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Fcron Daemon"
+ [ -n "$PID" ] && kill $PID >/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon fcron
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community/fcron/run-cron b/community/fcron/run-cron
new file mode 100755
index 000000000..51007a15a
--- /dev/null
+++ b/community/fcron/run-cron
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+
+if [ -z $1 ]; then
+ echo "Usage: $0 crondir"
+ exit 1
+fi
+
+for cron in $1/* ; do
+ if [ -x $cron ]; then
+ $cron
+ fi
+done
+unset cron
diff --git a/community/fcron/systab b/community/fcron/systab
new file mode 100755
index 000000000..11c7e2fd0
--- /dev/null
+++ b/community/fcron/systab
Binary files differ
diff --git a/community/fcron/systab.orig b/community/fcron/systab.orig
new file mode 100644
index 000000000..5b0045626
--- /dev/null
+++ b/community/fcron/systab.orig
@@ -0,0 +1,4 @@
+&bootrun 01 * * * * /usr/sbin/run-cron /etc/cron.hourly
+&bootrun 02 00 * * * /usr/sbin/run-cron /etc/cron.daily
+&bootrun 22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
+&bootrun 42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly