From a7e20424948f099ac004c9f792da6fadf3cadce3 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 30 Oct 2025 12:38:33 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 + pkg.info | 21 ++++++++ source-files/anacron | 1 + source-files/cronie.esv | 6 +++ .../make-error_func-prototype-complete.patch | 37 ++++++++++++++ source.sh | 49 +++++++++++++++++++ 6 files changed, 116 insertions(+) create mode 100644 .gitignore create mode 100644 pkg.info create mode 100644 source-files/anacron create mode 100644 source-files/cronie.esv create mode 100644 source-files/make-error_func-prototype-complete.patch create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..816b8a4 --- /dev/null +++ b/pkg.info @@ -0,0 +1,21 @@ +name: cronie +description: Daemon crond that runs specified programs at scheduled times and related tools +version: 1.7.2 +revision: 1 +url: https://github.com/cronie-crond/cronie/ +license: BSD-2-Clause +architecture: any +type: source +depends: + - bash + - pam + - run-parts +conflicts: + - cron +provides: + - cron +downloads: + - url: https://github.com/cronie-crond/cronie/archive/refs/tags/cronie-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 241ecc1dcd8d4b2a6744fe93509932254d20b7bb9d979d27429809493806357f diff --git a/source-files/anacron b/source-files/anacron new file mode 100644 index 0000000..3367c76 --- /dev/null +++ b/source-files/anacron @@ -0,0 +1 @@ +#ANACRON_RUN_ON_BATTERY_POWER=no diff --git a/source-files/cronie.esv b/source-files/cronie.esv new file mode 100644 index 0000000..e092868 --- /dev/null +++ b/source-files/cronie.esv @@ -0,0 +1,6 @@ +name: cronie +description: Cronie cron daemon +type: background +start_cmd: /usr/sbin/crond -n +exit_method: kill +restart: true diff --git a/source-files/make-error_func-prototype-complete.patch b/source-files/make-error_func-prototype-complete.patch new file mode 100644 index 0000000..1988825 --- /dev/null +++ b/source-files/make-error_func-prototype-complete.patch @@ -0,0 +1,37 @@ +From 09c630c654b2aeff06a90a412cce0a60ab4955a4 Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Mon, 18 Nov 2024 21:02:30 +0100 +Subject: [PATCH] load_entry(): Make error_func prototype complete + +Fixes #193 +--- + src/entry.c | 2 +- + src/funcs.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/entry.c b/src/entry.c +index 586eb9d..a2077e8 100644 +--- a/src/entry.c ++++ b/src/entry.c +@@ -90,7 +90,7 @@ void free_entry(entry * e) { + /* return NULL if eof or syntax error occurs; + * otherwise return a pointer to a new entry. + */ +-entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw, ++entry *load_entry(FILE * file, void (*error_func) (const char *), struct passwd *pw, + char **envp) { + /* this function reads one crontab entry -- the next -- from a file. + * it skips any leading blank lines, ignores comments, and returns +diff --git a/src/funcs.h b/src/funcs.h +index 427e027..f28d634 100644 +--- a/src/funcs.h ++++ b/src/funcs.h +@@ -89,7 +89,7 @@ char *env_get(const char *, char **), + user *load_user(int, struct passwd *, const char *, const char *, const char *), + *find_user(cron_db *, const char *, const char *); + +-entry *load_entry(FILE *, void (*)(), struct passwd *, char **); ++entry *load_entry(FILE *, void (*)(const char *), struct passwd *, char **); + + FILE *cron_popen(char *, const char *, struct passwd *, char **); + diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..583fb8f --- /dev/null +++ b/source.sh @@ -0,0 +1,49 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/make-error_func-prototype-complete.patch + autoreconf -fi +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --enable-anacron --enable-pie --enable-relro --with-inotify --with-pam + make +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make DESTDIR="$BPM_OUTPUT" install + chmod u+s "$BPM_OUTPUT"/usr/bin/crontab + + # Install directories + install -d "$BPM_OUTPUT"/var/spool/{,ana}cron + install -d "$BPM_OUTPUT"/etc/cron.{d,hourly,daily,weekly,monthly} + + # Install additional files + install -Dm644 contrib/anacrontab "$BPM_OUTPUT"/etc/anacrontab + install -Dm644 contrib/0hourly "$BPM_OUTPUT"/etc/cron.d + install -Dm644 contrib/0anacron "$BPM_OUTPUT"/etc/cron.hourly + + # Install default configuration files + install -Dm644 "$BPM_WORKDIR"/anacron "$BPM_OUTPUT"/etc/default/anacron + + # Allow all users to use cronie + touch "$BPM_OUTPUT"/etc/cron.deny + + # Install pam configuration file + install -Dm644 pam/crond "$BPM_OUTPUT"/etc/pam.d/crond + + # Install esvm service files + install -Dm644 "$BPM_WORKDIR"/cronie.esv "$BPM_OUTPUT"/etc/esvm/services/cronie.esv + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/cronie/COPYING +}