+%define mainver 2.2.4
+%define snapshot ss001007
Summary: Utility to control Networking behavior in 2.2.X kernels
Summary(pl): Narzêdzie do kontrolowania Sieci w kernelach 2.2
Name: iproute2
-Version: 2.2.4
-Release: 1
+Version: %{mainver}.%{snapshot}
+Release: 3
Vendor: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
-Copyright: GPL
+License: GPL
Group: Networking/Admin
Group(pl): Sieciowe/Administracyjne
-Source: ftp://ftp.inr.ac.ru/ip-routing/%{name}-%{version}-now-ss990417.tar.gz
-Patch0: iproute2-make.patch
-Patch1: iproute2-readme.patch
-BuildRoot: /tmp/%{name}-%{version}-root
+Source0: ftp://ftp.inr.ac.ru/ip-routing/%{name}-%{mainver}-now-%{snapshot}.tar.gz
+Patch0: %{name}-make.patch
+Patch1: %{name}-ll_types.patch
+%{?BOOT:Patch2: %{name}-uClibc.patch}
+BuildRequires: tetex-dvips
+BuildRequires: tetex-latex
+BuildRequires: psutils
+%{?BOOT:BuildRequires: uClibc-devel-BOOT}
+Obsoletes: iproute
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _sbindir /sbin
+%define _sysconfdir /etc/iproute2
%description
-This package contains the ip, tc and the rtmon tool that allow control of
-routing and other aspects of networking.
-
+This package contains the ip, tc and the rtmon tool that allow control
+of routing and other aspects of networking.
+
%description -l pl
-Ten pakiet zawiera programy pozwalaj±ce na kontrolê routingu i innych
+Ten pakiet zawiera programy pozwalaj±ce na kontrolê routingu i innych
aspektów dotycz±cych sieci.
-
+
+
+%if %{?BOOT:1}%{!?BOOT:0}
+%package BOOT
+Summary: Utility to control Networking behavior in 2.2.X kernels
+Summary(pl): Narzêdzie do kontrolowania Sieci w kernelach 2.2
+Group: Networking/Admin
+
+%description BOOT
+
+%endif
+
+
%prep
%setup -q -n %{name}
%patch0 -p1
%patch1 -p1
+%{?BOOT:%patch2 -p1}
%build
-make OPT="$RPM_OPT_FLAGS"
-%install
-rm -rf $RPM_BUILD_ROOT
+%if %{?BOOT:1}%{!?BOOT:0}
+%{__make} \
+ OPT="-Os" GLIBCFIX="" \
+ KERNEL_INCLUDE="/usr/lib/bootdisk%{_includedir}" \
+ LDFLAGS="-nostdlib -static -s" \
+ LDLIBS="%{_libdir}/bootdisk%{_libdir}/crt0.o %{_libdir}/bootdisk%{_libdir}/libc.a -lgcc" \
+ ADDLIB="inet_ntop.o inet_pton.o dnet_ntop.o dnet_pton.o ipx_ntop.o ipx_pton.o" \
+ SUBDIRS="lib ip"
+
+ LDLIBS="/usr/lib/libresolv.a %{_libdir}/bootdisk%{_libdir}/crt0.o %{_libdir}/bootdisk%{_libdir}/libc.a -lgcc" \
+
+# there are some problems compiling with uClibc, falling back to simple glibc-static
+%{__make} SUBDIRS="lib ip" OPT="-Os" LDFLAGS="-static -s"
+mv -f ip/ip ip-BOOT
+mv -f ip/rtacct rtacct-BOOT
+mv -f ip/rtmon rtmon-BOOT
+%{__make} clean
+%endif
+
+%{__make} OPT="%{!?debug:$RPM_OPT_FLAGS}%{?debug:-g -O0}"
+%{__make} -C doc
-install -d $RPM_BUILD_ROOT/{sbin,etc/iproute2}
-install -s ip/ip ip/rtmon ip/rtacct tc/tc $RPM_BUILD_ROOT/sbin
+%install
+rm -rf $RPM_BUILD_ROOT
+%if %{?BOOT:1}%{!?BOOT:0}
+install -d $RPM_BUILD_ROOT%{_libdir}/bootdisk/sbin
+# we need only 'ip' on bootdisk (don't we??)
+install -s ip-BOOT $RPM_BUILD_ROOT%{_libdir}/bootdisk/sbin/ip
+%endif
+
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}}
+install ip/{ip,rtmon,rtacct,routel} tc/tc $RPM_BUILD_ROOT%{_sbindir}
install etc/iproute2/rt_protos \
etc/iproute2/rt_realms \
etc/iproute2/rt_scopes \
etc/iproute2/rt_tables \
- $RPM_BUILD_ROOT/etc/iproute2
+ $RPM_BUILD_ROOT%{_sysconfdir}
-gzip -9nf READ* RELNOTES
+gzip -9nf READ* RELNOTES doc/*.ps
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc {README,README.ip-sysctl,README.iproute2+tc}.gz
-%doc {README.multidomain-httpd,README.policy-routing,RELNOTES}.gz
-%doc flowlabels.tex ip-tunnels.tex
-
-%attr(755,root,root) /sbin/*
-/etc/iproute2
-
-%changelog
-* Sat May 1 1999 Piotr Czerwiñski <pius@pld.org.pl>
- [2.2.4-1]
-- new upstream release (990417),
-- patches corrected,
-- added /etc/iproute2/*,
-- added more documentation,
-- recompiled on rpm 3,
-- cosmetic changes for common l&f.
-
-* Fri Feb 19 1999 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
-- new upstream release
-- gzipping instead bzipping
-
-* Fri Jan 01 1999 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
-- new upstream release (981220).
-- docs are now compressed
-
-* Sat Nov 07 1998 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
-- new upstream release (981101),
-- corrected patch.
-
-* Wed Oct 14 1998 Arkadiusz Mi¶kiewicz <misiek@zsz2.starachowice.pl>
-- initial rpm release.
+%doc {README,README.iproute2+tc,RELNOTES}.gz
+%doc doc/*.ps.gz
+%attr(755,root,root) %{_sbindir}/*
+%{_sysconfdir}
+
+%if %{?BOOT:1}%{!?BOOT:0}
+%files BOOT
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/bootdisk/sbin/*
+%endif