Unverified Commit 16bc8a29 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #195197 from yorickvP/upd-pypolicy

parents 5f34f1ff 3d8ffea1
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, m4 }:
{ lib, stdenv, fetchurl, m4, fixDarwinDylibNames }:

stdenv.mkDerivation rec {
  pname = "libmilter";
@@ -34,7 +34,11 @@ stdenv.mkDerivation rec {

  patches = [ ./install.patch ./sharedlib.patch ./glibc-2.30.patch ./darwin.patch ];

  nativeBuildInputs = [ m4 ];
  nativeBuildInputs = [ m4 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;

  postInstall = lib.optionalString stdenv.isDarwin ''
    fixDarwinDylibNames $out/lib/libmilter.dylib.1
  '';

  meta = with lib; {
    description = "Sendmail Milter mail filtering API library";
+40 −0
Original line number Diff line number Diff line
{ lib, python, buildPythonPackage, fetchFromGitHub, libmilter, bsddb3, pydns, iana-etc, libredirect }:

buildPythonPackage rec {
  pname = "pymilter";
  version = "1.0.5";

  src = fetchFromGitHub {
    owner = "sdgathman";
    repo = pname;
    rev = "${pname}-${version}";
    hash = "sha256-gZUWEDVZfDRiOOdG3lpiQldHxm/93l8qYVOHOEpHhzQ=";
  };

  buildInputs = [ libmilter ];
  propagatedBuildInputs = [ bsddb3 pydns ];

  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;
  };
}
+30 −0
Original line number Diff line number Diff line
{ lib, buildPythonApplication, fetchurl, pyspf }:
{ lib, buildPythonApplication, fetchurl, pyspf, dnspython, authres, pymilter }:

buildPythonApplication rec {
  pname = "pypolicyd-spf";
  majorVersion = "2.0";
  version = "${majorVersion}.2";
  pname = "spf-engine";
  version = "2.9.3";

  src = fetchurl {
    url = "https://launchpad.net/pypolicyd-spf/${majorVersion}/${version}/+download/${pname}-${version}.tar.gz";
    sha256 = "1nm8y1jjgx6mxrbcxrbdnmkf8vglwp0wiw6jipzh641wb24gi76z";
    url = "https://launchpad.net/${pname}/${lib.versions.majorMinor version}/${version}/+download/${pname}-${version}.tar.gz";
    sha256 = "sha256-w0Nb+L/Os3KPApENoylxCVaCD4FvgmvpfVvwCkt2IDE=";
  };

  propagatedBuildInputs = [ pyspf ];
  propagatedBuildInputs = [ pyspf dnspython authres pymilter ];

  preBuild = ''
  pythonImportsCheck = [
    "spf_engine"
    "spf_engine.milter_spf"
    "spf_engine.policyd_spf"
  ];

  postPatch = ''
    substituteInPlace setup.py --replace "'/etc'" "'$out/etc'"
  '';

  meta = with lib; {
    homepage = "https://launchpad.net/pypolicyd-spf/";
    homepage = "https://launchpad.net/spf-engine/";
    description = "Postfix policy engine for Sender Policy Framework (SPF) checking";
    maintainers = with maintainers; [ abbradar ];
    license = licenses.asl20;
    platforms = platforms.all;
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -1234,6 +1234,7 @@ mapAliases ({
  pyload = throw "pyload has been removed from nixpkgs, as it was unmaintained"; # Added 2021-03-21
  pynagsystemd = throw "pynagsystemd was removed as it was unmaintained and incompatible with recent systemd versions. Instead use its fork check_systemd"; # Added 2020-10-24
  pyo3-pack = maturin;
  pypolicyd-spf = spf-engine; # Added 2022-10-09
  pyrex = throw "pyrex has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-12
  pyrex095 = throw "pyrex has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-12
  pyrex096 = throw "pyrex has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-12
+1 −1
Original line number Diff line number Diff line
@@ -24383,7 +24383,7 @@ with pkgs;
  pure-ftpd = callPackage ../servers/ftp/pure-ftpd { };
  pypolicyd-spf = python3.pkgs.callPackage ../servers/mail/pypolicyd-spf { };
  spf-engine = python3.pkgs.callPackage ../servers/mail/spf-engine { };
  pypiserver = with python3Packages; toPythonApplication pypiserver;
Loading