Commit graph

67 commits

Author SHA1 Message Date
Dale Mellor
d0f96e6ff6
Updated use of autoconf guile detection macros.
This change also puts back the search specifically for guile version 3.

Note that, if guild is not imminently available (usually part of guile-devel
package) then make will abort with an ugly and very non-descriptive error
message.

  * configure.ac
2023-03-24 10:57:47 +00:00
Dale Mellor
dd27da748e
Version bump to 1.2.2.
* configure.ac:  single character edit
2023-03-23 16:32:58 +00:00
Dale Mellor
0fe4d2cc95
Merge system-wide Vixie cron updates.
I don't believe that anyone should be running system-wide cron processes these
days (the attack surface is rather large), but should use separate per-user or
per-service mcron daemon processes.  But mcron is advertised as a drop-in
Vixie replacement, so we should do what we can to make it safe in this use
case.

I've performed a basic vetting of the changes against vandalism, but haven't
verified the correctness of the code or done any checking; the changes are
being accepted on the basis that almost anything is an improvement on what
currently exists.
2023-03-18 14:18:17 +00:00
ulfvonbelow
4727c770c2
crontab-access: replace with wrapper, rename to crontab-access-real.
The wrapper has two purposes:
1. Not being a script, thereby eliminating the issues with setuid scripts.
2. Purging the environment. crontab-access-real has no need for any
   environment variables to do its work, so to prevent tampering with dynamic
   linker, libc, or guile, we may as well just unset them all.

This wrapper does introduce a requirement for a C compiler. Ideally it would
be conditional based on whether the wrapper is even going to be built, but
autoconf doesn't like that one bit. Someone with more experience with
autotools should sort that out. In the meantime I guess anyone wanting to
build without a C compiler being present is going to have to edit configure.ac
and re-run bootstrap.

* src/crontab-access.in: renamed to src/crontab-access-real.in
* src/crontab-access.c.in: new file, wrapper for crontab-access-real.
* Makefile.am: inform about crontab-access.c.in and name change to
  crontab-access-real. Put crontab-access-real in libexecdir.
2023-03-18 14:00:26 +00:00
ulfvonbelow
ec6a023c66
config.scm.in: rename to config.scm.in.in, substitute from Makefile.
* src/mcron/config.scm.in: renamed to config.scm.in.in.
  (config-sbin-dir): new variable.
* Makefile.am: substitute in config.scm.in.
2023-03-18 14:00:26 +00:00
Dale Mellor
aa19e31d01
The GUILE_PKG M4 macro no longer takes any arguments.
* configure.ac:  small alteration as described
2023-03-15 20:57:11 +00:00
Dale Mellor
19ba0a82d2
Lose hope of running against guile 2.2 or earlier.
We have previously allowed versions 2.0 and 2.2 to get past the configure
stage, but all versions of guile before 3.0 have in fact failed to compile the
code due to syntax errors for some time now.

* build-aux/guix.scm:  package depends on guile@3
* configure.ac:  only look for guile version 3
* src/mcron/base.scm:  drop allowance for old-fashioned (version 2.0) select
2022-07-07 16:56:54 +01:00
atsb
97cdae129d updating for next release 2021-08-05 10:24:44 +02:00
atsb
b57505ec3b updates for latest autoconf 2021-04-07 13:23:45 +02:00
atsb
96f31795e8 fixes for ubuntu 20.4 2020-08-13 16:25:05 +02:00
Mathieu Lirzin
289e4c505e
build: Remove C specific Guile configuration step
* configure.ac: Remove unecessary PKG_CHECK_MODULES invocation.
2020-05-17 11:51:55 +02:00
Mathieu Lirzin
bfe2a89212
build: Detect guile M4 macro expansion errors
This ensures that the absence of 'pkg-config' or 'guile' M4 macros
expansion do not pass the bootstrap step.

