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