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