]>
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 |
2f1a6712 | 17 | Version: 6.6.0 |
bb5be3d8 | 18 | Release: 2 |
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 |
2f1a6712 | 22 | # Source0-md5: 6716fc3188dbea226997fa2478a190d7 |
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 |
1e459dde | 67 | %define _defaultconfdir %{_libdir}/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} | |
3d1eb348 | 145 | Requires: bash-completion >= 1: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 | |
02397d99 | 196 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/iproute2/{protodown_reasons,rt_protos,rt_tables}.d \ |
1e459dde | 197 | $RPM_BUILD_ROOT%{_defaultconfdir}/{protodown_reasons,rt_protos,rt_tables}.d \ |
02397d99 | 198 | $RPM_BUILD_ROOT{%{_includedir},/var/run/netns,%{systemdtmpfilesdir}} |
c2884fcb AM |
199 | |
200 | %{__make} install \ | |
201 | LIBDIR=%{_libdir} \ | |
202 | DESTDIR=$RPM_BUILD_ROOT | |
203 | ||
1f99b759 JB |
204 | # omitted by make install |
205 | install -Dp man/man7/tc-hfsc.7 $RPM_BUILD_ROOT%{_mandir}/man7/tc-hfsc.7 | |
206 | ||
fa272163 | 207 | # arpd is not packaged here |
c2884fcb | 208 | %{__rm} $RPM_BUILD_ROOT%{_sbindir}/arpd $RPM_BUILD_ROOT%{_mandir}/man8/arpd.8 |
0a1f6d9e | 209 | |
32443dcd ER |
210 | cp -p lib/libnetlink.a $RPM_BUILD_ROOT%{_libdir} |
211 | cp -p include/libnetlink.h $RPM_BUILD_ROOT%{_includedir} | |
212 | ||
213 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
354f4215 | 214 | |
8ca003ed AM |
215 | %clean |
216 | rm -rf $RPM_BUILD_ROOT | |
217 | ||
bb5be3d8 JP |
218 | %triggerpostun -- iproute2 < 6.6.0-2 |
219 | for c in bpf_pinning ematch_map group nl_protos rt_dsfield rt_protos rt_realms rt_scopes rt_tables; do | |
220 | if [ -f /etc/iproute2/$c.rpmsave ] && [ ! -e /etc/iproute2/$c ]; then | |
221 | %{__mv} -f /etc/iproute2/$c.rpmsave /etc/iproute2/$c | |
222 | fi | |
223 | done | |
224 | ||
8ca003ed AM |
225 | %files |
226 | %defattr(644,root,root,755) | |
ca5bdfd0 | 227 | %doc README doc/actions examples |
c2884fcb | 228 | %attr(755,root,root) %{_sbindir}/bridge |
a7f458f6 | 229 | %attr(755,root,root) %{_sbindir}/ctstat |
5916d627 | 230 | %attr(755,root,root) %{_sbindir}/dcb |
aca0174e | 231 | %attr(755,root,root) %{_sbindir}/devlink |
c2884fcb | 232 | %attr(755,root,root) %{_sbindir}/genl |
e1c03590 ER |
233 | %attr(755,root,root) %{_sbindir}/ifstat |
234 | %attr(755,root,root) %{_sbindir}/ip | |
235 | %attr(755,root,root) %{_sbindir}/lnstat | |
236 | %attr(755,root,root) %{_sbindir}/nstat | |
9542c7cd | 237 | %attr(755,root,root) %{_sbindir}/rdma |
e1c03590 ER |
238 | %attr(755,root,root) %{_sbindir}/rtacct |
239 | %attr(755,root,root) %{_sbindir}/rtmon | |
a7f458f6 | 240 | %attr(755,root,root) %{_sbindir}/rtstat |
6bbfa630 | 241 | %attr(755,root,root) %{_sbindir}/tipc |
5916d627 | 242 | %attr(755,root,root) %{_sbindir}/vdpa |
256e3b0c | 243 | # default configs |
1e459dde JP |
244 | %dir %{_defaultconfdir} |
245 | %{_defaultconfdir}/bpf_pinning | |
246 | %{_defaultconfdir}/ematch_map | |
247 | %{_defaultconfdir}/group | |
248 | %{_defaultconfdir}/nl_protos | |
249 | %{_defaultconfdir}/rt_dsfield | |
250 | %{_defaultconfdir}/rt_protos | |
251 | %{_defaultconfdir}/rt_realms | |
252 | %{_defaultconfdir}/rt_scopes | |
253 | %{_defaultconfdir}/rt_tables | |
254 | %dir %{_defaultconfdir}/protodown_reasons.d | |
255 | %dir %{_defaultconfdir}/rt_protos.d | |
256 | %dir %{_defaultconfdir}/rt_tables.d | |
256e3b0c JB |
257 | # config overrides |
258 | %dir %{_sysconfdir}/iproute2 | |
02397d99 JP |
259 | %dir %{_sysconfdir}/iproute2/protodown_reasons.d |
260 | %dir %{_sysconfdir}/iproute2/rt_protos.d | |
261 | %dir %{_sysconfdir}/iproute2/rt_tables.d | |
a0cc6116 | 262 | %{_mandir}/man8/bridge.8* |
a7f458f6 | 263 | %{_mandir}/man8/ctstat.8* |
5916d627 JB |
264 | %{_mandir}/man8/dcb.8* |
265 | %{_mandir}/man8/dcb-app.8* | |
ee45e263 | 266 | %{_mandir}/man8/dcb-apptrust.8* |
5916d627 JB |
267 | %{_mandir}/man8/dcb-buffer.8* |
268 | %{_mandir}/man8/dcb-dcbx.8* | |
269 | %{_mandir}/man8/dcb-ets.8* | |
270 | %{_mandir}/man8/dcb-maxrate.8* | |
271 | %{_mandir}/man8/dcb-pfc.8* | |
0fd04007 | 272 | %{_mandir}/man8/dcb-rewr.8* |
3f07eebf JB |
273 | %{_mandir}/man8/devlink.8* |
274 | %{_mandir}/man8/devlink-dev.8* | |
f8112367 | 275 | %{_mandir}/man8/devlink-dpipe.8* |
8f9f37a4 | 276 | %{_mandir}/man8/devlink-health.8* |
74ae30ca | 277 | %{_mandir}/man8/devlink-lc.8* |
3f07eebf JB |
278 | %{_mandir}/man8/devlink-monitor.8* |
279 | %{_mandir}/man8/devlink-port.8* | |
4a3626c0 | 280 | %{_mandir}/man8/devlink-rate.8* |
d02fa201 | 281 | %{_mandir}/man8/devlink-region.8* |
f8112367 | 282 | %{_mandir}/man8/devlink-resource.8* |
3f07eebf | 283 | %{_mandir}/man8/devlink-sb.8* |
ca5bdfd0 | 284 | %{_mandir}/man8/devlink-trap.8* |
f8112367 | 285 | %{_mandir}/man8/genl.8* |
b60f3d88 | 286 | %{_mandir}/man8/ifstat.8* |
f8112367 JB |
287 | %{_mandir}/man8/ip.8* |
288 | %{_mandir}/man8/ip-*.8* | |
3679d517 | 289 | %{_mandir}/man8/lnstat.8* |
2dffe0e0 | 290 | %{_mandir}/man8/nstat.8* |
40d95966 | 291 | %{_mandir}/man8/rdma.8* |
9542c7cd AM |
292 | %{_mandir}/man8/rdma-dev.8* |
293 | %{_mandir}/man8/rdma-link.8* | |
4f323620 | 294 | %{_mandir}/man8/rdma-resource.8* |
40d95966 JB |
295 | %{_mandir}/man8/rdma-statistic.8* |
296 | %{_mandir}/man8/rdma-system.8* | |
3679d517 JB |
297 | %{_mandir}/man8/rtacct.8* |
298 | %{_mandir}/man8/rtmon.8* | |
a7f458f6 | 299 | %{_mandir}/man8/rtstat.8* |
215c2053 AO |
300 | %{_mandir}/man8/tipc.8* |
301 | %{_mandir}/man8/tipc-*.8* | |
5916d627 JB |
302 | %{_mandir}/man8/vdpa.8* |
303 | %{_mandir}/man8/vdpa-dev.8* | |
304 | %{_mandir}/man8/vdpa-mgmtdev.8* | |
d9c85390 JP |
305 | %{systemdtmpfilesdir}/%{name}.conf |
306 | %dir %attr(750,root,root) /var/run/netns | |
307 | ||
308 | %files routel | |
309 | %defattr(644,root,root,755) | |
310 | %attr(755,root,root) %{_sbindir}/routel | |
311 | %{_mandir}/man8/routel.8* | |
312 | ||
313 | %files ss | |
314 | %defattr(644,root,root,755) | |
315 | %attr(755,root,root) %{_sbindir}/ss | |
316 | %{_mandir}/man8/ss.8* | |
317 | ||
9fc1dfd7 | 318 | %if %{with tc} |
d9c85390 JP |
319 | %files tc |
320 | %defattr(644,root,root,755) | |
3679d517 | 321 | %attr(755,root,root) %{_sbindir}/tc |
9fc1dfd7 ER |
322 | %dir %{_libdir}/tc |
323 | %attr(755,root,root) %{_libdir}/tc/*.so | |
c2884fcb | 324 | %{_libdir}/tc/*.dist |
1f99b759 | 325 | %{_mandir}/man7/tc-hfsc.7* |
3679d517 JB |
326 | %{_mandir}/man8/tc.8* |
327 | %{_mandir}/man8/tc-*.8* | |
9fc1dfd7 | 328 | %endif |
49c78676 | 329 | |
b60f3d88 JB |
330 | %files devel |
331 | %defattr(644,root,root,755) | |
332 | %{_includedir}/iproute2 | |
333 | ||
49c78676 JK |
334 | %files -n libnetlink-devel |
335 | %defattr(644,root,root,755) | |
c529e3fb JB |
336 | %{_libdir}/libnetlink.a |
337 | %{_includedir}/libnetlink.h | |
e1c03590 | 338 | %{_mandir}/man3/libnetlink.3* |
9fc1dfd7 | 339 | |
aca0174e JB |
340 | %files -n bash-completion-iproute2 |
341 | %defattr(644,root,root,755) | |
f8112367 | 342 | %{bash_compdir}/devlink |
aca0174e | 343 | %{bash_compdir}/tc |