Added the new version for dummynet.
[ipfw.git] / planetlab / ipfwroot.spec
1 #
2 # $Id: ipfwroot.spec 16174 2009-12-15 13:38:15Z marta $
3 #
4 # TODO:
5 # restart crond
6 # modprobe ipfw_mod.ko (depmod ?)
7 #
8 %define url $URL$
9
10 # Marta Carbone <marta.carbone@iet.unipi.it>
11 # 2009 - Universita` di Pisa
12 # License is BSD.
13
14 # kernel_release, kernel_version and kernel_arch are expected to be set by the build to e.g.
15 # kernel_release : vs2.3.0.29.1.planetlab
16 # kernel_version : 2.6.22.14
17
18 %define name ipfwroot
19 %define version 0.9
20 %define taglevel 7
21
22 %define release %{kernel_version}.%{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
23 %define kernel_id_arch %{kernel_version}-%{kernel_release}-%{kernel_arch}
24 %define kernel_id %{kernel_version}-%{kernel_release}
25
26 Summary: ipfw and dummynet for Linux
27 Name: %{name}
28 Version: %{version}
29 Release: %{release}
30 License: BSD
31 Group: System Environment/Kernel
32 Source0: %{name}-%{version}.tar.bz2
33 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
34 Requires: vixie-cron
35 Requires: vsys-scripts
36
37 Vendor: unipi
38 Packager: PlanetLab <marta@onelab2.iet.unipi.it>
39 # XXX ask 
40 Distribution: PlanetLab %{plrelease}
41 URL: %(echo %{url} | cut -d ' ' -f 2)
42
43 %description
44 ipfw is the Linux port of the FreeBSD ipfw and dummynet packages
45
46 %prep
47 %setup
48
49 %build
50 # clean the rpm build directory
51 rm -rf $RPM_BUILD_ROOT
52
53 # with the new build, we use the kernel-devel rpm for building
54 %define kernelpath /usr/src/kernels/%{kernel_id_arch}
55
56 %__make KERNELPATH=%kernelpath clean
57 %__make KERNELPATH=%kernelpath IPFW_PLANETLAB=1
58
59 %install
60 install -D -m 755 dummynet2/ipfw_mod.ko $RPM_BUILD_ROOT/lib/modules/%{kernel_id}/net/netfilter/ipfw_mod.ko
61 install -D -m 755 ipfw/ipfw $RPM_BUILD_ROOT/sbin/ipfw
62 install -D -m 755 planetlab/ipfw-cleanup $RPM_BUILD_ROOT/usr/bin/ipfw-cleanup
63 install -D -m 644 planetlab/ipfw.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/ipfw.cron
64
65 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68 # here there is a list of the final installation directories
69 %files
70 %defattr(-,root,root)
71 %dir /lib/modules/%{kernel_id}
72 /lib/modules/%{kernel_id}/net/netfilter/ipfw_mod.ko
73 /sbin/ipfw
74 /usr/bin/ipfw-cleanup
75 %{_sysconfdir}/cron.d/ipfw.cron
76
77 %postun
78 # unload the module if present
79 LOADED=`cat /proc/modules | grep ^ipfw_mod`; if [ -n "$LOADED" ] ; then rmmod ipfw_mod; fi
80 # clean the old database and initialize the firewall
81 echo "super dbcleanup" | /vsys/ipfw-be 0
82 echo "super init" | /vsys/ipfw-be 0
83
84 %changelog
85 * Wed Jan 06 2010 Marta Carbone <marta.carbone@iet.unipi.it>
86 - move to dummynet2, added support for table lookup
87 - added the vsys-script dependencies and the ipfw initialization
88
89 * Tue Dec 15 2009 Marta Carbone <marta.carbone@iet.unipi.it>
90 - more work on the radix code, added sysctl read/write support
91
92 * Sun Nov 29 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-7
93 - added missing qsort.c - tag 0.9-6 was broken
94
95 * Thu Nov 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-6
96 - root: removed goto into the main ipfw switch, enabled slice_id matching
97 - slice: completely move netconfig checks into the backend
98
99 * Mon Nov 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-5
100 - additional features on matching packets, including uid match
101
102 * Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-4
103 - on behalf of Marta Carbone, more options and features
104
105 * Thu Jul 23 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-3
106 - fixed memory usage issue
107
108 * Wed Jul 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-2
109 - patch for building on x86_64
110
111 * Thu Jun 25 2009 Marta Carbone <marta.carbone@iet.unipi.it>
112 - post installation removed for deployment, moved manpages to the slice package
113
114 * Fri Apr 17 2009 Marta Carbone <marta.carbone@iet.unipi.it>
115 - Initial release