aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dcron
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-09-28 15:54:39 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2015-09-28 15:54:39 +0200
commitc87453388fd46eaa8db5bad0b17632383567c359 (patch)
treef035a48222d02ffae5c8f785fa8a190b4c9360b4 /testing/dcron
parent41d8142af0dc8fbf10385b5bd80fb3b6c8813800 (diff)
downloadaports-c87453388fd46eaa8db5bad0b17632383567c359.tar.bz2
aports-c87453388fd46eaa8db5bad0b17632383567c359.tar.xz
testing/dcron: new aport
Diffstat (limited to 'testing/dcron')
-rw-r--r--testing/dcron/APKBUILD68
-rw-r--r--testing/dcron/dcron.confd5
-rw-r--r--testing/dcron/dcron.initd24
-rw-r--r--testing/dcron/ldflags.patch38
-rw-r--r--testing/dcron/pidfile.patch43
5 files changed, 178 insertions, 0 deletions
diff --git a/testing/dcron/APKBUILD b/testing/dcron/APKBUILD
new file mode 100644
index 0000000000..663f4f065a
--- /dev/null
+++ b/testing/dcron/APKBUILD
@@ -0,0 +1,68 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
+pkgname=dcron
+pkgver=4.5
+pkgrel=0
+pkgdesc="dillon's lightweight cron daemon"
+url="http://www.jimpryor.net/linux/dcron.html"
+arch="all"
+license="GPL"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://www.jimpryor.net/linux/releases/${pkgname}-${pkgver}.tar.gz
+ $pkgname.initd
+ $pkgname.confd
+ pidfile.patch
+ ldflags.patch"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+ cd "$_builddir"
+ local i
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1 ;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ make PREFIX=/usr \
+ CRONTAB_GROUP=wheel \
+ CRONTABS=/etc/crontabs \
+ CRONSTAMPS=/var/spool/cron/cronstamps \
+ SCRONTABS=/etc/periodic || return 1
+}
+
+package() {
+ cd "$_builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+ install -Dm644 extra/crond.logrotate "$pkgdir"/etc/logrotate.d/$pkgname || return 1
+
+ install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname || return 1
+
+ install -Dm644 CHANGELOG "$pkgdir"/usr/share/doc/$pkgname/CHANGELOG || return 1
+ install -Dm644 README "$pkgdir"/usr/share/doc/$pkgname/README || return 1
+}
+
+md5sums="078833f3281f96944fc30392b1888326 dcron-4.5.tar.gz
+5471011446d9d15ee6c6f941b13ab9d3 dcron.initd
+a9f3fdab61f1646cbc074e6d59364303 dcron.confd
+1e40cbf27604072f147ec8b131988eaf pidfile.patch
+646b16f31abbea4c215512f58f421abc ldflags.patch"
+sha256sums="9e50edb6f5bd8153b16bad05087d985e5153ce45cc01ae77e7f842213fb4a824 dcron-4.5.tar.gz
+89d20c43af55c4d261725be6af444c47778b7ec31aa5779aeb5c3e9f5954d0d0 dcron.initd
+1e273164865bb8f05d97ef1479c285b86f4104951ac294af883eb65ce100ccd0 dcron.confd
+4272467e432eab948f6770ea639f38817123eac2c87fc76f3fcb2b2d4cecbbb6 pidfile.patch
+69b907a89d22bcff5ded7ebd749c4e8df87106e290c75110630031e75631ee3a ldflags.patch"
+sha512sums="08521391d16ba5adf80278ec2a734319c26c48841fd94b119c0b27d744c2cfb3562b1a3630135a03d1c43b1668d49262713abb20ff5f7ecd397a2a19a2f6105a dcron-4.5.tar.gz
+502a661f088e4e5b84d59b10f1419ce40e8cfb954aed4855a5dad7f30c1c8794c0472561a4b6bb5017fd7825589e33f591654b6704ce54d0c77f44da70802826 dcron.initd
+05b4a7aeb9d994aa3a37a0f2efa0f560a4eb6dd1fc77d67c85be3397f077bc92a0d647140164a96d48e49b486eef021aef5c3410704d457eda5eb894b46d26fb dcron.confd
+08bd8d7445b597a5c7d66d3e768c943388db44e0ae43a0cec2be3b0c83c510f00f808b02d52b86cb663e79ea66584b16f92eaa02d40489e5f4124206ae17378d pidfile.patch
+8a07ccfae80468a555e8f5ea60f88dd444a3aacb6baa6f747a6a02bcdce78baaa8aaf799ae9d2684a518bfff537dc0cdcf0b53bb6fc0017fa52228f1f0a16e49 ldflags.patch"
diff --git a/testing/dcron/dcron.confd b/testing/dcron/dcron.confd
new file mode 100644
index 0000000000..61cdf12b43
--- /dev/null
+++ b/testing/dcron/dcron.confd
@@ -0,0 +1,5 @@
+# /etc/conf.d/dcron
+
+# Options to pass to dcron at startup.
+# Default logging is via syslog; use -L to send to file.
+DCRON_OPTS=""
diff --git a/testing/dcron/dcron.initd b/testing/dcron/dcron.initd
new file mode 100644
index 0000000000..087c2783ab
--- /dev/null
+++ b/testing/dcron/dcron.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/dcron/files/dcron.init-4.5,v 1.1 2011/05/16 20:28:54 vapier Exp $
+
+depend() {
+ use logger clock hostname
+ provide cron
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ /usr/sbin/crond ${DCRON_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet \
+ --pidfile /var/run/crond.pid --exec /usr/sbin/crond
+ local ret=$?
+ rm -f /var/run/crond.pid
+ eend ${ret}
+}
diff --git a/testing/dcron/ldflags.patch b/testing/dcron/ldflags.patch
new file mode 100644
index 0000000000..7fa2d8d9d0
--- /dev/null
+++ b/testing/dcron/ldflags.patch
@@ -0,0 +1,38 @@
+From 8a292168e584c50808b80df3577a7d89fa32db26 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 16 May 2011 16:24:20 -0400
+Subject: [PATCH] drop LDFLAGS set, and restore CFLAGS linking
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 1938e05..8309ad6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -32,7 +32,6 @@ TABSRCS = crontab.c chuser.c
+ TABOBJS = crontab.o chuser.o
+ PROTOS = protos.h
+ LIBS =
+-LDFLAGS =
+ DEFS = -DVERSION='"$(VERSION)"' \
+ -DSCRONTABS='"$(SCRONTABS)"' -DCRONTABS='"$(CRONTABS)"' \
+ -DCRONSTAMPS='"$(CRONSTAMPS)"' -DLOG_IDENT='"$(LOG_IDENT)"' \
+@@ -54,10 +53,10 @@ protos.h: $(SRCS) $(TABSRCS)
+ fgrep -h Prototype $(SRCS) $(TABSRCS) > protos.h
+
+ crond: $(OBJS)
+- $(CC) $(LDFLAGS) $^ $(LIBS) -o crond
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o crond
+
+ crontab: $(TABOBJS)
+- $(CC) $(LDFLAGS) $^ -o crontab
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o crontab
+
+ %.o: %.c defs.h $(PROTOS)
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@
+--
+1.7.5.rc3
+
diff --git a/testing/dcron/pidfile.patch b/testing/dcron/pidfile.patch
new file mode 100644
index 0000000000..6004c4c4b4
--- /dev/null
+++ b/testing/dcron/pidfile.patch
@@ -0,0 +1,43 @@
+From 14b0f33ebf33d3d08427fd4d9fd4bda3cc107bd0 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 26 Oct 2010 01:42:32 -0400
+Subject: [PATCH] crond: write a pid file
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 2 +-
+ main.c | 5 +++++
+ 2 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index dc5b78f..e278312 100644
+--- a/Makefile
++++ b/Makefile
+@@ -38,7 +38,7 @@ DEFS = -DVERSION='"$(VERSION)"' \
+ -DTIMESTAMP_FMT='"$(TIMESTAMP_FMT)"'
+
+ # save variables needed for `make install` in config
+-all: $(PROTOS) crond crontab ;
++all: crond crontab ;
+ rm -f config
+ echo "PREFIX = $(PREFIX)" >> config
+ echo "SBINDIR = $(SBINDIR)" >> config
+diff --git a/main.c b/main.c
+index e4a742e..6313213 100644
+--- a/main.c
++++ b/main.c
+@@ -227,6 +227,11 @@ main(int ac, char **av)
+ exit(1);
+ } else if (pid > 0) {
+ /* parent */
++ FILE *fp;
++ if ((fp = fopen("/var/run/crond.pid", "w")) != NULL) {
++ fprintf(fp, "%d\n", pid);
++ fclose(fp);
++ }
+ exit(0);
+ }
+ /* child continues */
+--
+1.7.3.1
+