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