summaryrefslogtreecommitdiffstats
path: root/source/a/dcron/dcron.SlackBuild
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2018-06-13 05:43:00 +0000
committer Eric Hameleers <alien@slackware.com>2018-06-13 09:44:21 +0200
commitd8095c1e90c817c5c1bd4cbb892be7218946279b (patch)
tree031d60b6fcf278de9783be42a3a77d253a03a1ea /source/a/dcron/dcron.SlackBuild
parent2c20c6847e0caa3b62f6e5a0506790393c141932 (diff)
downloadcurrent-20180613054300.tar.gz
current-20180613054300.tar.xz
Wed Jun 13 05:43:00 UTC 201820180613054300
a/dcron-4.5-x86_64-7.txz: Rebuilt. Added init script and defaults file. Moved TMPDIR to /run/cron. Thanks to Robby Workman and shasta. a/efibootmgr-16-x86_64-1.txz: Upgraded. a/efivar-36-x86_64-1.txz: Added. a/elilo-3.16-x86_64-7.txz: Rebuilt. a/glibc-solibs-2.27-x86_64-4.txz: Rebuilt. Don't restart init in the install script, let rc.6 handle it. a/haveged-1.9.2-x86_64-1.txz: Added. a/pkgtools-15.0-noarch-18.txz: Rebuilt. setup.services: add support for rc.atd and rc.crond a/sysvinit-scripts-2.1-noarch-10.txz: Rebuilt. rc.6: restart init when shutting down - this prevents it from holding file handles to removed/upgraded versions of the glibc shared libraries which would interfere with shutdown. rc.K: use full path to telinit rc.M: start rc.atd and rc.crond rc.M: don't remove cron tempfiles (moved to /run/cron) rc.S: start rc.haveged ap/at-3.1.20-x86_64-3.txz: Rebuilt. Added init script and defaults file. l/glibc-2.27-x86_64-4.txz: Rebuilt. Don't restart init in the install script, let rc.6 handle it. l/glibc-i18n-2.27-x86_64-4.txz: Rebuilt. l/glibc-profile-2.27-x86_64-4.txz: Rebuilt. l/gnu-efi-3.0.8-x86_64-1.txz: Upgraded.
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 5c32ace8e..abd76e219 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