From 4187eefd6de17bbf3d9b9bca9ab0f230c21834e7efdd4476bddc27a536a36747 Mon Sep 17 00:00:00 2001 From: Todd R Date: Thu, 31 Aug 2017 16:57:14 +0000 Subject: [PATCH] Accepting request 519989 from devel:languages:python:singlespec-staging - Add use_2to3.patch * Allows setup.py to automatically convert code with 2to3 instead of having to do it manually. - singlespec auto-conversion Update to upstream ipaddr 2.1.11 - hostmask parsing bug fixed by pmarks (a nearly complete rewrite of the mask parsing code) - i97, incorrectly parses some v6 addresses. - docstring typos. - i95, refer to the nets in the exception raised by collapse_address_list - add license to boilerplate to test-2to3.sh - Require python-setuptools instead of distribute (upstreams merged) Update to upstream ipaddr 2.1.10 - i84, fix iterhosts for /31's or /127's - private method arg cleanup. - i83, docstring issue. - i87, new ipv4/ipv6 parser. patch from pmarks - i90, fix copyright. - bytes fix. patch from pmarks.- - Fix license file to have proper attribution (upstream issue 90) - Re-generated spec file with py2pack - Run testsuite (using python-nose) - Fix non-executable script rpmlint warning - Initial package, upstream ipaddr 2.1.9 OBS-URL: https://build.opensuse.org/request/show/519989 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ipaddr?expand=0&rev=38 --- python-ipaddr.changes | 13 ++++++++++++ python-ipaddr.spec | 48 +++++++++++++++++++++++++++---------------- use_2to3.patch | 24 ++++++++++++++++++++++ 3 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 use_2to3.patch diff --git a/python-ipaddr.changes b/python-ipaddr.changes index 0891011..4f00387 100644 --- a/python-ipaddr.changes +++ b/python-ipaddr.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Aug 31 16:53:09 UTC 2017 - toddrme2178@gmail.com + +- Add use_2to3.patch + * Allows setup.py to automatically convert code with 2to3 instead + of having to do it manually. + +------------------------------------------------------------------- +Thu Aug 24 13:41:27 UTC 2017 - jmatejek@suse.com + +- singlespec auto-conversion + ------------------------------------------------------------------- Wed Mar 25 16:32:23 UTC 2015 - klaussfreire@gmail.com @@ -43,3 +55,4 @@ Fri Jul 8 09:47:53 UTC 2011 - klaussfreire@users.sourceforge.net - Initial package, upstream ipaddr 2.1.9 + diff --git a/python-ipaddr.spec b/python-ipaddr.spec index d4cf186..285a66e 100644 --- a/python-ipaddr.spec +++ b/python-ipaddr.spec @@ -1,7 +1,7 @@ # # spec file for package python-ipaddr # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,25 +16,25 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-ipaddr Version: 2.1.11 Release: 0 -Url: http://code.google.com/p/ipaddr-py/ Summary: Google's IP address manipulation library License: Apache-2.0 Group: Development/Languages/Python -Source: ipaddr-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel -BuildRequires: python-nose -BuildRequires: python-setuptools -%if 0%{?suse_version} -%py_requires -%if 0%{?suse_version} > 1110 +Url: http://code.google.com/p/ipaddr-py/ +Source: https://files.pythonhosted.org/packages/source/i/ipaddr/ipaddr-%{version}.tar.gz +# PATCH-FIX-OPENSUSE - use_2to3.patch - use 2to3 to build python3 packages +Patch0: use_2to3.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pkginfo} +BuildRequires: %{python_module setuptools} +BuildRequires: python3-2to3 +BuildRequires: python-rpm-macros BuildArch: noarch -%endif -%endif -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + +%python_subpackages %description Google's IP address manipulation library. An IPv4/IPv6 manipulation library @@ -43,20 +43,32 @@ addresses and prefixes. %prep %setup -q -n ipaddr-%{version} +%patch0 -p1 sed -i "1d" ipaddr.py # Fix non-executable script %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install %check -nosetests +mkdir tester +pushd tester +%python_expand cp ../ipaddr_test.py ipaddr_test-%{$python_bin_suffix}.py -%files +if [ -e ipaddr_test-%{python3_bin_suffix}.py ] ; then + 2to3 -wn ipaddr_test-%{python3_bin_suffix}.py +fi + +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} +$python -B ipaddr_test-%{$python_bin_suffix}.py +} +popd + +%files %{python_files} %defattr(-,root,root,-) -%doc COPYING README RELEASENOTES +%doc COPYING README RELEASENOTES %{python_sitelib}/* %changelog diff --git a/use_2to3.patch b/use_2to3.patch new file mode 100644 index 0000000..036e0d9 --- /dev/null +++ b/use_2to3.patch @@ -0,0 +1,24 @@ +--- a/setup.py 2014-01-31 ++++ b/setup.py 2017-08-31 +@@ -14,17 +14,17 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-from distutils.core import setup +- +-import ipaddr ++from setuptools import setup ++from pkginfo import UnpackedSDist + + + setup(name='ipaddr', + maintainer='Google', + maintainer_email='ipaddr-py-dev@googlegroups.com', +- version=ipaddr.__version__, + url='http://code.google.com/p/ipaddr-py/', + license='Apache License, Version 2.0', ++ version=UnpackedSDist('.').version, ++ use_2to3=True, + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers',