@@ -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+}