Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 libmilter, 6 berkeleydb, 7 pydns, 8 iana-etc, 9 libredirect, 10 pyasyncore, 11 setuptools, 12}: 13 14buildPythonPackage rec { 15 pname = "pymilter"; 16 version = "1.0.6"; 17 pyproject = true; 18 19 src = fetchFromGitHub { 20 owner = "sdgathman"; 21 repo = "pymilter"; 22 rev = "refs/tags/pymilter-${version}"; 23 hash = "sha256-plaWXwDAIsVzEtrabZuZj7T4WNfz2ntQHgcMCVf5S70="; 24 }; 25 26 build-system = [ 27 setuptools 28 ]; 29 buildInputs = [ libmilter ]; 30 nativeCheckInputs = [ pyasyncore ]; 31 dependencies = [ 32 berkeleydb 33 pydns 34 ]; 35 36 preBuild = '' 37 sed -i 's/import thread/import _thread as thread/' Milter/greylist.py 38 ''; 39 40 # requires /etc/resolv.conf 41 # testpolicy: requires makemap (#100419) 42 # using exec -a makemap smtpctl results in "unknown group smtpq" 43 preCheck = '' 44 echo "nameserver 127.0.0.1" > resolv.conf 45 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) 46 export LD_PRELOAD=${libredirect}/lib/libredirect.so 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}