]> git.pld-linux.org Git - packages/iptables.git/blob - iptables.spec
- up to 1.4.8 (batch disabled; not mainained by anyone)
[packages/iptables.git] / iptables.spec
1 #
2 # TODO:
3 # - fix makefile (-D_UNKNOWN_KERNEL_POINTER_SIZE issue)
4 # - owner needs rewrite to xt
5 # - add manual sections from xtable-addons
6 # - ACCOUNT has been removed from iptables-20070806.patch, now should be taken
7 #   from http://www.intra2net.com/de/produkte/opensource/ipt_account/libipt_ACCOUNT-1.3.tar.gz
8 #
9 # Conditional build:
10 %bcond_without  doc             # without documentation (HOWTOS) which needed TeX
11 %bcond_without  dist_kernel     # without distribution kernel
12 %bcond_without  vserver         # kernel build without vserver
13 %bcond_with     batch           # build iptables-batch
14 %bcond_with     static
15 #
16 %define         netfilter_snap          20070806
17 %define         llh_version             7:2.6.22.1
18 %define         name6                   ip6tables
19 Summary:        Extensible packet filtering system && extensible NAT system
20 Summary(pl.UTF-8):      System filtrowania pakietów oraz system translacji adresów (NAT)
21 Summary(pt_BR.UTF-8):   Ferramenta para controlar a filtragem de pacotes no kernel-2.6.x
22 Summary(ru.UTF-8):      Утилиты для управления пакетными фильтрами ядра Linux
23 Summary(uk.UTF-8):      Утиліти для керування пакетними фільтрами ядра Linux
24 Summary(zh_CN.UTF-8):   Linux内核包过滤管理工具
25 Name:           iptables
26 Version:        1.4.8
27 Release:        1
28 License:        GPL
29 Group:          Networking/Admin
30 Source0:        ftp://ftp.netfilter.org/pub/iptables/%{name}-%{version}.tar.bz2
31 # Source0-md5:  697ed89f37af4473a5f6349ba2700f2d
32 Source1:        cvs://cvs.samba.org/netfilter/%{name}-howtos.tar.bz2
33 # Source1-md5:  2ed2b452daefe70ededd75dc0061fd07
34 Source2:        %{name}.init
35 Source3:        %{name6}.init
36 Patch0:         %{name}-%{netfilter_snap}.patch
37 Patch1:         %{name}-man.patch
38 # based on http://www.linuximq.net/patchs/iptables-1.4.6-imq.diff
39 Patch2:         %{name}-imq.patch
40 # http://www.balabit.com/downloads/files/tproxy/tproxy-iptables-20080204-1915.patch
41 Patch3:         %{name}-tproxy.patch
42 Patch4:         %{name}-stealth.patch
43 # almost based on iptables-1.4-for-kernel-2.6.20forward-layer7-2.18.patch
44 # http://switch.dl.sourceforge.net/sourceforge/l7-filter/netfilter-layer7-v2.18.tar.gz
45 Patch5:         %{name}-layer7.patch
46 Patch6:         %{name}-old-1.3.7.patch
47 # based on http://www.svn.barbara.eu.org/ipt_account/attachment/wiki/Software/ipt_account-0.1.21-20070804164729.tar.gz?format=raw
48 Patch7:         %{name}-account.patch
49 # http://people.linux-vserver.org/~dhozac/p/m/iptables-1.3.5-owner-xid.patch
50 Patch8:         %{name}-1.3.5-owner-xid.patch
51 Patch9:         %{name}-batch.patch
52 Patch10:        %{name}-headers.patch
53 Patch11:        %{name}-owner-struct-size-vs.patch
54 Patch999:       %{name}-llh-dirty-hack.patch
55 URL:            http://www.netfilter.org/
56 BuildRequires:  autoconf
57 BuildRequires:  automake
58 BuildRequires:  groff
59 BuildRequires:  libtool
60 %if %{with doc}
61 BuildRequires:  sed >= 4.0
62 BuildRequires:  sgml-tools
63 BuildRequires:  sgmls
64 BuildRequires:  tetex-dvips
65 BuildRequires:  tetex-format-latex
66 BuildRequires:  tetex-latex
67 BuildRequires:  tetex-tex-babel
68 %endif
69 %if %{with dist_kernel} && %{netfilter_snap} != 0
70 BuildRequires:  kernel%{_alt_kernel}-headers(netfilter) >= %{netfilter_snap}
71 BuildRequires:  kernel%{_alt_kernel}-source
72 %endif
73 #BuildRequires: linux-libc-headers >= %{llh_version}
74 BuildConflicts: kernel-headers < 2.3.0
75 Provides:       firewall-userspace-tool
76 Obsoletes:      ipchains
77 Obsoletes:      iptables-ipp2p
78 Obsoletes:      iptables24-compat
79 Obsoletes:      netfilter
80 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81
82 %description
83 An extensible NAT system, and an extensible packet filtering system.
84 Replacement of ipchains in 2.4 and higher kernels.
85
86 %description -l pl.UTF-8
87 Wydajny system translacji adresów (NAT) oraz system filtrowania
88 pakietów. Zamiennik ipchains w jądrach 2.4 i nowszych.
89
90 %description -l pt_BR.UTF-8
91 Esta é a ferramenta que controla o código de filtragem de pacotes do
92 kernel 2.4, obsoletando ipchains. Com esta ferramenta você pode
93 configurar filtros de pacotes, NAT, mascaramento (masquerading),
94 regras dinâmicas (stateful inspection), etc.
95
96 %description -l ru.UTF-8
97 iptables управляют кодом фильтрации сетевых пакетов в ядре Linux. Они
98 позволяют вам устанавливать межсетевые экраны (firewalls) и IP
99 маскарадинг, и т.п.
100
101 %description -l uk.UTF-8
102 iptables управляють кодом фільтрації пакетів мережі в ядрі Linux. Вони
103 дозволяють вам встановлювати міжмережеві екрани (firewalls) та IP
104 маскарадинг, тощо.
105
106 %package libs
107 Summary:        iptables libraries
108 Summary(pl.UTF-8):      Biblioteki iptables
109 Group:          Libraries
110 Conflicts:      iptables < 1.4.3-1
111
112 %description libs
113 iptables libraries.
114
115 %description libs -l pl.UTF-8
116 Biblioteki iptables.
117
118 %package devel
119 Summary:        Libraries and headers for developing iptables extensions
120 Summary(pl.UTF-8):      Biblioteki i nagłówki do tworzenia rozszerzeń iptables
121 Group:          Development/Libraries
122 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
123 Obsoletes:      iptables24-devel
124
125 %description devel
126 Libraries and headers for developing iptables extensions.
127
128 %description devel -l pl.UTF-8
129 Biblioteki i pliki nagłówkowe niezbędne do tworzenia rozszerzeń dla
130 iptables.
131
132 %package static
133 Summary:        Static iptables libraries
134 Summary(pl.UTF-8):      Biblioteki statyczne iptables
135 Group:          Development/Libraries
136 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
137
138 %description static
139 Static iptables libraries.
140
141 %description devel -l pl.UTF-8
142 Biblioteki statyczne iptables.
143
144 %package init
145 Summary:        Iptables init (RedHat style)
146 Summary(pl.UTF-8):      Iptables init (w stylu RedHata)
147 Group:          Networking/Admin
148 Requires(post,preun):   /sbin/chkconfig
149 Requires:       %{name}
150 Requires:       rc-scripts
151 Obsoletes:      firewall-init
152 Obsoletes:      firewall-init-ipchains
153 Obsoletes:      iptables24-init
154
155 %description init
156 Iptables-init is meant to provide an alternate way than firewall-init
157 to start and stop packet filtering through iptables(8).
158
159 %description init -l pl.UTF-8
160 Iptables-init ma na celu udostępnienie alternatywnego w stosunku do
161 firewall-init sposobu włączania i wyłączania filtrów IP jądra poprzez
162 iptables(8).
163
164 %prep
165 %setup -q -a1
166 %patch0 -p1
167 %patch1 -p1
168 %patch2 -p0
169 #%patch3 -p0
170 %patch4 -p1
171 %patch5 -p1
172 %patch6 -p1
173 %patch7 -p1
174 %if %{with vserver}
175 #patch8 -p1
176 %patch11 -p1
177 %endif
178 %if %{with batch}
179 %patch9 -p1
180 %endif
181 #%patch10 -p1
182
183 #patch999 -p1
184
185 chmod 755 extensions/.*-test*
186
187 %build
188 %{__libtoolize}
189 %{__aclocal}
190 %{__autoconf}
191 %{__automake}
192 %configure \
193         --with-kbuild=%{_kernelsrcdir} \
194         --with-ksource=%{_kernelsrcdir} \
195         --enable-devel \
196         --enable-libipq \
197         %{?with_static:--enable-static} \
198         --enable-shared
199
200 %{__make} -j1 all \
201         CC="%{__cc}" \
202         CFLAGS="%{rpmcflags} %{rpmcppflags} -D%{!?debug:N}DEBUG" \
203         KERNEL_DIR="%{_kernelsrcdir}" \
204         LIBDIR="%{_libdir}" \
205         DO_SELINUX=1 \
206         LDLIBS="-ldl"
207
208 %if %{with doc}
209 %{__make} -j1 -C iptables-howtos
210 sed -i 's:$(HTML_HOWTOS)::g; s:$(PSUS_HOWTOS)::g' iptables-howtos/Makefile
211 %endif
212
213 # Make a library, needed for OpenVCP
214 ar rcs libiptables.a iptables*.o
215 ar rcs libip6tables.a ip6tables*.o
216
217 %install
218 rm -rf $RPM_BUILD_ROOT
219 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir},%{_libdir},%{_mandir}/man3}
220
221 %{__make} install \
222         DESTDIR=$RPM_BUILD_ROOT \
223         BINDIR=%{_sbindir} \
224         MANDIR=%{_mandir} \
225         LIBDIR=%{_libdir}
226
227 # install library needed for collectd:
228 #install libiptc/libiptc.a $RPM_BUILD_ROOT%{_libdir}
229
230 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
231 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name6}
232
233 %clean
234 rm -rf $RPM_BUILD_ROOT
235
236 %post libs -p /sbin/ldconfig
237 %postun libs -p /sbin/ldconfig
238
239 %post init
240 /sbin/chkconfig --add %{name}
241 /sbin/chkconfig --add %{name6}
242
243 %preun init
244 if [ "$1" = "0" ]; then
245         /sbin/chkconfig --del %{name}
246         /sbin/chkconfig --del %{name6}
247 fi
248
249 %files
250 %defattr(644,root,root,755)
251 %{?with_doc:%doc iptables-howtos/{NAT,networking-concepts,packet-filtering}-HOWTO*}
252 %attr(755,root,root) %{_bindir}/iptables-xml
253 %attr(755,root,root) %{_sbindir}/iptables
254 %attr(755,root,root) %{_sbindir}/iptables-multi
255 %attr(755,root,root) %{_sbindir}/iptables-restore
256 %attr(755,root,root) %{_sbindir}/iptables-save
257 %attr(755,root,root) %{_sbindir}/ip6tables
258 %attr(755,root,root) %{_sbindir}/ip6tables-multi
259 %attr(755,root,root) %{_sbindir}/ip6tables-restore
260 %attr(755,root,root) %{_sbindir}/ip6tables-save
261 %if %{with batch}
262 %attr(755,root,root) %{_sbindir}/iptables-batch
263 %attr(755,root,root) %{_sbindir}/ip6tables-batch
264 %endif
265 %attr(755,root,root) %{_sbindir}/nfnl_osf
266 %dir %{_libdir}/xtables
267 %{_datadir}/xtables
268 %if %{with dist_kernel}
269 %attr(755,root,root) %{_libdir}/xtables/libip6t_ah.so
270 %attr(755,root,root) %{_libdir}/xtables/libip6t_dst.so
271 %attr(755,root,root) %{_libdir}/xtables/libip6t_eui64.so
272 %attr(755,root,root) %{_libdir}/xtables/libip6t_frag.so
273 %attr(755,root,root) %{_libdir}/xtables/libip6t_hbh.so
274 %attr(755,root,root) %{_libdir}/xtables/libip6t_hl.so
275 %attr(755,root,root) %{_libdir}/xtables/libip6t_HL.so
276 %attr(755,root,root) %{_libdir}/xtables/libip6t_icmp6.so
277 %attr(755,root,root) %{_libdir}/xtables/libip6t_ipv6header.so
278 %attr(755,root,root) %{_libdir}/xtables/libip6t_LOG.so
279 %attr(755,root,root) %{_libdir}/xtables/libip6t_mh.so
280 #%attr(755,root,root) %{_libdir}/xtables/libip6t_policy.so
281 %attr(755,root,root) %{_libdir}/xtables/libip6t_REJECT.so
282 %attr(755,root,root) %{_libdir}/xtables/libip6t_ROUTE.so
283 %attr(755,root,root) %{_libdir}/xtables/libip6t_rt.so
284 %attr(755,root,root) %{_libdir}/xtables/libipt_account.so
285 #attr(755,root,root) %{_libdir}/xtables/libipt_ACCOUNT.so
286 %attr(755,root,root) %{_libdir}/xtables/libipt_addrtype.so
287 %attr(755,root,root) %{_libdir}/xtables/libipt_ah.so
288 %attr(755,root,root) %{_libdir}/xtables/libipt_CLUSTERIP.so
289 %attr(755,root,root) %{_libdir}/xtables/libipt_DNAT.so
290 %attr(755,root,root) %{_libdir}/xtables/libipt_ecn.so
291 %attr(755,root,root) %{_libdir}/xtables/libipt_ECN.so
292 %attr(755,root,root) %{_libdir}/xtables/libipt_icmp.so
293 %attr(755,root,root) %{_libdir}/xtables/libipt_ipv4options.so
294 %attr(755,root,root) %{_libdir}/xtables/libipt_IPV4OPTSSTRIP.so
295 %attr(755,root,root) %{_libdir}/xtables/libipt_layer7.so
296 %attr(755,root,root) %{_libdir}/xtables/libipt_LOG.so
297 %attr(755,root,root) %{_libdir}/xtables/libipt_MASQUERADE.so
298 %attr(755,root,root) %{_libdir}/xtables/libipt_MIRROR.so
299 %attr(755,root,root) %{_libdir}/xtables/libipt_NETMAP.so
300 #%attr(755,root,root) %{_libdir}/xtables/libipt_policy.so
301 %attr(755,root,root) %{_libdir}/xtables/libipt_realm.so
302 %attr(755,root,root) %{_libdir}/xtables/libipt_REDIRECT.so
303 %attr(755,root,root) %{_libdir}/xtables/libipt_REJECT.so
304 %attr(755,root,root) %{_libdir}/xtables/libipt_ROUTE.so
305 %attr(755,root,root) %{_libdir}/xtables/libipt_rpc.so
306 %attr(755,root,root) %{_libdir}/xtables/libipt_SAME.so
307 %attr(755,root,root) %{_libdir}/xtables/libipt_set.so
308 %attr(755,root,root) %{_libdir}/xtables/libipt_SET.so
309 %attr(755,root,root) %{_libdir}/xtables/libipt_SNAT.so
310 %attr(755,root,root) %{_libdir}/xtables/libipt_stealth.so
311 %attr(755,root,root) %{_libdir}/xtables/libipt_ttl.so
312 %attr(755,root,root) %{_libdir}/xtables/libipt_TTL.so
313 %attr(755,root,root) %{_libdir}/xtables/libipt_ULOG.so
314 %attr(755,root,root) %{_libdir}/xtables/libipt_unclean.so
315 %attr(755,root,root) %{_libdir}/xtables/libxt_CLASSIFY.so
316 %attr(755,root,root) %{_libdir}/xtables/libxt_cluster.so
317 %attr(755,root,root) %{_libdir}/xtables/libxt_comment.so
318 %attr(755,root,root) %{_libdir}/xtables/libxt_connbytes.so
319 %attr(755,root,root) %{_libdir}/xtables/libxt_connlimit.so
320 %attr(755,root,root) %{_libdir}/xtables/libxt_connmark.so
321 %attr(755,root,root) %{_libdir}/xtables/libxt_CONNMARK.so
322 %attr(755,root,root) %{_libdir}/xtables/libxt_CONNSECMARK.so
323 %attr(755,root,root) %{_libdir}/xtables/libxt_conntrack.so
324 %attr(755,root,root) %{_libdir}/xtables/libxt_CT.so
325 %attr(755,root,root) %{_libdir}/xtables/libxt_dccp.so
326 %attr(755,root,root) %{_libdir}/xtables/libxt_dscp.so
327 %attr(755,root,root) %{_libdir}/xtables/libxt_DSCP.so
328 %attr(755,root,root) %{_libdir}/xtables/libxt_esp.so
329 %attr(755,root,root) %{_libdir}/xtables/libxt_hashlimit.so
330 %attr(755,root,root) %{_libdir}/xtables/libxt_helper.so
331 %attr(755,root,root) %{_libdir}/xtables/libxt_IMQ.so
332 %attr(755,root,root) %{_libdir}/xtables/libxt_iprange.so
333 %attr(755,root,root) %{_libdir}/xtables/libxt_length.so
334 %attr(755,root,root) %{_libdir}/xtables/libxt_limit.so
335 %attr(755,root,root) %{_libdir}/xtables/libxt_mac.so
336 %attr(755,root,root) %{_libdir}/xtables/libxt_mark.so
337 %attr(755,root,root) %{_libdir}/xtables/libxt_MARK.so
338 %attr(755,root,root) %{_libdir}/xtables/libxt_multiport.so
339 %attr(755,root,root) %{_libdir}/xtables/libxt_NFLOG.so
340 %attr(755,root,root) %{_libdir}/xtables/libxt_NFQUEUE.so
341 %attr(755,root,root) %{_libdir}/xtables/libxt_NOTRACK.so
342 %attr(755,root,root) %{_libdir}/xtables/libxt_owner.so
343 %attr(755,root,root) %{_libdir}/xtables/libxt_osf.so
344 %attr(755,root,root) %{_libdir}/xtables/libxt_physdev.so
345 %attr(755,root,root) %{_libdir}/xtables/libxt_pkttype.so
346 %attr(755,root,root) %{_libdir}/xtables/libxt_policy.so
347 %attr(755,root,root) %{_libdir}/xtables/libxt_recent.so
348 %attr(755,root,root) %{_libdir}/xtables/libxt_quota.so
349 %attr(755,root,root) %{_libdir}/xtables/libxt_RATEEST.so
350 %attr(755,root,root) %{_libdir}/xtables/libxt_rateest.so
351 %attr(755,root,root) %{_libdir}/xtables/libxt_sctp.so
352 %attr(755,root,root) %{_libdir}/xtables/libxt_SECMARK.so
353 %attr(755,root,root) %{_libdir}/xtables/libxt_socket.so
354 %attr(755,root,root) %{_libdir}/xtables/libxt_standard.so
355 %attr(755,root,root) %{_libdir}/xtables/libxt_state.so
356 %attr(755,root,root) %{_libdir}/xtables/libxt_statistic.so
357 %attr(755,root,root) %{_libdir}/xtables/libxt_string.so
358 %attr(755,root,root) %{_libdir}/xtables/libxt_tcpmss.so
359 %attr(755,root,root) %{_libdir}/xtables/libxt_TCPMSS.so
360 %attr(755,root,root) %{_libdir}/xtables/libxt_TCPOPTSTRIP.so
361 %attr(755,root,root) %{_libdir}/xtables/libxt_tcp.so
362 %attr(755,root,root) %{_libdir}/xtables/libxt_time.so
363 %attr(755,root,root) %{_libdir}/xtables/libxt_tos.so
364 %attr(755,root,root) %{_libdir}/xtables/libxt_TOS.so
365 %attr(755,root,root) %{_libdir}/xtables/libxt_TPROXY.so
366 %attr(755,root,root) %{_libdir}/xtables/libxt_TRACE.so
367 %attr(755,root,root) %{_libdir}/xtables/libxt_u32.so
368 %attr(755,root,root) %{_libdir}/xtables/libxt_udp.so
369 %else
370 %attr(755,root,root) %{_libdir}/xtables/*.so
371 %endif
372 %{_mandir}/man8/*
373
374 %files libs
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %ghost %{_libdir}/libipq.so.0                                                                                                          
377 %attr(755,root,root) %{_libdir}/libipq.so.*.*
378 %attr(755,root,root) %ghost %{_libdir}/libiptc.so.0
379 %attr(755,root,root) %{_libdir}/libiptc.so.*.*
380 %attr(755,root,root) %ghost %{_libdir}/libip4tc.so.0
381 %attr(755,root,root) %{_libdir}/libip4tc.so.*.*
382 %attr(755,root,root) %ghost %{_libdir}/libip6tc.so.0
383 %attr(755,root,root) %{_libdir}/libip6tc.so.*.*
384 %attr(755,root,root) %ghost %{_libdir}/libxtables.so.4
385 %attr(755,root,root) %{_libdir}/libxtables.so.*.*
386
387 %files devel
388 %defattr(644,root,root,755)
389 %{?with_doc:%doc iptables-howtos/netfilter-hacking-HOWTO*}
390 %attr(755,root,root) %{_libdir}/lib*.so
391 %{_libdir}/lib*.la
392 %{_includedir}/*.h
393 %{_includedir}/libiptc
394 %{_pkgconfigdir}/*.pc
395 %{_mandir}/man3/*
396
397 %if %{with static}
398 %files static
399 %defattr(644,root,root,755)
400 %{_libdir}/lib*.a
401 %endif
402
403 %files init
404 %defattr(644,root,root,755)
405 %attr(754,root,root) /etc/rc.d/init.d/iptables
406 %attr(754,root,root) /etc/rc.d/init.d/ip6tables
This page took 0.088165 seconds and 4 git commands to generate.