]>
Commit | Line | Data |
---|---|---|
2249595d JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python3 # do not build python3 modules | |
4 | ||
feabb8f2 AM |
5 | %define module netaddr |
6 | Summary: A pure Python network address representation and manipulation library | |
7 | Name: python-netaddr | |
2249595d | 8 | Version: 0.7.5 |
1813b841 | 9 | Release: 5 |
feabb8f2 AM |
10 | License: BSD |
11 | Group: Development/Languages/Python | |
2249595d JK |
12 | Source0: https://github.com/downloads/drkjam/netaddr/netaddr-%{version}.tar.gz |
13 | # Source0-md5: 06168e1efb753d4d3e48778a5373e192 | |
009884d2 | 14 | Patch0: issue-2.patch |
2249595d | 15 | URL: https://github.com/drkjam/netaddr/ |
f90abd59 | 16 | BuildRequires: python-modules |
2249595d | 17 | %{?with_python3:BuildRequires: python3-modules} |
f90abd59 | 18 | BuildRequires: rpm-pythonprov |
feabb8f2 AM |
19 | BuildArch: noarch |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
21 | ||
22 | %description | |
23 | A pure Python network address representation and manipulation library. | |
24 | ||
25 | netaddr provides a Pythonic way to work with: | |
26 | - IPv4 and IPv6 addresses and subnets (including CIDR notation) | |
27 | - MAC (Media Access Control) addresses in multiple presentation | |
28 | formats | |
29 | - IEEE EUI-64, OUI and IAB identifiers | |
30 | - nmap-style IP address ranges | |
31 | - a user friendly IP glob-style format | |
32 | ||
33 | Included are routines for: | |
34 | - generating, sorting and summarizing IP addresses | |
35 | - converting IP addresses and ranges between various different formats | |
36 | - performing set based operations on groups of IP addresses and | |
37 | subnets | |
38 | - arbitrary IP address range calculations and conversions | |
39 | - querying IEEE OUI and IAB organisational information | |
40 | - querying of IP standards related data from key IANA data sources | |
41 | ||
2249595d JK |
42 | %package -n python3-netaddr |
43 | Summary: A pure Python network address representation and manipulation library | |
44 | Group: Development/Languages/Python | |
45 | ||
46 | %description -n python3-netaddr | |
47 | A pure Python network address representation and manipulation library. | |
48 | ||
49 | netaddr provides a Pythonic way to work with: | |
50 | - IPv4 and IPv6 addresses and subnets (including CIDR notation) | |
51 | - MAC (Media Access Control) addresses in multiple presentation | |
52 | formats | |
53 | - IEEE EUI-64, OUI and IAB identifiers | |
54 | - nmap-style IP address ranges | |
55 | - a user friendly IP glob-style format | |
56 | ||
57 | Included are routines for: | |
58 | - generating, sorting and summarizing IP addresses | |
59 | - converting IP addresses and ranges between various different formats | |
60 | - performing set based operations on groups of IP addresses and | |
61 | subnets | |
62 | - arbitrary IP address range calculations and conversions | |
63 | - querying IEEE OUI and IAB organisational information | |
64 | - querying of IP standards related data from key IANA data sources | |
65 | ||
66 | %package -n netaddr | |
67 | Summary: An interactive shell for the Python netaddr library | |
68 | Group: Development/Languages/Python | |
69 | Requires: %{name} = %{version}-%{release} | |
70 | ||
71 | %description -n netaddr | |
72 | Interactive shell for the python-netaddr library. | |
73 | ||
feabb8f2 AM |
74 | %prep |
75 | %setup -q -n %{module}-%{version} | |
009884d2 | 76 | %patch0 -p1 |
feabb8f2 AM |
77 | |
78 | %build | |
009884d2 | 79 | %{__python} setup.py build |
feabb8f2 | 80 | |
2249595d | 81 | %if %{with python3} |
009884d2 | 82 | %{__python3} setup.py build |
2249595d JK |
83 | %endif |
84 | ||
feabb8f2 AM |
85 | %install |
86 | rm -rf $RPM_BUILD_ROOT | |
009884d2 | 87 | %{__python} setup.py install \ |
feabb8f2 AM |
88 | --optimize 2 \ |
89 | --root=$RPM_BUILD_ROOT | |
90 | ||
91 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
92 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
93 | %py_postclean | |
94 | ||
2249595d | 95 | %if %{with python3} |
009884d2 | 96 | %{__python3} setup.py install \ |
2249595d JK |
97 | --optimize 2 \ |
98 | --root=$RPM_BUILD_ROOT | |
99 | %py3_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
100 | %py3_comp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
2249595d JK |
101 | %endif |
102 | ||
feabb8f2 AM |
103 | %clean |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %files | |
107 | %defattr(644,root,root,755) | |
108 | %doc docs/api AUTHORS CHANGELOG README THANKS | |
feabb8f2 AM |
109 | %{py_sitescriptdir}/*.egg-info |
110 | %dir %{py_sitescriptdir}/%{module} | |
111 | %{py_sitescriptdir}/%{module}/*.py[co] | |
112 | %dir %{py_sitescriptdir}/%{module}/eui | |
113 | %{py_sitescriptdir}/%{module}/eui/*.py[co] | |
114 | %{py_sitescriptdir}/%{module}/eui/*.idx | |
115 | %{py_sitescriptdir}/%{module}/eui/*.txt | |
116 | %dir %{py_sitescriptdir}/%{module}/ip | |
117 | %{py_sitescriptdir}/%{module}/ip/*.py[co] | |
118 | %{py_sitescriptdir}/%{module}/ip/*-space | |
119 | %{py_sitescriptdir}/%{module}/ip/*-addresses | |
120 | %dir %{py_sitescriptdir}/%{module}/strategy | |
121 | %{py_sitescriptdir}/%{module}/strategy/*.py[co] | |
122 | %dir %{py_sitescriptdir}/%{module}/tests | |
123 | %{py_sitescriptdir}/%{module}/tests/*.py[co] | |
2249595d JK |
124 | #%{py_sitescriptdir}/%{module}/tests/2.x/core |
125 | #%{py_sitescriptdir}/%{module}/tests/2.x/eui | |
126 | #%{py_sitescriptdir}/%{module}/tests/2.x/ip | |
127 | #%{py_sitescriptdir}/%{module}/tests/2.x/strategy | |
128 | ||
129 | %if %{with python3} | |
130 | %files -n python3-netaddr | |
131 | %defattr(644,root,root,755) | |
132 | %doc docs/api AUTHORS CHANGELOG README THANKS | |
133 | %{py3_sitescriptdir}/*.egg-info | |
134 | %dir %{py3_sitescriptdir}/%{module} | |
df012ee4 JK |
135 | %{py3_sitescriptdir}/%{module}/*.py |
136 | %{py3_sitescriptdir}/%{module}/__pycache__ | |
2249595d | 137 | %dir %{py3_sitescriptdir}/%{module}/eui |
df012ee4 JK |
138 | %{py3_sitescriptdir}/%{module}/eui/*.py |
139 | %{py3_sitescriptdir}/%{module}/eui/__pycache__ | |
2249595d JK |
140 | %{py3_sitescriptdir}/%{module}/eui/*.idx |
141 | %{py3_sitescriptdir}/%{module}/eui/*.txt | |
142 | %dir %{py3_sitescriptdir}/%{module}/ip | |
df012ee4 JK |
143 | %{py3_sitescriptdir}/%{module}/ip/*.py |
144 | %{py3_sitescriptdir}/%{module}/ip/__pycache__ | |
2249595d JK |
145 | %{py3_sitescriptdir}/%{module}/ip/*-space |
146 | %{py3_sitescriptdir}/%{module}/ip/*-addresses | |
147 | %dir %{py3_sitescriptdir}/%{module}/strategy | |
df012ee4 JK |
148 | %{py3_sitescriptdir}/%{module}/strategy/*.py |
149 | %{py3_sitescriptdir}/%{module}/strategy/__pycache__ | |
2249595d | 150 | %dir %{py3_sitescriptdir}/%{module}/tests |
df012ee4 JK |
151 | %{py3_sitescriptdir}/%{module}/tests/*.py |
152 | %{py3_sitescriptdir}/%{module}/tests/__pycache__ | |
2249595d JK |
153 | #%{py3_sitescriptdir}/%{module}/tests/3.x/core |
154 | #%{py3_sitescriptdir}/%{module}/tests/3.x/eui | |
155 | #%{py3_sitescriptdir}/%{module}/tests/3.x/ip | |
156 | #%{py3_sitescriptdir}/%{module}/tests/3.x/strategy | |
157 | %endif | |
158 | ||
159 | %files -n netaddr | |
160 | %defattr(644,root,root,755) | |
161 | %attr(755,root,root) %{_bindir}/netaddr |