* configure.ac: Allow or forbid some M4 macros patterns in the generated
'configure' script.
2020-05-17 11:51:55 +02:00
atsb
42fae5880e prepare version 1.2.0 2020-04-22 20:45:35 +02:00
Dale Mellor
1eedf3b6d2 project: banish need for C compiler
This patch gets rid of the thin veneer that we currently have around the three
executables.  This was done for historical reasons (circa 2003 Guile couldnʼt
deal with process signals and forks).  In fact these problems were fixed many
moons ago, and there is now no need for it.  The project becomes 100% Guile!

Many files are affected; interested coders should use the GIT repository to
understand the details of all the changes.
2020-04-20 17:03:25 +00:00
atsb
bd37306294 preparing 1.1.4 2020-04-12 14:54:24 +02:00
Ludovic Courtès
bedec44b39 build: Support Guile 3.0.
* configure.ac: Add "3.0" to 'GUILE_PKG'.
2020-02-27 21:03:47 +00:00
atsb
a373317d96 prepared files for 1.1.3 2019-11-17 12:08:19 +01:00
Adam Bilbrough
d4b48ee300 final push for 1.1.2 2018-11-26 19:08:16 +01:00
宋文武
7228d3048a
build: Add '--with-sendmail' configure option
This allows users to configure the Mail Transfert Agent (MTA) of their
choice.

* configure.ac: Add '--with-sendmail' option.
(SENDMAIL): Default to 'sendmail -t'.
* NEWS: Announce it.
* src/mcron/redirect.scm (with-mail-out): Assume the MTA is reading the
message for recipients.
* build-aux/guix.scm: Remove 'which' from the native-inputs.
2018-10-07 12:22:53 +02:00
Mathieu Lirzin
6c4f93371c
build: Add "maint.mk"
* maint.mk: New maintainer-only Makefile fragment.
* Makefile.am: Include it.
* configure.ac: Substitute "maint.mk" content when it exists.
2018-03-26 01:44:22 +02:00
Mathieu Lirzin
cae2270fd7
build: Check non-standard C functions at configure time
* configure.ac: Check 'argp_parse' and 'asprintf' presence.
2018-03-23 22:13:43 +01:00
Mathieu Lirzin
fe9592fd28
maint: Update copyright years 2018-03-20 19:27:59 +01:00
Mathieu Lirzin
64ff2b1ddf
build: Support 'make installcheck'
* configure.ac: Pass 'std-options' to AM_INIT_AUTOMAKE to check that the
"--help" and "--version" options can be passed to installed programs.
* Makefile.am (installcheck-local): New rule which checks the programs
presence and configuration.
2018-03-20 02:18:05 +01:00
Mathieu Lirzin
dd9d6a6b06
build: Handle all programs names transformations
Previously only prepending a prefix was handled when installing 'crontab'.
Using the 'transform' Make macro allows the installation process to support
generic transformations as defined by the '--program-suffix' and
'--program-transform-name' configure options.

* configure.ac: Don't substitue '@real_program_prefix@'.
* Makefile.am (fpp): Remove.
(transform_exe): New macro.
[MULTI_USER] (install-exec-hook): Use it when installing 'crontab'.
2018-03-20 00:11:28 +01:00
Mathieu Lirzin
22ba12d1aa
build: Reverse '--disable-multi-user' effect
This fixes a bug where the '--disable-multi-user' was actually having the
reverse effect of installing 'cron' and 'crontab'.

