From 5f9fd40b5c0cb316394313042962ced71fd77a6e Mon Sep 17 00:00:00 2001
From: Daniel Black <dragonheart@gentoo.org>
Date: Sun, 18 Jul 2010 08:47:09 +0000
Subject: version bump. python3 friendlyness as per #313479. Homepage/URL move
 as per bug #312457 thanks Matthias Dahl (Portage version: 2.2_rc67/cvs/Linux
 x86_64)

---
 mail-filter/pypolicyd-spf/ChangeLog                |  14 ++-
 mail-filter/pypolicyd-spf/files/0.7.3-2to3.patch   |  85 +++++++++++++++
 mail-filter/pypolicyd-spf/files/0.8.0-2to3.patch   | 114 +++++++++++++++++++++
 .../pypolicyd-spf/pypolicyd-spf-0.7.3.ebuild       |  29 ++++++
 mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.ebuild |  16 ---
 .../pypolicyd-spf/pypolicyd-spf-0.8.0.ebuild       |  30 ++++++
 6 files changed, 270 insertions(+), 18 deletions(-)
 create mode 100644 mail-filter/pypolicyd-spf/files/0.7.3-2to3.patch
 create mode 100644 mail-filter/pypolicyd-spf/files/0.8.0-2to3.patch
 create mode 100644 mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.3.ebuild
 delete mode 100644 mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.ebuild
 create mode 100644 mail-filter/pypolicyd-spf/pypolicyd-spf-0.8.0.ebuild

(limited to 'mail-filter/pypolicyd-spf')

diff --git a/mail-filter/pypolicyd-spf/ChangeLog b/mail-filter/pypolicyd-spf/ChangeLog
index b9c8de114e47..7a1b36ce33c5 100644
--- a/mail-filter/pypolicyd-spf/ChangeLog
+++ b/mail-filter/pypolicyd-spf/ChangeLog
@@ -1,6 +1,16 @@
 # ChangeLog for mail-filter/pypolicyd-spf
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/pypolicyd-spf/ChangeLog,v 1.9 2009/11/19 16:18:54 maekke Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/pypolicyd-spf/ChangeLog,v 1.10 2010/07/18 08:47:07 dragonheart Exp $
+
+*pypolicyd-spf-0.8.0 (18 Jul 2010)
+*pypolicyd-spf-0.7.3 (18 Jul 2010)
+
+  18 Jul 2010; Daniel Black <dragonheart@gentoo.org>
+  -pypolicyd-spf-0.7.ebuild, +pypolicyd-spf-0.7.3.ebuild,
+  +pypolicyd-spf-0.8.0.ebuild, +files/0.7.3-2to3.patch,
+  +files/0.8.0-2to3.patch:
+  version bump. python3 friendlyness as per #313479. Homepage/URL move as
+  per bug #312457 thanks Matthias Dahl
 
   19 Nov 2009; Markus Meier <maekke@gentoo.org> pypolicyd-spf-0.7.1.ebuild:
   amd64/x86 stable, bug #293032
