diff --git a/pypolicyd-spf-1.3.1-ipaddress.patch b/pypolicyd-spf-1.3.1-ipaddress.patch new file mode 100644 index 0000000..76d5db4 --- /dev/null +++ b/pypolicyd-spf-1.3.1-ipaddress.patch @@ -0,0 +1,38 @@ +--- pypolicyd-spf-1.3.1/policyd-spf.original 2014-06-04 15:08:50.000000000 +1000 ++++ pypolicyd-spf-1.3.1/policyd-spf 2015-06-18 14:28:55.300135301 +1000 +@@ -38,10 +38,7 @@ + if int(micro) < 7: + raise ImportError("At least pyspf 2.0.7 is required.") + import policydspfsupp +-try: +- import ipaddress +-except ImportError: +- import ipaddr as ipaddress ++import ipaddress + try: + import authres + except: +@@ -54,6 +51,12 @@ + def _cidrmatch(ip, netwrk): + """Match connect IP against a CIDR network of other IP addresses.""" + ++ if sys.version_info.major < 3: ++ if isinstance(ip, str): ++ ip = ip.decode('ascii') ++ if isinstance(netwrk, str): ++ netwrk = netwrk.decode('ascii') ++ + try: + address = ipaddress.ip_address(ip) + except AttributeError: +@@ -65,6 +68,10 @@ + return network.__contains__(address) + + def _get_rdns_lookup(ip): ++ if sys.version_info.major < 3: ++ if isinstance(ip, str): ++ ip = ip.decode('ascii') ++ + try: + address = ipaddress.ip_address(ip) + except AttributeError: diff --git a/pypolicyd-spf.spec b/pypolicyd-spf.spec index cf9ef95..96efbef 100644 --- a/pypolicyd-spf.spec +++ b/pypolicyd-spf.spec @@ -1,14 +1,16 @@ Name: pypolicyd-spf Version: 1.3.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: SPF Policy Server for Postfix (Python implementation) License: ASL 2.0 URL: https://launchpad.net/%{name} Source0: https://launchpad.net/%{name}/1.3/%{version}/+download/%{name}-%{version}.tar.gz +Patch0: pypolicyd-spf-1.3.1-ipaddress.patch + BuildArch: noarch -Requires: postfix, python-pyspf, python-ipaddr +Requires: postfix, python-pyspf, python-ipaddress BuildRequires: python2-devel %description @@ -22,6 +24,7 @@ range of requirements. %prep %setup -q +%patch0 -p1 -b .ipaddress %build @@ -49,6 +52,9 @@ range of requirements. %changelog +* Thu Jun 18 2015 Bojan Smojver 1.3.1-3 +- user python-ipaddress instead of python-ipaddr + * Wed Oct 1 2014 Bojan Smojver 1.3.1-2 - fix bug #1138206