aboutsummaryrefslogtreecommitdiff
path: root/utilities/dcron/dcron.build
diff options
context:
space:
mode:
authorDeposite Pirate2018-09-16 18:48:36 +0200
committerDeposite Pirate2018-09-16 18:48:36 +0200
commitd150a5f3e462fa7fe194a805a4aa0076f4d03ab9 (patch)
treece5e44d69c5f3175bfdbd1e3717b52c5dcca5638 /utilities/dcron/dcron.build
parentf29d3519ce073ec30f99754d93304324f7f26d65 (diff)
Add ports.
Diffstat (limited to 'utilities/dcron/dcron.build')
-rwxr-xr-xutilities/dcron/dcron.build89
1 files changed, 89 insertions, 0 deletions
diff --git a/utilities/dcron/dcron.build b/utilities/dcron/dcron.build
new file mode 100755
index 0000000..f60ebf2
--- /dev/null
+++ b/utilities/dcron/dcron.build
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd>
+
+source /usr/src/ports/Build/build.sh
+
+NAME=dcron
+VERSION=4.5
+BUILD=2
+
+# Description
+
+cat > ${PKG}/install/slack-desc <<EOF
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+$(padd)|-----handy-ruler------------------------------------------------------|
+${NAME}: dcron (Dillon's Cron daemon)
+${NAME}:
+${NAME}: The cron daemon runs in the background and executes tasks on behalf
+${NAME}: of users at the appropriate time. Many timed system tasks are
+${NAME}: started with cron, such as the nightly indexing with updatedb.
+${NAME}:
+${NAME}: dcron was written entirely from scratch by Matthew Dillon.
+${NAME}:
+${NAME}: Homepage: http://www.jimpryor.net/linux/dcron.html
+${NAME}:
+${NAME}:
+EOF
+
+cat >> ${PKG}/install/doinst.sh <<EOF
+#!/bin/sh
+
+config() {
+ NEW="\$1"
+ OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/conf.d/crond.conf.new
+
+if [ ! -r var/spool/cron/crontabs/root ]; then
+ mv var/spool/cron/crontabs/root.new var/spool/cron/crontabs/root
+else
+ rm -f var/spool/cron/crontabs/root.new
+fi
+EOF
+
+# Sources
+
+SRCNAME[0]=${NAME}
+SRCVERS[0]=${VERSION}
+SRCPACK[0]=http://www.jimpryor.net/linux/releases/${SRCNAME[0]}-${SRCVERS[0]}.tar.gz
+SRCCOPY[0]="GPL2"
+
+build0()
+{
+make ${JOBS} CFLAGS+="${FLAGS}" PREFIX="${SYS_DIR[usr]}"
+make install DESTDIR="${PKG}" PREFIX="${SYS_DIR[usr]}" MANDIR="${SYS_DIR[man]}"
+changelog CHANGELOG
+install.dir ${PKG}${SYS_DIR[etc]}/conf.d
+install.cfg extra/crond.conf ${PKG}${SYS_DIR[etc]}/conf.d/crond.conf.new
+install.dir ${PKG}${SYS_DIR[share]}/vim/ftplugin
+install.dat extra/crontab.vim ${PKG}${SYS_DIR[share]}/vim/ftplugin
+install.dir ${PKG}${SYS_DIR[systemdsystemunitdir]}
+install.dat dcron.service ${PKG}${SYS_DIR[systemdsystemunitdir]}
+#FIXME: perhaps all this stuff should be renamed to dcron so that other versions
+#of cron may be installed at the same time
+chmod 0751 ${PKG}${SYS_DIR[var]}/spool/cron
+chmod 0750 ${PKG}${SYS_DIR[var]}/spool/cron/cron{tabs,stamps}
+chmod 4711 ${PKG}${SYS_DIR[usr]}/bin/crontab
+chmod 0755 ${PKG}${SYS_DIR[usr]}/sbin/crond
+#FIXME: this goes away when we switch to systemd
+install.dir ${PKG}${SYS_DIR[etc]}/cron.{d,hourly,daily,weekly,monthly}
+install -m 0600 crontab.root ${PKG}${SYS_DIR[var]}/spool/cron/crontabs/root.new
+install.bin run-parts ${PKG}${SYS_DIR[usr]}/sbin
+install.man run-parts.8 ${PKG}${SYS_DIR[man]}/man8
+}