[packages/dcron] new, version 4.5

glen glen at pld-linux.org
Sat Oct 26 13:41:00 CEST 2013


commit 2f80c398fe2a89989d6dfa7c3afdb930308e1ccd
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Oct 26 14:38:43 2013 +0300

    new, version 4.5
    
    based on src.rpm for fedora from opensuse and initscript from pld cronie
    ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home%3A/zhonghuaren/Fedora_19/src/dcron-4.5-5.1.src.rpm

 dcron-fix_makefile.patch |  29 ++++++++++++++
 dcron.init               | 101 +++++++++++++++++++++++++++++++++++++++++++++++
 dcron.spec               |  68 +++++++++++++++++++++++++++++++
 3 files changed, 198 insertions(+)
---
diff --git a/dcron.spec b/dcron.spec
new file mode 100644
index 0000000..b3fd4dc
--- /dev/null
+++ b/dcron.spec
@@ -0,0 +1,68 @@
+# TODO
+# - crontab spool dir not compatible with other cron implementations
+# - package default hourly,monhtly,etc and provide crontabs name
+# - provides anacron functionality, O/P name?
+# - triggers for switching with other crondaemons (after testing)
+# - logrotate?
+# - systemd init
+# - crontab system group
+Summary:	Lightweight Cron Daemon
+Name:		dcron
+Version:	4.5
+Release:	0.1
+License:	GPL v2+
+Group:		Daemons
+Source0:	http://www.jimpryor.net/linux/releases/%{name}-%{version}.tar.gz
+# Source0-md5:	078833f3281f96944fc30392b1888326
+Source1:	%{name}.init
+Patch1:		%{name}-fix_makefile.patch
+URL:		http://www.jimpryor.net/linux/dcron.html
+BuildRequires:	pkgconfig
+Provides:	crondaemon
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+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.
+
+%prep
+%setup -q
+%patch1
+
+%build
+%{__make} \
+	CC="%{__cc}" \
+	OPTFLAGS="%{rpmcflags}" \
+	PREFIX=%{_prefix} \
+	INSTALL="install -p"
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d}
+%{__make} install \
+    DESTDIR=$RPM_BUILD_ROOT
+
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
+install -d $RPM_BUILD_ROOT%{_var}/spool/%{name}/{crontabs,cronstamps}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG README
+%dir /etc/cron.d
+%attr(754,root,root) /etc/rc.d/init.d/crond
+%attr(755,root,root) %{_bindir}/crontab
+%attr(755,root,root) %{_sbindir}/crond
+%{_mandir}/man1/crontab.1.*
+%{_mandir}/man8/crond.8.*
+%dir %attr(700,root,root) %{_var}/spool/%{name}
+%dir %attr(700,root,root) %{_var}/spool/%{name}/crontabs
+%dir %attr(700,root,root) %{_var}/spool/%{name}/cronstamps
diff --git a/dcron-fix_makefile.patch b/dcron-fix_makefile.patch
new file mode 100644
index 0000000..05dfb50
--- /dev/null
+++ b/dcron-fix_makefile.patch
@@ -0,0 +1,29 @@
+--- Makefile.orig	2011-05-10 20:01:39.000000000 +0200
++++ Makefile	2011-05-10 20:04:17.000000000 +0200
+@@ -20,11 +20,11 @@
+ 
+ 
+ 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
++INSTALL_DATA = $(INSTALL) -D -m0644
++INSTALL_DIR = $(INSTALL) -d -m0755
++CFLAGS = $(OPTFLAGS)
+ CFLAGS += -Wall -Wstrict-prototypes -Wno-missing-field-initializers
+ 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
+@@ -63,8 +63,8 @@
+ 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@
+ 
+ install:
+-	$(INSTALL_PROGRAM) -m0700 -g root crond $(DESTDIR)$(SBINDIR)/crond
+-	$(INSTALL_PROGRAM) -m4750 -g $(CRONTAB_GROUP) crontab $(DESTDIR)$(BINDIR)/crontab
++	$(INSTALL_PROGRAM) -m0700 crond $(DESTDIR)$(SBINDIR)/crond
++	$(INSTALL_PROGRAM) -m4750 crontab $(DESTDIR)$(BINDIR)/crontab
+ 	$(INSTALL_DATA) crontab.1 $(DESTDIR)$(MANDIR)/man1/crontab.1
+ 	$(INSTALL_DATA) crond.8 $(DESTDIR)$(MANDIR)/man8/crond.8
+ 	$(INSTALL_DIR) $(DESTDIR)$(SCRONTABS)
diff --git a/dcron.init b/dcron.init
new file mode 100755
index 0000000..9a12daa
--- /dev/null
+++ b/dcron.init
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# crond		Start/Stop the cron clock daemon.
+#
+# chkconfig:	2345 40 60
+# description:	cron is a standard UNIX program that runs user-specified \
+#		programs at periodic scheduled times. dcron adds a \
+#		number of features to the basic UNIX cron, including better \
+#		security and more powerful configuration options.
+#
+# processname:	crond
+# config:	/etc/cron.d
+# pidfile:	/var/run/crond.pid
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+CROND_ARGS=""
+
+# Get service config
+[ -f /etc/sysconfig/cron ] && . /etc/sysconfig/cron
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/crond ]; then
+		msg_already_running "dcron crond"
+		return
+	fi
+
+	msg_starting "dcron crond"
+	daemon /usr/sbin/crond $CROND_ARGS
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/crond ]; then
+		msg_not_running "dcron crond"
+		return
+	fi
+
+	msg_stopping "dcron crond"
+	killproc crond
+	rm -f /var/lock/subsys/crond
+}
+
+reload() {
+	if [ ! -f /var/lock/subsys/crond ]; then
+		msg_not_running "dcron crond"
+		RETVAL=7
+		return
+	fi
+
+	msg_reloading "dcron crond"
+	killproc crond -HUP
+	RETVAL=$?
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/crond ]; then
+		msg_not_running "dcron crond"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+upstart_controlled
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  reload|force-reload|flush-logs)
+	reload
+	;;
+  status)
+	status --pidfile /var/run/crond.pid crond
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dcron.git/commitdiff/2f80c398fe2a89989d6dfa7c3afdb930308e1ccd



More information about the pld-cvs-commit mailing list