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