]> git.pld-linux.org Git - packages/python-netaddr.git/blob - python-netaddr.spec
310b5b2e45615112303fb5b574e98a806cd38be6
[packages/python-netaddr.git] / python-netaddr.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # sphinx based documentation
4 %bcond_without  python3         # do not build python3 modules
5
6 %define         module  netaddr
7 Summary:        A pure Python network address representation and manipulation library
8 Name:           python-netaddr
9 Version:        0.7.19
10 Release:        4
11 License:        BSD
12 Group:          Development/Languages/Python
13 Source0:        https://pypi.python.org/packages/source/n/netaddr/%{module}-%{version}.tar.gz
14 # Source0-md5:  51019ef59c93f3979bcb37d3b8527e07
15 Patch0:         script-shebang.patch
16 URL:            https://github.com/drkjam/netaddr/
17 BuildRequires:  rpmbuild(macros) >= 1.710
18 BuildRequires:  python-modules
19 %{?with_python3:BuildRequires:  python3-modules}
20 BuildRequires:  rpm-pythonprov
21 %{?with_apidocs:BuildRequires:  sphinx-pdg}
22 BuildArch:      noarch
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %description
26 A pure Python network address representation and manipulation library.
27
28 netaddr provides a Pythonic way to work with:
29 - IPv4 and IPv6 addresses and subnets (including CIDR notation)
30 - MAC (Media Access Control) addresses in multiple presentation
31   formats
32 - IEEE EUI-64, OUI and IAB identifiers
33 - nmap-style IP address ranges
34 - a user friendly IP glob-style format
35
36 Included are routines for:
37 - generating, sorting and summarizing IP addresses
38 - converting IP addresses and ranges between various different formats
39 - performing set based operations on groups of IP addresses and
40   subnets
41 - arbitrary IP address range calculations and conversions
42 - querying IEEE OUI and IAB organisational information
43 - querying of IP standards related data from key IANA data sources
44
45 %package -n python3-netaddr
46 Summary:        A pure Python network address representation and manipulation library
47 Group:          Development/Languages/Python
48
49 %description -n python3-netaddr
50 A pure Python network address representation and manipulation library.
51
52 netaddr provides a Pythonic way to work with:
53 - IPv4 and IPv6 addresses and subnets (including CIDR notation)
54 - MAC (Media Access Control) addresses in multiple presentation
55   formats
56 - IEEE EUI-64, OUI and IAB identifiers
57 - nmap-style IP address ranges
58 - a user friendly IP glob-style format
59
60 Included are routines for:
61 - generating, sorting and summarizing IP addresses
62 - converting IP addresses and ranges between various different formats
63 - performing set based operations on groups of IP addresses and
64   subnets
65 - arbitrary IP address range calculations and conversions
66 - querying IEEE OUI and IAB organisational information
67 - querying of IP standards related data from key IANA data sources
68
69 %package -n netaddr
70 Summary:        An interactive shell for the Python netaddr library
71 Group:          Development/Languages/Python
72 %if %{with python3}
73 Requires:       python3-netaddr = %{version}-%{release}
74 %else
75 Requires:       %{name} = %{version}-%{release}
76 %endif
77
78 %description -n netaddr
79 Interactive shell for the python-netaddr library.
80
81 %prep
82 %setup -q -n %{module}-%{version}
83 %patch0 -p1
84
85 %{__sed} -i -e '1s,/usr/bin/env python,%{?with_python3:%{__python3}}%{!?with_python3:%{__python}},' \
86         netaddr/tools/netaddr
87
88 %build
89 %py_build
90
91 %if %{with python3}
92 %py3_build
93 %endif
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 %py_install \
98         --optimize 2 \
99         --root=$RPM_BUILD_ROOT
100
101 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
102 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
103 %py_postclean
104
105 %if %{with apidocs}
106 sphinx-build -b html -d build/doctrees -D latex_paper_size=a4 docs/source build/html
107 %endif
108
109 %if %{with python3}
110 %py3_install \
111         --optimize 2 \
112         --root=$RPM_BUILD_ROOT
113 %py3_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
114 %py3_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
115 %endif
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %files
121 %defattr(644,root,root,755)
122 %doc AUTHORS CHANGELOG README.md
123 %if %{with apidocs}
124 %doc build/html
125 %endif
126 %{py_sitescriptdir}/*.egg-info
127 %dir %{py_sitescriptdir}/%{module}
128 %{py_sitescriptdir}/%{module}/*.py[co]
129 %dir %{py_sitescriptdir}/%{module}/contrib
130 %{py_sitescriptdir}/%{module}/contrib/*.py[co]
131 %dir %{py_sitescriptdir}/%{module}/eui
132 %{py_sitescriptdir}/%{module}/eui/*.py[co]
133 %{py_sitescriptdir}/%{module}/eui/*.idx
134 %{py_sitescriptdir}/%{module}/eui/*.txt
135 %dir %{py_sitescriptdir}/%{module}/ip
136 %{py_sitescriptdir}/%{module}/ip/*.py[co]
137 %{py_sitescriptdir}/%{module}/ip/*.xml
138 %dir %{py_sitescriptdir}/%{module}/strategy
139 %{py_sitescriptdir}/%{module}/strategy/*.py[co]
140 #%dir %{py_sitescriptdir}/%{module}/tests
141 #%{py_sitescriptdir}/%{module}/tests/*.py[co]
142 #%{py_sitescriptdir}/%{module}/tests/2.x/core
143 #%{py_sitescriptdir}/%{module}/tests/2.x/eui
144 #%{py_sitescriptdir}/%{module}/tests/2.x/ip
145 #%{py_sitescriptdir}/%{module}/tests/2.x/strategy
146
147 %if %{with python3}
148 %files -n python3-netaddr
149 %defattr(644,root,root,755)
150 %doc AUTHORS CHANGELOG README.md
151 %if %{with apidocs}
152 %doc build/html
153 %endif
154 %{py3_sitescriptdir}/*.egg-info
155 %dir %{py3_sitescriptdir}/%{module}
156 %{py3_sitescriptdir}/%{module}/*.py
157 %{py3_sitescriptdir}/%{module}/__pycache__
158 %dir %{py3_sitescriptdir}/%{module}/contrib
159 %{py3_sitescriptdir}/%{module}/contrib/*.py
160 %{py3_sitescriptdir}/%{module}/contrib/__pycache__
161 %dir %{py3_sitescriptdir}/%{module}/eui
162 %{py3_sitescriptdir}/%{module}/eui/*.py
163 %{py3_sitescriptdir}/%{module}/eui/__pycache__
164 %{py3_sitescriptdir}/%{module}/eui/*.idx
165 %{py3_sitescriptdir}/%{module}/eui/*.txt
166 %dir %{py3_sitescriptdir}/%{module}/ip
167 %{py3_sitescriptdir}/%{module}/ip/*.py
168 %{py3_sitescriptdir}/%{module}/ip/__pycache__
169 %{py3_sitescriptdir}/%{module}/ip/*.xml
170 %dir %{py3_sitescriptdir}/%{module}/strategy
171 %{py3_sitescriptdir}/%{module}/strategy/*.py
172 %{py3_sitescriptdir}/%{module}/strategy/__pycache__
173 #%dir %{py3_sitescriptdir}/%{module}/tests
174 #%{py3_sitescriptdir}/%{module}/tests/*.py
175 #%{py3_sitescriptdir}/%{module}/tests/__pycache__
176 #%{py3_sitescriptdir}/%{module}/tests/3.x/core
177 #%{py3_sitescriptdir}/%{module}/tests/3.x/eui
178 #%{py3_sitescriptdir}/%{module}/tests/3.x/ip
179 #%{py3_sitescriptdir}/%{module}/tests/3.x/strategy
180 %endif
181
182 %files -n netaddr
183 %defattr(644,root,root,755)
184 %attr(755,root,root) %{_bindir}/netaddr
This page took 0.061617 seconds and 2 git commands to generate.