]>
Commit | Line | Data |
---|---|---|
4d4e8753 | 1 | # |
0a1f6d9e | 2 | # TODO: |
6f4820ce ER |
3 | # - fix build @ uClibc |
4 | # - fix iface_descr patch | |
0a1f6d9e | 5 | # |
4d4e8753 | 6 | # Conditional build |
c2f906a7 | 7 | %bcond_without tc # don't build tc program (it breaks static linkage) |
3679d517 | 8 | %bcond_without atm # disable ATM support for tc |
c2f906a7 | 9 | %bcond_with uClibc # do some hacks to build with uClibc |
6f4820ce ER |
10 | %bcond_with iface_descr # build with interface description support |
11 | ||
9fc1dfd7 | 12 | Summary: Advanced IP routing and network device configuration tools |
d2344512 | 13 | Summary(es.UTF-8): Herramientas para encaminamiento avanzado y configuración de interfaces de red |
3679d517 | 14 | Summary(pl.UTF-8): Narzędzie do konfigurowania sieci |
d2344512 | 15 | Summary(pt_BR.UTF-8): Ferramentas para roteamento avançado e configuração de interfaces de rede |
354f4215 | 16 | Name: iproute2 |
74ae30ca | 17 | Version: 6.0.0 |
5916d627 | 18 | Release: 1 |
3679d517 | 19 | License: GPL v2+ |
354f4215 | 20 | Group: Networking/Admin |
bed31e25 | 21 | Source0: https://www.kernel.org/pub/linux/utils/net/iproute2/%{name}-%{version}.tar.xz |
74ae30ca | 22 | # Source0-md5: 5da6cb3154ee09b9a8b4004d1c2df4cd |
03b26d3c | 23 | Source1: %{name}.tmpfiles |
33826d1b | 24 | Patch0: %{name}-link.patch |
9b297650 | 25 | Patch3: %{name}-LDFLAGS.patch |
4f323620 | 26 | |
b3946cd7 | 27 | Patch5: %{name}-build.patch |
47fff01d | 28 | Patch6: %{name}-print_cache_route_entries.patch |
207621e4 | 29 | # extensions |
af6313ca | 30 | Patch10: %{name}-2.2.4-wrr.patch |
00a4c5cb | 31 | Patch11: esfq-%{name}.patch |
91d521f5 | 32 | Patch12: 001-net-dev-iface-descr-0.1.diff |
8f6469c2 | 33 | Patch14: %{name}-q_srr.v0.4.patch |
26ae64ee | 34 | Patch15: %{name}-ip_route_get.patch |
40d95966 | 35 | URL: https://wiki.linuxfoundation.org/networking/iproute2 |
4ef82693 | 36 | BuildRequires: bison |
4c573c73 | 37 | BuildRequires: db-devel |
aca0174e JB |
38 | # libelf |
39 | BuildRequires: elfutils-devel | |
e3fc76c4 | 40 | BuildRequires: flex |
fa272163 | 41 | BuildRequires: iptables-devel >= 0:1.4.5 |
61cc2420 | 42 | BuildRequires: libbpf-devel >= 0.1.0 |
8fe3c7c9 JB |
43 | BuildRequires: libbsd-devel |
44 | BuildRequires: libcap-devel | |
aca0174e JB |
45 | BuildRequires: libmnl-devel |
46 | BuildRequires: libselinux-devel | |
9c6f7b37 | 47 | BuildRequires: libtirpc-devel |
d072516f | 48 | %if %{with atm} |
76ab126a | 49 | BuildRequires: linux-atm-devel |
d072516f | 50 | %endif |
1525a420 | 51 | BuildRequires: linux-libc-headers >= 7:2.6.12.0-15 |
aca0174e | 52 | BuildRequires: pkgconfig |
5916d627 | 53 | BuildRequires: rpm-build >= 4.6 |
aca0174e | 54 | BuildRequires: rpmbuild(macros) >= 1.673 |
a4d66bf6 | 55 | BuildRequires: sed >= 4.0 |
33826d1b JB |
56 | BuildRequires: tar >= 1:1.22 |
57 | BuildRequires: xz | |
d9c85390 JP |
58 | Suggests: %{name}-routel = %{version}-%{release} |
59 | Suggests: %{name}-ss = %{version}-%{release} | |
60 | Suggests: %{name}-tc = %{version}-%{release} | |
151bfb35 | 61 | Obsoletes: ifstat < 1.2 |
e1c03590 | 62 | Obsoletes: iproute |
cbbe9fec | 63 | Obsoletes: iproute2-doc < 4.14.1 |
4c4edaba | 64 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
8ca003ed | 65 | |
9ea83253 | 66 | %define _sbindir /sbin |
67 | %define _sysconfdir /etc/iproute2 | |
c2827c7c | 68 | |
8ca003ed | 69 | %description |
0d5db0b4 JB |
70 | The iproute package contains networking utilities (ip, tc and rtmon, |
71 | for example) which are designed to use the advanced networking | |
6f4820ce | 72 | capabilities of the Linux 2.4.x and 2.6.x kernel. |
e316d7c9 | 73 | |
70fcbc5f JR |
74 | %description -l es.UTF-8 |
75 | Linux mantiene compatibilidad con los utilitarios estándares de | |
76 | configuración de la red, pero se necesitan nuevos utilitarios para | |
77 | usar los recursos y características del nuevo núcleo. Este paquete | |
e316d7c9 | 78 | incluye los nuevos utilitarios. |
323e0978 | 79 | |
70fcbc5f | 80 | %description -l pl.UTF-8 |
0d5db0b4 JB |
81 | Ten pakiet zawiera programy (m.in. ip, tc, rtmon) pozwalające na |
82 | kontrolę routingu i innych aspektów dotyczących sieci z wykorzystaniem | |
83 | zaawansowanych możliwości jąder Linuksa 2.4.x i 2.6.x. | |
e316d7c9 | 84 | |
70fcbc5f JR |
85 | %description -l pt_BR.UTF-8 |
86 | O Linux mantém compatibilidade com os utilitários padrão de | |
87 | configuração da rede, mas novos utilitários são necessários para fazer | |
88 | uso das características e recursos da nova kernel. This package | |
e316d7c9 | 89 | includes the new utilities. |
323e0978 | 90 | |
d9c85390 JP |
91 | %package routel |
92 | Summary: routel - list routes with pretty output format | |
93 | Requires: %{name} = %{version}-%{release} | |
94 | Requires: python3 | |
95 | Requires: python3-modules | |
96 | ||
97 | %description routel | |
98 | The routel script will list routes in a format that some might | |
99 | consider easier to interpret then the ip route list equivalent. | |
100 | ||
101 | %package ss | |
102 | Summary: ss - another utility to investigate sockets | |
103 | ||
104 | %description ss | |
105 | ss is used to dump socket statistics. It allows showing information | |
106 | similar to netstat. It can display more TCP and state information than | |
107 | other tools. | |
108 | ||
109 | %package tc | |
110 | Summary: tc - show / manipulate traffic control settings | |
111 | Requires: iptables-libs >= 0:1.4.5 | |
112 | ||
113 | %description tc | |
114 | Tc is used to configure Traffic Control in the Linux kernel. | |
115 | ||
b60f3d88 JB |
116 | %package devel |
117 | Summary: Header file for tc plugins development | |
118 | Summary(pl.UTF-8): Plik nagłówkowy do tworzenia wtyczek programu tc | |
119 | Group: Development/Libraries | |
120 | # doesn't require base | |
121 | ||
122 | %description devel | |
123 | Header file for tc plugins development. | |
124 | ||
125 | %description devel -l pl.UTF-8 | |
126 | Plik nagłówkowy do tworzenia wtyczek programu tc. | |
127 | ||
49c78676 JK |
128 | %package -n libnetlink-devel |
129 | Summary: Library for the netlink interface | |
d2344512 | 130 | Summary(pl.UTF-8): Biblioteka do interfejsu netlink |
49c78676 JK |
131 | Group: Development/Libraries |
132 | ||
133 | %description -n libnetlink-devel | |
134 | This library provides an interface for kernel-user netlink interface. | |
135 | ||
70fcbc5f JR |
136 | %description -n libnetlink-devel -l pl.UTF-8 |
137 | Ta biblioteka udostępnia interfejs do interfejsu netlink między jądrem | |
138 | a przestrzenią użytkownika. | |
a52556c3 | 139 | |
aca0174e JB |
140 | %package -n bash-completion-iproute2 |
141 | Summary: Bash completion for iproute2 commands | |
142 | Summary(pl.UTF-8): Bashowe dopełnianie parametrów poleceń iproute2 | |
143 | Group: Applications/Shells | |
144 | Requires: %{name} = %{version}-%{release} | |
145 | Requires: bash-completion >= 2.0 | |
5916d627 | 146 | BuildArch: noarch |
aca0174e JB |
147 | |
148 | %description -n bash-completion-iproute2 | |
f8112367 | 149 | Bash completion for iproute2 commands (currently devlink and tc). |
aca0174e JB |
150 | |
151 | %description -n bash-completion-iproute2 -l pl.UTF-8 | |
f8112367 JB |
152 | Bashowe dopełnianie parametrów poleceń iproute2 (obecnie devlink i |
153 | tc). | |
aca0174e | 154 | |
8ca003ed | 155 | %prep |
7e3e3f9a | 156 | %setup -q |
36f42953 | 157 | |
9b297650 | 158 | # conflict with atm-vbr patched linux-libc-headers |
cbbe9fec | 159 | %{__rm} include/uapi/linux/atm.h |
9b297650 JB |
160 | |
161 | %patch0 -p1 | |
9b297650 | 162 | %patch3 -p1 |
4f323620 | 163 | |
b3946cd7 | 164 | %patch5 -p1 |
47fff01d | 165 | %patch6 -p1 |
91d521f5 | 166 | # extensions: |
6234a9fe | 167 | %patch10 -p1 |
039e8f2b | 168 | %patch11 -p1 |
6f4820ce | 169 | %{?with_iface_descr:%patch12 -p1} |
8f6469c2 | 170 | %patch14 -p1 |
26ae64ee | 171 | %patch15 -p1 |
d1f6ab22 | 172 | |
a4d66bf6 JB |
173 | %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' ip/routel |
174 | ||
8ca003ed | 175 | %build |
dd97cf21 | 176 | %{__make} \ |
93591f64 | 177 | %if %{with uClibc} |
178 | CC="%{_target_cpu}-uclibc-gcc" \ | |
179 | LD="%{_target_cpu}-uclibc-gcc" \ | |
180 | %else | |
181 | CC="%{__cc}" \ | |
182 | LD="%{__cc}" \ | |
183 | %endif | |
f2b536a2 | 184 | HOSTCC="%{__cc}" \ |
64551ae4 | 185 | CCOPTS="%{rpmcflags} %{rpmcppflags} -Wno-unused-result -DXT_LIB_DIR=\\\"%{_libdir}/xtables\\\"" \ |
4e7688ae | 186 | LDFLAGS="%{rpmldflags} -Wl,-export-dynamic" \ |
e7a772a9 | 187 | LIBDIR=%{_libdir} \ |
3f07eebf JB |
188 | %{!?with_tc:SUBDIRS="lib ip misc"} \ |
189 | V=1 | |
207621e4 | 190 | |
5e896a68 AM |
191 | # make sure we don't produce broken ip binary |
192 | ./ip/ip link add type vlan help 2>&1 | grep -q "VLANID :=" || exit 1 | |
193 | ||
8ca003ed AM |
194 | %install |
195 | rm -rf $RPM_BUILD_ROOT | |
32443dcd | 196 | install -d $RPM_BUILD_ROOT{%{_includedir},/var/run/netns,%{systemdtmpfilesdir}} |
c2884fcb AM |
197 | |
198 | %{__make} install \ | |
199 | LIBDIR=%{_libdir} \ | |
200 | DESTDIR=$RPM_BUILD_ROOT | |
201 | ||
1f99b759 JB |
202 | # omitted by make install |
203 | install -Dp man/man7/tc-hfsc.7 $RPM_BUILD_ROOT%{_mandir}/man7/tc-hfsc.7 | |
204 | ||
fa272163 | 205 | # arpd is not packaged here |
c2884fcb | 206 | %{__rm} $RPM_BUILD_ROOT%{_sbindir}/arpd $RPM_BUILD_ROOT%{_mandir}/man8/arpd.8 |
0a1f6d9e | 207 | |
32443dcd ER |
208 | cp -p lib/libnetlink.a $RPM_BUILD_ROOT%{_libdir} |
209 | cp -p include/libnetlink.h $RPM_BUILD_ROOT%{_includedir} | |
210 | ||
211 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
354f4215 | 212 | |
8ca003ed AM |
213 | %clean |
214 | rm -rf $RPM_BUILD_ROOT | |
215 | ||
216 | %files | |
217 | %defattr(644,root,root,755) | |
ca5bdfd0 | 218 | %doc README doc/actions examples |
c2884fcb | 219 | %attr(755,root,root) %{_sbindir}/bridge |
a7f458f6 | 220 | %attr(755,root,root) %{_sbindir}/ctstat |
5916d627 | 221 | %attr(755,root,root) %{_sbindir}/dcb |
aca0174e | 222 | %attr(755,root,root) %{_sbindir}/devlink |
c2884fcb | 223 | %attr(755,root,root) %{_sbindir}/genl |
e1c03590 ER |
224 | %attr(755,root,root) %{_sbindir}/ifstat |
225 | %attr(755,root,root) %{_sbindir}/ip | |
226 | %attr(755,root,root) %{_sbindir}/lnstat | |
227 | %attr(755,root,root) %{_sbindir}/nstat | |
9542c7cd | 228 | %attr(755,root,root) %{_sbindir}/rdma |
e1c03590 ER |
229 | %attr(755,root,root) %{_sbindir}/rtacct |
230 | %attr(755,root,root) %{_sbindir}/rtmon | |
a7f458f6 | 231 | %attr(755,root,root) %{_sbindir}/rtstat |
6bbfa630 | 232 | %attr(755,root,root) %{_sbindir}/tipc |
5916d627 | 233 | %attr(755,root,root) %{_sbindir}/vdpa |
dd519f44 | 234 | %dir %{_sysconfdir} |
64551ae4 | 235 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bpf_pinning |
c2884fcb AM |
236 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ematch_map |
237 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/group | |
03b26d3c | 238 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nl_protos |
c2884fcb | 239 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_dsfield |
e1c03590 ER |
240 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_protos |
241 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_realms | |
242 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_scopes | |
243 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_tables | |
a0cc6116 | 244 | %{_mandir}/man8/bridge.8* |
a7f458f6 | 245 | %{_mandir}/man8/ctstat.8* |
5916d627 JB |
246 | %{_mandir}/man8/dcb.8* |
247 | %{_mandir}/man8/dcb-app.8* | |
248 | %{_mandir}/man8/dcb-buffer.8* | |
249 | %{_mandir}/man8/dcb-dcbx.8* | |
250 | %{_mandir}/man8/dcb-ets.8* | |
251 | %{_mandir}/man8/dcb-maxrate.8* | |
252 | %{_mandir}/man8/dcb-pfc.8* | |
3f07eebf JB |
253 | %{_mandir}/man8/devlink.8* |
254 | %{_mandir}/man8/devlink-dev.8* | |
f8112367 | 255 | %{_mandir}/man8/devlink-dpipe.8* |
8f9f37a4 | 256 | %{_mandir}/man8/devlink-health.8* |
74ae30ca | 257 | %{_mandir}/man8/devlink-lc.8* |
3f07eebf JB |
258 | %{_mandir}/man8/devlink-monitor.8* |
259 | %{_mandir}/man8/devlink-port.8* | |
4a3626c0 | 260 | %{_mandir}/man8/devlink-rate.8* |
d02fa201 | 261 | %{_mandir}/man8/devlink-region.8* |
f8112367 | 262 | %{_mandir}/man8/devlink-resource.8* |
3f07eebf | 263 | %{_mandir}/man8/devlink-sb.8* |
ca5bdfd0 | 264 | %{_mandir}/man8/devlink-trap.8* |
f8112367 | 265 | %{_mandir}/man8/genl.8* |
b60f3d88 | 266 | %{_mandir}/man8/ifstat.8* |
f8112367 JB |
267 | %{_mandir}/man8/ip.8* |
268 | %{_mandir}/man8/ip-*.8* | |
3679d517 | 269 | %{_mandir}/man8/lnstat.8* |
2dffe0e0 | 270 | %{_mandir}/man8/nstat.8* |
40d95966 | 271 | %{_mandir}/man8/rdma.8* |
9542c7cd AM |
272 | %{_mandir}/man8/rdma-dev.8* |
273 | %{_mandir}/man8/rdma-link.8* | |
4f323620 | 274 | %{_mandir}/man8/rdma-resource.8* |
40d95966 JB |
275 | %{_mandir}/man8/rdma-statistic.8* |
276 | %{_mandir}/man8/rdma-system.8* | |
3679d517 JB |
277 | %{_mandir}/man8/rtacct.8* |
278 | %{_mandir}/man8/rtmon.8* | |
a7f458f6 | 279 | %{_mandir}/man8/rtstat.8* |
215c2053 AO |
280 | %{_mandir}/man8/tipc.8* |
281 | %{_mandir}/man8/tipc-*.8* | |
5916d627 JB |
282 | %{_mandir}/man8/vdpa.8* |
283 | %{_mandir}/man8/vdpa-dev.8* | |
284 | %{_mandir}/man8/vdpa-mgmtdev.8* | |
d9c85390 JP |
285 | %{systemdtmpfilesdir}/%{name}.conf |
286 | %dir %attr(750,root,root) /var/run/netns | |
287 | ||
288 | %files routel | |
289 | %defattr(644,root,root,755) | |
290 | %attr(755,root,root) %{_sbindir}/routel | |
291 | %{_mandir}/man8/routel.8* | |
292 | ||
293 | %files ss | |
294 | %defattr(644,root,root,755) | |
295 | %attr(755,root,root) %{_sbindir}/ss | |
296 | %{_mandir}/man8/ss.8* | |
297 | ||
9fc1dfd7 | 298 | %if %{with tc} |
d9c85390 JP |
299 | %files tc |
300 | %defattr(644,root,root,755) | |
3679d517 | 301 | %attr(755,root,root) %{_sbindir}/tc |
9fc1dfd7 ER |
302 | %dir %{_libdir}/tc |
303 | %attr(755,root,root) %{_libdir}/tc/*.so | |
c2884fcb | 304 | %{_libdir}/tc/*.dist |
1f99b759 | 305 | %{_mandir}/man7/tc-hfsc.7* |
3679d517 JB |
306 | %{_mandir}/man8/tc.8* |
307 | %{_mandir}/man8/tc-*.8* | |
9fc1dfd7 | 308 | %endif |
49c78676 | 309 | |
b60f3d88 JB |
310 | %files devel |
311 | %defattr(644,root,root,755) | |
312 | %{_includedir}/iproute2 | |
313 | ||
49c78676 JK |
314 | %files -n libnetlink-devel |
315 | %defattr(644,root,root,755) | |
c529e3fb JB |
316 | %{_libdir}/libnetlink.a |
317 | %{_includedir}/libnetlink.h | |
e1c03590 | 318 | %{_mandir}/man3/libnetlink.3* |
9fc1dfd7 | 319 | |
aca0174e JB |
320 | %files -n bash-completion-iproute2 |
321 | %defattr(644,root,root,755) | |
f8112367 | 322 | %{bash_compdir}/devlink |
aca0174e | 323 | %{bash_compdir}/tc |