Merge branch 'mdadm-sendmail'

* mdadm-sendmail:
  mdadm: use shared system-sendmail
This commit is contained in:
Léo Gaspard 2018-12-09 02:46:22 +09:00
commit c0663aa3f8
No known key found for this signature in database
GPG key ID: 8A55848B6090F9CF

View file

@ -1,18 +1,5 @@
{ stdenv, writeScript
, fetchurl, groff
}:
{ stdenv, writeScript, fetchurl, groff, system-sendmail }:
let
sendmail-script = writeScript "sendmail-script" ''
#!/bin/sh
if [ -x /run/wrappers/bin/sendmail ]; then
/run/wrappers/bin/sendmail "$@"
else
/run/current-system/sw/bin/sendmail "$@"
fi
'';
in
stdenv.mkDerivation rec {
name = "mdadm-4.1";
@ -23,7 +10,7 @@ stdenv.mkDerivation rec {
# This is to avoid self-references, which causes the initrd to explode
# in size and in turn prevents mdraid systems from booting.
allowedReferences = [ stdenv.cc.libc.out sendmail-script ];
allowedReferences = [ stdenv.cc.libc.out system-sendmail ];
patches = [ ./no-self-references.patch ];
@ -40,7 +27,7 @@ stdenv.mkDerivation rec {
preConfigure = ''
sed -e 's@/lib/udev@''${out}/lib/udev@' \
-e 's@ -Werror @ @' \
-e 's@/usr/sbin/sendmail@${sendmail-script}@' -i Makefile
-e 's@/usr/sbin/sendmail@${system-sendmail}@' -i Makefile
'';
meta = with stdenv.lib; {