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