summary refs log tree commit diff
path: root/pkgs/tools/system/mcron
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-04-03 18:46:26 +0000
committerLudovic Courtès <ludo@gnu.org>2009-04-03 18:46:26 +0000
commit644cf259a5d8253dc0ac48917bfec110db652976 (patch)
treee8d07d4fe5bd6e9b0ee7c87559e607a92eb6183a /pkgs/tools/system/mcron
parent985178ff4b244272dd62aadd3134fd0f40087ed4 (diff)
downloadnixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.tar
nixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.tar.gz
nixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.tar.bz2
nixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.tar.lz
nixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.tar.xz
nixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.tar.zst
nixpkgs-644cf259a5d8253dc0ac48917bfec110db652976.zip
Add GNU mcron, a `cron' implementation in Guile Scheme.
svn path=/nixpkgs/trunk/; revision=14870
Diffstat (limited to 'pkgs/tools/system/mcron')
-rw-r--r--pkgs/tools/system/mcron/default.nix30
-rw-r--r--pkgs/tools/system/mcron/install-vixie-programs.patch22
2 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/tools/system/mcron/default.nix b/pkgs/tools/system/mcron/default.nix
new file mode 100644
index 00000000000..3c14d207a56
--- /dev/null
+++ b/pkgs/tools/system/mcron/default.nix
@@ -0,0 +1,30 @@
+{ fetchurl, stdenv, guile, which, ed }:
+
+stdenv.mkDerivation rec {
+  name = "mcron-1.0.4";
+
+  src = fetchurl {
+    url = "mirror://gnu/mcron/${name}.tar.gz";
+    sha256 = "0wrpi9qj50a8wfslapnkmsr6d3qx40hfw57a022m1z1syiljq4xl";
+  };
+
+  patches = [ ./install-vixie-programs.patch ];
+
+  buildInputs = [ guile which ed ];
+
+  meta = {
+    description = "GNU mcron, a flexible implementation of `cron' in Guile";
+
+    longDescription = ''
+      The GNU package mcron (Mellor's cron) is a 100% compatible
+      replacement for Vixie cron.  It is written in pure Guile, and
+      allows configuration files to be written in scheme (as well as
+      Vixie's original format) for infinite flexibility in specifying
+      when jobs should be run.  Mcron was written by Dale Mellor.
+    '';
+
+    homepage = http://www.gnu.org/software/mcron/;
+
+    license = "GPLv3+";
+  };
+}
diff --git a/pkgs/tools/system/mcron/install-vixie-programs.patch b/pkgs/tools/system/mcron/install-vixie-programs.patch
new file mode 100644
index 00000000000..98cdb6d142c
--- /dev/null
+++ b/pkgs/tools/system/mcron/install-vixie-programs.patch
@@ -0,0 +1,22 @@
+This patch allows us to install the Vixie-compatible binaries as
+non-root.
+
+--- mcron-1.0.4/makefile.in	2008-02-21 20:55:24.000000000 +0100
++++ mcron-1.0.4/makefile.in	2009-04-03 20:18:44.000000000 +0200
+@@ -872,15 +872,11 @@ mcron.c : main.scm crontab.scm makefile.
+ 	@rm -f mcron.escaped.scm > /dev/null 2>&1
+ 
+ install-exec-hook:
+-	@if [ "`id -u`" -eq "0" ]; then \
++	@if true; then \
+ 	   rm -f $(fpp)cron$(EXEEXT) > /dev/null 2>&1; \
+ 	   $(INSTALL) --mode='u=rwx' mcron$(EXEEXT) $(fpp)cron$(EXEEXT); \
+ 	   rm -f $(fpp)crontab$(EXEEXT) > /dev/null 2>&1; \
+ 	   $(INSTALL) --mode='u=rwxs,og=rx' mcron$(EXEEXT) $(fpp)crontab$(EXEEXT); \
+-	   ./mkinstalldirs -m 'u=rwx' /var/cron; \
+-	   ./mkinstalldirs -m 'u=rwx,og=rx' /var/run; \
+-	   ./mkinstalldirs -m 'u=rwx,og=rx' @GUILE_SITE@; \
+-	   ./mkinstalldirs -m 'u=rwx,og=rx' @GUILE_SITE@/mcron; \
+     else \
+        echo "+++ WARNING: NON-ROOT INSTALL: ONLY mcron WILL BE INSTALLED, NOT ANY OF THE VIXIE REPLACEMENT PROGRAMS"; \
+ 	fi