* configure.ac: Reverse equality test when setting 'MULTI_USER' Automake
conditional.
2018-03-19 23:08:46 +01:00
Mathieu Lirzin
98eaa3fb9c
maint: Remove obsolete configure checks
* configure.ac: Don't check for 'sed' and 'cp' programs which are
considered portable.  Don't check for 'head' and 'which' programs which
are not required.
2018-03-19 22:37:54 +01:00
Mathieu Lirzin
c01106387f
Replace generic C wrapper with individual programs
* src/wrapper.c: Delete.
* src/crontab.c: New file.
* src/mcron.c: Likewise.
* src/cron.c: Likewise.
* configure.ac: Adapt 'AC_CONFIG_DIR' to use "src/mcron.c".
* Makefile.am (bin_crontab_SOURCES, bin_cron_SOURCES)
(bin_mcron_SOURCES): Use new files.
(bin_cron_CPPFLAGS, bin_mcron_CPPFLAGS, bin_crontab_CPPFLAGS): Delete.
2017-09-28 15:57:21 +02:00
Mathieu Lirzin
9b52c0d454
wrapper: Move 'wrap_env_path' to a new 'utils' module.
* src/wrapper.c: Move 'wrap_env_path' to ...
* src/utils.h: ... here.  New module.
* src/utils.c: New file.
* configure.ac: Use AC_PROG_RANLIB and AM_PROG_AR.
* Makefile.am (noinst_LIBRARIES, src_libmcron_a_SOURCES): New variables.
(LDADD): Add 'src/libmcron.a'.
2017-09-28 15:50:58 +02:00
Mathieu Lirzin
2b9828f303
build: Remove "--enable-debug" configure option
Unlike C code where debugging impose the "-g" compilation flags.  This
debugging option only affects Guile code, so using an environment variable
works better since it doesn't impose to recompile Mcron or to edit
"config.scm".

* configure.ac: Remove "--enable-debug" configure option.
* src/mcron/config.scm.in (config-debug): Use MCRON_DEBUG environment variable
to trigger the debug mode at runtime.
2017-09-28 15:43:21 +02:00
Mathieu Lirzin
02d67e7f0e
build: Remove "maintainer-mode" configure option.
* configure.ac: Remove "maintainer-mode" configure option.
2017-09-28 14:50:05 +02:00
Mathieu Lirzin
245f1ae338
build: Replace "--enable-no-vixie-clobber" with "--disable-multi-user".
* configure.ac: Define "--disable-multi-user" option instead of
"--enable-no-vixie-clobber".
* Makefile.am (install-exec-hook) [MULTI_USER]: Only set crontab setuid bit.
(bin_PROGRAMS): Keep only 'mcron' by default.
(bin_PROGRAMS) [MULTI_USER]: Add 'crontab'
(sbin_PROGRAMS) [MULTI_USER]: Add 'cron'.
(noinst_PROGRAMS) [!MULTI_USER]: Add 'cron' and 'crontab'.
(dist_man_MANS): Move 'crontab.1' and 'cron.8' ...
(extra_mans): here.  New variable.
(dist_man_MANS) [MULTI_USER]: Add it.
(all-local) [!MULTI_USER]: New target.  Depend on it.
(EXTRA_DIST) [!MULTI_USER]: Distribute it.
(MAINTAINERCLEANFILES): Clean it.
2017-09-28 13:19:28 +02:00
Mathieu Lirzin
c2cdfefaca
build: Rename variables for Guile install directories.
* configure.ac (moduledir, mcronmoduledir): Rename to ...
* Makefile.am (guilesitedir, pkgmoduledir): ... these.
(dist_mcronmodule_DATA, mcronmodule_DATA, mcronscriptdir)
(dist_mcronscript_DATA, mcronscript_DATA): Rename to ...
(dist_pkgmodule_DATA, pkgmodule_DATA, pkgscriptdir, dist_pkgscript_DATA)
(pkgscript_DATA): ... these.
(modules): Adapt.
2017-09-28 13:18:27 +02:00
Mathieu Lirzin
ade37c96b7
build: Support Guile 2.2.
* configure.ac: Use 'GUILE_PKG' and 'GUILE_PROGS'.  Remove explicit Guile
version check and check for 'guild'.  Honor $GUILE_EFFECTIVE_VERSION in
'moduledir'.
2017-09-28 13:15:24 +02:00
Mathieu Lirzin
a3051133c0
maint: Generate version number.
* build-aux/git-version-gen: New script.
* configure.ac (AC_INIT): Use it.
(AC_REQUIRE_AUX_FILE): Distribute it.
* Makefile.am (.version): New target.
(BUILT_SOURCES, EXTRA_DIST): Add it.
(dist-hook): Generate ".tarball-version".
* .gitignore: Update.
2016-12-28 23:06:03 +01:00
Mathieu Lirzin
2cdd544a56
maint: Reformat copyright notices and copying permission statements. 2016-12-28 22:19:03 +01:00
Mathieu Lirzin
19d68f7dd6
build: Rename 'mcron.c' to 'wrapper.c'.
* src/mcron.c: Rename to ...
* src/wrapper.c: ... this.
* Makefile.am (mcron_SOURCES, cron_SOURCES, crontab_SOURCES): Adapt to it.
* configure.ac (AC_CONFIG_SRCDIR): Likewise.
2016-12-28 22:19:03 +01:00
Mathieu Lirzin
245413041c
build: Define PACKAGE_LOAD_PATH in Makefile.
Previously PACKAGE_LOAD_PATH was set in config header which wasn't correctly
expanded due to the presence of ${prefix} in ${moduledir}.  Let 'make' handle
the expansion.

