]> git.pld-linux.org Git - packages/python-IPy.git/blob - python-IPy.spec
rebuild with python 3.10
[packages/python-IPy.git] / python-IPy.spec
1 # Conditional build:
2 %bcond_without  tests   # unit tests
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 %define         module          IPy
7 %define         egg_name        IPy
8 %define         pypi_name       IPy
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}
12 Version:        1.00
13 Release:        4
14 License:        BSD
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
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
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
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
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.
46
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
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
67 %prep
68 %setup -q -n %{pypi_name}-%{version}
69
70 %build
71 %if %{with python2}
72 %py_build
73 %if %{with tests}
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"
78 done
79 %endif
80 %endif
81
82 %if %{with python3}
83 %py3_build
84 %if %{with tests}
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"
89 done
90 %endif
91 %endif
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95
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}
104
105 %py_postclean
106 %endif
107
108 %if %{with python3}
109 %py3_install
110 %endif
111
112 %clean
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with python2}
116 %files
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
121 %endif
122
123 %if %{with python3}
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
130 %endif
This page took 0.049579 seconds and 3 git commands to generate.