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