From 691acdf843240d92e57bb504a0c2d1eb320cc58d Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sun, 25 Dec 2011 17:25:34 -0600
Subject: dcron: update to version 4.5

refs #807
closes #807
---
 abs/core/dcron/PKGBUILD            | 62 +++++++++++++++++---------------------
 abs/core/dcron/__changelog         |  2 +-
 abs/core/dcron/crond               | 37 -----------------------
 abs/core/dcron/dcron-3.1.patch     | 33 --------------------
 abs/core/dcron/dcron-logname.patch | 25 ---------------
 abs/core/dcron/dcron.conf.d        |  4 ---
 abs/core/dcron/dcron.install       |  5 ++-
 abs/core/dcron/dcron.rc.d          | 47 -----------------------------
 abs/core/dcron/root.crontab        | 12 --------
 abs/core/dcron/run-cron            | 14 ---------
 10 files changed, 33 insertions(+), 208 deletions(-)
 delete mode 100755 abs/core/dcron/crond
 delete mode 100644 abs/core/dcron/dcron-3.1.patch
 delete mode 100644 abs/core/dcron/dcron-logname.patch
 delete mode 100644 abs/core/dcron/dcron.conf.d
 delete mode 100644 abs/core/dcron/dcron.rc.d
 delete mode 100644 abs/core/dcron/root.crontab
 delete mode 100755 abs/core/dcron/run-cron

diff --git a/abs/core/dcron/PKGBUILD b/abs/core/dcron/PKGBUILD
index 0003bf7..26c1a7a 100644
--- a/abs/core/dcron/PKGBUILD
+++ b/abs/core/dcron/PKGBUILD
@@ -1,50 +1,44 @@
 # Maintainer: Paul Mattal <paul.archlinux.org>
 
 pkgname=dcron
-pkgver=4.4
-pkgrel=3
+pkgver=4.5
+pkgrel=2
 pkgdesc="dillon's lightweight cron daemon"
-arch=(i686 x86_64)
+arch=('i686' 'x86_64')
 license=('GPL')
 url="http://www.jimpryor.net/linux/dcron"
-backup=(var/spool/cron/root etc/conf.d/crond)
-depends=('glibc')
+backup=('var/spool/cron/root' 'etc/conf.d/crond')
+depends=('bash')
 provides=('cron')
-groups=('base')
-source=("http://www.jimpryor.net/linux/releases/${pkgname}-${pkgver}.tar.gz"
-	'dcron-logname.patch'
-	'dcron.rc.d'
-	'dcron.conf.d')
-md5sums=('02d848ba043a9df5bf2102a9f4bc04bd'
-	 'c6054421b48100f7a2a7a36e2d33c92a'
-	 '73693cdd59df526e729cdec99c5ed8fb'
-	 '5bfa07beb54d0beaf3f38225e4d5a9fa')
+conflicts=('cron')
+source=("http://www.jimpryor.net/linux/releases/${pkgname}-${pkgver}.tar.gz")
+md5sums=('078833f3281f96944fc30392b1888326')
 optdepends=('smtp-server: sending cron job output via email')
 install=$pkgname.install
 
 build() {
-	cd "$srcdir/${pkgname}-${pkgver}" || return 1
+        cd "$srcdir/${pkgname}-${pkgver}"
 
-	# patch to add LOGNAME environment variable
-	patch -p1 -i $srcdir/dcron-logname.patch || return 1
+        # by default, any member of group "users" can edit their own crontab
+        make \
+                PREFIX=/usr \
+                CRONTAB_GROUP=users \
+                CRONTABS=/var/spool/cron \
+                CRONSTAMPS=/var/spool/cronstamps
+}
 
