From 9dc8a15f1a6913bc3d747743d00ac83a1d5fa4906043b8ef572159301b1c1e3e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 14 Aug 2017 08:05:12 +0000 Subject: [PATCH] Accepting request 514799 from home:mnhauke:network:automation - Convert to singlespec OBS-URL: https://build.opensuse.org/request/show/514799 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netaddr?expand=0&rev=18 --- python-netaddr.changes | 6 ++++++ python-netaddr.spec | 37 +++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/python-netaddr.changes b/python-netaddr.changes index e13266e..eed0130 100644 --- a/python-netaddr.changes +++ b/python-netaddr.changes @@ -1,3 +1,9 @@ + +------------------------------------------------------------------- +Sun Aug 6 09:31:51 UTC 2017 - mardnh@gmx.de + +- Convert to singlespec + ------------------------------------------------------------------- Sat Jan 14 14:15:17 UTC 2017 - michael@stroeder.com diff --git a/python-netaddr.spec b/python-netaddr.spec index b9c3b46..56d6939 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -16,24 +16,22 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +#%%bcond_without test Name: python-netaddr Version: 0.7.19 Release: 0 -Url: http://github.com/drkjam/netaddr Summary: Pythonic manipulation of IPv4, IPv6, CIDR, EUI and MAC network addresses License: BSD-3-Clause Group: Development/Languages/Python -Source: https://pypi.io/packages/source/n/netaddr/netaddr-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel -BuildRequires: python-setuptools -%if 0%{?suse_version} -%py_requires -%if 0%{?suse_version} > 1110 +Url: http://github.com/drkjam/netaddr +Source: https://files.pythonhosted.org/packages/source/n/netaddr/netaddr-%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +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 A pure Python network address representation and manipulation library. @@ -57,15 +55,22 @@ Included are routines for: sed -i "1d" netaddr/{ip/iana,eui/ieee,tests/__init__}.py # Fix non-executable scripts %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_clone %{buildroot}%{_bindir}/netaddr +%fdupes %{buildroot} -%files -%defattr(-,root,root,-) +%if %{with test} +%check +%python_exec setup.py test +%endif + +%files %{python_files} %{python_sitelib}/* -%{_bindir}/netaddr +%{_bindir}/netaddr-%{python_bin_suffix} +%python3_only %{_bindir}/netaddr %doc AUTHORS CHANGELOG COPYRIGHT README.md LICENSE %changelog