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