summaryrefslogtreecommitdiff
path: root/source/a/dcron/dcron.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/dcron/dcron.SlackBuild')
-rwxr-xr-xsource/a/dcron/dcron.SlackBuild56
1 files changed, 42 insertions, 14 deletions
diff --git a/source/a/dcron/dcron.SlackBuild b/source/a/dcron/dcron.SlackBuild
index 5c32ace8..abd76e21 100755
--- a/source/a/dcron/dcron.SlackBuild
+++ b/source/a/dcron/dcron.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Copyright 2009, 2010, 2012, 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=dcron
VERSION=${VERSION:-$(echo dcron-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-6}
+BUILD=${BUILD:-7}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -44,6 +44,7 @@ if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
exit 0
fi
+CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-dcron
@@ -73,30 +74,47 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Define TMPDIR as /var/spool/cron instead of /tmp
-zcat $CWD/defs.h.TMPDIR.diff.gz | patch -p1 --verbose || exit 1
+# Apply patches from git:
+zcat $CWD/patches/0002-README-var-spool-cron-crontabs-root.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0003-CHANGELOG-tweak.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0006-Fixed-a-bug-whereby-syncs-killed-all-waiting-jobs.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0007-Update-main.c.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0008-Fix-3-every-Nth-day-of-week-syntax-not-working.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0009-Updated-manpage.patch.gz | patch -p1 --verbose || exit 1
+
+# Define TMPDIR as /run/cron instead of /tmp:
+# This eliminates possibility of stale $TMPDIR/cron.??????/ dirs as
+# they won't survive a reboot when they're in a subdir of /run
+zcat $CWD/patches/defs.h.TMPDIR.diff.gz | patch -p1 --verbose || exit 1
# Fix problem where user creates /var/spool/cron/crontabs/<user>.new
# using 'crontab -', exits with control-c, and then crontab refuses to
-# overwrite the junk file. It would be better if dcron would wipe
+# overwrite the junk file. It would be better if dcron would wipe
# the junk file in the event it were not closed correctly, but oh well.
-zcat $CWD/crontab.c.O_EXCL.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/crontab.c.O_EXCL.diff.gz | patch -p1 --verbose || exit 1
-# Running jobs should not block cron.update:
-zcat $CWD/dcron.update.during.long.running.jobs.diff.gz | patch -p1 --verbose || exit 1
+CFLAGS+="$SLKCFLAGS" make \
+ PREFIX=/usr \
+ BINDIR=/usr/bin \
+ SBINDIR=/usr/sbin \
+ MANDIR=/usr/man \
+ CRONTAB_GROUP=root \
+ || exit 1
-# Change _BSD_SOURCE to _DEFAULT_SOURCE for recent glibc:
-zcat $CWD/defs.h._DEFAULT_SOURCE.diff.gz | patch -p1 --verbose || exit 1
+# This works now, but predictability is a good thing...
+#make install DESTDIR=$PKG
-CFLAGS+="$SLKCFLAGS" make || exit 1
strip --strip-unneeded crond crontab
-mkdir -p $PKG/usr/{bin,sbin}
+mkdir -p $PKG/usr/sbin
cat crond > $PKG/usr/sbin/crond
-cat crontab > $PKG/usr/bin/crontab
-zcat $CWD/run-parts.gz > $PKG/usr/bin/run-parts
chmod 0755 $PKG/usr/sbin/crond
+
+mkdir -p $PKG/usr/bin
+cat crontab > $PKG/usr/bin/crontab
chmod 4711 $PKG/usr/bin/crontab
+
+zcat $CWD/run-parts.gz > $PKG/usr/bin/run-parts
chmod 0755 $PKG/usr/bin/run-parts
mkdir -p $PKG/usr/man/man{1,8}
@@ -104,6 +122,15 @@ cat crontab.1 | gzip -9c > $PKG/usr/man/man1/crontab.1.gz
cat crond.8 | gzip -9c > $PKG/usr/man/man8/crond.8.gz
cat $CWD/run-parts.8.gz > $PKG/usr/man/man8/run-parts.8.gz
+# Add the init script:
+mkdir -p $PKG/etc/rc.d
+cat $CWD/rc.crond > $PKG/etc/rc.d/rc.crond.new
+chmod 755 $PKG/etc/rc.d/rc.crond.new
+
+# Add the default file:
+mkdir -p $PKG/etc/default
+cat $CWD/crond.default > $PKG/etc/default/crond.new
+
# Create some other stuff we need
mkdir -p $PKG/etc/cron.{hourly,daily,weekly,monthly}
mkdir -p $PKG/var/spool/cron/crontabs
@@ -112,6 +139,7 @@ chmod 0751 $PKG/var/spool/cron
chmod 0750 $PKG/var/spool/cron/crontabs $PKG/var/spool/cron/cronstamps
zcat $CWD/crontab.root > $PKG/var/spool/cron/crontabs/root.new
chmod 0600 $PKG/var/spool/cron/crontabs/root.new
+
# dcron will whine about "unable to scan" this directory, so we'll create it
mkdir -p $PKG/etc/cron.d