diff --git a/DEVELOPERS b/DEVELOPERS index f4dd8df9e0..837fa93f4d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1473,6 +1473,7 @@ F: package/s6-networking/ F: package/s6-portable-utils/ F: package/s6-rc/ F: package/skalibs/ +F: package/snooze/ F: package/tipidee/ N: Jagan Teki diff --git a/package/Config.in b/package/Config.in index 3ec6d0d879..3153fd6afa 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2406,6 +2406,7 @@ menu "Miscellaneous" source "package/qpdf/Config.in" source "package/rtl_433/Config.in" source "package/shared-mime-info/Config.in" + source "package/snooze/Config.in" source "package/sunwait/Config.in" source "package/taskd/Config.in" source "package/wine/Config.in" diff --git a/package/snooze/0001-fix-snooze-n-format-string.patch b/package/snooze/0001-fix-snooze-n-format-string.patch new file mode 100644 index 0000000000..293777166f --- /dev/null +++ b/package/snooze/0001-fix-snooze-n-format-string.patch @@ -0,0 +1,40 @@ +From 5f9e616b29fe272fffbb31e4b7ea8ff61f781601 Mon Sep 17 00:00:00 2001 +From: Leah Neukirchen +Date: Wed, 29 May 2024 19:42:27 +0200 +Subject: [PATCH] fix "snooze -n" format string + +Fixes #22. + +Signed-off-by: J. Neuschäfer + +Upstream: https://github.com/leahneukirchen/snooze/commit/5f9e616b29fe272fffbb31e4b7ea8ff61f781601 +--- + snooze.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/snooze.c b/snooze.c +index 06f0d07..e47ad11 100644 +--- a/snooze.c ++++ b/snooze.c +@@ -329,13 +329,13 @@ main(int argc, char *argv[]) + char weekstr[4]; + struct tm *tm = localtime(&t); + strftime(weekstr, sizeof weekstr, "%a", tm); +- printf("%s %s %2ldd%3ldh%3ldm%3lds ", ++ printf("%s %s %2dd%3dh%3dm%3ds ", + isotime(tm), + weekstr, +- ((t - now) / (60*60*24)), +- ((t - now) / (60*60)) % 24, +- ((t - now) / 60) % 60, +- (t - now) % 60); ++ ((int)(t - now) / (60*60*24)), ++ ((int)(t - now) / (60*60)) % 24, ++ ((int)(t - now) / 60) % 60, ++ (int)(t - now) % 60); + if(jitter) { + printf("(plus up to %ds for jitter)\n", jitter); + } else { +-- +2.43.0 + diff --git a/package/snooze/Config.in b/package/snooze/Config.in new file mode 100644 index 0000000000..0e068cb607 --- /dev/null +++ b/package/snooze/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_SNOOZE + bool "snooze" + help + snooze is a tool for waiting until a particular time and then + running a command. Together with a service supervision system + such as runit, this can be used to replace cron(8). + + https://github.com/leahneukirchen/snooze diff --git a/package/snooze/snooze.hash b/package/snooze/snooze.hash new file mode 100644 index 0000000000..c1710d857f --- /dev/null +++ b/package/snooze/snooze.hash @@ -0,0 +1,3 @@ +# Locally computed: +sha256 d63fde85d9333188bed5996baabd833eaa00842ce117443ffbf8719c094be414 snooze-0.5.tar.gz +sha256 2cea433f84afcfd9d55515908d3ea69ed1df00ffbf90cc48cd68d72a2b464544 README.md diff --git a/package/snooze/snooze.mk b/package/snooze/snooze.mk new file mode 100644 index 0000000000..9c5f7a3830 --- /dev/null +++ b/package/snooze/snooze.mk @@ -0,0 +1,28 @@ +################################################################################ +# +# snooze +# +################################################################################ + +SNOOZE_VERSION = 0.5 +SNOOZE_SITE = $(call github,leahneukirchen,snooze,v$(SNOOZE_VERSION)) +SNOOZE_LICENSE = CC0-1.0 + +# Unfortunately, snooze doesn't have a dedicated file for the license, but it +# is mentioned in the README and in the manpage. +SNOOZE_LICENSE_FILES = README.md + +SNOOZE_MAKE_OPTS = \ + PREFIX=/usr \ + CC=$(TARGET_CC) \ + CFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS)" + +define SNOOZE_BUILD_CMDS + $(MAKE) -C $(@D)/ $(SNOOZE_MAKE_OPTS) +endef + +define SNOOZE_INSTALL_TARGET_CMDS + $(MAKE) -C $(@D)/ $(SNOOZE_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install +endef + +$(eval $(generic-package))