1 ##%define date_version 070710
2 %define cbq_version v0.7.3
4 Summary: Advanced IP routing and network device configuration tools
8 Group: Applications/System
9 Source: http://developer.osdl.org/dev/iproute2/download/iproute2-%{version}.tar.bz2
10 #Source1: iproute-doc-2.6.22.tar.gz
11 URL: http://linux-net.osdl.org/index.php/Iproute2
14 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15 BuildRequires: tetex-latex tetex-dvips linuxdoc-tools
16 BuildRequires: flex psutils db4-devel bison
19 The iproute package contains networking utilities (ip and rtmon, for
20 example) which are designed to use the advanced networking
21 capabilities of the Linux 2.4.x and 2.6.x kernel.
24 %setup -q -c iproute-%{version}
27 export LIBDIR=%{_libdir}
29 cd iproute2-%{version}
34 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
36 mkdir -p $RPM_BUILD_ROOT/sbin \
37 $RPM_BUILD_ROOT%{_sbindir} \
38 $RPM_BUILD_ROOT%{_mandir}/man8 \
39 $RPM_BUILD_ROOT/%{_sysconfdir}/iproute2 \
40 $RPM_BUILD_ROOT%{_datadir}/tc \
41 $RPM_BUILD_ROOT%{_libdir}/tc
43 cd iproute2-%{version}
44 install -m 755 ip/ip ip/ifcfg ip/rtmon tc/tc $RPM_BUILD_ROOT/sbin
45 install -m 755 misc/ss misc/nstat misc/rtacct misc/lnstat misc/arpd $RPM_BUILD_ROOT%{_sbindir}
47 #install -m 755 tc/q_netem.so $RPM_BUILD_ROOT%{_libdir}/tc
48 #install -m 755 tc/q_atm.so $RPM_BUILD_ROOT%{_libdir}/tc
49 install -m 644 netem/normal.dist netem/pareto.dist netem/paretonormal.dist $RPM_BUILD_ROOT%{_datadir}/tc
50 install -m 644 man/man8/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8
51 rm -r $RPM_BUILD_ROOT/%{_mandir}/man8/ss.8
52 iconv -f latin1 -t utf8 < man/man8/ss.8 > $RPM_BUILD_ROOT/%{_mandir}/man8/ss.8
53 install -m 755 examples/cbq.init-%{cbq_version} $RPM_BUILD_ROOT/sbin/cbq
54 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cbq
56 cp -f etc/iproute2/* $RPM_BUILD_ROOT/%{_sysconfdir}/iproute2
57 rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug/*
59 #copy the tex file from source for time when tex was broken
60 #source1 was created from last functional version
62 #mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
63 #cd %{name}-doc-2.6.22
66 #create example avpkt file
67 cat <<EOF > $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cbq/cbq-0000.example
68 DEVICE=eth0,10Mbit,1Mbit
75 cat <<EOF > $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cbq/avpkt
80 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
83 %defattr(-,root,root,-)
84 %dir %{_sysconfdir}/iproute2
85 %doc iproute2-%{version}/README.decnet iproute2-%{version}/README.iproute2+tc iproute2-%{version}/RELNOTES iproute2-%{version}/examples/README.cbq
86 %doc iproute2-%{version}/doc/*.ps
87 %doc iproute2-%{version}/examples
90 %attr(644,root,root) %config(noreplace) %{_sysconfdir}/iproute2/*
96 %dir %{_sysconfdir}/sysconfig/cbq
97 %config(noreplace) %{_sysconfdir}/sysconfig/cbq/*