-	# by default, any member of group "users" can edit their own crontab
-	make \
-		PREFIX=/usr \
-		CRONTAB_GROUP=users \
-		CRONTABS=/var/spool/cron \
-		CRONSTAMPS=/var/spool/cronstamps \
-		|| return 1
-	make DESTDIR="$pkgdir" install || return 1
+package() {
+        cd "$srcdir/${pkgname}-${pkgver}"
+        make DESTDIR="$pkgdir" install
 
-	# install standard configuration and scripts
-	install -d -m755 "$pkgdir/etc/cron."{hourly,daily,weekly,monthly} \
-		|| return 1
-	install -D -m755 extra/run-cron "$pkgdir/usr/sbin/run-cron" || return 1
-	install -D -m0600 extra/root.crontab "$pkgdir/var/spool/cron/root" \
-		|| return 1
+        # install standard configuration and scripts
+        install -d -m755 "$pkgdir/etc/cron."{hourly,daily,weekly,monthly} 
 
-	# install Arch configuration and launch scripts
-	install -D -m755 "$srcdir/dcron.rc.d" "$pkgdir/etc/rc.d/crond" || return 1
-	install -D -m0644 "$srcdir/dcron.conf.d" "$pkgdir/etc/conf.d/crond" || return 1
+        install -D -m755 extra/run-cron "$pkgdir/usr/sbin/run-cron"
+        install -D -m0600 extra/root.crontab "$pkgdir/var/spool/cron/root" 
+        install -D -m755 extra/crond.rc "$pkgdir/etc/rc.d/crond"
+        install -D -m0644 extra/crond.conf "$pkgdir/etc/conf.d/crond"
+        install -D -m644 extra/crontab.vim "$pkgdir/usr/share/vim/vimfiles/ftplugin/crontab.vim"
+        sed -i -e 's=/var/spool/cron/cronstamps=/var/spool/cronstamps=' extra/prune-cronstamps
+        install -D -m755 extra/prune-cronstamps "$pkgdir/etc/cron.d/prune-cronstamps"
 }
diff --git a/abs/core/dcron/__changelog b/abs/core/dcron/__changelog
index e6464b6..8e4bced 100644
--- a/abs/core/dcron/__changelog
+++ b/abs/core/dcron/__changelog
@@ -1,4 +1,4 @@
-Added an every ten minutes dir + job
+Added an every ten minutes dir + job by .install file
 
  grep -q cron.tenminutes /var/spool/cron/root
   if [ $? = 1 ]
diff --git a/abs/core/dcron/crond b/abs/core/dcron/crond
deleted file mode 100755
index ef80db3..0000000
--- a/abs/core/dcron/crond
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-PID=`pidof -o %PPID /usr/sbin/crond`
-case "$1" in
-  start)
-    stat_busy "Starting Cron Daemon"
-    [ -z "$PID" ] && /usr/sbin/crond >>/var/log/crond 2>&1
-    if [ $? -gt 0 ]; then
-      stat_fail
-    else
-      PID=`pidof -o %PPID /usr/sbin/crond`
-      echo $PID >/var/run/crond.pid
-      add_daemon crond
-      stat_done
-    fi
-    ;;
-  stop)
-    stat_busy "Stopping Cron Daemon"
-    [ ! -z "$PID" ]  && kill $PID &>/dev/null
-    if [ $? -gt 0 ]; then
-      stat_fail
-    else
-      rm_daemon crond
-      stat_done
-    fi
-    ;;
-  restart)
-    $0 stop
-    $0 start
-    ;;
-  *)
-    echo "usage: $0 {start|stop|restart}"  
-esac
-exit 0
diff --git a/abs/core/dcron/dcron-3.1.patch b/abs/core/dcron/dcron-3.1.patch
deleted file mode 100644
index 975d51c..0000000
--- a/abs/core/dcron/dcron-3.1.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -Naur dcron-orig/defs.h dcron/defs.h
---- dcron-orig/defs.h	2006-04-29 10:20:58.000000000 -0700
-+++ dcron/defs.h	2006-05-04 18:40:05.000000000 -0700
-@@ -28,7 +28,7 @@
- #define arysize(ary)	(sizeof(ary)/sizeof((ary)[0]))
- 
- #ifndef CRONTABS
--#define CRONTABS	"/var/spool/cron/crontabs"
-+#define CRONTABS	"/var/spool/cron"
- #endif
- #ifndef SCRONTABS
- #define SCRONTABS	"/etc/cron.d"
-@@ -44,7 +44,7 @@
- #if defined(__DragonFly__)
- #define SENDMAIL	"/usr/sbin/sendmail"
- #else
--#define SENDMAIL	"/usr/lib/sendmail"
-+#define SENDMAIL	"/usr/sbin/sendmail"
- #endif
- #endif
- 
-diff -Naur dcron-orig/subs.c dcron/subs.c
---- dcron-orig/subs.c	2006-04-27 10:29:56.000000000 -0700
-+++ dcron/subs.c	2006-05-04 18:40:19.000000000 -0700
-@@ -79,7 +79,7 @@
- 
-     buf[0] = 0;
-     if (useDate)
--	strftime(buf, 128, "%d-%b-%y %H:%M  ", tp);
-+	strftime(buf, 128, "%d-%b-%Y %H:%M  ", tp);
-     vsnprintf(buf + strlen(buf), nmax, ctl, va);
-     return(strlen(buf));
- }
diff --git a/abs/core/dcron/dcron-logname.patch b/abs/core/dcron/dcron-logname.patch
deleted file mode 100644
index c37c5f4..0000000
--- a/abs/core/dcron/dcron-logname.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-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/abs/core/dcron/dcron.conf.d b/abs/core/dcron/dcron.conf.d
deleted file mode 100644
index 763c712..0000000
--- a/abs/core/dcron/dcron.conf.d
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# Parameters to be passed to crond
-#
-CROND_ARGS="-S -l info"
diff --git a/abs/core/dcron/dcron.install b/abs/core/dcron/dcron.install
index b3e90da..fb01dc9 100644
--- a/abs/core/dcron/dcron.install
+++ b/abs/core/dcron/dcron.install
@@ -10,7 +10,10 @@ post_upgrade() {
   then
 	  echo "0,10,20,30,40,50 * * * *	/usr/sbin/run-cron /etc/cron.tenminutes" >> /var/spool/cron/root
   fi
-
+  if [ ! -e /etc/cron.tenminutes ]
+  then
+	  mkdir -p /etc/cron.tenminutes
+  fi
 
 }
 
