From aa825ebc5d5a868515916b982a572b62ca1b6dede739acf4b5e93cb8c86776b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 6 Sep 2018 09:03:37 +0000 Subject: [PATCH] Accepting request 633530 from home:Pharaoh_Atem:SUSE_Pagure - Initial packaging OBS-URL: https://build.opensuse.org/request/show/633530 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pymilter?expand=0&rev=1 --- .gitattributes | 23 ++++++++ .gitignore | 1 + pymilter-1.0.2.tar.gz | 3 + pymilter-dns_dsn.patch | 36 ++++++++++++ python-pymilter.changes | 4 ++ python-pymilter.spec | 100 ++++++++++++++++++++++++++++++++++ tmpfiles-python-pymilter.conf | 1 + 7 files changed, 168 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pymilter-1.0.2.tar.gz create mode 100644 pymilter-dns_dsn.patch create mode 100644 python-pymilter.changes create mode 100644 python-pymilter.spec create mode 100644 tmpfiles-python-pymilter.conf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pymilter-1.0.2.tar.gz b/pymilter-1.0.2.tar.gz new file mode 100644 index 0000000..8b0df45 --- /dev/null +++ b/pymilter-1.0.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f513053f5fc9b0c31d886d8412a411bdc958786a673d7071b1bd521498b01153 +size 1022535 diff --git a/pymilter-dns_dsn.patch b/pymilter-dns_dsn.patch new file mode 100644 index 0000000..84c6dcb --- /dev/null +++ b/pymilter-dns_dsn.patch @@ -0,0 +1,36 @@ +diff --git a/Milter/dns.py b/Milter/dns.py +index 67bed03..e4a9751 100644 +--- a/Milter/dns.py ++++ b/Milter/dns.py +@@ -26,8 +26,8 @@ def DNSLookup(name, qtype): + # A RR as dotted quad. For consistency, this driver should + # return both as binary string. + return [((a['name'], a['typename']), a['data']) for a in resp.answers] +- except IOError, x: +- raise DNSError, str(x) ++ except IOError as x: ++ raise DNSError(str(x)) + + class Session(object): + """A Session object has a simple cache with no TTL that is valid +diff --git a/Milter/dsn.py b/Milter/dsn.py +index 021d9d2..b27f749 100644 +--- a/Milter/dsn.py ++++ b/Milter/dsn.py +@@ -142,13 +142,13 @@ def send_dsn(mailfrom,receiver,msg=None,timeout=600,session=None,ourfrom=''): + if badrcpts: + return badrcpts + return None # success +- except smtplib.SMTPRecipientsRefused,x: ++ except smtplib.SMTPRecipientsRefused as x: + if len(x.recipients) == 1: + return x.recipients.values()[0] # permanent error + return x.recipients +- except smtplib.SMTPSenderRefused,x: ++ except smtplib.SMTPSenderRefused as x: + return x.args[:2] # does not accept DSN +- except smtplib.SMTPDataError,x: ++ except smtplib.SMTPDataError as x: + return x.args # permanent error + except smtplib.SMTPException: + pass # any other error, try next MX diff --git a/python-pymilter.changes b/python-pymilter.changes new file mode 100644 index 0000000..686c626 --- /dev/null +++ b/python-pymilter.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu Sep 6 02:33:45 UTC 2018 - Neal Gompa + +- Initial packaging diff --git a/python-pymilter.spec b/python-pymilter.spec new file mode 100644 index 0000000..0377ab8 --- /dev/null +++ b/python-pymilter.spec @@ -0,0 +1,100 @@ +# +# spec file for package python-pymilter +# +# Copyright (c) 2018 Neal Gompa . +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +# we don't want to provide private python extension libs +%global __provides_exclude_from ^(%{python2_sitearch}/.*\\.so|%{python3_sitearch}/.*\\.so)$ + +# Python 2 module isn't building properly and we don't really need it right now anyway... +%global skip_python2 1 + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Summary: Python interface to sendmail milter API +Name: python-pymilter +Version: 1.0.2 +Release: 0 +License: GPL-2.0-or-later +Group: Development/Libraries/Python +URL: http://www.bmsi.com/python/milter.html +Source0: https://github.com/sdgathman/pymilter/archive/pymilter-%{version}.tar.gz +Source1: tmpfiles-python-pymilter.conf +# Backported patch for Python 3 +Patch0: pymilter-dns_dsn.patch +BuildRequires: fdupes +BuildRequires: sendmail-devel >= 8.13 +BuildRequires: systemd-rpm-macros +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +%if "%{python_flavor}" == "python2" +Requires: python2-pydns +%endif +%if "%{python_flavor}" == "python3" +Requires: python3-py3dns +%endif +# Common subpackage named as such to avoid creating flavor packages +Requires: pymilter-common = %{version}-%{release} +%python_subpackages + +%description +This is a python extension module to enable python scripts to +attach to sendmail's libmilter functionality. Additional python +modules provide for navigating and modifying MIME parts, sending +DSNs, and doing CBV. + +%package -n pymilter-common +Summary: Common files for pymilter +BuildArch: noarch +Requires(post): systemd + +%description -n pymilter-common +This package contains the common files used for pymilter. + +%prep +%autosetup -n pymilter-pymilter-%{version} -p1 + +# Patch from within the source tree (*sigh*)... +patch -p1 -b -z .py3