From c9f308a14690cd32642b77352d95172df9d364b9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 26 Nov 2010 16:23:47 +0100 Subject: [PATCH] Added dcron-4.4 build template. --- srcpkgs/dcron/files/crond.confd | 3 ++ srcpkgs/dcron/files/crond.init | 10 +++++ srcpkgs/dcron/patches/dcron-logname.patch | 25 ++++++++++++ srcpkgs/dcron/template | 46 +++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 srcpkgs/dcron/files/crond.confd create mode 100755 srcpkgs/dcron/files/crond.init create mode 100644 srcpkgs/dcron/patches/dcron-logname.patch create mode 100644 srcpkgs/dcron/template diff --git a/srcpkgs/dcron/files/crond.confd b/srcpkgs/dcron/files/crond.confd new file mode 100644 index 00000000000..f49ad39a1b4 --- /dev/null +++ b/srcpkgs/dcron/files/crond.confd @@ -0,0 +1,3 @@ +# Arguments passed to the cron daemon. +# +CROND_ARGS="-S -l info" diff --git a/srcpkgs/dcron/files/crond.init b/srcpkgs/dcron/files/crond.init new file mode 100755 index 00000000000..1cea8325004 --- /dev/null +++ b/srcpkgs/dcron/files/crond.init @@ -0,0 +1,10 @@ +#!/sbin/runscript + +command=/usr/sbin/crond +command_args="${CROND_ARGS}" + +depend() +{ + need localmount + after bootmisc +} diff --git a/srcpkgs/dcron/patches/dcron-logname.patch b/srcpkgs/dcron/patches/dcron-logname.patch new file mode 100644 index 00000000000..c37c5f45f65 --- /dev/null +++ b/srcpkgs/dcron/patches/dcron-logname.patch @@ -0,0 +1,25 @@ +diff -aur dcron-4.4/chuser.c dcron-4.4.logname/chuser.c +--- dcron-4.4/chuser.c 2010-02-15 11:18:13.111967483 +0100 ++++ dcron-4.4.logname/chuser.c 2010-02-15 11:18:29.615531204 +0100 +@@ -25,6 +25,7 @@ + return(-1); + } + setenv("USER", pas->pw_name, 1); ++ setenv("LOGNAME", pas->pw_name, 1); + setenv("HOME", pas->pw_dir, 1); + setenv("SHELL", "/bin/sh", 1); + +diff -aur dcron-4.4/crontab.1 dcron-4.4.logname/crontab.1 +--- dcron-4.4/crontab.1 2010-02-15 11:18:13.111967483 +0100 ++++ dcron-4.4.logname/crontab.1 2010-02-15 11:19:48.295707950 +0100 +@@ -57,8 +57,8 @@ + .PP + Nor does it do any special environment handling. + A shell script is better-suited to doing that than a cron daemon. +-This cron daemon sets up only three environment variables: USER, +-HOME, and SHELL. ++This cron daemon sets up only four environment variables: USER, ++LOGNAME, HOME, and SHELL. + .PP + Our crontab format is roughly similar to that used by vixiecron. + Individual fields may contain a time, a time range, a time range diff --git a/srcpkgs/dcron/template b/srcpkgs/dcron/template new file mode 100644 index 00000000000..ecda79760ff --- /dev/null +++ b/srcpkgs/dcron/template @@ -0,0 +1,46 @@ +# Template file for 'dcron' +pkgname=dcron +version=4.4 +patch_args="-Np1" +distfiles="http://www.jimpryor.net/linux/releases/dcron-${version}.tar.gz" +build_style=custom-install +short_desc="Dillon's lightweight cron daemon" +maintainer="Juan RP " +checksum=0847dee3a76ba504f2f1587038fef5193b143988c96bf3fdc511abd23099cb66 +long_desc=" + This lightweight cron daemon aims to be simple and secure, with just enough + features to stay useful. It was written from scratch by Matt Dillon in 1994. + It's now developed and maintained by Jim Pryor. + + In the author's opinion, having to combine a cron daemon with another daemon + like anacron makes for too much complexity. So the goal is a simple cron daemon + that can also take over the central functions of anacron." + +keep_empty_dirs=yes +replaces="cronie>=0" +openrc_services="crond default true" +conf_files="/var/spool/cron/root /etc/conf.d/cron" + +Add_dependency run glibc + +do_build() +{ + make PREFIX=/usr CRONTAB_GROUP=users CRONTABS=/var/spool/cron \ + CRONSTAMPS=/var/spool/cronstamps || return 1 +} + +do_install() +{ + make DESTDIR=${DESTDIR} install || return 1 + + install -d ${DESTDIR}/etc/cron.{hour,week,month}ly + install -D -m755 extra/run-cron ${DESTDIR}/usr/sbin/run-cron + install -D -m600 extra/root.crontab ${DESTDIR}/var/spool/cron/root + install -D -m644 extra/crond.logrotate ${DESTDIR}/etc/logrotate.d/crond + + install -D -m644 ${FILESDIR}/crond.confd ${DESTDIR}/etc/conf.d/crond + install -D -m755 ${FILESDIR}/crond.init ${DESTDIR}/etc/init.d/crond + + # crontab must be setuid for all users to work! + chmod 4755 ${DESTDIR}/usr/bin/crontab +}