2 %bcond_without tests # unit tests
3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
9 Summary: Class and tools for handling of IPv4 and IPv6 addresses and networks
10 Summary(pl.UTF-8): Klasy i narzędzia do obsługi adresów i sieci IPv4 i IPv6
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://pypi.debian.net/IPy/%{module}-%{version}.tar.gz
17 # Source0-md5: 1a90c68174234672241a7e60c7ea0fb9
18 URL: https://github.com/haypo/python-ipy/wiki
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
29 Requires: python-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 The IP class allows a comfortable parsing and handling for most
35 notations in use for IPv4 and IPv6 Addresses and Networks. It was
36 greatly inspired bei RIPE's Perl module Net::IP's interface but
37 doesn't share the Implementation. It doesn't share non-CIDR netmasks,
38 so funky stuff lixe a netmask 0xffffff0f can't be done here.
40 %description -l pl.UTF-8
41 Klasa IP pozwala w wygodny sposób analizować i obsługiwać większość
42 używanych notacji zapisu adresów i sieci IPv4 i IPv6. Jest w dużej
43 części zainspirowana interfejsem modułu Perla RIPE Net::IP, ale nie
44 współdzieli z nim implementacji. Nie dzieli masek sieciowych nie-CIDR,
45 więc zabawne rzeczy typu maska 0xffffff0f są tutaj niewykonalne.
47 %package -n python3-%{pypi_name}
48 Summary: Class and tools for handling of IPv4 and IPv6 addresses and networks
49 Summary(pl.UTF-8): Klasy i narzędzia do obsługi adresów i sieci IPv4 i IPv6
50 Group: Libraries/Python
51 Requires: python3-modules
53 %description -n python3-%{pypi_name}
54 The IP class allows a comfortable parsing and handling for most
55 notations in use for IPv4 and IPv6 Addresses and Networks. It was
56 greatly inspired bei RIPE's Perl module Net::IP's interface but
57 doesn't share the Implementation. It doesn't share non-CIDR netmasks,
58 so funky stuff lixe a netmask 0xffffff0f can't be done here.
60 %description -n python3-%{pypi_name} -l pl.UTF-8
61 Klasa IP pozwala w wygodny sposób analizować i obsługiwać większość
62 używanych notacji zapisu adresów i sieci IPv4 i IPv6. Jest w dużej
63 części zainspirowana interfejsem modułu Perla RIPE Net::IP, ale nie
64 współdzieli z nim implementacji. Nie dzieli masek sieciowych nie-CIDR,
65 więc zabawne rzeczy typu maska 0xffffff0f są tutaj niewykonalne.
68 %setup -q -n %{pypi_name}-%{version}
74 for test in test/*.py; do
75 # enable when this is fixed: https://github.com/autocracy/python-ipy/issues/27
76 [ "$test" = "test/test_fuzz.py" ] && continue
77 PYTHONPATH=build-2 %{__python} "$test"
85 for test in test/*.py; do
86 # enable when this is fixed: https://github.com/autocracy/python-ipy/issues/27
87 [ "$test" = "test/test_fuzz.py" ] && continue
88 PYTHONPATH=build-3 %{__python3} "$test"
94 rm -rf $RPM_BUILD_ROOT
99 # when files are installed in other way that standard 'setup.py
100 # they need to be (re-)compiled
101 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
102 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
103 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
113 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
118 %doc ChangeLog README.rst AUTHORS COPYING
119 %{py_sitescriptdir}/%{module}.py*
120 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
124 %files -n python3-%{pypi_name}
125 %defattr(644,root,root,755)
126 %doc ChangeLog README.rst AUTHORS COPYING
127 %{py3_sitescriptdir}/%{module}.py*
128 %{py3_sitescriptdir}/__pycache__/%{module}.*.pyc
129 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info