1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 libmilter,
6 berkeleydb,
7 py3dns,
8 pyasyncore,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "pymilter";
14 version = "1.0.6";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "sdgathman";
19 repo = "pymilter";
20 tag = "pymilter-${version}";
21 hash = "sha256-plaWXwDAIsVzEtrabZuZj7T4WNfz2ntQHgcMCVf5S70=";
22 };
23
24 build-system = [
25 setuptools
26 ];
27
28 buildInputs = [ libmilter ];
29
30 nativeCheckInputs = [
31 pyasyncore
32 ];
33
34 dependencies = [
35 berkeleydb
36 py3dns
37 ];
38
39 preBuild = ''
40 substituteInPlace Milter/greylist.py \
41 --replace-fail "import thread" "import _thread as thread"
42 '';
43
44 # testpolicy: requires makemap (#100419)
45 # using exec -a makemap smtpctl results in "unknown group smtpq"
46 preCheck = ''
47 sed -i '/testpolicy/d' test.py
48 rm testpolicy.py
49 '';
50
51 pythonImportsCheck = [ "Milter" ];
52
53 meta = with lib; {
54 homepage = "http://bmsi.com/python/milter.html";
55 description = "Python bindings for libmilter api";
56 maintainers = with maintainers; [ yorickvp ];
57 license = licenses.gpl2;
58 };
59}