about summary refs log tree commit diff
path: root/pkgs/tools/system/cron
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-10-10 11:07:15 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-10-10 11:07:15 +0000
commit710f6c165b317d2dc763289cd182f19595142af1 (patch)
tree9adb4a4e916e8cecd9abf2947606701be78fca29 /pkgs/tools/system/cron
parent08d3f9460dba35bbdd04fd256f44baceda60f9c5 (diff)
Making the vixie cron have a configurable sendmail path (for nixos)
svn path=/nixpkgs/trunk/; revision=24196
Diffstat (limited to 'pkgs/tools/system/cron')
-rw-r--r--pkgs/tools/system/cron/default.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/tools/system/cron/default.nix b/pkgs/tools/system/cron/default.nix
index 2f7bffcbe31df..17583f612dc02 100644
--- a/pkgs/tools/system/cron/default.nix
+++ b/pkgs/tools/system/cron/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{stdenv, fetchurl, sendmailPath ? "/usr/sbin/sendmail"}:
 
 stdenv.mkDerivation {
   name = "cron-4.1";
@@ -9,10 +9,15 @@ stdenv.mkDerivation {
 
   unpackCmd = "(mkdir cron && cd cron && sh $curSrc)";
 
-  preBuild = "
+  preBuild = ''
     substituteInPlace Makefile --replace ' -o root' ' ' --replace 111 755
-    makeFlags=\"DESTROOT=$out\"
-  ";
+    makeFlags="DESTROOT=$out"
+
+    # We want to ignore the $glibc/include/paths.h definition of
+    # sendmail path
+    echo "#undef _PATH_SENDMAIL" >> pathnames.h
+    echo '#define _PATH_SENDMAIL "${sendmailPath}"' >> pathnames.h
+  '';
 
   preInstall = "ensureDir $out/bin $out/sbin $out/share/man/man1 $out/share/man/man5 $out/share/man/man8";