--- bcron-0.10.orig/debian/README.Debian.diet +++ bcron-0.10/debian/README.Debian.diet @@ -0,0 +1,14 @@ +Building bcron with the diet libc +--------------------------------- + +This package optionally can be built with the diet libc instead of the glibc +to provide small statically linked programs. + +To use the diet libc, make sure the latest versions of the dietlibc-dev and +bglibs-dev packages are installed, and set DEB_BUILD_OPTIONS=diet in the +environment when building the package, e.g.: + + # apt-get install dietlibc-dev bglibs-dev + $ DEB_BUILD_OPTIONS=diet fakeroot apt-get source -b bcron + + -- Gerrit Pape , Sat, 02 Apr 2005 12:40:26 +0000 --- bcron-0.10.orig/debian/bcron-run.README.Debian +++ bcron-0.10/debian/bcron-run.README.Debian @@ -0,0 +1,32 @@ +bcron-run for Debian +-------------------- + +This package sets up the bcron-sched, bcron-spool, and bcron-update +services to provide the Debian cron functionality mandated by Debian +policy 9.5. This includes support for the /etc/crontab file and the +/etc/cron.d/ directory, as well as the crontab(1) program as user +interface, and support for the /etc/cron.hourly/, /etc/cron.daily/, +/etc/cron.weekly/, and /etc/cron.monthly/ directories. + +The bcron services including their logs are handled through runit, and +so enabled automatically on package installation and system boot. Use +the sv(8) program to control a service or print its status information. +See the runit package's documentation for details, e.g. + + # sv status bcron-sched + run: bcron-sched: (pid 11169) 14528s; run: log: (pid 11168) 14528s + # sv restart bcron-sched + ok: run: bcron-sched: (pid 11188) 0s + # sv status bcron-sched + run: bcron-sched: (pid 2423) 4s; run: log: (pid 11168) 55s + # + +Logs are written to the /var/log/bcron/, /var/log/bcron/spool/, and +/var/log/bcron/update/ directories, through the svlogd(8) program. +Configure the logs through the ``config'' file, and access the recent +log entries through the ``current'' log file in these directories, see +the svlogd(8) man page for details, e.g. + + $ less /var/log/bcron/current + + -- Gerrit Pape , Sat, 02 Apr 2005 12:40:26 +0000 --- bcron-0.10.orig/debian/bcron-run.conffiles +++ bcron-0.10/debian/bcron-run.conffiles @@ -0,0 +1,7 @@ +/etc/crontab +/etc/bcron-sched/run +/etc/bcron-sched/log/run +/etc/bcron-spool/run +/etc/bcron-spool/log/run +/etc/bcron-update/run +/etc/bcron-update/log/run --- bcron-0.10.orig/debian/bcron-run.postinst +++ bcron-0.10/debian/bcron-run.postinst @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +test "$1" = 'configure' || exit 0 + +err() { echo >&2 "$*"; exit 1; } + +getent passwd cron >/dev/null || \ + adduser --system --group --home /var/spool/cron --no-create-home cron +getent passwd cronlog >/dev/null || \ + adduser --system --home /nonexistent --no-create-home cronlog + +if test ! -p /var/spool/cron/trigger; then + test ! -e /var/spool/cron/trigger || + err /var/spool/cron/trigger exists, but is not a fifo. + mkfifo -m0600 /var/spool/cron/trigger +fi + +for i in crontabs tmp trigger; do + chown cron:cron /var/spool/cron/$i + chmod go-rwx /var/spool/cron/$i +done +for i in `ls -1 /var/spool/cron/crontabs/ || :`; do + chown cron:cron /var/spool/cron/crontabs/$i +done +chown cronlog:adm /var/log/bcron /var/log/bcron/spool /var/log/bcron/update +chmod 2750 /var/log/bcron /var/log/bcron/spool /var/log/bcron/update + +test -n "$2" || + for i in sched spool update; do + update-service --add /etc/bcron-$i + done +test -z "$2" || + sv t /etc/service/bcron-* || echo 'unable to restart bcron-* services.' --- bcron-0.10.orig/debian/bcron-run.postrm +++ bcron-0.10/debian/bcron-run.postrm @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +test "$1" != 'remove' || exec rm -f /var/spool/cron/crontabs/:?* +test "$1" = 'purge' || exit 0 + +sv force-shutdown /etc/bcron-sched /etc/bcron-spool /etc/bcron-update || : +for i in sched spool update; do + rm -rf /etc/bcron-$i/supervise /etc/bcron-$i/log/supervise + rm -rf /var/lib/supervise/bcron-$i /var/lib/supervise/bcron-$i.log +done + +rm -f /var/spool/cron/trigger +for i in '' spool update; do + for j in '@*' current config lock state; do + rm -f /var/log/bcron/$i/$j + done +done +rmdir /var/log/bcron/spool /var/log/bcron/update || : +rmdir /var/log/bcron || : + +getent passwd cron >/dev/null || getent passwd cronlog >/dev/null || exit 0 +if ! deluser --version >/dev/null 2>&1; then + echo 'deluser program not available, not removing system users "cron", "cronlog".' >&2 + exit 0 +fi +getent passwd cron >/dev/null || deluser cron +getent passwd cronlog >/dev/null || deluser cronlog --- bcron-0.10.orig/debian/bcron-run.prerm +++ bcron-0.10/debian/bcron-run.prerm @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +trap "cd `pwd`" EXIT + +test "$1" = 'remove' || test "$1" = 'deconfigure' || \ + test "$1" = 'failed-upgrade' || exit 0 + +for i in update spool sched; do + update-service --remove /etc/bcron-$i || : +done --- bcron-0.10.orig/debian/bcron.README.Debian +++ bcron-0.10/debian/bcron.README.Debian @@ -0,0 +1,17 @@ +bcron for Debian +---------------- + +This package contains the bcron programs, installed into /usr/bin/ and +/usr/sbin/, and the bcron documentation. + +To have the current cron package replaced by bcron, install the bcron-run +package, which enables the bcron services to provide default Debian cron +features, e.g. + + # apt-get install bcron-run + +bcron's behavior can be configured through the /etc/bcron/ directory, +see the man pages and the documentation in /usr/share/doc/bcron/ for +details. + + -- Gerrit Pape , Sat, 02 Apr 2005 12:40:26 +0000 --- bcron-0.10.orig/debian/bcron.docs +++ bcron-0.10/debian/bcron.docs @@ -0,0 +1,7 @@ +ANNOUNCEMENT +NEWS +README +TODO +VERSION +bcron.html +debian/README.Debian.diet --- bcron-0.10.orig/debian/changelog +++ bcron-0.10/debian/changelog @@ -0,0 +1,184 @@ +bcron (0.10-3) unstable; urgency=medium + + * debian/control: Revert bcron-run: Provides:, Replaces:, Conflicts: + cron-daemon instead of cron (thx Russ Allbery). + * debian/control: Provides: cron, cron-daemon. + + -- Gerrit Pape Sat, 18 Oct 2014 19:45:39 +0000 + +bcron (0.10-2) unstable; urgency=low + + * debian/control: bcron-run: Provides:, Replaces:, Conflicts: + cron-daemon instead of cron (thx Alexandre Detiste, closes: 752506). + * debian/diff/0006-tests.sh-skip-tests-exec-fds-tests-exec-sim...diff: + new: tests.sh: skip tests/exec-fds, tests/exec-simple if $HOME does + not exist. + + -- Gerrit Pape Mon, 11 Aug 2014 19:11:21 +0000 + +bcron (0.10-1) unstable; urgency=low + + * new upstream release 0.10. + * debian/diff/0004-bcron-exec.c-fix-typo-...diff: remove; fixed + upstream. + * debian/diff/0006-tests.sh-export-TZ-CST0-trailing-...diff: remove; + obsolete. + * debian/diff/0007-tests.sh-*.diff, 0008-bcron-exec-...diff: remove; + applied upstream. + * debian/control: Build-Depends: python, man2html, texinfo. + * debian/diff/0001-...diff: adapt: remove *.html from TARGET to keep + them on make clean. + * debian/rules: ./ChangeLog no longer shipped by upstream, use NEWS. + * debian/bcron-run.postinst: don't use update-service --add on package + upgrade; use sv t to restart services on package upgrade. + * debian/bcron-run.postinst: remove code for package upgrade from + version 0.09-8 or earlier. + * debian/control: remove version (>= 1.8.0-2) from Depends: runit. + * debian/bcron-run.postrm: purge: use sv force-shutdown instead of + force-stop to take down services; guard deluser against failure. + * debian/rules: echo /usr/share/doc >conf-man; no longer install man + pages explicitly. + * debian/diff/0005-Makefile-don-t-use-Wl-R-bglibs-when-linking...diff: + new: Makefile: don't use -Wl,-R'$${bglibs}' when linking programs. + * debian/control: Standards-Version: 3.9.5.0. + + -- Gerrit Pape Sun, 10 Aug 2014 14:16:45 +0000 + +bcron (0.09-13) unstable; urgency=medium + + * debian/diff/0008-bcron-exec-Mark-all-temporary-files-close-...diff: + new; from upstream git; bcron-exec: Mark all temporary files + close-on-exec and close selfpipe; this fixes a security bug in + bcron where cron jobs get access to the temporary output files from + all other jobs that are still running (closes: #686650). + + -- Gerrit Pape Wed, 16 Jan 2013 10:13:37 +0000 + +bcron (0.09-12) unstable; urgency=low + + * debian/rules, debian/bcron.README.Debian: no longer install the + bcron.info file (closes: #528865). + * debian/control: bcron: Recommends: default-mta | + mail-transport-agent; bcron-run: Depends: default-mta | + mail-transport-agent (thx Jonathan Nieder; closes: #495834). + * debian/control: Standards-Version: 3.9.2.0. + + -- Gerrit Pape Thu, 20 Oct 2011 12:41:01 +0000 + +bcron (0.09-11) unstable; urgency=low + + * debian/bcron-run.postrm: services' supervise dirs are now located in + /var/lib/supervise/, remove those on purge. + * debian/rules: no longer include named pipe /var/spool/cron/trigger + in the bcron-run packages (closes: #552687). + * debian/bcron-run.postinst: create named pipe /var/spool/cron/trigger + if it doesn't exist yet, error out if it exists but is not a fifo. + * debian/bcron-run.postrm: remove /var/spool/cron/trigger on purge. + * debian/control: Standards-Version: 3.8.3.0. + + -- Gerrit Pape Sun, 01 Nov 2009 22:50:15 +0000 + +bcron (0.09-10) unstable; urgency=low + + * debian/control: Build-Depends: libbg1-dev (closes: #482516). + + -- Gerrit Pape Sun, 25 May 2008 16:15:18 +0000 + +bcron (0.09-9) unstable; urgency=low + + * debian/bcron-run.postinst, debian/bcron-run.prerm: use runit's + update-service program to add/remove services from system-wide service + supervision, instead of dealing with symlinks in /var/service/ directly. + * debian/control: package bcron-run: Depends: runit (>= 1.8.0-2) (1st + version that provides the update-service program). + * debian/rules: no longer include dangling links for ./supervise/ + subdirectories, update-service now takes care of this. + * debian/bcron-run.postinst: remove bcron service on upgrade from + <= 0.09-8, and re-add afterwards through update-service. + * debian/bcron-run.postrm: purge: adapt paths in /var/run/; force-stop bcron + services; remove ./supervise/ subdirectories (or symlinks) in service + directories. + * debian/control: add Vcs-Git: http://smarden.org/git/bcron.git/. + * debian/control: Standards-Version: 3.7.3.0. + + -- Gerrit Pape Wed, 13 Feb 2008 22:55:42 +0000 + +bcron (0.09-8) unstable; urgency=medium + + * debian/diff/*: redo diffs with git. + * debian/rules: apply diffs from debian/diff with patch -p1, not -p0. + * debian/diff/0006-tests.sh-export-TZ-CST0-trailing-zero-to-make-new.diff: + new; export TZ=CST0 (trailing zero) in selftests to make new glibc in + sid happy (closes: #422125). + * debian/diff/0007-tests.sh-replace-bashism-let-with-posix-arithmetic.diff: + new; replace bashism 'let' in selftests with posix arithmetic expansions + $(( )). + + -- Gerrit Pape Tue, 08 May 2007 17:45:32 +0000 + +bcron (0.09-7) unstable; urgency=medium + + * debian/bcron-run.postrm: check for deluser being available, if not, + print warning and don't remove system users (ref: #398539). + + -- Gerrit Pape Fri, 17 Nov 2006 20:12:14 +0000 + +bcron (0.09-6) unstable; urgency=low + + * debian/bcron-run.postinst: don't make the log service system user + cronlog member of group adm, but nogroup; cronlog's home directory is + /nonexistent; make log directories mode 2750, owner cronlog:adm + (closes: #396687). + + -- Gerrit Pape Mon, 6 Nov 2006 20:18:51 +0000 + +bcron (0.09-5) unstable; urgency=low + + * debian/control: Build-Depends: bglibs-dev (>> 1.041-1) (closes: + #376244); bcron-run: Suggests: anacron (closes: #375078). + + -- Gerrit Pape Thu, 13 Jul 2006 18:51:24 +0000 + +bcron (0.09-4) unstable; urgency=low + + * debian/diff/initgroups.diff: new; bcron-exec: setup group membership + properly (thx Joshua N Pritikin, closes: #352159). + * debian/implicit: update to revision 1.11. + + -- Gerrit Pape Sat, 4 Mar 2006 00:25:03 +0000 + +bcron (0.09-3) unstable; urgency=low + + * debian/bcron-run.postrm: typo; minor. + * debian/bcron-run.postinst, debian/bcron-run.README.Debian, + debian/bcron-run.prerm: use sv program instead of runsvctrl, runsvstat, + svwaitdown. + * debian/control: bcron-run Depends: runit (>> 1.3.0-0). + + -- Gerrit Pape Wed, 12 Oct 2005 10:23:04 +0000 + +bcron (0.09-2) unstable; urgency=low + + * debian/diff/bcron-spool-socket.diff: new; change path to bcron-spool + socket to /var/run/.bcron-spool (thx Tommi Virtanen, closes: #321383). + + -- Gerrit Pape Fri, 5 Aug 2005 17:33:30 +0000 + +bcron (0.09-1) unstable; urgency=low + + * new upstream version. + * debian/diff/var-run-.bcron-spool.diff, debian/diff/man.diff: remove; + adopted upstream. + * debian/rules: install-arch: use $install_prefix with new bg-installer; + build-arch: run selftests. + * debian/control: Standards-Version: 3.6.2.0; Build-Depends: bglibs-dev + (>> 1.021-0). + * debian/diff/tests.diff: new; skip non-root-only spool-*-baduser tests. + + -- Gerrit Pape Wed, 20 Jul 2005 20:51:18 +0000 + +bcron (0.08-0.3) unstable; urgency=low + + * initial version (closes: #302309). + + -- Gerrit Pape Sun, 10 Apr 2005 10:02:48 +0000 --- bcron-0.10.orig/debian/control +++ bcron-0.10/debian/control @@ -0,0 +1,38 @@ +Source: bcron +Section: admin +Priority: optional +Maintainer: Gerrit Pape +Build-Depends: libbg1-dev, python, man2html-base, texinfo +Standards-Version: 3.9.5.0 +Vcs-Git: http://smarden.org/git/bcron.git/ + +Package: bcron +Architecture: any +Depends: ${shlibs:Depends} +Recommends: bcron-run, runit, ucspi-unix, default-mta | mail-transport-agent +Description: Bruce's cron system (programs) + This is bcron, a new cron system designed with secure operations in mind. + To do this, the system is divided into several separate programs, each + responsible for a separate task, with strictly controlled communications + between them. The user interface is a drop-in replacement for similar + systems (such as vixie-cron), but the internals differ greatly. + . + This package contains the bcron programs. + +Package: bcron-run +Architecture: all +Section: admin +Depends: bcron, runit, ucspi-unix, default-mta | mail-transport-agent, adduser +Provides: cron, cron-daemon +Replaces: cron +Conflicts: cron +Suggests: runit-run, anacron +Description: Bruce's cron system + This is bcron, a new cron system designed with secure operations in mind. + To do this, the system is divided into several separate programs, each + responsible for a separate task, with strictly controlled communications + between them. The user interface is a drop-in replacement for similar + systems (such as vixie-cron), but the internals differ greatly. + . + This package sets up the bcron services, and replaces the default Debian + cron package. --- bcron-0.10.orig/debian/copyright +++ bcron-0.10/debian/copyright @@ -0,0 +1,15 @@ +This package was debianized by Gerrit Pape on +Sat, 02 Apr 2005 12:40:26 +0000. + +It was downloaded from http://untroubled.org/bcron/ + +Upstream Author: Bruce Guenter + +Copyright: + +This package is Copyright(C) 2005 Bruce Guenter or FutureQuest, Inc., and +may be copied according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 +or a later version. A copy of this license is included with this package. +This package comes with no warranty of any kind. + +The full text of the GPL can be found at /usr/share/common-licenses/GPL-2. --- bcron-0.10.orig/debian/crontab +++ bcron-0.10/debian/crontab @@ -0,0 +1,7 @@ +SHELL=/bin/sh +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +14 * * * * root run-parts --report /etc/cron.hourly +24 4 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily +39 4 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly +54 4 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly --- bcron-0.10.orig/debian/diff/0001-remove-.html-from-TARGET-to-keep-them-on-make-clean.diff +++ bcron-0.10/debian/diff/0001-remove-.html-from-TARGET-to-keep-them-on-make-clean.diff @@ -0,0 +1,49 @@ +From 4286117d3480b1287d53d5ddc279a72635b09443 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:54:30 +0000 +Subject: [PATCH] remove *.html from TARGET to keep them on make clean. + +--- + TARGETS | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/TARGETS b/TARGETS +index 6178929..aef6411 100644 +--- a/TARGETS ++++ b/TARGETS +@@ -1,24 +1,16 @@ + all + bcron-exec +-bcron-exec.8.html + bcron-exec.o + bcron-sched +-bcron-sched.8.html + bcron-sched.o + bcron-spool +-bcron-spool.8.html + bcron-spool.o + bcron-start +-bcron-start.8.html + bcron-start.o + bcron-update +-bcron-update.8.html + bcron-update.o + bcron.a +-bcron.html +-bcron.info + bcrontab +-bcrontab.1.html + bcrontab.o + chdir.o + clean +@@ -26,7 +18,6 @@ clean-spac + compile + conf_sendmail.c + connection.o +-crontab.5.html + crontab.o + crontabs.o + docs +-- +2.0.1 + --- bcron-0.10.orig/debian/diff/0002-Spool-socket-is-var-run-.bcron-spool-instead-of-var-r.diff +++ bcron-0.10/debian/diff/0002-Spool-socket-is-var-run-.bcron-spool-instead-of-var-r.diff @@ -0,0 +1,26 @@ +From 8bcb4178524f61565e02d527a37c7468431b4539 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:55:56 +0000 +Subject: [PATCH] Spool socket is /var/run/.bcron-spool instead of + /var/run/bcron-spool on Debian. + +--- + bcron.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bcron.h b/bcron.h +index 984d54c..754af1d 100644 +--- a/bcron.h ++++ b/bcron.h +@@ -8,7 +8,7 @@ + + #define BCRON_SPOOL "/var/spool/cron" + #define CRONTAB_DIR "crontabs" +-#define SOCKET_PATH "/var/run/bcron-spool" ++#define SOCKET_PATH "/var/run/.bcron-spool" + #define BCRON_USER "cron" + #define TRIGGER "trigger" + +-- +2.0.1 + --- bcron-0.10.orig/debian/diff/0003-Have-bcron-update-ignore-files-that-are-outside-Debia.diff +++ bcron-0.10/debian/diff/0003-Have-bcron-update-ignore-files-that-are-outside-Debia.diff @@ -0,0 +1,63 @@ +From bdd26a3940ed4c00baaf0d0080fad77a788daad1 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 08:59:14 +0000 +Subject: [PATCH] Have bcron-update ignore files that are outside Debian + namespace. + +On Debian, if path is a directory, bcron-spool skips files in this +directory with names that do not solely consist of lower- and uppercase +letters ('a'-'z', 'A'-'Z'), digits ('0'-'9'), underscores ('_'), and +hyphens ('-'). +--- + bcron-update.8 | 8 ++++++++ + bcron-update.c | 13 +++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/bcron-update.8 b/bcron-update.8 +index 9bed66d..5726f5b 100644 +--- a/bcron-update.8 ++++ b/bcron-update.8 +@@ -15,6 +15,14 @@ those changes into the crontab spool directory. + .B bcron-update + runs as root in order to be able to read system files that would + potentially be unreadable otherwise. ++.P ++On Debian, if ++.I path ++is a directory, ++.B bcron-update ++skips files in this directory with names that do not solely consist of ++lower- and uppercase letters ('a'-'z', 'A'-'Z'), digits ('0'-'9'), ++underscores ('_'), and hyphens ('-'). + .SH EXAMPLES + To mirror modern vixie-cron's behavior, use: + .EX +diff --git a/bcron-update.c b/bcron-update.c +index 7bf6c6f..23bc8ce 100644 +--- a/bcron-update.c ++++ b/bcron-update.c +@@ -136,8 +136,21 @@ static int check_dir(struct arg* a, struct ministat* st) + while ((e = readdir(a->dir)) != 0) { + struct statcache_entry* se; + const char* name = e->d_name; ++ char *c; + if (name[0] == '.') + continue; ++ /* check Debian cron files namespace */ ++ for (c = e->d_name; *c; ++c) { ++ if (*c == '-') continue; ++ if (*c < '0') break; ++ if (*c <= '9') continue; ++ if (*c < 'A') break; ++ if (*c <= 'Z') continue; ++ if (*c == '_') continue; ++ if (*c < 'a') break; ++ if (*c > 'z') break; ++ } ++ if (*c) continue; + if ((se = statcache_get(&a->entries, &name)) == 0) { + /* File is new. */ + ministat2(a->path, name, st); +-- +2.0.1 + --- bcron-0.10.orig/debian/diff/0004-tests.sh-skip-non-root-only-spool-baduser-tests.diff +++ bcron-0.10/debian/diff/0004-tests.sh-skip-non-root-only-spool-baduser-tests.diff @@ -0,0 +1,66 @@ +From 2360bf1d30be6ae7a4d6d6106179f7b4f091ab16 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 8 May 2007 09:02:18 +0000 +Subject: [PATCH] tests.sh: skip non-root-only spool-*-baduser tests. + +--- + tests.sh | 36 ++++++++++++++++++------------------ + 1 file changed, 18 insertions(+), 18 deletions(-) + +diff --git a/tests.sh b/tests.sh +index 2f93ca5..98f2c95 100644 +--- a/tests.sh ++++ b/tests.sh +@@ -578,14 +578,14 @@ END_OF_TEST_RESULTS + + ##### Test tests/spool-submit-baduser ##### + +-runtest() { +-printf "Sroot\\0* * * * * echo hello\\n" | spoolcmd +-rm -f $CRONTABS/root +-} +-vecho "Running test tests/spool-submit-baduser " +-run_compare_test tests/spool-submit-baduser < +Date: Sun, 10 Aug 2014 14:23:00 +0000 +Subject: [PATCH] Makefile: don't use -Wl,-R'$${bglibs}' when linking programs + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f47e1a1..d3684c2 100644 +--- a/Makefile ++++ b/Makefile +@@ -122,7 +122,7 @@ load: conf-ld conf-bglibs + ( bglibs=`head -n 1 conf-bglibs`; \ + echo '#!/bin/sh';\ + echo 'main="$$1"; shift';\ +- echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" "-Wl,-R'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \ ++ echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \ + ) >load + chmod 755 load + +-- +2.0.1 + --- bcron-0.10.orig/debian/diff/0006-tests.sh-skip-tests-exec-fds-tests-exec-simple-if-HOM.diff +++ bcron-0.10/debian/diff/0006-tests.sh-skip-tests-exec-fds-tests-exec-simple-if-HOM.diff @@ -0,0 +1,58 @@ +From e2145b3bc420a99398c35fddd51b466a88a5ca32 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Mon, 11 Aug 2014 19:05:49 +0000 +Subject: [PATCH] tests.sh: skip tests/exec-fds, tests/exec-simple if $HOME + does not exist + +This fixes FTBFS on Debian autobuilders, which run the package build +process as user with non-existng home directory /sbuild-nonexistent. + +E.g.: +https://buildd.debian.org/status/fetch.php?pkg=bcron&arch=amd64&ver=0.10-1&stamp=1407686613 +--- + tests.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/tests.sh b/tests.sh +index 98f2c95..676e258 100644 +--- a/tests.sh ++++ b/tests.sh +@@ -511,6 +511,8 @@ END_OF_TEST_RESULTS + + ##### Test tests/exec-fds ##### + ++if test -d "$HOME"; then ++ + runtest() { + echo 'exec 2>/dev/null' >$tmp/echo-all.sh + fd=4 +@@ -551,6 +553,8 @@ Subject: Cron sleep 1; echo all done + all done + END_OF_TEST_RESULTS + ++fi ++ + + ##### Test tests/sched-dump ##### + +@@ -590,6 +594,8 @@ END_OF_TEST_RESULTS + + ##### Test tests/exec-simple ##### + ++if test -d "$HOME"; then ++ + runtest() { + doexec 'echo yes' + } +@@ -605,6 +611,8 @@ Subject: Cron echo yes + yes + END_OF_TEST_RESULTS + ++fi ++ + + ##### Test tests/spool-submit ##### + +-- +2.0.1 + --- bcron-0.10.orig/debian/etc/bcron-sched/log/run +++ bcron-0.10/debian/etc/bcron-sched/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -ucronlog svlogd -tt /var/log/bcron --- bcron-0.10.orig/debian/etc/bcron-sched/run +++ bcron-0.10/debian/etc/bcron-sched/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec 2>&1 +exec chpst -e/etc/bcron bcron-start --- bcron-0.10.orig/debian/etc/bcron-spool/log/run +++ bcron-0.10/debian/etc/bcron-spool/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -ucronlog svlogd -tt /var/log/bcron/spool --- bcron-0.10.orig/debian/etc/bcron-spool/run +++ bcron-0.10/debian/etc/bcron-spool/run @@ -0,0 +1,5 @@ +#!/bin/sh +exec 2>&1 +exec chpst -e/etc/bcron -Ucron sh -c ' + exec unixserver -U ${BCRON_SOCKET:-/var/run/.bcron-spool} bcron-spool +' --- bcron-0.10.orig/debian/etc/bcron-update/log/run +++ bcron-0.10/debian/etc/bcron-update/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec chpst -ucronlog svlogd -tt /var/log/bcron/update --- bcron-0.10.orig/debian/etc/bcron-update/run +++ bcron-0.10/debian/etc/bcron-update/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec 2>&1 +exec bcron-update /etc/crontab /etc/cron.d --- bcron-0.10.orig/debian/implicit +++ bcron-0.10/debian/implicit @@ -0,0 +1,93 @@ +# $Id: implicit,v 1.11 2005/11/29 21:57:55 pape Exp $ + +.PHONY: deb-checkdir deb-checkuid + +deb-checkdir: + @test -e debian/control || sh -cx '! : wrong directory' +deb-checkuid: + @test "`id -u`" -eq 0 || sh -cx '! : need root privileges' + +%.deb: %.deb-docs %.deb-DEBIAN + @rm -f $*.deb $*.deb-checkdir $*.deb-docs $*.deb-docs-base \ + $*.deb-docs-docs $*.deb-docs-examples $*.deb-DEBIAN \ + $*.deb-DEBIAN-dir $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums + +%.udeb: %.deb-DEBIAN + @rm -f $*.deb $*.deb-checkdir $*.deb-DEBIAN $*.deb-DEBIAN-dir \ + $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums + +%.deb-checkdir: + @test -d debian/$* || sh -cx '! : directory debian/$* missing' + @test "`id -u`" -eq 0 || sh -cx '! : need root privileges' + +%.deb-docs-base: + : implicit + @rm -f debian/$*/usr/share/doc/$*/* || : + @install -d -m0755 debian/$*/usr/share/doc/$* + : debian/$*/usr/share/doc/$*/ + @sh -cx 'install -m0644 debian/copyright debian/$*/usr/share/doc/$*/' + @sh -cx 'install -m0644 debian/changelog \ + debian/$*/usr/share/doc/$*/changelog.Debian' + @test ! -r changelog || \ + sh -cx 'install -m0644 changelog debian/$*/usr/share/doc/$*/' + @test -r debian/$*/usr/share/doc/$*/changelog || \ + sh -cx 'mv debian/$*/usr/share/doc/$*/changelog.Debian \ + debian/$*/usr/share/doc/$*/changelog' + @test -s debian/$*/usr/share/doc/$*/changelog || \ + sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog' + @gzip -9 debian/$*/usr/share/doc/$*/changelog* +%.deb-docs-docs: + @for i in `cat debian/$*.docs 2>/dev/null || :`; do \ + if test -d $$i; then \ + sh -cx "install -d -m0755 debian/$*/usr/share/doc/$*/$${i##*/}" && \ + for j in $$i/*; do \ + sh -cx "install -m0644 $$j \ + debian/$*/usr/share/doc/$*/$${i##*/}/" || exit 1; \ + done || exit 1; \ + continue; \ + fi; \ + sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/" || exit 1; \ + done + @test ! -r debian/$*.README.Debian || \ + sh -cx 'install -m0644 debian/$*.README.Debian \ + debian/$*/usr/share/doc/$*/README.Debian' + @if test -r debian/$*.NEWS.Debian; then \ + sh -cx 'install -m0644 debian/$*.NEWS.Debian \ + debian/$*/usr/share/doc/$*/NEWS.Debian && \ + gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \ + fi +%.deb-docs-examples: + @rm -rf debian/$*/usr/share/doc/$*/examples + : debian/$*/usr/share/doc/$*/examples/ + @test ! -r debian/$*.examples || \ + install -d -m0755 debian/$*/usr/share/doc/$*/examples + @for i in `cat debian/$*.examples 2>/dev/null || :`; do \ + sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/examples/" \ + || exit 1; \ + done +%.deb-docs: %.deb-checkdir %.deb-docs-base %.deb-docs-docs %.deb-docs-examples + : debian/$*/usr/share/doc/$*/ ok + +%.deb-DEBIAN-base: + @rm -rf debian/$*/DEBIAN + : debian/$*/DEBIAN/ + @install -d -m0755 debian/$*/DEBIAN + @for i in conffiles shlibs templates; do \ + test ! -r debian/$*.$$i || \ + sh -cx "install -m0644 debian/$*.$$i debian/$*/DEBIAN/$$i" \ + || exit 1; \ + done +%.deb-DEBIAN-scripts: + @for i in preinst prerm postinst postrm config; do \ + test ! -r debian/$*.$$i || \ + sh -cx "install -m0755 debian/$*.$$i debian/$*/DEBIAN/$$i" \ + || exit 1; \ + done +%.deb-DEBIAN-md5sums: + : debian/$*/DEBIAN/md5sums + @rm -f debian/$*/DEBIAN/md5sums + @cd debian/$* && find * -path 'DEBIAN' -prune -o \ + -type f -exec md5sum {} >>DEBIAN/md5sums \; +%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \ + %.deb-DEBIAN-md5sums + : debian/$*/DEBIAN/ ok --- bcron-0.10.orig/debian/rules +++ bcron-0.10/debian/rules @@ -0,0 +1,125 @@ +#!/usr/bin/make -f + +STRIP =strip +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + STRIP =: nostrip +endif + +CFLAGS =-g -O2 -Wall +LDFLAGS = +CC =gcc +BGLIBS =/usr/lib/bglibs +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS =-g -O0 -Wall +endif +ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) + CC =diet -v -Os gcc -nostdinc + BGLIBS =/usr/lib/diet/bglibs +endif + +DIR =$(shell pwd)/debian/bcron + +patch: deb-checkdir patch-stamp +patch-stamp: + for i in `ls -1 debian/diff/*.diff || :`; do \ + patch -p1 <$$i || exit 1; \ + done + touch patch-stamp + +build: deb-checkdir build-arch-stamp build-indep-stamp + +build-arch: deb-checkdir build-arch-stamp +build-arch-stamp: patch-stamp + -gcc -v + for i in conf-*; do \ + test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \ + done + echo '$(CC) $(CFLAGS)' >conf-cc + echo '$(CC) $(LDFLAGS)' >conf-ld + echo '/usr/sbin' >conf-bin + echo '/usr/share/man' >conf-man + echo '$(BGLIBS)/include' >conf-bgincs + echo '$(BGLIBS)/lib' >conf-bglibs + $(MAKE) + sh tests.sh + touch build-arch-stamp + +build-indep: deb-checkdir build-indep-stamp +build-indep-stamp: + touch build-indep-stamp + +clean: deb-checkdir deb-checkuid patch-stamp + $(MAKE) clean + test ! -e patch-stamp || \ + for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done + for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done + rm -f build-arch-stamp build-indep-stamp patch-stamp + rm -rf '$(DIR)' '$(DIR)'-run + rm -f debian/files debian/substvars changelog + +install: install-arch install-indep +install-arch: deb-checkdir deb-checkuid build-arch-stamp + rm -rf '$(DIR)' + install -d -m0755 '$(DIR)'/usr/bin '$(DIR)'/usr/sbin + PATH="/usr/lib/bglibs/bin:$$PATH" make install install_prefix='$(DIR)' + rm -f '$(DIR)'/usr/sbin/crontab + $(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/* + mv '$(DIR)'/usr/sbin/bcrontab '$(DIR)'/usr/bin/bcrontab + install -d -m0755 '$(DIR)'/etc/bcron + mv '$(DIR)'/usr/share/man/man5/crontab.5 \ + '$(DIR)'/usr/share/man/man5/bcrontab.5 + rm -f '$(DIR)'/usr/share/man/man1/crontab.1 + gzip -9 '$(DIR)'/usr/share/man/man?/*.? + test -r changelog || ln -s NEWS changelog + +install-indep: deb-checkdir deb-checkuid build-indep-stamp + rm -rf '$(DIR)'-run + install -d -m0755 '$(DIR)'-run/usr/bin + ln -s bcrontab '$(DIR)'-run/usr/bin/crontab + install -d -m0755 '$(DIR)'-run/var/spool/cron/crontabs + install -d -m0755 '$(DIR)'-run/var/spool/cron/tmp + install -d -m0755 '$(DIR)'-run/etc/cron.d + install -d -m0755 '$(DIR)'-run/etc/bcron-sched/log + install -m0755 debian/etc/bcron-sched/run \ + '$(DIR)'-run/etc/bcron-sched/run + install -m0755 debian/etc/bcron-sched/log/run \ + '$(DIR)'-run/etc/bcron-sched/log/run + install -d -m0755 '$(DIR)'-run/etc/bcron-spool/log + install -m0755 debian/etc/bcron-spool/run \ + '$(DIR)'-run/etc/bcron-spool/run + install -m0755 debian/etc/bcron-spool/log/run \ + '$(DIR)'-run/etc/bcron-spool/log/run + install -d -m0755 '$(DIR)'-run/etc/bcron-update/log + install -m0755 debian/etc/bcron-update/run \ + '$(DIR)'-run/etc/bcron-update/run + install -m0755 debian/etc/bcron-update/log/run \ + '$(DIR)'-run/etc/bcron-update/log/run + install -d -m0755 '$(DIR)'-run/var/log/bcron/spool + install -d -m0755 '$(DIR)'-run/var/log/bcron/update + install -m0644 debian/crontab '$(DIR)'-run/etc/crontab + install -d -m0755 '$(DIR)'-run/etc/cron.daily + install -d -m0755 '$(DIR)'-run/etc/cron.hourly + install -d -m0755 '$(DIR)'-run/etc/cron.monthly + test -r changelog || ln -s NEWS changelog + # man pages + install -d -m0755 '$(DIR)'-run/usr/share/man/man5 + ln -s bcrontab.5.gz '$(DIR)'-run/usr/share/man/man5/crontab.5.gz + install -d -m0755 '$(DIR)'-run/usr/share/man/man1 + ln -s bcrontab.1.gz '$(DIR)'-run/usr/share/man/man1/crontab.1.gz + +binary-arch: deb-checkdir deb-checkuid install-arch bcron.deb + test '$(CC)' != 'gcc' || \ + dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/* + dpkg-gencontrol -isp -pbcron -P'$(DIR)' + dpkg -b '$(DIR)' .. + +binary-indep: deb-checkdir deb-checkuid install-indep bcron-run.deb + dpkg-gencontrol -isp -pbcron-run -P'$(DIR)'-run + dpkg -b '$(DIR)'-run .. + +binary: binary-indep binary-arch + +.PHONY: patch build build-arch build-indep clean install install-arch \ +install-indep binary-arch binary-indep binary + +include debian/implicit