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