59dbba83f2c5c9b8379134c7c74b71232c29248c
[ipfw.git] / planetlab / ipfwroot.spec
1 #
2 # TODO:
3 # restart crond
4 #
5 %define url $URL$
6
7 # Marta Carbone <marta.carbone@iet.unipi.it>
8 # 2009 - Universita` di Pisa
9 # License is BSD.
10
11 # kernel_release, kernel_version and kernel_arch are expected to be set by the build to e.g.
12 # kernel_release : vs2.3.0.29.1.planetlab
13 # kernel_version : 2.6.22.14
14
15 %define name ipfwroot
16 %define version 0.9
17 %define taglevel 19
18
19 %define release %{kernel_version}.%{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
20
21 # guess which convention is used; k27 and before used dash, k32 uses dot
22 %define kernelpath_dash /usr/src/kernels/%{kernel_version}-%{kernel_release}-%{kernel_arch}
23 %define kernelpath_dot /usr/src/kernels/%{kernel_version}-%{kernel_release}.%{kernel_arch}
24 %define kernelpath %( [ -d %{kernelpath_dot} ] && echo %{kernelpath_dot} || echo %{kernelpath_dash} )
25
26 # the k32 kernel currently builds e.g. /lib/modules/2.6.32-0.onelab.2010.12.07-i686
27 # the k27 and before does not have the -i686 part
28 %define kernel_id_old %{kernel_version}-%{kernel_release}
29 %define kernel_id_new %{kernel_version}-%{kernel_release}.%{_target_cpu}
30 %define kernel_id %( [ -d %{kernelpath_dot} ] && echo %{kernel_id_new} || echo %{kernel_id_old} )
31
32 Summary: ipfw and dummynet for Linux
33 Name: %{name}
34 Version: %{version}
35 Release: %{release}
36 License: BSD
37 Group: System Environment/Kernel
38 Source0: %{name}-%{version}.tar.bz2
39 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
40 Requires: vixie-cron
41 Requires: vsys-scripts
42 Obsoletes: ipfw
43
44 Vendor: unipi
45 Packager: PlanetLab <marta@onelab2.iet.unipi.it>
46 # XXX ask 
47 Distribution: PlanetLab %{plrelease}
48 URL: %(echo %{url} | cut -d ' ' -f 2)
49
50 %description
51 ipfw is the Linux port of the FreeBSD ipfw and dummynet packages
52
53 %prep
54 %setup
55
56 %build
57 # clean the rpm build directory
58 rm -rf $RPM_BUILD_ROOT
59
60 %__make KERNELPATH=%kernelpath clean
61 %__make KERNELPATH=%kernelpath IPFW_PLANETLAB=1
62
63 %install
64 install -D -m 755 dummynet2/ipfw_mod.ko $RPM_BUILD_ROOT/lib/modules/%{kernel_id}/net/netfilter/ipfw_mod.ko
65 install -D -m 755 ipfw/ipfw $RPM_BUILD_ROOT/sbin/ipfw
66 install -D -m 644 planetlab/ipfw.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/ipfw.cron
67 install -D -m 755 planetlab/ipfw $RPM_BUILD_ROOT/etc/rc.d/init.d/ipfw
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %post
73 ### this script is also triggered while the node image is being created at build-time
74 # some parts of the script do not make sense in this context
75 # this is why the build exports PL_BOOTCD=1 in such cases
76 depmod -a
77 /sbin/chkconfig --add ipfw
78 # start the service if not building
79 [ -z "$PL_BOOTCD" ] && service ipfw start
80
81 %postun
82 # stop the service if not building
83 [ -z "$PL_BOOTCD" ] && service ipfw stop
84
85 # here there is a list of the final installation directories
86 %files
87 %defattr(-,root,root)
88 %dir /lib/modules/%{kernel_id}
89 /lib/modules/%{kernel_id}/net/netfilter/ipfw_mod.ko
90 /sbin/ipfw
91 %{_sysconfdir}/cron.d/ipfw.cron
92 /etc/rc.d/init.d/ipfw
93
94 %changelog
95 * Wed Dec 08 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-19
96 - fix detection of kernel conventions
97
98 * Tue Dec 07 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-18
99 - guess conventions for either <=k27 or >=k32
100
101 * Tue Jun 15 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - ipfw-0.9-17
102 - testing git only module-tag
103
104 * Tue Jun 15 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - ipfw-0.9-16
105 - tagging ipfw to test module-tools on (pure) git
106
107 * Wed May 12 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - ipfw-0.9-15
108 - tagging for obsoletes
109
110 * Tue Apr 27 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-13
111 - Update to the ipfw3 version of the dummynet code.
112
113 * Mon Apr 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-11
114 - add ipfw initialization script to chkconfig
115
116 * Wed Mar 03 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - ipfw-0.9-10
117 - - Load module at installation - Marta
118
119 * Mon Jan 11 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-9
120 - consistent with vsys-scripts-0.95-13
121
122 * Mon Jan 11 2010 Marta Carbone <marta.carbone@iet.unipi.it>
123 - Integrated the ipfw rules cleanup into the backend
124
125 * Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-8
126 - builds on 2.6.22 & 2.6.27 - for 32 and 64 bits
127
128 * Wed Jan 06 2010 Marta Carbone <marta.carbone@iet.unipi.it>
129 - move to dummynet2, added support for table lookup
130 - added the vsys-script dependencies and the ipfw initialization
131
132 * Tue Dec 15 2009 Marta Carbone <marta.carbone@iet.unipi.it>
133 - more work on the radix code, added sysctl read/write support
134
135 * Sun Nov 29 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-7
136 - added missing qsort.c - tag 0.9-6 was broken
137
138 * Thu Nov 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-6
139 - root: removed goto into the main ipfw switch, enabled slice_id matching
140 - slice: completely move netconfig checks into the backend
141
142 * Mon Nov 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-5
143 - additional features on matching packets, including uid match
144
145 * Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-4
146 - on behalf of Marta Carbone, more options and features
147
148 * Thu Jul 23 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-3
149 - fixed memory usage issue
150
151 * Wed Jul 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - ipfw-0.9-2
152 - patch for building on x86_64
153
154 * Thu Jun 25 2009 Marta Carbone <marta.carbone@iet.unipi.it>
155 - post installation removed for deployment, moved manpages to the slice package
156
157 * Fri Apr 17 2009 Marta Carbone <marta.carbone@iet.unipi.it>
158 - Initial release