diff options
Diffstat (limited to 'community/incron')
-rw-r--r-- | community/incron/PKGBUILD | 36 | ||||
-rw-r--r-- | community/incron/incron.init | 34 | ||||
-rw-r--r-- | community/incron/incron.install | 15 |
3 files changed, 85 insertions, 0 deletions
diff --git a/community/incron/PKGBUILD b/community/incron/PKGBUILD new file mode 100644 index 000000000..bc8e83ab3 --- /dev/null +++ b/community/incron/PKGBUILD @@ -0,0 +1,36 @@ +# $Id: PKGBUILD 1515 2009-08-24 21:08:19Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Roberto Alsina <ralsina@kde.org> +# Contributor: scj <scj(at)archlinux(dot)us> +pkgname=incron +pkgver=0.5.9 +pkgrel=1 +pkgdesc="Like the regular cron but is driven by filesystem events instead of time periods" +arch=('i686' 'x86_64') +url="http://incron.aiken.cz/" +license=("GPL") +depends=('gcc-libs') +install=incron.install +source=(http://inotify.aiken.cz/download/incron/$pkgname-$pkgver.tar.gz \ + incron.init) +options=(emptydirs) +md5sums=('a285b9e14af7bf9f9524fe051a06255f' + '648e1ca1a4b1e624401d9d71aa3756b3') + +build() { + cd $startdir/src/$pkgname-$pkgver + + install -D -m 755 $startdir/incron.init $startdir/pkg/etc/rc.d/incrond + mkdir -p $startdir/pkg/usr/share/man $startdir/pkg/usr/bin $startdir/pkg/usr/sbin + + sed -i '1,1i#include <stdio.h>' icd-main.cpp inotify-cxx.cpp usertable.cpp appargs.cpp + sed -i 's|strchr(s,|(char*)strchr(s,|' incroncfg.cpp + + make || return 1 + + make PREFIX=$startdir/pkg/usr \ + MANPATH=$startdir/pkg/usr/share/man \ + USERDATADIR=$startdir/pkg/var/spool/incron \ + CFGDIR=$startdir/pkg/etc \ + SYSDATADIR=$startdir/pkg/etc/incron.d install +} diff --git a/community/incron/incron.init b/community/incron/incron.init new file mode 100644 index 000000000..337c0fa0b --- /dev/null +++ b/community/incron/incron.init @@ -0,0 +1,34 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Starting Incrond" + /usr/sbin/incrond + add_daemon incrond + stat_done + ;; + stop) + stat_busy "Stopping Incrond" + PID=`pidof -o %PPID /usr/sbin/incrond` + [ -z "$PID" ] || kill $PID + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon incrond + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" + ;; +esac +exit 0 diff --git a/community/incron/incron.install b/community/incron/incron.install new file mode 100644 index 000000000..3c4535b00 --- /dev/null +++ b/community/incron/incron.install @@ -0,0 +1,15 @@ +post_install () { + # Check user/group incron exists + getent group incron > /dev/null || groupadd incron + getent passwd incron > /dev/null || useradd -c "Incron system" -g incron -s /bin/false -d /var/spool/incron incron + # Fix permissions + chown incron.incron -R /var/spool/incron +} + +pre_remove() { + [ -h /var/service/incron ] && rm /var/service/incron + /etc/rc.d/incron stop + usr/sbin/userdel incron >& /dev/null + usr/sbin/groupdel incron >& /dev/null +} + |