git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #67263 from pacien/exim-spf

exim: add SPF support (+ init libspf2 at 1.2.10)

commit7cec032b9e0cd916999850040e53f086031f5c13 authorSamuel Leathers <disasm@gmail.com> dateSat 24 Aug 2019, 00:58 (7 years ago) parent578a619f1ef419
3 files changed+52−1
pkgs/development/libraries/libspf2/default.nix+43 pkgs/servers/mail/exim/default.nix+7−1 pkgs/top-level/all-packages.nix+2
pkgs/development/libraries/libspf2/default.nixnew file+43
@@ -0,0 +1,43 @@
1+{ stdenv, fetchurl, autoreconfHook }:
2+
3+with stdenv.lib;
4+
5+stdenv.mkDerivation rec {
6+ pname = "libspf2";
7+ version = "1.2.10";
8+
9+ src = fetchurl {
10+ url = "https://www.libspf2.org/spf/libspf2-${version}.tar.gz";
11+ sha256 = "1j91p0qiipzf89qxq4m1wqhdf01hpn1h5xj4djbs51z23bl3s7nr";
12+ };
13+
14+ patches = [
15+ (fetchurl {
16+ name = "0001-gcc-variadic-macros.patch";
17+ url = "https://github.com/shevek/libspf2/commit/5852828582f556e73751076ad092f72acf7fc8b6.patch";
18+ sha256 = "1v6ashqzpr0xidxq0vpkjd8wd66cj8df01kyzj678ljzcrax35hk";
19+ })
20+ ];
21+
22+ postPatch = ''
23+ # disable static bins compilation
24+ sed -i \
25+ -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \
26+ -e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \
27+ -e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \
28+ -e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am
29+ '';
30+
31+ # autoreconf necessary because we modified automake files
32+ nativeBuildInputs = [ autoreconfHook ];
33+
34+ doCheck = true;
35+
36+ meta = {
37+ description = "Implementation of the Sender Policy Framework for SMTP authorization";
38+ homepage = https://www.libspf2.org;
39+ license = with licenses; [ lgpl21Plus bsd2 ];
40+ maintainers = with maintainers; [ pacien ];
41+ platforms = platforms.all;
42+ };
43+}
pkgs/servers/mail/exim/default.nix+7−1
@@ -3,6 +3,7 @@
33, enableMySQL ? false, mysql, zlib
44, enableAuthDovecot ? false, dovecot
55, enablePAM ? false, pam
6+, enableSPF ? true, libspf2
67}:
78
89stdenv.mkDerivation rec {
@@ -18,7 +19,8 @@ stdenv.mkDerivation rec {
1819 ++ stdenv.lib.optional enableLDAP openldap
1920 ++ stdenv.lib.optionals enableMySQL [ mysql.connector-c zlib ]
2021 ++ stdenv.lib.optional enableAuthDovecot dovecot
21− ++ stdenv.lib.optional enablePAM pam;
22+ ++ stdenv.lib.optional enablePAM pam
23+ ++ stdenv.lib.optional enableSPF libspf2;
2224
2325 preBuild = ''
2426 sed '
@@ -64,6 +66,10 @@ stdenv.mkDerivation rec {
6466 s:^\(EXTRALIBS_EXIM\)=\(.*\):\1=\2 -lpam:
6567 s:^# \(EXTRALIBS_EXIM\)=.*:\1=-lpam:
6668 ''}
69+ ${stdenv.lib.optionalString enableSPF ''
70+ s:^# \(SUPPORT_SPF\)=.*:\1=yes:
71+ s:^# \(LDFLAGS += -lspf2\):\1:
72+ ''}
6773 #/^\s*#.*/d
6874 #/^\s*$/d
6975 ' < src/EDITME > Local/Makefile
pkgs/top-level/all-packages.nix+2
@@ -4516,6 +4516,8 @@ in
45164516
45174517 libsidplayfp = callPackage ../development/libraries/libsidplayfp { };
45184518
4519+ libspf2 = callPackage ../development/libraries/libspf2 { };
4520+
45194521 libsrs2 = callPackage ../development/libraries/libsrs2 { };
45204522
45214523 libtermkey = callPackage ../development/libraries/libtermkey { };