diff --git a/mail-filter/pypolicyd-spf/files/0.7.3-2to3.patch b/mail-filter/pypolicyd-spf/files/0.7.3-2to3.patch
new file mode 100644
index 000000000000..68ce6151e1f8
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/files/0.7.3-2to3.patch
@@ -0,0 +1,85 @@
+--- ./policydspfsupp.py (original)
++++ ./policydspfsupp.py (refactored)
+@@ -24,7 +24,7 @@
+ import sys
+ import string
+ import re
+-import urllib
++import urllib.request, urllib.parse, urllib.error
+ import stat
+ 
+ 
+@@ -57,7 +57,7 @@
+     if filename != None:
+         try:
+             readConfigFile(filename, config)
+-        except Exception, e:
++        except Exception as e:
+             if useSyslog:
+                 syslog.syslog(e.args[0])
+             if useStderr:
+@@ -75,7 +75,7 @@
+    def __call__(self, etype, evalue, etb):
+       import traceback
+       tb = traceback.format_exception(*(etype, evalue, etb))
+-      tb = map(string.rstrip, tb)
++      tb = list(map(string.rstrip, tb))
+       tb = string.join(tb, '\n')
+       for line in string.split(tb, '\n'):
+          if self.useSyslog:
+@@ -95,7 +95,7 @@
+     Address can either be a domain name, or local part.
+     Returns the quoted address.'''
+ 
+-    s = urllib.quote(s, '@_-+')
++    s = urllib.parse.quote(s, '@_-+')
+     if len(s) > 0 and s[0] == '.': s = '%2e' + s[1:]
+     return(s)
+ 
+@@ -104,7 +104,7 @@
+ def unquoteAddress(s):
+     '''Undo the quoting of an address.  Returns the unquoted address.'''
+ 
+-    return(urllib.unquote(s))
++    return(urllib.parse.unquote(s))
+ 
+ 
+ ###############################################################
+@@ -137,7 +137,7 @@
+     #  check to see if it's a file
+     try:
+         mode = os.stat(path)[0]
+-    except OSError, e:
++    except OSError as e:
+         syslog.syslog('ERROR stating "%s": %s' % ( path, e.strerror ))
+         return(configData)
+     if not stat.S_ISREG(mode):
+@@ -153,7 +153,7 @@
+         #  parse line
+         line = string.strip(string.split(line, '#', 1)[0])
+         if not line: continue
+-        data = map(string.strip, string.split(line, '=', 1))
++        data = list(map(string.strip, string.split(line, '=', 1)))
+         if len(data) != 2:
+             if len(data) == 1:
+                 if debugLevel >= 1:
+--- policyd-spf (original)
++++ policyd-spf (refactored)
+@@ -273,7 +273,7 @@
+         instance = str(int(random.random()*100000))
+     # This is to prevent multiple headers being prepended
+     # for multi-recipient mail.
+-    found_instance = instance_dict.has_key(instance)
++    found_instance = instance in instance_dict
+     '''Data structure for results is a list of:
+         [0] SPF result 
+         [1] SPF reason
+@@ -400,7 +400,7 @@
+ configFile = '/etc/python-policyd-spf/policyd-spf.conf'
+ if len(sys.argv) > 1:
+     if sys.argv[1] in ( '-?', '--help', '-h' ):
+-        print 'usage: policyd-spf [<configfilename>]'
++        print('usage: policyd-spf [<configfilename>]')
+         sys.exit(1)
+     configFile = sys.argv[1]
+ 
diff --git a/mail-filter/pypolicyd-spf/files/0.8.0-2to3.patch b/mail-filter/pypolicyd-spf/files/0.8.0-2to3.patch
new file mode 100644
index 000000000000..f842e03d3a9a
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/files/0.8.0-2to3.patch
@@ -0,0 +1,114 @@
+--- ./policydspfsupp.py (original)
++++ ./policydspfsupp.py (refactored)
+@@ -24,7 +24,7 @@
+ import sys
+ import string
+ import re
+-import urllib
++import urllib.request, urllib.parse, urllib.error
+ import stat
+ 
+ 
+@@ -57,7 +57,7 @@
+     if filename != None:
+         try:
+             readConfigFile(filename, config)
+-        except Exception, e:
++        except Exception as e:
+             if useSyslog:
+                 syslog.syslog(e.args[0])
+             if useStderr:
+@@ -75,7 +75,7 @@
+    def __call__(self, etype, evalue, etb):
+       import traceback
+       tb = traceback.format_exception(*(etype, evalue, etb))
+-      tb = map(string.rstrip, tb)
++      tb = list(map(string.rstrip, tb))
+       tb = string.join(tb, '\n')
+       for line in string.split(tb, '\n'):
+          if self.useSyslog:
+@@ -122,7 +122,7 @@
+     #  check to see if it's a file
+     try:
+         mode = os.stat(path)[0]
+-    except OSError, e:
++    except OSError as e:
+         syslog.syslog('ERROR stating "%s": %s' % ( path, e.strerror ))
+         return(configData)
+     if not stat.S_ISREG(mode):
+@@ -138,7 +138,7 @@
+         #  parse line
+         line = string.strip(string.split(line, '#', 1)[0])
+         if not line: continue
+-        data = map(string.strip, string.split(line, '=', 1))
++        data = list(map(string.strip, string.split(line, '=', 1)))
+         if len(data) != 2:
+             if len(data) == 1:
+                 if debugLevel >= 1:
+--- ./policydspfuser.py (original)
++++ ./policydspfuser.py (refactored)
+@@ -52,7 +52,7 @@
+     #  check to see if it's a file
+     try:
+         mode = os.stat(path)[0]
+-    except OSError, e:
++    except OSError as e:
+         syslog.syslog('ERROR stating "%s": %s' % ( path, e.strerror ))
+         return(configData)
+ 
+@@ -65,7 +65,7 @@
+         #  parse line
+         line = string.strip(string.split(line, '#', 1)[0])
+         if not line: continue
+-        data = map(string.strip, string.split(line, ',', 1))
++        data = list(map(string.strip, string.split(line, ',', 1)))
+         user, value = data
+         if user != recipient:
+             peruser = False
+@@ -75,7 +75,7 @@
+         for valuepair in valuelist:
+             key, item = string.split(valuepair, '=')
+             values[key] = item
+-        for config in values.iteritems():
++        for config in values.items():
+             #  check validity of name
+             conversion = nameConversion.get(config[0])
+             name, value = config
+--- policyd-spf (original)
++++ policyd-spf (refactored)
+@@ -241,7 +241,7 @@
+                 else:
+                     # Reverse lookup didn't find any records, so don't continue with the check
+                     rDNSName = None
+-            except spf.TempError, e:
++            except spf.TempError as e:
+                 # DNS timeout - continue with the base SPF check.
+                 rDNSName = None
+             if (rDNSName is not None):
+@@ -275,7 +275,7 @@
+         instance = str(int(random.random()*100000))
+     # This is to prevent multiple headers being prepended
+     # for multi-recipient mail.
+-    if instance_dict.has_key(instance):
++    if instance in instance_dict:
+         found_instance = instance_dict[instance]
+     else:
+         found_instance = []
+@@ -570,7 +570,7 @@
+ configFile = '/etc/python-policyd-spf/policyd-spf.conf'
+ if len(sys.argv) > 1:
+     if sys.argv[1] in ( '-?', '--help', '-h' ):
+-        print 'usage: policyd-spf [<configfilename>]'
++        print('usage: policyd-spf [<configfilename>]')
+         sys.exit(1)
+     configFile = sys.argv[1]
+ 
+@@ -593,7 +593,7 @@
+     if not line:
+         peruser = False
+         if debugLevel >= 4: syslog.syslog('Found the end of entry')
+-        configData = dict(configGlobal.items())
++        configData = dict(list(configGlobal.items()))
+         if configData.get('Per_User'):
+             import policydspfuser
+             configData, peruser = policydspfuser.datacheck(configData, data.get('recipient'))
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.3.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.3.ebuild
new file mode 100644
index 000000000000..a1117a7ef6c5
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.3.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.3.ebuild,v 1.1 2010/07/18 08:47:07 dragonheart Exp $
+
+
+EAPI="3"
+#PYTHON_DEPEND="*"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit distutils eutils versionator
+
+DESCRIPTION="Python based policy daemon for Postfix SPF checking"
+SRC_URI="http://launchpad.net/pypolicyd-spf/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+HOMEPAGE="https://launchpad.net/pypolicyd-spf"
+
+IUSE=""
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=">=dev-python/pyspf-2.0.3"
+
+
+src_prepare() {
+	sed -i -e 's/[\xc2\xa9]//g' policydspfsupp.py policydspfuser.py policyd-spf
+	epatch "${FILESDIR}"/${PV}-2to3.patch
+	distutils_src_prepare
+}
+
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.ebuild
deleted file mode 100644
index 678757e69457..000000000000
--- a/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.ebuild
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/pypolicyd-spf/pypolicyd-spf-0.7.ebuild,v 1.1 2008/06/26 08:36:04 dragonheart Exp $
-
-inherit distutils eutils
-
-DESCRIPTION="Python based policy daemon for Postfix SPF checking"
-SRC_URI="http://www.openspf.org/blobs/${P}.tar.gz"
-HOMEPAGE="http://www.openspf.org/Software"
-
-IUSE=""
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="~amd64 ~x86"
-
-DEPEND=">=dev-python/pyspf-2.0.3"
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-0.8.0.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-0.8.0.ebuild
new file mode 100644
index 000000000000..0e8a9fac01e7
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/pypolicyd-spf-0.8.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/pypolicyd-spf/pypolicyd-spf-0.8.0.ebuild,v 1.1 2010/07/18 08:47:08 dragonheart Exp $
+
+
+EAPI="3"
+#PYTHON_DEPEND="*"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit distutils eutils versionator
+
+DESCRIPTION="Python based policy daemon for Postfix SPF checking"
+SRC_URI="http://launchpad.net/pypolicyd-spf/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+HOMEPAGE="https://launchpad.net/pypolicyd-spf"
+
+IUSE=""
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=">=dev-python/pyspf-2.0.3"
+
+
+src_prepare() {
+	sed -i -e 's/[\xc2\xa9]//g' -e 's/FL/F/g'  policydspfsupp.py policydspfuser.py policyd-spf
+	epatch "${FILESDIR}"/0.8.0-2to3.patch
+	distutils_src_prepare
+
+}
+
-- 
cgit v1.2.3-65-gdbad