]>
Commit | Line | Data |
---|---|---|
b3652667 AM |
1 | # |
2 | # Conditional build: | |
ae82a4bf JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_with python3 # CPython 3.x module [already included in 3.3+ distribution] | |
b3652667 AM |
5 | %bcond_without tests # do not perform "make test" |
6 | ||
7 | %define module ipaddress | |
8 | Summary: IPv4/IPv6 manipulation library | |
ae82a4bf | 9 | Summary(pl.UTF-8): Biblioteka do operacji na adresach IPv4/IPv6 |
b3652667 | 10 | Name: python-%{module} |
dab95539 | 11 | Version: 1.0.18 |
904865f5 | 12 | Release: 2 |
b3652667 AM |
13 | License: PSF |
14 | Group: Libraries/Python | |
ae82a4bf | 15 | #Source0Download: https://pypi.python.org/simple/ipaddress/ |
dab95539 JB |
16 | Source0: https://files.pythonhosted.org/packages/source/i/ipaddress/%{module}-%{version}.tar.gz |
17 | # Source0-md5: 310c2dfd64eb6f0df44aa8c59f2334a7 | |
b3652667 | 18 | URL: https://pypi.python.org/pypi/ipaddress/ |
b3652667 | 19 | BuildRequires: rpm-pythonprov |
ae82a4bf JB |
20 | BuildRequires: rpmbuild(macros) >= 1.714 |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.6 | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-modules >= 1:3.2 | |
26 | BuildRequires: python3-modules < 1:3.3 | |
27 | %endif | |
28 | Requires: python-modules >= 1:2.6 | |
b3652667 AM |
29 | BuildArch: noarch |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | IPv4/IPv6 manipulation library. | |
34 | ||
ae82a4bf JB |
35 | %description -l pl.UTF-8 |
36 | Biblioteka do operacji na adresach IPv4/IPv6. | |
37 | ||
38 | %package -n python3-%{module} | |
39 | Summary: IPv4/IPv6 manipulation library | |
40 | Summary(pl.UTF-8): Biblioteka do operacji na adresach IPv4/IPv6 | |
41 | Group: Libraries/Python | |
42 | Requires: python-modules >= 1:3.2 | |
43 | Requires: python-modules < 1:3.3 | |
b3652667 | 44 | |
ae82a4bf JB |
45 | %description -n python3-%{module} |
46 | IPv4/IPv6 manipulation library. | |
b3652667 | 47 | |
ae82a4bf JB |
48 | %description -n python3-%{module} -l pl.UTF-8 |
49 | Biblioteka do operacji na adresach IPv4/IPv6. | |
b3652667 AM |
50 | |
51 | %prep | |
52 | %setup -q -n %{module}-%{version} | |
53 | ||
54 | %build | |
ae82a4bf | 55 | %if %{with python2} |
589fd4aa | 56 | %py_build %{?with_tests:test} |
ae82a4bf | 57 | %endif |
b3652667 | 58 | |
ae82a4bf JB |
59 | %if %{with python3} |
60 | %py3_build %{?with_tests:test} | |
b3652667 AM |
61 | %endif |
62 | ||
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
ae82a4bf | 66 | %if %{with python2} |
589fd4aa | 67 | %py_install |
b3652667 AM |
68 | |
69 | %py_postclean | |
ae82a4bf JB |
70 | %endif |
71 | ||
72 | %if %{with python3} | |
73 | %py3_install | |
74 | %endif | |
b3652667 AM |
75 | |
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
ae82a4bf | 79 | %if %{with python2} |
b3652667 AM |
80 | %files |
81 | %defattr(644,root,root,755) | |
ae82a4bf JB |
82 | %doc README.md |
83 | %{py_sitescriptdir}/ipaddress.py[co] | |
b3652667 AM |
84 | %{py_sitescriptdir}/ipaddress-*.egg-info |
85 | %endif | |
86 | ||
ae82a4bf JB |
87 | %if %{with python3} |
88 | %files -n python3-%{module} | |
b3652667 | 89 | %defattr(644,root,root,755) |
ae82a4bf JB |
90 | %doc README.md |
91 | %{py3_sitescriptdir}/ipaddress.py | |
92 | %{py3_sitescriptdir}/__pycache__/ipaddress.cpython-*.py[co] | |
93 | %{py3_sitescriptdir}/ipaddress-*.egg-info | |
b3652667 | 94 | %endif |