2018-06-17 13:28:23 -07:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, autoconf, automake, libtool, bison
|
2018-10-23 08:07:17 -07:00
|
|
|
, libasr, libevent, zlib, libressl, db, pam
|
2015-04-22 15:37:51 -07:00
|
|
|
}:
|
2013-07-15 06:05:03 -07:00
|
|
|
|
2018-10-23 08:07:17 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2013-07-15 06:05:03 -07:00
|
|
|
name = "opensmtpd-${version}";
|
2018-10-23 08:07:17 -07:00
|
|
|
version = "6.4.0p1";
|
2013-07-15 06:05:03 -07:00
|
|
|
|
2015-04-22 15:37:51 -07:00
|
|
|
nativeBuildInputs = [ autoconf automake libtool bison ];
|
2018-10-23 08:07:17 -07:00
|
|
|
buildInputs = [ libasr libevent zlib libressl db pam ];
|
2013-07-15 06:05:03 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-09-15 08:19:51 -07:00
|
|
|
url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
|
2018-10-23 08:07:17 -07:00
|
|
|
sha256 = "1qxxhnlsmpfh9v4azgl0634955r085gsic1c66jdll21bd5w2mq8";
|
2015-02-12 16:24:05 -08:00
|
|
|
};
|
2013-07-15 06:05:03 -07:00
|
|
|
|
2018-06-17 13:28:23 -07:00
|
|
|
patches = [
|
|
|
|
./proc_path.diff
|
2018-10-23 08:07:17 -07:00
|
|
|
./fix-build.diff # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
|
2018-06-17 13:28:23 -07:00
|
|
|
];
|
2015-09-26 00:40:44 -07:00
|
|
|
|
2018-10-23 08:07:17 -07: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
|
|
|
|
'';
|
2016-05-23 14:07:05 -07:00
|
|
|
|
2015-02-12 16:24:05 -08:00
|
|
|
configureFlags = [
|
2015-04-22 15:37:51 -07:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2013-07-15 06:05:03 -07:00
|
|
|
"--with-mantype=doc"
|
2016-05-27 05:36:42 -07:00
|
|
|
"--with-auth-pam"
|
|
|
|
"--without-auth-bsdauth"
|
|
|
|
"--with-path-socket=/run"
|
2016-05-22 13:22:39 -07:00
|
|
|
"--with-user-smtpd=smtpd"
|
|
|
|
"--with-user-queue=smtpq"
|
|
|
|
"--with-group-queue=smtpq"
|
2016-05-27 05:36:42 -07:00
|
|
|
"--with-path-CAfile=/etc/ssl/certs/ca-certificates.crt"
|
|
|
|
"--with-libevent=${libevent.dev}"
|
|
|
|
"--with-table-db"
|
2015-02-12 16:24:05 -08:00
|
|
|
];
|
2013-07-15 06:05:03 -07:00
|
|
|
|
2018-10-23 08:07:17 -07:00
|
|
|
# See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
|
|
|
|
makeFlags = [ "CFLAGS=-ffunction-sections" "LDFLAGS=-Wl,--gc-sections" ];
|
|
|
|
|
2015-04-22 15:37:51 -07:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=\${out}/etc"
|
|
|
|
"localstatedir=\${TMPDIR}"
|
|
|
|
];
|
|
|
|
|
2016-05-22 13:22:39 -07:00
|
|
|
meta = with stdenv.lib; {
|
2014-12-18 11:04:22 -08:00
|
|
|
homepage = https://www.opensmtpd.org/;
|
2013-07-15 06:05:03 -07:00
|
|
|
description = ''
|
|
|
|
A free implementation of the server-side SMTP protocol as defined by
|
2014-11-11 05:20:43 -08:00
|
|
|
RFC 5321, with some additional standard extensions
|
2013-07-15 06:05:03 -07:00
|
|
|
'';
|
2016-05-22 13:22:39 -07:00
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.linux;
|
2018-10-23 08:07:17 -07:00
|
|
|
maintainers = with maintainers; [ rickynils obadz ekleog ];
|
2013-07-15 06:05:03 -07:00
|
|
|
};
|
|
|
|
}
|