Basic specfile taken from F10
[iproute2.git] / iproute.spec
1 ##%define date_version 070710
2 %define cbq_version v0.7.3
3
4 Summary: Advanced IP routing and network device configuration tools
5 Name: iproute
6 Version: 2.6.28
7 Release: 1.trellis
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
12
13 License: GPLv2+
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
17
18 %description
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.
22
23 %prep
24 %setup -q -c iproute-%{version}
25
26 %build
27 export LIBDIR=%{_libdir}
28
29 cd iproute2-%{version}
30 make %{?_smp_mflags}
31 make -C doc
32
33 %install
34 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
35
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
42
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}
46 #netem is static
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
55
56 cp -f etc/iproute2/* $RPM_BUILD_ROOT/%{_sysconfdir}/iproute2
57 rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug/*
58
59 #copy the tex file from source for time when tex was broken
60 #source1 was created from last functional version
61 #tar -xvzf %{SOURCE1}
62 #mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
63 #cd %{name}-doc-2.6.22
64 #cp -pR *.ps ../doc
65
66 #create example avpkt file
67 cat <<EOF > $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cbq/cbq-0000.example
68 DEVICE=eth0,10Mbit,1Mbit
69 RATE=128Kbit
70 WEIGHT=10Kbit
71 PRIO=5
72 RULE=192.168.1.0/24
73 EOF
74
75 cat <<EOF > $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cbq/avpkt
76 AVPKT=3000
77 EOF
78
79 %clean
80 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
81
82 %files
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
88 /sbin/*
89 %{_mandir}/man8/*
90 %attr(644,root,root) %config(noreplace) %{_sysconfdir}/iproute2/*
91 %{_sbindir}/*
92 %dir %{_datadir}/tc
93 %{_datadir}/tc/*
94 #%dir %{_libdir}/tc/
95 #%{_libdir}/tc/*
96 %dir %{_sysconfdir}/sysconfig/cbq
97 %config(noreplace) %{_sysconfdir}/sysconfig/cbq/*
98
99