python-IPy/python-IPy.spec

105 lines
2.5 KiB
RPMSpec
Raw Normal View History

2019-09-30 11:15:03 -04:00
Name: python-IPy
Version: 0.81
2019-11-06 19:48:32 +08:00
Release: 25
2019-09-30 11:15:03 -04:00
Summary: Class and Tools for Handling of IPv4 and IPv6 Addresses and Networks
License: BSD
URL: https://github.com/autocracy/python-ipy
Source0: https://pypi.python.org/packages/source/I/IPy/IPy-%{version}.tar.gz
Patch6000: 0003-Revert-IPSet-doesn-t-need-MutableSet-inheritance.-Tr.patch
Patch6001: 0034-57-obey-explicit-version-for-small-int-as-string.patch
BuildArch: noarch
%if 0%{?with_python2}
BuildRequires: python2-devel python2-setuptools
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel python3-setuptools
%endif
%description
The IP class allows a comfortable parsing and handling for most notations
in use for IPv4 and IPv6 addresses and networks. It was greatly inspired
by RIPE's Perl module NET::IP's interface but doesn't share the
implementation. It doesn't share non-CIDR netmasks, so funky stuff like a
netmask of 0xffffff0f can't be done here.
%if 0%{?with_python2}
%package -n python2-IPy
Summary: Python2 package for python-IPy
%{?python_provide: %python_provide python2-IPy}
%description -n python2-IPy
Python2 package for python-IPy
%endif
%if 0%{?with_python3}
%package -n python3-IPy
Summary: Python3 package for python-IPy
%{?python_provide: %python_provide python3-IPy}
Provides: %{name}-python3 = %{version}-%{release}
Obsoletes: %{name}-python3
%description -n python3-IPy
Python3 package for python-IPy
%endif
%prep
%autosetup -n IPy-%{version} -p1
%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install
%endif
%check
%if 0%{?with_python2}
PYTHONPATH=$PWD %{__python2} test/test_IPy.py
PYTHONPATH=$PWD %{__python2} test_doc.py
%endif
%if 0%{?with_python3}
PYTHONPATH=$PWD %{__python3} test/test_IPy.py
#PYTHONPATH=$PWD %{__python3} test_doc.py # FAILS
%endif
%if 0%{?with_python2}
%files -n python2-IPy
%defattr(-,root,root)
2019-11-06 19:48:32 +08:00
%license COPYING
%doc AUTHORS
2019-09-30 11:15:03 -04:00
%{python2_sitelib}/*
%endif
%if 0%{?with_python3}
%files -n python3-IPy
%defattr(-,root,root)
2019-11-06 19:48:32 +08:00
%license COPYING
%doc AUTHORS
2019-09-30 11:15:03 -04:00
%{python3_sitelib}/*
%endif
%changelog
2019-11-06 19:48:32 +08:00
* Thu Oct 10 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.81-25
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:add license files to rpm package
2019-09-30 11:15:03 -04:00
* Thu Aug 22 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.81-24
- Package init