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