# $Id: Portfile 93073 2012-05-14 20:31:14Z ryandesign@macports.org $

PortSystem 1.0

name			fcron
version			3.0.6
categories		sysutils
platforms		darwin
maintainers		yahoo.com:compconsultant
description		fcron is an alternative scheduler aka cron daemon
long_description	fcron is a scheduler. It aims at replacing Vixie Cron, so \
			it implements most of its functionalities. But contrary to \
			Vixie Cron, fcron does not need your system to be up 7 \
			days a week, 24 hours a day : it also works well with \
			systems which are not running neither all the time nor \
			regularly (contrary to anacrontab).

homepage		http://fcron.free.fr
master_sites		${homepage}/archives
extract.suffix		.src.tar.gz
checksums		md5 69ebcb41921e2a282f41ebecb3a27053 \
			sha1 6b0a886931d9a89c65df33228384b07d672238bf \
			rmd160 fadcb39ce106dcd61f31e1d4d6ab7c2d1149b36b

configure.args		--with-boot-install=no \
			--with-pam=no \
			--with-selinux=no

startupitem.create	yes
startupitem.name	fcron
startupitem.start	"\[ -x ${prefix}/sbin/fcron \] && ${prefix}/sbin/fcron -b"
startupitem.stop	"\[ -r ${prefix}/var/run/fcron.pid \] \\" \
					"&& kill -KILL `cat ${prefix}/var/run/fcron.pid`"

destroot.keepdirs	${destroot}${prefix}/var/spool/fcron

pre-destroot	{
	addgroup fcron
	set gid [existsgroup fcron]
	adduser fcron shell=/bin/bash gid=${gid} \
			realname=fcronServer
}
post-destroot {
	foreach file [glob ${destroot}${prefix}/etc/fcron*] {
		file rename ${file} ${file}.sample
	}
}

notes "
Please create the fcron configuration file $prefix/etc/fcron.conf\
by using the sample file $prefix/etc/fcron.conf.sample as a reference
"
