2022-01-13 20:06:32 +00:00
|
|
|
{ lib, stdenv, fetchurl, openssl, libevent, libasr, ncurses,
|
|
|
|
pkg-config, lua5, perl, libmysqlclient, postgresql, sqlite, hiredis,
|
2020-04-24 23:36:52 +00:00
|
|
|
enableLua ? true,
|
|
|
|
enablePerl ? true,
|
|
|
|
enableMysql ? true,
|
|
|
|
enablePostgres ? true,
|
|
|
|
enableSqlite ? true,
|
|
|
|
enableRedis ? true,
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opensmtpd-extras";
|
2020-05-15 21:57:56 +00:00
|
|
|
version = "6.7.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.opensmtpd.org/archives/${pname}-${version}.tar.gz";
|
2020-05-15 21:57:56 +00:00
|
|
|
sha256 = "1b1mx71bvmv92lbm08wr2p60g3qhikvv3n15zsr6dcwbk9aqahzq";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ openssl libevent
|
2022-01-13 20:06:32 +00:00
|
|
|
libasr lua5 perl libmysqlclient postgresql sqlite hiredis ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-privsep-user=smtpd"
|
|
|
|
"--with-libevent-dir=${libevent.dev}"
|
|
|
|
|
|
|
|
"--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"
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enableLua [
|
2021-02-05 17:12:51 +00:00
|
|
|
"--with-lua=${pkg-config}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-filter-lua"
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enablePerl [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-perl=${perl}"
|
|
|
|
"--with-filter-perl"
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enableMysql [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-table-mysql"
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enablePostgres [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-table-postgres"
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enableSqlite [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-table-sqlite"
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enableRedis [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-table-redis"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString enableRedis
|
2020-04-24 23:36:52 +00:00
|
|
|
"-I${hiredis}/include/hiredis -lhiredis"
|
2021-01-15 22:18:51 +00:00
|
|
|
+ lib.optionalString enableMysql
|
2020-04-24 23:36:52 +00:00
|
|
|
" -L${libmysqlclient}/lib/mysql";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.opensmtpd.org/";
|
|
|
|
description = "Extra plugins for the OpenSMTPD mail server";
|
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ gebner ekleog ];
|
|
|
|
};
|
|
|
|
}
|