4 # - fix iface_descr patch
7 %bcond_without tc # don't build tc program (it breaks static linkage)
8 %bcond_without atm # disable ATM support for tc
9 %bcond_with uClibc # do some hacks to build with uClibc
10 %bcond_with iface_descr # build with interface description support
12 Summary: Advanced IP routing and network device configuration tools
13 Summary(es.UTF-8): Herramientas para encaminamiento avanzado y configuración de interfaces de red
14 Summary(pl.UTF-8): Narzędzie do konfigurowania sieci
15 Summary(pt_BR.UTF-8): Ferramentas para roteamento avançado e configuração de interfaces de rede
20 Group: Networking/Admin
21 Source0: https://www.kernel.org/pub/linux/utils/net/iproute2/%{name}-%{version}.tar.xz
22 # Source0-md5: ae811fc51b3a2c9c7701be308152c45a
23 Source1: %{name}.tmpfiles
24 Patch0: %{name}-link.patch
25 Patch3: %{name}-LDFLAGS.patch
27 Patch5: %{name}-build.patch
28 Patch6: %{name}-print_cache_route_entries.patch
30 Patch10: %{name}-2.2.4-wrr.patch
31 Patch11: esfq-%{name}.patch
32 Patch12: 001-net-dev-iface-descr-0.1.diff
33 Patch14: %{name}-q_srr.v0.4.patch
34 Patch15: %{name}-ip_route_get.patch
35 URL: https://wiki.linuxfoundation.org/networking/iproute2
37 BuildRequires: db-devel
39 BuildRequires: elfutils-devel
41 BuildRequires: iptables-devel >= 0:1.4.5
42 BuildRequires: libbpf-devel >= 0.1.0
43 BuildRequires: libbsd-devel
44 BuildRequires: libcap-devel
45 BuildRequires: libmnl-devel
46 BuildRequires: libselinux-devel
47 BuildRequires: libtirpc-devel
49 BuildRequires: linux-atm-devel
51 BuildRequires: linux-libc-headers >= 7:2.6.12.0-15
52 BuildRequires: pkgconfig
53 BuildRequires: rpm-build >= 4.6
54 BuildRequires: rpmbuild(macros) >= 1.673
55 BuildRequires: sed >= 4.0
56 BuildRequires: tar >= 1:1.22
58 Suggests: %{name}-routel = %{version}-%{release}
59 Suggests: %{name}-ss = %{version}-%{release}
60 Suggests: %{name}-tc = %{version}-%{release}
61 Obsoletes: ifstat < 1.2
63 Obsoletes: iproute2-doc < 4.14.1
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 %define _sbindir /sbin
69 The iproute package contains networking utilities (ip, tc and rtmon,
70 for example) which are designed to use the advanced networking
71 capabilities of the Linux 2.4.x and 2.6.x kernel.
73 %description -l es.UTF-8
74 Linux mantiene compatibilidad con los utilitarios estándares de
75 configuración de la red, pero se necesitan nuevos utilitarios para
76 usar los recursos y características del nuevo núcleo. Este paquete
77 incluye los nuevos utilitarios.
79 %description -l pl.UTF-8
80 Ten pakiet zawiera programy (m.in. ip, tc, rtmon) pozwalające na
81 kontrolę routingu i innych aspektów dotyczących sieci z wykorzystaniem
82 zaawansowanych możliwości jąder Linuksa 2.4.x i 2.6.x.
84 %description -l pt_BR.UTF-8
85 O Linux mantém compatibilidade com os utilitários padrão de
86 configuração da rede, mas novos utilitários são necessários para fazer
87 uso das características e recursos da nova kernel. This package
88 includes the new utilities.
91 Summary: routel - list routes with pretty output format
92 Requires: %{name} = %{version}-%{release}
94 Requires: python3-modules
97 The routel script will list routes in a format that some might
98 consider easier to interpret then the ip route list equivalent.
101 Summary: ss - another utility to investigate sockets
104 ss is used to dump socket statistics. It allows showing information
105 similar to netstat. It can display more TCP and state information than
109 Summary: tc - show / manipulate traffic control settings
110 Requires: iptables-libs >= 0:1.4.5
113 Tc is used to configure Traffic Control in the Linux kernel.
116 Summary: Header file for tc plugins development
117 Summary(pl.UTF-8): Plik nagłówkowy do tworzenia wtyczek programu tc
118 Group: Development/Libraries
119 # doesn't require base
122 Header file for tc plugins development.
124 %description devel -l pl.UTF-8
125 Plik nagłówkowy do tworzenia wtyczek programu tc.
127 %package -n libnetlink-devel
128 Summary: Library for the netlink interface
129 Summary(pl.UTF-8): Biblioteka do interfejsu netlink
130 Group: Development/Libraries
132 %description -n libnetlink-devel
133 This library provides an interface for kernel-user netlink interface.
135 %description -n libnetlink-devel -l pl.UTF-8
136 Ta biblioteka udostępnia interfejs do interfejsu netlink między jądrem
137 a przestrzenią użytkownika.
139 %package -n bash-completion-iproute2
140 Summary: Bash completion for iproute2 commands
141 Summary(pl.UTF-8): Bashowe dopełnianie parametrów poleceń iproute2
142 Group: Applications/Shells
143 Requires: %{name} = %{version}-%{release}
144 Requires: bash-completion >= 1:2.0
147 %description -n bash-completion-iproute2
148 Bash completion for iproute2 commands (currently devlink and tc).
150 %description -n bash-completion-iproute2 -l pl.UTF-8
151 Bashowe dopełnianie parametrów poleceń iproute2 (obecnie devlink i
157 # conflict with atm-vbr patched linux-libc-headers
158 %{__rm} include/uapi/linux/atm.h
168 %{?with_iface_descr:%patch12 -p1}
172 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' ip/routel
177 CC="%{_target_cpu}-uclibc-gcc" \
178 LD="%{_target_cpu}-uclibc-gcc" \
184 CCOPTS="%{rpmcflags} %{rpmcppflags} -Wno-unused-result -DXT_LIB_DIR=\\\"%{_libdir}/xtables\\\"" \
185 LDFLAGS="%{rpmldflags} -Wl,-export-dynamic" \
187 %{!?with_tc:SUBDIRS="lib ip misc"} \
190 # make sure we don't produce broken ip binary
191 ./ip/ip link add type vlan help 2>&1 | grep -q "VLANID :=" || exit 1
194 rm -rf $RPM_BUILD_ROOT
195 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/iproute2,%{_includedir},/var/run/netns,%{systemdtmpfilesdir}}
199 DESTDIR=$RPM_BUILD_ROOT
201 # omitted by make install
202 install -Dp man/man7/tc-hfsc.7 $RPM_BUILD_ROOT%{_mandir}/man7/tc-hfsc.7
204 # arpd is not packaged here
205 %{__rm} $RPM_BUILD_ROOT%{_sbindir}/arpd $RPM_BUILD_ROOT%{_mandir}/man8/arpd.8
207 cp -p lib/libnetlink.a $RPM_BUILD_ROOT%{_libdir}
208 cp -p include/libnetlink.h $RPM_BUILD_ROOT%{_includedir}
210 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
213 rm -rf $RPM_BUILD_ROOT
216 %defattr(644,root,root,755)
217 %doc README doc/actions examples
218 %attr(755,root,root) %{_sbindir}/bridge
219 %attr(755,root,root) %{_sbindir}/ctstat
220 %attr(755,root,root) %{_sbindir}/dcb
221 %attr(755,root,root) %{_sbindir}/devlink
222 %attr(755,root,root) %{_sbindir}/genl
223 %attr(755,root,root) %{_sbindir}/ifstat
224 %attr(755,root,root) %{_sbindir}/ip
225 %attr(755,root,root) %{_sbindir}/lnstat
226 %attr(755,root,root) %{_sbindir}/nstat
227 %attr(755,root,root) %{_sbindir}/rdma
228 %attr(755,root,root) %{_sbindir}/rtacct
229 %attr(755,root,root) %{_sbindir}/rtmon
230 %attr(755,root,root) %{_sbindir}/rtstat
231 %attr(755,root,root) %{_sbindir}/tipc
232 %attr(755,root,root) %{_sbindir}/vdpa
234 %{_prefix}/lib/iproute2
236 %dir %{_sysconfdir}/iproute2
237 %{_mandir}/man8/bridge.8*
238 %{_mandir}/man8/ctstat.8*
239 %{_mandir}/man8/dcb.8*
240 %{_mandir}/man8/dcb-app.8*
241 %{_mandir}/man8/dcb-apptrust.8*
242 %{_mandir}/man8/dcb-buffer.8*
243 %{_mandir}/man8/dcb-dcbx.8*
244 %{_mandir}/man8/dcb-ets.8*
245 %{_mandir}/man8/dcb-maxrate.8*
246 %{_mandir}/man8/dcb-pfc.8*
247 %{_mandir}/man8/dcb-rewr.8*
248 %{_mandir}/man8/devlink.8*
249 %{_mandir}/man8/devlink-dev.8*
250 %{_mandir}/man8/devlink-dpipe.8*
251 %{_mandir}/man8/devlink-health.8*
252 %{_mandir}/man8/devlink-lc.8*
253 %{_mandir}/man8/devlink-monitor.8*
254 %{_mandir}/man8/devlink-port.8*
255 %{_mandir}/man8/devlink-rate.8*
256 %{_mandir}/man8/devlink-region.8*
257 %{_mandir}/man8/devlink-resource.8*
258 %{_mandir}/man8/devlink-sb.8*
259 %{_mandir}/man8/devlink-trap.8*
260 %{_mandir}/man8/genl.8*
261 %{_mandir}/man8/ifstat.8*
262 %{_mandir}/man8/ip.8*
263 %{_mandir}/man8/ip-*.8*
264 %{_mandir}/man8/lnstat.8*
265 %{_mandir}/man8/nstat.8*
266 %{_mandir}/man8/rdma.8*
267 %{_mandir}/man8/rdma-dev.8*
268 %{_mandir}/man8/rdma-link.8*
269 %{_mandir}/man8/rdma-resource.8*
270 %{_mandir}/man8/rdma-statistic.8*
271 %{_mandir}/man8/rdma-system.8*
272 %{_mandir}/man8/rtacct.8*
273 %{_mandir}/man8/rtmon.8*
274 %{_mandir}/man8/rtstat.8*
275 %{_mandir}/man8/tipc.8*
276 %{_mandir}/man8/tipc-*.8*
277 %{_mandir}/man8/vdpa.8*
278 %{_mandir}/man8/vdpa-dev.8*
279 %{_mandir}/man8/vdpa-mgmtdev.8*
280 %{systemdtmpfilesdir}/%{name}.conf
281 %dir %attr(750,root,root) /var/run/netns
284 %defattr(644,root,root,755)
285 %attr(755,root,root) %{_sbindir}/routel
286 %{_mandir}/man8/routel.8*
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{_sbindir}/ss
291 %{_mandir}/man8/ss.8*
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_sbindir}/tc
298 %attr(755,root,root) %{_libdir}/tc/*.so
300 %{_mandir}/man7/tc-hfsc.7*
301 %{_mandir}/man8/tc.8*
302 %{_mandir}/man8/tc-*.8*
306 %defattr(644,root,root,755)
307 %{_includedir}/iproute2
309 %files -n libnetlink-devel
310 %defattr(644,root,root,755)
311 %{_libdir}/libnetlink.a
312 %{_includedir}/libnetlink.h
313 %{_mandir}/man3/libnetlink.3*
315 %files -n bash-completion-iproute2
316 %defattr(644,root,root,755)
317 %{bash_compdir}/devlink