* Makefile.am (AM_CPPFLAGS): New variable.
(cron_CPPFLAGS, crontab_CPPFLAGS, mcron_CPPFLAGS): Use it.
* configure.ac (PACKAGE_LOAD_PATH): Undefine it.
(AC_CONFIG_HEADER): Remove macro.
* src/mcron.c: Adapt to it.
2016-12-01 00:15:56 +01:00
Mathieu Lirzin
10c9f31c6c
build: Use Automake warnings.
* configure.ac (AM_INIT_AUTOMAKE): Add more warnings.
* Makefile.am (AM_V_GUILEC, AM_V_GUILEC_, AM_V_GUILEC_0): Rename to ...
(guilec_verbose, guilec_verbose_, guilec_verbose_0): ... these.  Make them
more portable.  This follows an example from Automake manual.
2016-12-01 00:15:56 +01:00
Mathieu Lirzin
9d173e23bc
job-specifier: range: Add tests.
* build-aux/test-driver.scm: New script.
* configure.ac (AC_REQUIRE_AUX_FILE): Add it.
* tests/job-specifier.scm: New test.
* Makefile.am (TEST_EXTENSIONS, AM_TESTS_ENVIRONMENT, SCM_LOG_DRIVER)
(TESTS): New variables.
(EXTRA_DIST): Update.
* .gitignore: Likewise.
2016-12-01 00:15:55 +01:00
Mathieu Lirzin
52364699ed build: Use AC_CONFIG_SRCDIR safety check.
* configure.ac (AC_CONFIG_SCRDIR): Set it to 'src/mcron.c'.
2016-05-07 23:38:53 +02:00
Mathieu Lirzin
995bc9ca6e all: Rename 'scm' directory to 'src'.
* scm/mcron/config.scm.in: Rename to ...
* src/mcron/config.scm.in: ... this.
* scm/mcron/crontab.scm: Rename to ...
* src/mcron/crontab.scm: ... this.
* scm/mcron/environment.scm: Rename to ...
* src/mcron/environment.scm: ... this.
* scm/mcron/job-specifier.scm: Rename to ...
* src/mcron/job-specifier.scm: ... this.
* scm/mcron/main.scm: Rename to ...
* src/mcron/main.scm: ... this.
* scm/mcron/mcron-core.scm: Rename to ...
* src/mcron/mcron-core.scm: ... this.
* scm/mcron/redirect.scm: Rename to ...
* src/mcron/redirect.scm: ... this.
* scm/mcron/vixie-specification.scm: Rename to ...
* src/mcron/vixie-specification.scm: ... this.
* scm/mcron/vixie-time.scm: Rename to ...
* src/mcron/vixie-time.scm: ... this.
* mcron.c: Rename to ...
* src/mcron.c: ... this.
* Makefile.am: Adapt to them.
* build-aux/pre-inst-env.in: Likewise.
* configure.ac (AC_CONFIG_FILES): Likewise.
(AC_CONFIG_HEADER): Set to 'src/config.h'.
* .gitignore: Update.
2016-05-07 23:38:53 +02:00
Mathieu Lirzin
8952d2dc44 build: Support VPATH builds.
This allows using 'mcron' before it is installed without hardcoding the
local build environment in the executable.

