2015-11-14 21:32:51 +01:00
|
|
|
{ stdenv, fetchurl, openssl, libevent, libasr,
|
2018-11-09 14:37:09 +01:00
|
|
|
python2, pkgconfig, lua5, perl, mysql, postgresql, sqlite, hiredis,
|
|
|
|
enablePython ? true,
|
|
|
|
enableLua ? true,
|
|
|
|
enablePerl ? true,
|
|
|
|
enableMysql ? true,
|
|
|
|
enablePostgres ? true,
|
|
|
|
enableSqlite ? true,
|
|
|
|
enableRedis ? true,
|
|
|
|
}:
|
2017-12-27 16:15:33 +01:00
|
|
|
|
2015-11-14 21:32:51 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "opensmtpd-extras-${version}";
|
2018-11-09 14:37:09 +01:00
|
|
|
version = "6.4.0";
|
2015-11-14 21:32:51 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
|
2018-11-09 14:37:09 +01:00
|
|
|
sha256 = "09k25l7zy5ch3fk6qphni2h0rxdp8wacmfag1whi608dgimrhrnb";
|
2015-11-14 21:32:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ openssl libevent
|
2017-12-27 16:15:33 +01:00
|
|
|
libasr python2 lua5 perl mysql.connector-c postgresql sqlite hiredis ];
|
2015-11-14 21:32:51 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-privsep-user=smtpd"
|
2016-04-16 19:35:59 +02:00
|
|
|
"--with-libevent-dir=${libevent.dev}"
|
2015-11-14 21:32:51 +01:00
|
|
|
|
|
|
|
"--with-filter-clamav"
|
|
|
|
"--with-filter-dkim-signer"
|
|
|
|
"--with-filter-dnsbl"
|
|
|
|
"--with-filter-monkey"
|
|
|
|
"--with-filter-pause"
|
|
|
|
"--with-filter-regex"
|
|
|
|
"--with-filter-spamassassin"
|
|
|
|
"--with-filter-stub"
|
|
|
|
"--with-filter-trace"
|
|
|
|
"--with-filter-void"
|
|
|
|
"--with-queue-null"
|
|
|
|
"--with-queue-ram"
|
|
|
|
"--with-queue-stub"
|
|
|
|
"--with-table-ldap"
|
|
|
|
"--with-table-socketmap"
|
|
|
|
"--with-table-passwd"
|
|
|
|
"--with-table-stub"
|
|
|
|
"--with-scheduler-ram"
|
|
|
|
"--with-scheduler-stub"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enablePython [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-python=${python2}"
|
|
|
|
"--with-filter-python"
|
|
|
|
"--with-queue-python"
|
|
|
|
"--with-table-python"
|
|
|
|
"--with-scheduler-python"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enableLua [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-lua=${pkgconfig}"
|
|
|
|
"--with-filter-lua"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enablePerl [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-perl=${perl}"
|
|
|
|
"--with-filter-perl"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enableMysql [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-table-mysql"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enablePostgres [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-table-postgres"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enableSqlite [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-table-sqlite"
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
] ++ stdenv.lib.optional enableRedis [
|
2015-11-14 21:32:51 +01:00
|
|
|
"--with-table-redis"
|
|
|
|
];
|
|
|
|
|
2018-11-09 14:37:09 +01:00
|
|
|
NIX_CFLAGS_COMPILE =
|
|
|
|
stdenv.lib.optional enableRedis
|
|
|
|
"-I${hiredis}/include/hiredis -lhiredis"
|
|
|
|
++ stdenv.lib.optional enableMysql
|
|
|
|
"-L${mysql.connector-c}/lib/mysql";
|
2015-11-14 21:32:51 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.opensmtpd.org/;
|
|
|
|
description = "Extra plugins for the OpenSMTPD mail server";
|
|
|
|
license = licenses.isc;
|
2018-03-24 00:10:46 +01:00
|
|
|
platforms = platforms.linux;
|
2018-11-09 14:37:09 +01:00
|
|
|
maintainers = with maintainers; [ gebner ekleog ];
|
2015-11-14 21:32:51 +01:00
|
|
|
};
|
|
|
|
}
|