-# conditional build
-# --without tetex # with tetex-2 there shuld be BR tetex-tex-babel
-# --without tc (don't build tc program, it break static linkage)
-# --without dist_kernel
-
-%define _kernel24 %(echo %{_kernel_ver} | grep -q '2\.[012]\.' ; echo $?)
-%define mainver 2.4.7
-%define snapshot ss020116
+#
+# Conditional build
+%bcond_without doc # don't build documentation
+%bcond_without tc # don't build tc program (it breaks static linkage)
+%bcond_with uClibc # do some hacks to build with uClibc
+#
Summary: Utility to control Networking behavior in 2.2.X kernels
Summary(es): Herramientas para encaminamiento avanzado y configuración de interfaces de red
Summary(pl): Narzêdzie do kontrolowania Sieci w kernelach 2.2
Summary(pt_BR): Ferramentas para roteamento avançado e configuração de interfaces de rede
Name: iproute2
+%define mainver 2.4.7
+%define snapshot ss020116
Version: %{mainver}.%{snapshot}
-%define _rel 10
-Release: %{_rel}@%{_kernel_ver_str}
+Release: 16
License: GPL
Vendor: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Group: Networking/Admin
Source0: ftp://ftp.inr.ac.ru/ip-routing/%{name}-%{mainver}-now-%{snapshot}.tar.gz
+# Source0-md5: 2c7e5f3a10e703745ecdc613f7a7d187
Source1: %{name}-owl-man.tar.bz2
-# Source1-md5: cd4425df972a4ab001db31a5eb1c5da5
-Patch0: %{name}-make.patch
-Patch1: %{name}-uClibc.patch
-Patch2: %{name}-fix-2_2.patch
-Patch3: %{name}-label.patch
-Patch4: %{name}-latest.patch
-Patch5: %{name}-htb2_tc.patch
-Patch6: wrr-iproute2-2.2.4.patch
-Patch7: htb3.6_tc.patch
-Patch8: %{name}-no_libresolv.patch
-%{!?_without_tc:BuildRequires: db-devel}
+# Source1-md5: cd4425df972a4ab001db31a5eb1c5da5
+Patch0: %{name}-Makefile.patch
+Patch1: %{name}-llh.patch
+Patch2: %{name}-diffserv-config.patch
+Patch3: %{name}-netlink.patch
+Patch4: %{name}-ipaddress.patch
+Patch5: %{name}-iprule.patch
+# uClibc hacks
+Patch6: %{name}-uClibc.patch
+# extensions
+Patch10: htb3.6_tc.patch
+Patch11: wrr-iproute2-2.2.4.patch
+Patch12: %{name}-2.2.4-now-ss001007-esfq.diff
BuildRequires: bison
-%{!?_without_tetex:BuildRequires: latex2html}
-%{!?_without_tetex:BuildRequires: psutils}
-%{!?_without_tetex:BuildRequires: sgml-tools}
-%{!?_without_tetex:BuildRequires: tetex-dvips}
-%{!?_without_tetex:BuildRequires: tetex-latex}
+BuildRequires: linux-libc-headers >= 7:2.6.4.0-3
+%if %{with doc}
+BuildRequires: psutils
+BuildRequires: sgml-tools
+BuildRequires: tetex-dvips
+BuildRequires: tetex-latex
+BuildRequires: tetex-tex-babel
+%endif
Obsoletes: iproute
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q -n %{name} -a1
+rm -rf include-glibc
%patch0 -p1
%patch1 -p1
%patch2 -p1
-#%%patch3 -p1
-#%%patch4 -p1
-%if %{_kernel24}
-%patch7 -p1
-%else
+%patch3 -p1
+%patch4 -p1
%patch5 -p1
-%endif
-%patch6 -p1
-%patch8 -p1
+%{?with_uClibc:%patch6 -p1}
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
%build
-WRRDEF=""
-grep -q tc_wrr_class_weight /usr/include/linux/pkt_sched.h || WRRDEF="-DNEED_WRR_DEFS"
-
%{__make} \
CC="%{__cc}" \
- OPT="%{rpmcflags} ${WRRDEF}" \
- KERNEL_INCLUDE="%{_kernelsrcdir}/include" \
- %{?_without_tc:SUBDIRS="lib ip" LDFLAGS="%{rpmldflags}"}
-%{!?_without_tetex:%{__make} -C doc}
+ OPT="%{rpmcflags}" \
+ %{!?with_tc:SUBDIRS="lib ip misc" LDFLAGS="%{rpmldflags}"}
+
+%{?with_doc:%{__make} -C doc}
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir},%{_mandir}/man8,%{_libdir},%{_includedir}}
-install ip/{ip,rtmon,routel} %{!?_without_tc:tc/tc} $RPM_BUILD_ROOT%{_sbindir}
+install ip/{ip,rtmon,routel} %{?with_tc:tc/tc} misc/{rtacct,rtstat,ss,ifstat} $RPM_BUILD_ROOT%{_sbindir}
install etc/iproute2/rt_protos \
etc/iproute2/rt_realms \
etc/iproute2/rt_scopes \
%files
%defattr(644,root,root,755)
-%doc README README.iproute2+tc RELNOTES
-%{!?_without_tetex:%doc doc/*.ps}
+%doc README README.iproute2+tc RELNOTES %{?with_doc:doc/*.ps}
%attr(755,root,root) %{_sbindir}/*
%dir %{_sysconfdir}
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*
%files -n libnetlink-devel
%defattr(644,root,root,755)
-%{_libdir}/*
-%{_includedir}/*
+%{_libdir}/lib*.a
+%{_includedir}/*.h