]>
Commit | Line | Data |
---|---|---|
3506e45d | 1 | # Conditional build: |
78426673 | 2 | %bcond_without tests # unit tests |
3506e45d AM |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
3506e45d AM |
6 | %define module IPy |
7 | %define egg_name IPy | |
8 | %define pypi_name IPy | |
391f4966 | 9 | Summary: Class and tools for handling of IPv4 and IPv6 addresses and networks |
38a3cba1 | 10 | Summary(pl.UTF-8): Klasy i narzędzia do obsługi adresów i sieci IPv4 i IPv6 |
3506e45d | 11 | Name: python-%{pypi_name} |
ea45be62 | 12 | Version: 1.00 |
1eaf4015 | 13 | Release: 4 |
391f4966 | 14 | License: BSD |
78bebdee | 15 | Group: Libraries/Python |
3506e45d | 16 | Source0: https://pypi.debian.net/IPy/%{module}-%{version}.tar.gz |
ea45be62 | 17 | # Source0-md5: 1a90c68174234672241a7e60c7ea0fb9 |
d77e90f4 | 18 | URL: https://github.com/haypo/python-ipy/wiki |
1dc2749c | 19 | BuildRequires: rpm-pythonprov |
3506e45d AM |
20 | BuildRequires: rpmbuild(macros) >= 1.714 |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules | |
23 | BuildRequires: python-setuptools | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-modules | |
27 | BuildRequires: python3-setuptools | |
28 | %endif | |
29 | Requires: python-modules | |
30 | BuildArch: noarch | |
78bebdee AM |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
1dc2749c JB |
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. | |
39 | ||
a18b2e7f JR |
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. | |
78bebdee | 46 | |
3506e45d | 47 | %package -n python3-%{pypi_name} |
c50a6d3d AM |
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 | |
3506e45d AM |
50 | Group: Libraries/Python |
51 | Requires: python3-modules | |
52 | ||
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. | |
59 | ||
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. | |
66 | ||
78bebdee | 67 | %prep |
3506e45d | 68 | %setup -q -n %{pypi_name}-%{version} |
391f4966 AF |
69 | |
70 | %build | |
3506e45d | 71 | %if %{with python2} |
2c2826e9 | 72 | %py_build |
78426673 AM |
73 | %if %{with tests} |
74 | for test in test/*.py; do | |
aa44e164 AM |
75 | # enable when this is fixed: https://github.com/autocracy/python-ipy/issues/27 |
76 | [ "$test" = "test/test_fuzz.py" ] && continue | |
78426673 AM |
77 | PYTHONPATH=build-2 %{__python} "$test" |
78 | done | |
79 | %endif | |
3506e45d AM |
80 | %endif |
81 | ||
82 | %if %{with python3} | |
83 | %py3_build | |
78426673 AM |
84 | %if %{with tests} |
85 | for test in test/*.py; do | |
aa44e164 AM |
86 | # enable when this is fixed: https://github.com/autocracy/python-ipy/issues/27 |
87 | [ "$test" = "test/test_fuzz.py" ] && continue | |
78426673 AM |
88 | PYTHONPATH=build-3 %{__python3} "$test" |
89 | done | |
90 | %endif | |
3506e45d | 91 | %endif |
78bebdee AM |
92 | |
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
3506e45d AM |
96 | %if %{with python2} |
97 | %py_install | |
98 | ||
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} | |
78bebdee | 104 | |
2d0a0f5f | 105 | %py_postclean |
3506e45d AM |
106 | %endif |
107 | ||
108 | %if %{with python3} | |
109 | %py3_install | |
110 | %endif | |
2d0a0f5f | 111 | |
78bebdee AM |
112 | %clean |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
3506e45d | 115 | %if %{with python2} |
78bebdee AM |
116 | %files |
117 | %defattr(644,root,root,755) | |
ea45be62 | 118 | %doc ChangeLog README.rst AUTHORS COPYING |
3506e45d AM |
119 | %{py_sitescriptdir}/%{module}.py* |
120 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
124 | %files -n python3-%{pypi_name} | |
125 | %defattr(644,root,root,755) | |
ea45be62 | 126 | %doc ChangeLog README.rst AUTHORS COPYING |
3506e45d AM |
127 | %{py3_sitescriptdir}/%{module}.py* |
128 | %{py3_sitescriptdir}/__pycache__/%{module}.*.pyc | |
129 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
130 | %endif |