logrotate: make mailutils overridable (#44504)

This commit is contained in:
Richard Marko 2018-08-05 22:19:35 +02:00 committed by xeji
parent 8dc20dce0a
commit 97ca78687a

View File

@ -1,4 +1,6 @@
{ stdenv, fetchFromGitHub, mailutils, gzip, popt, autoreconfHook }: { stdenv, fetchFromGitHub, gzip, popt, autoreconfHook
, mailutils ? null
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "logrotate-${version}"; name = "logrotate-${version}";
@ -14,8 +16,11 @@ stdenv.mkDerivation rec {
# Logrotate wants to access the 'mail' program; to be done. # Logrotate wants to access the 'mail' program; to be done.
patchPhase = '' patchPhase = ''
sed -i -e 's,[a-z/]\+gzip,${gzip}/bin/gzip,' \ sed -i -e 's,[a-z/]\+gzip,${gzip}/bin/gzip,' \
-e 's,[a-z/]\+gunzip,${gzip}/bin/gunzip,' \ -e 's,[a-z/]\+gunzip,${gzip}/bin/gunzip,' configure.ac
-e 's,[a-z/]\+mail,${mailutils}/bin/mail,' configure.ac
${stdenv.lib.optionalString (mailutils != null) ''
sed -i -e 's,[a-z/]\+mail,${mailutils}/bin/mail,' configure.ac
''}
''; '';
autoreconfPhase = '' autoreconfPhase = ''