]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # TODO: | |
3 | # - fix build @ uClibc | |
4 | # - fix iface_descr patch | |
5 | # | |
6 | # Conditional build | |
7 | %bcond_without doc # don't build documentation | |
8 | %bcond_without tc # don't build tc program (it breaks static linkage) | |
9 | %bcond_without atm # disable ATM support for tc | |
10 | %bcond_with uClibc # do some hacks to build with uClibc | |
11 | %bcond_with iface_descr # build with interface description support | |
12 | ||
13 | Summary: Advanced IP routing and network device configuration tools | |
14 | Summary(es.UTF-8): Herramientas para encaminamiento avanzado y configuración de interfaces de red | |
15 | Summary(pl.UTF-8): Narzędzie do konfigurowania sieci | |
16 | Summary(pt_BR.UTF-8): Ferramentas para roteamento avançado e configuração de interfaces de rede | |
17 | Name: iproute2 | |
18 | Version: 3.1.0 | |
19 | Release: 1 | |
20 | License: GPL v2+ | |
21 | Group: Networking/Admin | |
22 | Source0: http://kernel.org/pub/linux/utils/networking/iproute2/%{name}-%{version}.tar.xz | |
23 | # Source0-md5: 810cdc0ddc2409a7af7089588c6c9a68 | |
24 | Patch0: %{name}-build.patch | |
25 | Patch1: %{name}-arp.patch | |
26 | Patch3: %{name}-iptables.patch | |
27 | Patch4: %{name}-iptables64.patch | |
28 | Patch5: %{name}-LDFLAGS.patch | |
29 | # extensions | |
30 | Patch10: %{name}-2.2.4-wrr.patch | |
31 | Patch11: esfq-%{name}.patch | |
32 | Patch12: 001-net-dev-iface-descr-0.1.diff | |
33 | Patch13: %{name}-q_atm_c.patch | |
34 | Patch14: %{name}-q_srr.v0.4.patch | |
35 | Patch15: %{name}-ip_route_get.patch | |
36 | URL: http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 | |
37 | BuildRequires: bison | |
38 | BuildRequires: db-devel | |
39 | BuildRequires: flex | |
40 | BuildRequires: iptables-devel >= 0:1.4.5 | |
41 | %if %{with atm} | |
42 | BuildRequires: linux-atm-devel | |
43 | %endif | |
44 | BuildRequires: linux-libc-headers >= 7:2.6.12.0-15 | |
45 | %if %{with doc} | |
46 | BuildRequires: psutils | |
47 | BuildRequires: sgml-tools | |
48 | %if "%{pld_release}" != "th" | |
49 | BuildRequires: tetex-dvips | |
50 | BuildRequires: tetex-fonts-jknappen | |
51 | BuildRequires: tetex-format-latex | |
52 | BuildRequires: tetex-metafont | |
53 | BuildRequires: tetex-tex-babel | |
54 | %else | |
55 | BuildRequires: texlive-dvips | |
56 | BuildRequires: texlive-fonts-cmsuper | |
57 | BuildRequires: texlive-fonts-jknappen | |
58 | BuildRequires: texlive-latex | |
59 | BuildRequires: texlive-tex-babel | |
60 | %endif | |
61 | %endif | |
62 | Requires: iptables-libs >= 0:1.4.5 | |
63 | Obsoletes: ifstat | |
64 | Obsoletes: iproute | |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %define _sbindir /sbin | |
68 | %define _sysconfdir /etc/iproute2 | |
69 | ||
70 | %description | |
71 | The iproute package contains networking utilities (ip, tc and rtmon, | |
72 | for example) which are designed to use the advanced networking | |
73 | capabilities of the Linux 2.4.x and 2.6.x kernel. | |
74 | ||
75 | %description -l es.UTF-8 | |
76 | Linux mantiene compatibilidad con los utilitarios estándares de | |
77 | configuración de la red, pero se necesitan nuevos utilitarios para | |
78 | usar los recursos y características del nuevo núcleo. Este paquete | |
79 | incluye los nuevos utilitarios. | |
80 | ||
81 | %description -l pl.UTF-8 | |
82 | Ten pakiet zawiera programy (m.in. ip, tc, rtmon) pozwalające na | |
83 | kontrolę routingu i innych aspektów dotyczących sieci z wykorzystaniem | |
84 | zaawansowanych możliwości jąder Linuksa 2.4.x i 2.6.x. | |
85 | ||
86 | %description -l pt_BR.UTF-8 | |
87 | O Linux mantém compatibilidade com os utilitários padrão de | |
88 | configuração da rede, mas novos utilitários são necessários para fazer | |
89 | uso das características e recursos da nova kernel. This package | |
90 | includes the new utilities. | |
91 | ||
92 | %package -n libnetlink-devel | |
93 | Summary: Library for the netlink interface | |
94 | Summary(pl.UTF-8): Biblioteka do interfejsu netlink | |
95 | Group: Development/Libraries | |
96 | ||
97 | %description -n libnetlink-devel | |
98 | This library provides an interface for kernel-user netlink interface. | |
99 | ||
100 | %description -n libnetlink-devel -l pl.UTF-8 | |
101 | Ta biblioteka udostępnia interfejs do interfejsu netlink między jądrem | |
102 | a przestrzenią użytkownika. | |
103 | ||
104 | %package doc | |
105 | Summary: ip and tc documentation with examples | |
106 | Summary(pl.UTF-8): Dokumentacja do ip i tc z przykładami | |
107 | License: GPL v2+ | |
108 | Group: Applications/System | |
109 | ||
110 | %description doc | |
111 | The iproute documentation contains howtos and examples of settings. | |
112 | ||
113 | %description doc -l pl.UTF-8 | |
114 | Dokumentacja do iproute zawiera "howto" oraz przykłady ustawień. | |
115 | ||
116 | %prep | |
117 | %setup -q | |
118 | #rm -rf include/linux | |
119 | %patch0 -p1 | |
120 | %patch1 -p1 | |
121 | ||
122 | %if "%{_lib}" == "lib64" | |
123 | %patch4 -p1 | |
124 | %else | |
125 | %patch3 -p1 | |
126 | %endif | |
127 | %patch5 -p1 | |
128 | ||
129 | # extensions: | |
130 | %patch10 -p1 | |
131 | %patch11 -p1 | |
132 | %{?with_iface_descr:%patch12 -p1} | |
133 | %patch13 -p0 | |
134 | %patch14 -p1 | |
135 | %patch15 -p1 | |
136 | ||
137 | %build | |
138 | %{__make} \ | |
139 | %if %{with uClibc} | |
140 | CC="%{_target_cpu}-uclibc-gcc" \ | |
141 | LD="%{_target_cpu}-uclibc-gcc" \ | |
142 | %else | |
143 | CC="%{__cc}" \ | |
144 | LD="%{__cc}" \ | |
145 | %endif | |
146 | HOSTCC="%{__cc}" \ | |
147 | OPT="%{rpmcflags} %{rpmcppflags}" \ | |
148 | LDFLAGS="%{rpmldflags} -Wl,-export-dynamic" \ | |
149 | LIBDIR=%{_libdir} \ | |
150 | %{!?with_tc:SUBDIRS="lib ip misc"} | |
151 | ||
152 | %{?with_doc:%{__make} -C doc} | |
153 | ||
154 | # make sure we don't produce broken ip binary | |
155 | ./ip/ip link add type vlan help 2>&1 | grep -q "VLANID :=" || exit 1 | |
156 | ||
157 | %install | |
158 | rm -rf $RPM_BUILD_ROOT | |
159 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir},%{_mandir}/man{3,7,8},%{_libdir},%{_includedir},%{?with_tc:%{_libdir}/tc}} | |
160 | ||
161 | install -p ip/{ip,rtmon,routel} %{?with_tc:tc/tc} misc/{ifstat,lnstat,nstat,rtacct,ss} $RPM_BUILD_ROOT%{_sbindir} | |
162 | cp -a etc/iproute2/rt_protos \ | |
163 | etc/iproute2/rt_realms \ | |
164 | etc/iproute2/rt_scopes \ | |
165 | etc/iproute2/rt_tables \ | |
166 | $RPM_BUILD_ROOT%{_sysconfdir} | |
167 | ||
168 | cp -a man/man3/* $RPM_BUILD_ROOT%{_mandir}/man3 | |
169 | cp -a man/man7/* $RPM_BUILD_ROOT%{_mandir}/man7 | |
170 | cp -a man/man8/* $RPM_BUILD_ROOT%{_mandir}/man8 | |
171 | echo ".so tc-pbfifo.8" > $RPM_BUILD_ROOT%{_mandir}/man8/tc-bfifo.8 | |
172 | echo ".so tc-pbfifo.8" > $RPM_BUILD_ROOT%{_mandir}/man8/tc-pfifo.8 | |
173 | # arpd is not packaged here | |
174 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/arpd.8 | |
175 | ||
176 | cp -a lib/libnetlink.a $RPM_BUILD_ROOT%{_libdir} | |
177 | cp -a include/libnetlink.h $RPM_BUILD_ROOT%{_includedir} | |
178 | %{?with_tc:install -p tc/*.so $RPM_BUILD_ROOT%{_libdir}/tc} | |
179 | ||
180 | %if %{with doc} | |
181 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
182 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
183 | %endif | |
184 | ||
185 | %clean | |
186 | rm -rf $RPM_BUILD_ROOT | |
187 | ||
188 | %files | |
189 | %defattr(644,root,root,755) | |
190 | %doc README README.decnet README.iproute2+tc README.distribution README.lnstat | |
191 | %attr(755,root,root) %{_sbindir}/ifstat | |
192 | %attr(755,root,root) %{_sbindir}/ip | |
193 | %attr(755,root,root) %{_sbindir}/lnstat | |
194 | %attr(755,root,root) %{_sbindir}/nstat | |
195 | %attr(755,root,root) %{_sbindir}/routel | |
196 | %attr(755,root,root) %{_sbindir}/rtacct | |
197 | %attr(755,root,root) %{_sbindir}/rtmon | |
198 | %attr(755,root,root) %{_sbindir}/ss | |
199 | %dir %{_sysconfdir} | |
200 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_protos | |
201 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_realms | |
202 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_scopes | |
203 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rt_tables | |
204 | %{_mandir}/man8/ip.8* | |
205 | %{_mandir}/man8/lnstat.8* | |
206 | %{_mandir}/man8/routel.8* | |
207 | %{_mandir}/man8/rtacct.8* | |
208 | %{_mandir}/man8/rtmon.8* | |
209 | %{_mandir}/man8/ss.8* | |
210 | %if %{with tc} | |
211 | %attr(755,root,root) %{_sbindir}/tc | |
212 | %dir %{_libdir}/tc | |
213 | %attr(755,root,root) %{_libdir}/tc/*.so | |
214 | %{_mandir}/man7/tc-hfsc.7* | |
215 | %{_mandir}/man8/tc.8* | |
216 | %{_mandir}/man8/tc-*.8* | |
217 | %endif | |
218 | ||
219 | %files -n libnetlink-devel | |
220 | %defattr(644,root,root,755) | |
221 | %{_libdir}/libnetlink.a | |
222 | %{_includedir}/libnetlink.h | |
223 | %{_mandir}/man3/libnetlink.3* | |
224 | ||
225 | %if %{with doc} | |
226 | %files doc | |
227 | %defattr(644,root,root,755) | |
228 | %doc RELNOTES doc/*.ps | |
229 | %{_examplesdir}/%{name}-%{version} | |
230 | %endif |