From 9a7dded5dfab2d41eb5c5dbf02985cde9d4e45d6 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 5 Mar 2014 11:22:51 +0100 Subject: [PATCH] Add dcron. There doesn't seem to be a way to autostart the daemon on boot (unless we directly modify the boot script). Assume the user will do that himself by adding to ~/config/settings/boot/. crond needs to be told where to store the crontab and cronstamps file, and where to read the cron files. The default values are non-existing folders in /var and /etc (just creating those is ok, too). --- sys-process/dcron/dcron-4.5.recipe | 63 ++++++++++++++++++++ sys-process/dcron/patches/dcron-4.5.patchset | 53 ++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 sys-process/dcron/dcron-4.5.recipe create mode 100644 sys-process/dcron/patches/dcron-4.5.patchset diff --git a/sys-process/dcron/dcron-4.5.recipe b/sys-process/dcron/dcron-4.5.recipe new file mode 100644 index 000000000..8504a6ed2 --- /dev/null +++ b/sys-process/dcron/dcron-4.5.recipe @@ -0,0 +1,63 @@ +SUMMARY="dillon's lightweight cron daemon" +DESCRIPTION=" +This is a continuation of Matt Dillon's beautifully minimalist dcron. At first +I had written a fork (yacron), but Matt has handed over maintainership of the +main dcron branch, so all of yacron was merged into dcron 4.0. + +The biggest changes in v4.0 are syslogging and a variety of anacron-like +features. If you use this version of dcron, you shouldn't have any further need +for anacron. + +More specifically, dcron can now: +* log to syslog or a file +* email job output to a remote addresses, instead of the local user who owns \ + the job (so it works with lightweight mail handlers like msmtp, which \ + don't route mail to local users). +* replace sendmail with any other script to which all job output should be piped +* various crontab syntax extensions, including @daily and @reboot and more \ + finer-grained frequency specifiers. See manpages for details. +" +HOMEPAGE="http://www.jimpryor.net/linux/dcron.html" +SRC_URI="http://www.jimpryor.net/linux/releases/dcron-$portVersion.tar.gz" +CHECKSUM_MD5="078833f3281f96944fc30392b1888326" +REVISION="1" +ARCHITECTURES="x86_gcc2" + +PROVIDES=" + dcron = $portVersion + cmd:crond + cmd:crontab + " + +REQUIRES=" + haiku >= $haikuVersion +" + +BUILD_REQUIRES=" + haiku_devel >= $haikuVersion + " + +BUILD_PREREQUIRES=" + cmd:gcc + cmd:as + cmd:make +" + +PATCHES="dcron-$portVersion.patchset" + +BUILD() +{ + make PREFIX=$prefix SBINDIR=$binDir BINDIR=$binDir MANDIR=$manDir \ + CRONTAB_GROUP=root CRONTABS=$prefix/var/spool/cron/crontabs \ + CRONSTAMPS=$prefix/var/spool/cron/cronstamps +} + +INSTALL() +{ + make install +} +LICENSE="GNU GPL v2" +COPYRIGHT=" + 1994 Matthew Dillon + 2009-2011 James Pryor +" diff --git a/sys-process/dcron/patches/dcron-4.5.patchset b/sys-process/dcron/patches/dcron-4.5.patchset new file mode 100644 index 000000000..8c8643429 --- /dev/null +++ b/sys-process/dcron/patches/dcron-4.5.patchset @@ -0,0 +1,53 @@ +From 1b37f8b350c0ab8c7da9be5663da2bb68fc687cb Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Wed, 5 Mar 2014 10:59:27 +0100 +Subject: Haiku compatibility hacks. + + +diff --git a/Makefile b/Makefile +index c7cc359..ff0313e 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,19 +20,19 @@ MANDIR = $(PREFIX)/share/man + + + SHELL = /bin/sh +-INSTALL = install -o root ++INSTALL = install + INSTALL_PROGRAM = $(INSTALL) -D + INSTALL_DATA = $(INSTALL) -D -m0644 -g root + INSTALL_DIR = $(INSTALL) -d -m0755 -g root + CFLAGS ?= -O2 +-CFLAGS += -Wall -Wstrict-prototypes -Wno-missing-field-initializers ++CFLAGS += -Wall -Wstrict-prototypes + SRCS = main.c subs.c database.c job.c concat.c chuser.c + OBJS = main.o subs.o database.o job.o concat.o chuser.o + TABSRCS = crontab.c chuser.c + TABOBJS = crontab.o chuser.o + PROTOS = protos.h + LIBS = +-LDFLAGS = ++LDFLAGS = -lbsd + DEFS = -DVERSION='"$(VERSION)"' \ + -DSCRONTABS='"$(SCRONTABS)"' -DCRONTABS='"$(CRONTABS)"' \ + -DCRONSTAMPS='"$(CRONSTAMPS)"' -DLOG_IDENT='"$(LOG_IDENT)"' \ +diff --git a/main.c b/main.c +index 595f07a..cde23c8 100644 +--- a/main.c ++++ b/main.c +@@ -234,10 +234,12 @@ main(int ac, char **av) + + if (setsid() < 0) + perror("setsid"); ++#ifndef __HAIKU__ + if ((fd = open("/dev/tty", O_RDWR)) >= 0) { + ioctl(fd, TIOCNOTTY, 0); + close(fd); + } ++#endif + + /* setup logging for backgrounded daemons */ + +-- +1.8.3.4 +