blob: d26e354d54b2776f05b9f106f2d03810202ac097 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
{
lib,
python,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
libmilter,
bsddb3,
pydns,
iana-etc,
libredirect,
pyasyncore,
}:
buildPythonPackage rec {
pname = "pymilter";
version = "1.0.5";
format = "setuptools";
src = fetchFromGitHub {
owner = "sdgathman";
repo = pname;
rev = "${pname}-${version}";
hash = "sha256-gZUWEDVZfDRiOOdG3lpiQldHxm/93l8qYVOHOEpHhzQ=";
};
buildInputs = [ libmilter ];
nativeCheckInputs = [ pyasyncore ];
propagatedBuildInputs = [
bsddb3
pydns
];
patches = [
(fetchpatch {
name = "Remove-calls-to-the-deprecated-method-assertEquals";
url = "https://github.com/sdgathman/pymilter/pull/57.patch";
hash = "sha256-/5LlDR15nMR3l7rkVjT3w4FbDTFAAgNdERWlPNL2TVg=";
})
];
preBuild = ''
sed -i 's/import thread/import _thread as thread/' Milter/greylist.py
'';
# requires /etc/resolv.conf
# testpolicy: requires makemap (#100419)
# using exec -a makemap smtpctl results in "unknown group smtpq"
preCheck = ''
echo "nameserver 127.0.0.1" > resolv.conf
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
export LD_PRELOAD=${libredirect}/lib/libredirect.so
sed -i '/testpolicy/d' test.py
rm testpolicy.py
'';
pythonImportsCheck = [ "Milter" ];
meta = with lib; {
homepage = "http://bmsi.com/python/milter.html";
description = "Python bindings for libmilter api";
maintainers = with maintainers; [ yorickvp ];
license = licenses.gpl2;
};
}
|