nixpkgs-suyu/pkgs/tools/networking/ssmtp/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

{lib, stdenv, fetchurl, tlsSupport ? true, openssl ? null}:
assert tlsSupport -> openssl != null;
stdenv.mkDerivation {
name = "ssmtp-2.64";
src = fetchurl {
url = "mirror://debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2";
sha256 = "0dps8s87ag4g3jr6dk88hs9zl46h3790marc5c2qw7l71k4pvhr2";
};
# A request has been made to merge this patch into ssmtp.
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858781
patches = [ ./ssmtp_support_AuthPassFile_parameter.patch ];
2018-07-25 23:44:21 +02:00
configureFlags = [
"--sysconfdir=/etc"
2021-01-15 10:19:50 +01:00
(lib.enableFeature tlsSupport "ssl")
2018-07-25 23:44:21 +02:00
];
postConfigure =
''
# Don't run the script that interactively generates a config file.
# Also don't install the broken, cyclic symlink /lib/sendmail.
sed -e '/INSTALLED_CONFIGURATION_FILE/d' \
-e 's|/lib/sendmail|$(TMPDIR)/sendmail|' \
-i Makefile
2018-11-29 05:50:02 +01:00
substituteInPlace Makefile \
--replace '$(INSTALL) -s' '$(INSTALL) -s --strip-program $(STRIP)'
'';
2019-11-05 02:10:31 +01:00
installFlags = [ "etcdir=$(out)/etc" ];
installTargets = [ "install" "install-sendmail" ];
2021-01-15 10:19:50 +01:00
buildInputs = lib.optional tlsSupport openssl;
2021-01-15 10:19:50 +01:00
NIX_LDFLAGS = lib.optionalString tlsSupport "-lcrypto";
2019-01-04 20:33:51 +01:00
meta = with lib; {
platforms = platforms.linux;
2018-08-11 14:34:24 +02:00
license = licenses.gpl2;
maintainers = with maintainers; [ basvandijk ];
};
}