nixpkgs/pkgs/servers/mail/opensmtpd/default.nix

66 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, fetchpatch, autoconf, automake, libtool, bison
2018-10-23 15:07:17 +00:00
, libasr, libevent, zlib, libressl, db, pam
2015-04-22 22:37:51 +00:00
}:
2018-10-23 15:07:17 +00:00
stdenv.mkDerivation rec {
name = "opensmtpd-${version}";
2018-10-23 15:07:17 +00:00
version = "6.4.0p1";
2015-04-22 22:37:51 +00:00
nativeBuildInputs = [ autoconf automake libtool bison ];
2018-10-23 15:07:17 +00:00
buildInputs = [ libasr libevent zlib libressl db pam ];
src = fetchurl {
url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
2018-10-23 15:07:17 +00:00
sha256 = "1qxxhnlsmpfh9v4azgl0634955r085gsic1c66jdll21bd5w2mq8";
2015-02-13 00:24:05 +00:00
};
patches = [
./proc_path.diff
2018-10-23 15:07:17 +00:00
./fix-build.diff # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
];
2015-09-26 07:40:44 +00:00
2018-10-23 15:07:17 +00:00
# See https://github.com/OpenSMTPD/OpenSMTPD/issues/885 for the `sh bootstrap`
# requirement
postPatch = ''
substituteInPlace smtpd/parse.y \
--replace "/usr/libexec/" "$out/libexec/opensmtpd/"
substituteInPlace mk/smtpctl/Makefile.am --replace "chgrp" "true"
substituteInPlace mk/smtpctl/Makefile.am --replace "chmod 2555" "chmod 0555"
sh bootstrap
'';
2015-02-13 00:24:05 +00:00
configureFlags = [
2015-04-22 22:37:51 +00:00
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-mantype=doc"
"--with-auth-pam"
"--without-auth-bsdauth"
"--with-path-socket=/run"
2016-05-22 20:22:39 +00:00
"--with-user-smtpd=smtpd"
"--with-user-queue=smtpq"
"--with-group-queue=smtpq"
"--with-path-CAfile=/etc/ssl/certs/ca-certificates.crt"
"--with-libevent=${libevent.dev}"
"--with-table-db"
2015-02-13 00:24:05 +00:00
];
2018-10-23 15:07:17 +00:00
# See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
makeFlags = [ "CFLAGS=-ffunction-sections" "LDFLAGS=-Wl,--gc-sections" ];
2015-04-22 22:37:51 +00:00
installFlags = [
"sysconfdir=\${out}/etc"
"localstatedir=\${TMPDIR}"
];
2016-05-22 20:22:39 +00:00
meta = with stdenv.lib; {
2014-12-18 19:04:22 +00:00
homepage = https://www.opensmtpd.org/;
description = ''
A free implementation of the server-side SMTP protocol as defined by
2014-11-11 13:20:43 +00:00
RFC 5321, with some additional standard extensions
'';
2016-05-22 20:22:39 +00:00
license = licenses.isc;
platforms = platforms.linux;
2018-10-23 15:07:17 +00:00
maintainers = with maintainers; [ rickynils obadz ekleog ];
};
}