merge up to iptables 1.3.8 with a basic set of extensions
[iptables.git] / iptables.spec
1 %define name iptables
2 %define version 1.3.8
3 %define release 0%{?pldistro:.%{pldistro}}%{?date:.%{date}}
4
5 Vendor: PlanetLab
6 Packager: PlanetLab Central <support@planet-lab.org>
7 Distribution: PlanetLab 3.0
8 URL: http://cvs.planet-lab.org/cvs/iptables
9
10 %define build_devel 1
11 %define linux_header 0
12
13 Name: %{name}
14 Summary: Tools for managing Linux kernel packet filtering capabilities.
15 Version: %{version}
16 Release: %{release}
17 Source: http://www.netfilter.org/%{name}-%{version}.tar.bz2
18 %define SOURCE1 iptables.init
19 %define SOURCE2 iptables-config
20 Group: System Environment/Base
21 #URL: http://www.netfilter.org/
22 BuildRoot: %{_tmppath}/%{name}-buildroot
23 License: GPL
24 BuildPrereq: /usr/bin/perl
25 Requires: kernel >= 2.4.20
26 Requires(post,postun): chkconfig
27 Prefix: %{_prefix}
28 BuildRequires: kernel-devel
29
30 %package ipv6
31 Summary: IPv6 support for iptables.
32 Group: System Environment/Base
33 Requires: %{name} = %{version}
34
35 %if %{build_devel}
36 %package devel
37 Summary: Development package for iptables.
38 Group: System Environment/Base
39 Requires: %{name} = %{version}
40 %endif
41
42 %description
43 The iptables utility controls the network packet filtering code in the
44 Linux kernel. If you need to set up firewalls and/or IP masquerading,
45 you should install this package.
46
47 %description ipv6
48 The iptables package contains IPv6 (the next version of the IP
49 protocol) support for iptables. Iptables controls the Linux kernel
50 network packet filtering code, allowing you to set up firewalls and IP
51 masquerading. 
52
53 Install iptables-ipv6 if you need to set up firewalling for your
54 network and you are using ipv6.
55
56 %if %{build_devel}
57 %description devel
58 The iptables utility controls the network packet filtering code in the
59 Linux kernel. If you need to set up firewalls and/or IP masquerading,
60 you should install this package.
61 %endif
62
63 %prep
64 rm -rf %{buildroot}
65
66 %setup -q
67
68 # Put it to a reasonable place
69 find . -type f -exec perl -pi -e "s,/usr,%{prefix},g" {} \;
70
71 %build
72 TOPDIR=`pwd`
73 OPT="$RPM_OPT_FLAGS -I$TOPDIR/include"
74
75 %define KERNEL %(rpm -q kernel-devel | tail -n 1 | sed 's,kernel-devel-,,')
76 count=$(rpm -q kernel-devel| wc -l)
77 if [ $count -gt 1 ] ; then
78         echo "WARNING: choosing kernel-devel-%{KERNEL}"
79         echo "  but there are other kernel-devel packages installed: $(rpm -q kernel-devel)"
80 fi
81         
82 %define KERNEL_DIR "/usr/src/kernels/%{KERNEL}"
83
84 make COPT_FLAGS="$OPT" KERNEL_DIR=%{KERNEL_DIR} LIBDIR=/%{_lib}
85 make COPT_FLAGS="$OPT" KERNEL_DIR=%{KERNEL_DIR} LIBDIR=/%{_lib} iptables-save iptables-restore
86 make COPT_FLAGS="$OPT" KERNEL_DIR=%{KERNEL_DIR} LIBDIR=/%{_lib} ip6tables-save ip6tables-restore
87
88 %install
89 make install DESTDIR=%{buildroot} KERNEL_DIR=%{KERNEL_DIR} BINDIR=/sbin LIBDIR=/%{_lib} MANDIR=%{_mandir}
90 %if %{build_devel}
91 make install-devel DESTDIR=%{buildroot} KERNEL_DIR=%{KERNEL_DIR} BINDIR=/sbin LIBDIR=%{_libdir} MANDIR=%{_mandir} INCDIR=%{_includedir}
92 %endif
93 cp ip{6,}tables-{save,restore} $RPM_BUILD_ROOT/sbin
94 cp iptables-*.8 $RPM_BUILD_ROOT%{_mandir}/man8
95 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
96 install -c -m755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/iptables
97 sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE1} > ip6tables.init
98 install -c -m755 ip6tables.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ip6tables
99 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
100 install -c -m755 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/iptables-config
101 sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE2} > ip6tables-config
102 install -c -m755 ip6tables-config $RPM_BUILD_ROOT/etc/sysconfig/ip6tables-config
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT 
106
107 %post
108 /sbin/chkconfig --add iptables
109
110 %preun
111 if [ "$1" = 0 ]; then
112         /sbin/chkconfig --del iptables
113 fi
114
115 %post ipv6
116 /sbin/chkconfig --add ip6tables
117
118 %preun ipv6
119 if [ "$1" = 0 ]; then
120         /sbin/chkconfig --del ip6tables
121 fi
122
123 %files
124 %defattr(-,root,root,0755)
125 %doc COPYING INSTALL INCOMPATIBILITIES
126 %config %attr(0755,root,root) /etc/rc.d/init.d/iptables
127 %config(noreplace) %attr(0600,root,root) /etc/sysconfig/iptables-config
128 /sbin/iptables*
129 %{_mandir}/man8/iptables*
130 %dir /%{_lib}/iptables
131 /%{_lib}/iptables/libipt*
132 /sbin/ipset*
133 %{_mandir}/man8/ipset*
134 %dir /%{_lib}/ipset
135 /%{_lib}/ipset/libipset*
136
137 %files ipv6
138 %defattr(-,root,root,0755)
139 %config %attr(0755,root,root) /etc/rc.d/init.d/ip6tables
140 %config(noreplace) %attr(0600,root,root) /etc/sysconfig/ip6tables-config
141 /sbin/ip6tables*
142 %{_mandir}/man8/ip6tables*
143 /%{_lib}/iptables/libip6t*
144
145 %if %{build_devel}
146 %files devel
147 %defattr(-,root,root,0755)
148 %{_includedir}/libipq.h
149 %{_libdir}/libipq.a
150 %{_libdir}/libiptc.a
151 %{_mandir}/man3/*
152 %endif
153
154 %changelog
155 * Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
156 - rebuilt
157
158 * Thu Feb 26 2004 Thomas Woerner <twoerner@redhat.com> 1.2.9-2.3
159 - fixed iptables-restore -c fault if there are no counters (#116421)
160
161 * Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
162 - rebuilt
163
164 * Sun Jan  25 2004 Dan Walsh <dwalsh@redhat.com> 1.2.9-1.2
165 - Close File descriptors to prevent SELinux error message
166
167 * Wed Jan  7 2004 Thomas Woerner <twoerner@redhat.com> 1.2.9-1.1
168 - rebuild
169
170 * Wed Dec 17 2003 Thomas Woerner <twoerner@redhat.com> 1.2.9-1
171 - vew version 1.2.9
172 - new config options in ipXtables-config:
173   IPTABLES_MODULES_UNLOAD
174 - more documentation in ipXtables-config
175 - fix for netlink security issue in libipq (devel package)
176 - print fix for libipt_icmp (#109546)
177
178 * Thu Oct 23 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-13
179 - marked all messages in iptables init script for translation (#107462)
180 - enabled devel package (#105884, #106101)
181 - bumped build for fedora for libipt_recent.so (#106002)
182
183 * Tue Sep 23 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-12.1
184 - fixed lost udp port range in ip6tables-save (#104484)
185 - fixed non numeric multiport port output in ipXtables-savs
186
187 * Mon Sep 22 2003 Florian La Roche <Florian.LaRoche@redhat.de> 1.2.8-11
188 - do not link against -lnsl
189
190 * Wed Sep 17 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-10
191 - made variables in rmmod_r local
192
193 * Tue Jul 22 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-9
194 - fixed permission for init script
195
196 * Sat Jul 19 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-8
197 - fixed save when iptables file is missing and iptables-config permissions
198
199 * Tue Jul  8 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-7
200 - fixes for ip6tables: module unloading, setting policy only for existing 
201   tables
202
203 * Thu Jul  3 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-6
204 - IPTABLES_SAVE_COUNTER defaults to no, now
205 - install config file in /etc/sysconfig
206 - exchange unload of ip_tables and ip_conntrack
207 - fixed start function
208
209 * Wed Jul  2 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-5
210 - new config option IPTABLES_SAVE_ON_RESTART
211 - init script: new status, save and restart
212 - fixes #44905, #65389, #80785, #82860, #91040, #91560 and #91374
213
214 * Mon Jun 30 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-4
215 - new config option IPTABLES_STATUS_NUMERIC
216 - cleared IPTABLES_MODULES in iptables-config
217
218 * Mon Jun 30 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-3
219 - new init scripts
220
221 * Sat Jun 28 2003 Florian La Roche <Florian.LaRoche@redhat.de>
222 - remove check for very old kernel versions in init scripts
223 - sync up both init scripts and remove some further ugly things
224 - add some docu into rpm
225
226 * Thu Jun 26  2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-2
227 - rebuild
228
229 * Mon Jun 16 2003 Thomas Woerner <twoerner@redhat.com> 1.2.8-1
230 - update to 1.2.8
231
232 * Wed Jan 22 2003 Tim Powers <timp@redhat.com>
233 - rebuilt
234
235 * Mon Jan 13 2003 Bill Nottingham <notting@redhat.com> 1.2.7a-1
236 - update to 1.2.7a
237 - add a plethora of bugfixes courtesy Michael Schwendt <mschewndt@yahoo.com>
238
239 * Fri Dec 13 2002 Elliot Lee <sopwith@redhat.com> 1.2.6a-3
240 - Fix multilib
241
242 * Wed Aug 07 2002 Karsten Hopp <karsten@redhat.de>
243 - fixed iptables and ip6tables initscript output, based on #70511
244 - check return status of all iptables calls, not just the last one
245   in a 'for' loop.
246
247 * Mon Jul 29 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.6a-1
248 - 1.2.6a (bugfix release, #69747)
249
250 * Fri Jun 21 2002 Tim Powers <timp@redhat.com>
251 - automated rebuild
252
253 * Thu May 23 2002 Tim Powers <timp@redhat.com>
254 - automated rebuild
255
256 * Mon Mar  4 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.5-3
257 - Add some fixes from CVS, fixing bug #60465
258
259 * Tue Feb 12 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.5-2
260 - Merge ip6tables improvements from Ian Prowell <iprowell@prowell.org>
261   #59402
262 - Update URL (#59354)
263 - Use /sbin/chkconfig rather than chkconfig in %postun script
264
265 * Fri Jan 11 2002 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.5-1
266 - 1.2.5
267
268 * Wed Jan 09 2002 Tim Powers <timp@redhat.com>
269 - automated rebuild
270
271 * Mon Nov  5 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.4-2
272 - Fix %preun script
273
274 * Tue Oct 30 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.4-1
275 - Update to 1.2.4 (various fixes, including security fixes; among others:
276   #42990, #50500, #53325, #54280)
277 - Fix init script (#31133)
278
279 * Mon Sep  3 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.3-1
280 - 1.2.3 (5 security fixes, some other fixes)
281 - Fix updating (#53032)
282
283 * Mon Aug 27 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.2-4
284 - Fix #50990
285 - Add some fixes from current CVS; should fix #52620
286
287 * Mon Jul 16 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.2-3
288 - Add some fixes from the current CVS tree; fixes #49154 and some IPv6
289   issues
290
291 * Tue Jun 26 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.2-2
292 - Fix iptables-save reject-with (#45632), Patch from Michael Schwendt
293   <mschwendt@yahoo.com>
294
295 * Tue May  8 2001 Bernhard Rosenkraenzer <bero@redhat.com> 1.2.2-1
296 - 1.2.2
297
298 * Wed Mar 21 2001 Bernhard Rosenkraenzer <bero@redhat.com>
299 - 1.2.1a, fixes #28412, #31136, #31460, #31133
300
301 * Thu Mar  1 2001 Bernhard Rosenkraenzer <bero@redhat.com>
302 - Yet another initscript fix (#30173)
303 - Fix the fixes; they fixed some issues but broke more important
304   stuff :/ (#30176)
305
306 * Tue Feb 27 2001 Bernhard Rosenkraenzer <bero@redhat.com>
307 - Fix up initscript (#27962)
308 - Add fixes from CVS to iptables-{restore,save}, fixing #28412
309
310 * Fri Feb 09 2001 Karsten Hopp <karsten@redhat.de>
311 - create /etc/sysconfig/iptables mode 600 (same problem as #24245)
312
313 * Mon Feb 05 2001 Karsten Hopp <karsten@redhat.de>
314 - fix bugzilla #25986 (initscript not marked as config file)
315 - fix bugzilla #25962 (iptables-restore)
316 - mv chkconfig --del from postun to preun
317
318 * Thu Feb  1 2001 Trond Eivind Glomsrød <teg@redhat.com>
319 - Fix check for ipchains
320
321 * Mon Jan 29 2001 Bernhard Rosenkraenzer <bero@redhat.com>
322 - Some fixes to init scripts
323
324 * Wed Jan 24 2001 Bernhard Rosenkraenzer <bero@redhat.com>
325 - Add some fixes from CVS, fixes among other things Bug #24732
326
327 * Wed Jan 17 2001 Bernhard Rosenkraenzer <bero@redhat.com>
328 - Add missing man pages, fix up init script (Bug #17676)
329
330 * Mon Jan 15 2001 Bill Nottingham <notting@redhat.com>
331 - add init script
332
333 * Mon Jan 15 2001 Bernhard Rosenkraenzer <bero@redhat.com>
334 - 1.2
335 - fix up ipv6 split
336 - add init script
337 - Move the plugins from /usr/lib/iptables to /lib/iptables.
338   This needs to work before /usr is mounted...
339 - Use -O1 on alpha (compiler bug)
340
341 * Sat Jan  6 2001 Bernhard Rosenkraenzer <bero@redhat.com>
342 - 1.1.2
343 - Add IPv6 support (in separate package)
344
345 * Thu Aug 17 2000 Bill Nottingham <notting@redhat.com>
346 - build everywhere
347
348 * Tue Jul 25 2000 Bernhard Rosenkraenzer <bero@redhat.com>
349 - 1.1.1
350
351 * Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
352 - automatic rebuild
353
354 * Tue Jun 27 2000 Preston Brown <pbrown@redhat.com>
355 - move iptables to /sbin.
356 - excludearch alpha for now, not building there because of compiler bug(?)
357
358 * Fri Jun  9 2000 Bill Nottingham <notting@redhat.com>
359 - don't obsolete ipchains either
360 - update to 1.1.0
361
362 * Mon Jun  4 2000 Bill Nottingham <notting@redhat.com>
363 - remove explicit kernel requirement
364
365 * Tue May  2 2000 Bernhard Rosenkränzer <bero@redhat.com>
366 - initial package