* build-aux/pre-inst-env.in: New script.
* configure.ac (AC_CONFIG_FILES): Create it.
(AC_CONFIG_HEADER): Add 'config.h'.
(moduledir): New variable.
(PACKAGE_LOAD_PATH): new C preprocessor macro.
* mcron.c: Include "config.h".
(main): Don't overwrite Guile load paths.
(inner_main): Prepend Mcron modules load paths.
* Makefile.am (.scm.go, doc/mcron.1): Use 'pre-inst-env'.
(mcron_CFLAGS): Remove GUILE_LOAD_PATH macro.
(noinst_SCRIPTS): New variable.
* .gitignore: Update.
2016-05-07 23:38:53 +02:00
Mathieu Lirzin
b59f2f5ea6 build: Use a non-recursive makefile.
* configure.ac (AM_INIT_AUTOMAKE): Use 'subdir-objects' option.
(AC_CONFIG_FILES): Remove 'scm/mcron/makefile' and 'makefile'.  Add
'Makefile'.
* makefile.am: Delete file.  Move its content into ...
* scm/mcron/makefile.am: Likewise.
* Makefile.am: ... this.  New file.
* .gitignore: Update.
2016-05-07 16:17:52 +02:00
Mathieu Lirzin
1712722a7b build: Enable silent rules by default.
* configure.ac (AM_SILENT_RULES): Use macro.
* makefile.am (doc/mcron.1): Use $(AM_V_HELP2MAN).
(AM_V_HELP2MAN, AM_V_HELP2MAN_, AM_V_HELP2MAN_): New variables.
* scm/mcron/makefile.am (.scm.go): Use $(AM_V_GUILEC).
(AM_V_GUILEC, AM_V_GUILEC_, AM_V_GUILEC_): New variables.
2016-05-07 11:42:11 +02:00
Mathieu Lirzin
3221c05720 build: Compile and install '.go' files.
* configure.ac: Set and substitute 'mcronmoduledir'.  Check for 'guild'
which requires Guile >= 2.0.7.  Use 'AC_CANONICAL_HOST'.
* scm/mcron/makefile.am (.scm.go): New target.
(MODULES, GEN_MODULES, GOBJECTS, CLEANFILES, SUFFIXES)
(dist_mcronmodule_DATA, mcronmodule_DATA): New variables.
(pkgdata_DATA, EXTRA_DIST): Remove variables.
* .gitignore: Adjust accordingly.
2016-05-07 11:42:11 +02:00
Mathieu Lirzin
3c903bfc80 main: Add (mcron main) module.
Remove 'ed' hack to eval content of scm/mcron/main.scm in the C wrapper.
Use proper libguile functions instead.

* scm/mcron/main.scm (mcron main): New module.
(show-version, show-package-information, show-help, main): Remove
extra newline characters in strings.
* mcron.c.template: Rename to ...
* mcron.c: ... this.
(inner_main): Set current module to (mcron main).
* makefile.ed: Delete file.
* configure.ac: Remove check for 'ed'.
* makefile.am: Adjust accordingly.
* .gitignore: Likewise.
2016-05-07 11:42:00 +02:00
Mathieu Lirzin
754d1d0176 maint: Fix package name and bug reports email address.
* configure.ac (AC_INIT): Fix package name and bug reports email
address.
2016-05-07 11:32:18 +02:00
Mathieu Lirzin
c43a9173e6 maint: Use 'build-aux' directory for auxiliary build tools.
* configure.ac (AC_CONFIG_AUX_DIR): Set it to 'build-aux'.
* .gitignore: Adapt to it.
2016-05-07 11:32:18 +02:00
Mathieu Lirzin
8f430594f4 build: Fix build of the manual.
* mcron.texinfo.in: Rename to ...
* doc/mcron.texi: ... this.
* doc/config.texi.in: New file.
* configure.ac: Adapt to it.
* makefile.am: Likewise.
* .gitignore: Likewise.
* README--git: Likewise.
2016-05-07 11:32:17 +02:00
Dale Mellor
bc38f2add2 Add maintainer-mode option to configure, to pacify Debian. 2014-05-25 17:21:00 +01:00