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