From 6fa70448db96ffb481a696f17f99a1758c16e016 Mon Sep 17 00:00:00 2001 From: augiedoggie Date: Tue, 23 Apr 2024 21:06:27 -0600 Subject: [PATCH] cronie: update to 1.7.2 and overhaul recipe (#10371) --- sys-process/cronie/additional-files/0anacron | 12 ++ sys-process/cronie/additional-files/0hourly | 6 + .../cronie/additional-files/anacrontab | 16 +++ sys-process/cronie/additional-files/cron.deny | 1 + .../cronie/additional-files/cronie.launch.in | 8 ++ sys-process/cronie/additional-files/crontab | 5 + sys-process/cronie/cronie-1.6.1.recipe | 64 ---------- sys-process/cronie/cronie-1.7.2.recipe | 114 ++++++++++++++++++ sys-process/cronie/licenses/ISC | 12 ++ 9 files changed, 174 insertions(+), 64 deletions(-) create mode 100644 sys-process/cronie/additional-files/0anacron create mode 100644 sys-process/cronie/additional-files/0hourly create mode 100644 sys-process/cronie/additional-files/anacrontab create mode 100644 sys-process/cronie/additional-files/cron.deny create mode 100644 sys-process/cronie/additional-files/cronie.launch.in create mode 100644 sys-process/cronie/additional-files/crontab delete mode 100644 sys-process/cronie/cronie-1.6.1.recipe create mode 100644 sys-process/cronie/cronie-1.7.2.recipe create mode 100644 sys-process/cronie/licenses/ISC diff --git a/sys-process/cronie/additional-files/0anacron b/sys-process/cronie/additional-files/0anacron new file mode 100644 index 000000000..f86914cbc --- /dev/null +++ b/sys-process/cronie/additional-files/0anacron @@ -0,0 +1,12 @@ +#!/bin/sh +# Check whether 0anacron was run today already +if test -r /var/spool/anacron/cron.daily; then + day=`cat /var/spool/anacron/cron.daily` +fi +if [ `date +%Y%m%d` = "$day" ]; then + exit 0 +fi + +# TODO add check to see if we're running on battery and exit + +anacron -s diff --git a/sys-process/cronie/additional-files/0hourly b/sys-process/cronie/additional-files/0hourly new file mode 100644 index 000000000..3dbdf187e --- /dev/null +++ b/sys-process/cronie/additional-files/0hourly @@ -0,0 +1,6 @@ +# Run the hourly jobs +SHELL=/bin/bash +PATH=/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/boot/system/bin +MAILTO="" +# If you change the username of UID 0 then you must change "user" below to match +01 * * * * user run-parts /etc/cron.hourly diff --git a/sys-process/cronie/additional-files/anacrontab b/sys-process/cronie/additional-files/anacrontab new file mode 100644 index 000000000..83004f144 --- /dev/null +++ b/sys-process/cronie/additional-files/anacrontab @@ -0,0 +1,16 @@ +# /etc/anacrontab: configuration file for anacron + +# See anacron(8) and anacrontab(5) for details. + +SHELL=/bin/bash +PATH=/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/boot/system/bin +MAILTO="" +# the maximal random delay added to the base delay of the jobs +RANDOM_DELAY=45 +# the jobs will be started during the following hours only +START_HOURS_RANGE=3-22 + +#period in days delay in minutes job-identifier command +1 5 cron.daily nice run-parts /etc/cron.daily +7 25 cron.weekly nice run-parts /etc/cron.weekly +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly diff --git a/sys-process/cronie/additional-files/cron.deny b/sys-process/cronie/additional-files/cron.deny new file mode 100644 index 000000000..06e685cc8 --- /dev/null +++ b/sys-process/cronie/additional-files/cron.deny @@ -0,0 +1 @@ +# without this file, only users listed in /etc/cron.allow can use crontab diff --git a/sys-process/cronie/additional-files/cronie.launch.in b/sys-process/cronie/additional-files/cronie.launch.in new file mode 100644 index 000000000..4489f6fae --- /dev/null +++ b/sys-process/cronie/additional-files/cronie.launch.in @@ -0,0 +1,8 @@ + + +job x-vnd.cronie-crond { + launch @CROND_BIN@ -n -P -s + on initial_volumes_mounted + no_safemode + legacy +} diff --git a/sys-process/cronie/additional-files/crontab b/sys-process/cronie/additional-files/crontab new file mode 100644 index 000000000..61b453a58 --- /dev/null +++ b/sys-process/cronie/additional-files/crontab @@ -0,0 +1,5 @@ +# /etc/crontab: configuration file for cron + +# See cron(8) and crontab(5) for details. + +# m h dom mon dow user command diff --git a/sys-process/cronie/cronie-1.6.1.recipe b/sys-process/cronie/cronie-1.6.1.recipe deleted file mode 100644 index 17576ba0a..000000000 --- a/sys-process/cronie/cronie-1.6.1.recipe +++ /dev/null @@ -1,64 +0,0 @@ -SUMMARY="A cron daemon" -DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron" -HOMEPAGE="https://github.com/cronie-crond/cronie/" -COPYRIGHT="2004-2018 Paul Vixie" -LICENSE="BSD (2-clause) - BSD (3-clause) - GNU GPL v2" -REVISION="1" -SOURCE_URI="https://github.com/cronie-crond/cronie/archive/cronie-$portVersion.tar.gz" -CHECKSUM_SHA256="1ddbc8f8d07dfe1d45998b0a0cbd9a216cd4d7bc64d1626b2bc8b3a69e4641d1" -SOURCE_DIR="cronie-cronie-$portVersion" - -ARCHITECTURES="all ?x86_gcc2" -SECONDARY_ARCHITECTURES="x86" - -commandBinDir=$binDir -commandSuffix=$secondaryArchSuffix -if [ "$targetArchitecture" = x86_gcc2 ]; then - commandSuffix= - commandBinDir=$prefix/bin -fi - -PROVIDES=" - cronie$secondaryArchSuffix = $portVersion - cmd:anacron$commandSuffix = $portVersion - cmd:crond$commandSuffix = $portVersion - cmd:cronnext$commandSuffix = $portVersion - cmd:crontab$commandSuffix = $portVersion - " -REQUIRES=" - haiku$secondaryArchSuffix -# lib:libpam$secondaryArchSuffix - " -CONFLICTS=" - dcron - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel -# devel:libpam$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:aclocal - cmd:autoconf - cmd:autoheader - cmd:automake - cmd:make - cmd:gcc$secondaryArchSuffix - cmd:libtoolize$secondaryArchSuffix - " - -BUILD() -{ - autogen.sh - runConfigure --omit-dirs binDir ./configure \ - --bindir=$commandBinDir \ - --enable-anacron - make $jobArgs -} - -INSTALL() -{ - make install -} diff --git a/sys-process/cronie/cronie-1.7.2.recipe b/sys-process/cronie/cronie-1.7.2.recipe new file mode 100644 index 000000000..ee4d02aed --- /dev/null +++ b/sys-process/cronie/cronie-1.7.2.recipe @@ -0,0 +1,114 @@ +SUMMARY="Standard UNIX cron daemon that runs specified programs at scheduled times" +DESCRIPTION="Cronie contains the standard UNIX daemon crond that runs specified programs at \ +scheduled times and related tools. The source is based on the original vixie-cron and has \ +security and configuration enhancements." +HOMEPAGE="https://github.com/cronie-crond/cronie/" +COPYRIGHT=" + 1988-1994 Paul Vixie + 1998-2024 Marcela Mašláňová, Colin Dean, Tomáš Mráz, Marco Migliori, Sami Kerola, and others + " +LICENSE=" + BSD (2-clause) + BSD (3-clause) + GNU GPL v2 + ISC + MIT + " +REVISION="1" +SOURCE_URI="https://github.com/cronie-crond/cronie/archive/cronie-$portVersion.tar.gz" +CHECKSUM_SHA256="241ecc1dcd8d4b2a6744fe93509932254d20b7bb9d979d27429809493806357f" +SOURCE_DIR="cronie-cronie-$portVersion" +ADDITIONAL_FILES=" + 0anacron + 0hourly + anacrontab + cron.deny + crontab + cronie.launch.in + " + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +GLOBAL_WRITABLE_FILES=" + settings/etc/anacrontab keep-old + settings/etc/cron.deny keep-old + settings/etc/cron.d/0hourly keep-old + settings/etc/cron.hourly/0anacron keep-old + settings/etc/cron.daily directory keep-old + settings/etc/cron.weekly directory keep-old + settings/etc/cron.monthly directory keep-old + settings/etc/crontab keep-old + var/run directory keep-old + var/spool/cron directory keep-old + var/spool/anacron directory keep-old + " + +commandBinDir=$binDir +commandSuffix=$secondaryArchSuffix +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + cronie$secondaryArchSuffix = $portVersion + cmd:anacron$commandSuffix = $portVersion + cmd:crond$commandSuffix = $portVersion + cmd:cronnext$commandSuffix = $portVersion + cmd:crontab$commandSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + cmd:nice + cmd:run_parts + " +CONFLICTS=" + dcron + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoconf + cmd:autoheader + cmd:automake + cmd:gawk + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + " + +BUILD() +{ + ./autogen.sh + runConfigure --omit-dirs "binDir sysconfDir" ./configure \ + --bindir=$commandBinDir \ + --sysconfdir=$settingsDir/etc \ + --with-editor=nano \ + --enable-anacron + + make $jobArgs +} + +INSTALL() +{ + make install + + chmod u+s $commandBinDir/crontab + + install -d $localStateDir/spool/{ana,}cron $localStateDir/run + install -d $settingsDir/etc/cron.{d,hourly,daily,weekly,monthly} + + install -Dm0644 $portDir/additional-files/cron.deny $settingsDir/etc/cron.deny + install -Dm0644 $portDir/additional-files/crontab $settingsDir/etc/crontab + install -Dm0644 $portDir/additional-files/anacrontab $settingsDir/etc/anacrontab + install -Dm0644 $portDir/additional-files/0hourly $settingsDir/etc/cron.d/0hourly + install -Dm0755 $portDir/additional-files/0anacron $settingsDir/etc/cron.hourly/0anacron + + install -d $dataDir/launch + sed -e "s|@CROND_BIN@|$commandBinDir/crond|" \ + $portDir/additional-files/cronie.launch.in > $dataDir/launch/cronie.launch +} diff --git a/sys-process/cronie/licenses/ISC b/sys-process/cronie/licenses/ISC new file mode 100644 index 000000000..56c552828 --- /dev/null +++ b/sys-process/cronie/licenses/ISC @@ -0,0 +1,12 @@ +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +