]> git.pld-linux.org Git - packages/iproute2.git/blob - iproute2.spec
228652bfb9f9e11069feb227d621c792c9247fe2
[packages/iproute2.git] / iproute2.spec
1 #
2 # TODO:
3 # - fix build @ uClibc
4 # - fix iface_descr patch
5 #
6 # Conditional build
7 %bcond_without  tc              # don't build tc program (it breaks static linkage)
8 %bcond_with     uClibc          # do some hacks to build with uClibc
9 %bcond_with     iface_descr     # build with interface description support
10
11 Summary:        Advanced IP routing and network device configuration tools
12 Summary(es.UTF-8):      Herramientas para encaminamiento avanzado y configuración de interfaces de red
13 Summary(pl.UTF-8):      Narzędzie do konfigurowania sieci
14 Summary(pt_BR.UTF-8):   Ferramentas para roteamento avançado e configuração de interfaces de rede
15 Name:           iproute2
16 Version:        6.7.0
17 Release:        1
18 License:        GPL v2+
19 Group:          Networking/Admin
20 Source0:        https://www.kernel.org/pub/linux/utils/net/iproute2/%{name}-%{version}.tar.xz
21 # Source0-md5:  35d8277d1469596b7edc07a51470a033
22 Source1:        %{name}.tmpfiles
23 Patch3:         %{name}-LDFLAGS.patch
24
25 Patch5:         %{name}-build.patch
26 Patch6:         %{name}-print_cache_route_entries.patch
27 # extensions
28 Patch10:        %{name}-2.2.4-wrr.patch
29 Patch11:        esfq-%{name}.patch
30 Patch12:        001-net-dev-iface-descr-0.1.diff
31 Patch14:        %{name}-q_srr.v0.4.patch
32 Patch15:        %{name}-ip_route_get.patch
33 URL:            https://wiki.linuxfoundation.org/networking/iproute2
34 BuildRequires:  bison
35 BuildRequires:  db-devel
36 # libelf
37 BuildRequires:  elfutils-devel
38 BuildRequires:  flex
39 BuildRequires:  iptables-devel >= 0:1.4.5
40 BuildRequires:  libbpf-devel >= 0.1.0
41 BuildRequires:  libbsd-devel
42 BuildRequires:  libcap-devel
43 BuildRequires:  libmnl-devel
44 BuildRequires:  libselinux-devel
45 BuildRequires:  libtirpc-devel
46 BuildRequires:  linux-libc-headers >= 7:2.6.12.0-15
47 BuildRequires:  pkgconfig
48 BuildRequires:  rpm-build >= 4.6
49 BuildRequires:  rpmbuild(macros) >= 1.673
50 BuildRequires:  sed >= 4.0
51 BuildRequires:  tar >= 1:1.22
52 BuildRequires:  xz
53 Suggests:       %{name}-routel = %{version}-%{release}
54 Suggests:       %{name}-ss = %{version}-%{release}
55 Suggests:       %{name}-tc = %{version}-%{release}
56 Obsoletes:      ifstat < 1.2
57 Obsoletes:      iproute
58 Obsoletes:      iproute2-doc < 4.14.1
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %define         _sbindir        /sbin
62 %define         _defaultconfdir %{_datadir}/iproute2
63
64 %description
65 The iproute package contains networking utilities (ip, tc and rtmon,
66 for example) which are designed to use the advanced networking
67 capabilities of the Linux 2.4.x and 2.6.x kernel.
68
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
73 incluye los nuevos utilitarios.
74
75 %description -l pl.UTF-8
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.
79
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
84 includes the new utilities.
85
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
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
123 %package -n libnetlink-devel
124 Summary:        Library for the netlink interface
125 Summary(pl.UTF-8):      Biblioteka do interfejsu netlink
126 Group:          Development/Libraries
127
128 %description -n libnetlink-devel
129 This library provides an interface for kernel-user netlink interface.
130
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.
134
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}
140 Requires:       bash-completion >= 1:2.0
141 BuildArch:      noarch
142
143 %description -n bash-completion-iproute2
144 Bash completion for iproute2 commands (currently devlink and tc).
145
146 %description -n bash-completion-iproute2 -l pl.UTF-8
147 Bashowe dopełnianie parametrów poleceń iproute2 (obecnie devlink i
148 tc).
149
150 %prep
151 %setup -q
152
153 # conflict with atm-vbr patched linux-libc-headers
154 %{__rm} include/uapi/linux/atm.h
155
156 %patch3 -p1
157
158 %patch5 -p1
159 %patch6 -p1
160 # extensions:
161 %patch10 -p1
162 %patch11 -p1
163 %{?with_iface_descr:%patch12 -p1}
164 %patch14 -p1
165 %patch15 -p1
166
167 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' ip/routel
168
169 %build
170 %{__make} \
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
178         HOSTCC="%{__cc}" \
179         CCOPTS="%{rpmcflags} %{rpmcppflags} -Wno-unused-result -DXT_LIB_DIR=\\\"%{_libdir}/xtables\\\"" \
180         LDFLAGS="%{rpmldflags} -Wl,-export-dynamic" \
181         LIBDIR=%{_libdir} \
182         %{!?with_tc:SUBDIRS="lib ip misc"} \
183         V=1
184
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
188 %install
189 rm -rf $RPM_BUILD_ROOT
190 install -d $RPM_BUILD_ROOT%{_sysconfdir}/iproute2/{protodown_reasons,rt_protos,rt_tables}.d \
191         $RPM_BUILD_ROOT%{_defaultconfdir}/{protodown_reasons,rt_protos,rt_tables}.d \
192         $RPM_BUILD_ROOT{%{_includedir},/var/run/netns,%{systemdtmpfilesdir}}
193
194 %{__make} install \
195         LIBDIR=%{_libdir} \
196         DESTDIR=$RPM_BUILD_ROOT
197
198 # omitted by make install
199 install -Dp man/man7/tc-hfsc.7 $RPM_BUILD_ROOT%{_mandir}/man7/tc-hfsc.7
200
201 # arpd is not packaged here
202 %{__rm} $RPM_BUILD_ROOT%{_sbindir}/arpd $RPM_BUILD_ROOT%{_mandir}/man8/arpd.8
203
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
208
209 %clean
210 rm -rf $RPM_BUILD_ROOT
211
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
219 %files
220 %defattr(644,root,root,755)
221 %doc README doc/actions examples
222 %attr(755,root,root) %{_sbindir}/bridge
223 %attr(755,root,root) %{_sbindir}/ctstat
224 %attr(755,root,root) %{_sbindir}/dcb
225 %attr(755,root,root) %{_sbindir}/devlink
226 %attr(755,root,root) %{_sbindir}/genl
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
231 %attr(755,root,root) %{_sbindir}/rdma
232 %attr(755,root,root) %{_sbindir}/rtacct
233 %attr(755,root,root) %{_sbindir}/rtmon
234 %attr(755,root,root) %{_sbindir}/rtstat
235 %attr(755,root,root) %{_sbindir}/tipc
236 %attr(755,root,root) %{_sbindir}/vdpa
237 # default configs
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
251 # config overrides
252 %dir %{_sysconfdir}/iproute2
253 %dir %{_sysconfdir}/iproute2/protodown_reasons.d
254 %dir %{_sysconfdir}/iproute2/rt_protos.d
255 %dir %{_sysconfdir}/iproute2/rt_tables.d
256 %{_mandir}/man8/bridge.8*
257 %{_mandir}/man8/ctstat.8*
258 %{_mandir}/man8/dcb.8*
259 %{_mandir}/man8/dcb-app.8*
260 %{_mandir}/man8/dcb-apptrust.8*
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*
266 %{_mandir}/man8/dcb-rewr.8*
267 %{_mandir}/man8/devlink.8*
268 %{_mandir}/man8/devlink-dev.8*
269 %{_mandir}/man8/devlink-dpipe.8*
270 %{_mandir}/man8/devlink-health.8*
271 %{_mandir}/man8/devlink-lc.8*
272 %{_mandir}/man8/devlink-monitor.8*
273 %{_mandir}/man8/devlink-port.8*
274 %{_mandir}/man8/devlink-rate.8*
275 %{_mandir}/man8/devlink-region.8*
276 %{_mandir}/man8/devlink-resource.8*
277 %{_mandir}/man8/devlink-sb.8*
278 %{_mandir}/man8/devlink-trap.8*
279 %{_mandir}/man8/genl.8*
280 %{_mandir}/man8/ifstat.8*
281 %{_mandir}/man8/ip.8*
282 %{_mandir}/man8/ip-*.8*
283 %{_mandir}/man8/lnstat.8*
284 %{_mandir}/man8/nstat.8*
285 %{_mandir}/man8/rdma.8*
286 %{_mandir}/man8/rdma-dev.8*
287 %{_mandir}/man8/rdma-link.8*
288 %{_mandir}/man8/rdma-resource.8*
289 %{_mandir}/man8/rdma-statistic.8*
290 %{_mandir}/man8/rdma-system.8*
291 %{_mandir}/man8/rtacct.8*
292 %{_mandir}/man8/rtmon.8*
293 %{_mandir}/man8/rtstat.8*
294 %{_mandir}/man8/tipc.8*
295 %{_mandir}/man8/tipc-*.8*
296 %{_mandir}/man8/vdpa.8*
297 %{_mandir}/man8/vdpa-dev.8*
298 %{_mandir}/man8/vdpa-mgmtdev.8*
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
312 %if %{with tc}
313 %files tc
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_sbindir}/tc
316 %dir %{_libdir}/tc
317 %attr(755,root,root) %{_libdir}/tc/*.so
318 %{_libdir}/tc/*.dist
319 %{_mandir}/man7/tc-hfsc.7*
320 %{_mandir}/man8/tc.8*
321 %{_mandir}/man8/tc-*.8*
322 %endif
323
324 %files devel
325 %defattr(644,root,root,755)
326 %{_includedir}/iproute2
327
328 %files -n libnetlink-devel
329 %defattr(644,root,root,755)
330 %{_libdir}/libnetlink.a
331 %{_includedir}/libnetlink.h
332 %{_mandir}/man3/libnetlink.3*
333
334 %files -n bash-completion-iproute2
335 %defattr(644,root,root,755)
336 %{bash_compdir}/devlink
337 %{bash_compdir}/tc
This page took 0.059166 seconds and 3 git commands to generate.