2017-03-27 23:42:02 +02:00
|
|
|
{ stdenv, fetchurl, lib, tls ? true, gnutls ? null }:
|
|
|
|
|
|
|
|
assert tls -> gnutls != null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2018-10-27 08:21:53 +02:00
|
|
|
version = "2.2";
|
2017-03-27 23:42:02 +02:00
|
|
|
name = "nullmailer-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://untroubled.org/nullmailer/nullmailer-${version}.tar.gz";
|
2018-10-27 08:21:53 +02:00
|
|
|
sha256 = "0md8cf90fl2yf3zh9njjy42a673v4j4ygyq95xg7fzkygdigm1lq";
|
2017-03-27 23:42:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = stdenv.lib.optional tls gnutls;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
] ++ stdenv.lib.optional tls "--enable-tls";
|
|
|
|
|
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
|
|
|
|
# We have to remove the ''var'' directory, since nix can't handle named pipes
|
|
|
|
# and we can't use it in the store anyway. Same for ''etc''.
|
|
|
|
# The second line is need, because the installer of nullmailer will copy its
|
|
|
|
# own prepared version of ''etc'' and ''var'' and also uses the prefix path (configure phase)
|
|
|
|
# for hardcoded absolute references to its own binary farm, e.g. sendmail binary is
|
|
|
|
# calling nullmailer-inject binary. Since we can't configure inside the store of
|
|
|
|
# the derivation we need both directories in the root, but don't want to put them there
|
|
|
|
# during install, hence we have to fix mumbling inside the install directory.
|
|
|
|
# This is kind of a hack, but the only way I know of, yet.
|
|
|
|
postInstall = ''
|
|
|
|
rm -rf $out/var/ $out/etc/
|
|
|
|
mv $out/$out/* $out/
|
|
|
|
rmdir $out/$out
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://untroubled.org/nullmailer/;
|
2017-03-27 23:42:02 +02:00
|
|
|
description = ''
|
|
|
|
A sendmail/qmail/etc replacement MTA for hosts which relay to a fixed set of smart relays.
|
|
|
|
It is designed to be simple to configure, secure, and easily extendable.
|
|
|
|
'';
|
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers ; [ sargon ];
|
|
|
|
};
|
|
|
|
}
|