]>
Commit | Line | Data |
---|---|---|
ceaf3787 AM |
1 | # Conditional build: |
2 | %bcond_without python2 # CPython 2.x module | |
3 | %bcond_without python3 # CPython 3.x module | |
4 | ||
5 | %define module ipwhois | |
6 | %define egg_name ipwhois | |
7 | %define pypi_name ipwhois | |
8 | Summary: Retrieve and parse whois data for IPv4 and IPv6 addresses | |
9 | Name: python-%{module} | |
10 | Version: 1.2.0 | |
b3abdc7f | 11 | Release: 3 |
ceaf3787 AM |
12 | License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.debian.net/ipwhois/ipwhois-1.2.0.tar.gz | |
15 | # Source0-md5: 29c322d1c812793a48378b738f6e9b04 | |
16 | Patch0: python.patch | |
17 | URL: https://github.com/secynic/ipwhois | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.5 | |
20 | BuildRequires: python-setuptools | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules >= 1:3.2 | |
24 | BuildRequires: python3-setuptools | |
25 | %endif | |
26 | BuildRequires: rpm-pythonprov | |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | Requires: python-modules >= 1:2.5 | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | pwhois is a Python package focused on retrieving and parsing whois data for IPv4 and IPv6 addresses. | |
34 | ||
35 | %package -n python3-%{module} | |
36 | Summary: Retrieve and parse whois data for IPv4 and IPv6 addresses | |
37 | Group: Libraries/Python | |
38 | Requires: python3-modules >= 1:3.2 | |
39 | ||
40 | %description -n python3-%{module} | |
41 | pwhois is a Python package focused on retrieving and parsing whois data for IPv4 and IPv6 addresses. | |
42 | ||
43 | %prep | |
44 | %setup -q -n %{pypi_name}-%{version} | |
45 | %patch0 -p1 | |
46 | ||
47 | %build | |
48 | %if %{with python2} | |
49 | %py_build | |
50 | %endif | |
51 | ||
52 | %if %{with python3} | |
53 | %py3_build | |
54 | %endif | |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | ||
59 | %if %{with python2} | |
60 | %py_install | |
61 | %py_postclean | |
62 | %endif | |
63 | ||
64 | %if %{with python3} | |
65 | %py3_install | |
66 | %endif | |
67 | ||
68 | %clean | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %if %{with python2} | |
72 | %files | |
73 | %defattr(644,root,root,755) | |
74 | %doc *.rst | |
75 | %{py_sitescriptdir}/%{module} | |
76 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | %files -n python3-%{module} | |
81 | %defattr(644,root,root,755) | |
82 | %doc *.rst | |
83 | %attr(755,root,root) %{_bindir}/ipwhois_cli.py | |
84 | %attr(755,root,root) %{_bindir}/ipwhois_utils_cli.py | |
85 | %{py3_sitescriptdir}/%{module} | |
86 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
87 | %endif |