diff --git a/abs/core/dcron/dcron.rc.d b/abs/core/dcron/dcron.rc.d
deleted file mode 100644
index b1a5770..0000000
--- a/abs/core/dcron/dcron.rc.d
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/crond
-
-PID=$(pidof -o %PPID /usr/sbin/crond)
-case $1 in
-start)
-	stat_busy "Starting Cron Daemon"
-
-	# defaults to using syslog, and sendmail-ing cron output to local user
-	# to mail output to remote address instead, add "-m user@host"
-	# to CROND_ARGS in /etc/conf.d/crond
-	if [[ -z $PID ]] && /usr/sbin/crond $CROND_ARGS; then
-
-		PID=$(pidof -o %PPID /usr/sbin/crond)
-		echo "$PID" > /var/run/crond.pid
-		add_daemon crond
-		stat_done
-	else
-		stat_fail
-		exit 1
-	fi
-	;;
-
-stop)
-	stat_busy "Stopping Cron Daemon"
-	if [[ ! -z $PID ]]  && kill "$PID" &>/dev/null; then
-		rm_daemon crond
-		stat_done
-	else
-		stat_fail
-		exit 1
-	fi
-	;;
-
-restart)
-	$0 stop
-	$0 start
-	;;
-
-*)
-	echo "Usage: $0 {start|stop|restart}" >&2
-	exit 1
-
-esac
diff --git a/abs/core/dcron/root.crontab b/abs/core/dcron/root.crontab
deleted file mode 100644
index 726558f..0000000
--- a/abs/core/dcron/root.crontab
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# DO NOT EDIT THIS FILE MANUALLY!! USE crontab -e INSTEAD.
-#
-
-# <minute> <hour> <day> <month> <dow> <command>
-
-
-01 * * * *  /usr/sbin/run-cron /etc/cron.hourly
-02 00 * * * /usr/sbin/run-cron /etc/cron.daily
-22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
-42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly
-
diff --git a/abs/core/dcron/run-cron b/abs/core/dcron/run-cron
deleted file mode 100755
index 51007a1..0000000
--- a/abs/core/dcron/run-cron
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-
-if [ -z $1 ]; then
-   echo "Usage: $0 crondir"
-   exit 1
-fi
-
-for cron in $1/* ; do
-  if [ -x $cron ]; then
-     $cron
-  fi
-done
-unset cron
-- 
cgit v0.12