]> git.pld-linux.org Git - packages/iptables.git/blob - iptables.spec
- new iptables-batch patch
[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 #
14 %define         netfilter_snap          20070806
15 %define         llh_version             7:2.6.22.1
16 %define         name6                   ip6tables
17 #
18 %define         rel 2
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.1.1
27 Release:        %{rel}
28 License:        GPL
29 Group:          Networking/Daemons
30 Source0:        ftp://ftp.netfilter.org/pub/iptables/%{name}-%{version}.tar.bz2
31 # Source0-md5:  723fa88d8a0915e184f99e03e9bf06cb
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.0-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:  libtool
59 %if %{with doc}
60 BuildRequires:  sed >= 4.0
61 BuildRequires:  sgml-tools
62 BuildRequires:  sgmls
63 BuildRequires:  tetex-dvips
64 BuildRequires:  tetex-format-latex
65 BuildRequires:  tetex-latex
66 BuildRequires:  tetex-tex-babel
67 %endif
68 %if %{with dist_kernel} && %{netfilter_snap} != 0
69 BuildRequires:  kernel%{_alt_kernel}-headers(netfilter) >= %{netfilter_snap}
70 BuildRequires:  kernel%{_alt_kernel}-source
71 %endif
72 #BuildRequires: linux-libc-headers >= %{llh_version}
73 BuildConflicts: kernel-headers < 2.3.0
74 Provides:       firewall-userspace-tool
75 Obsoletes:      ipchains
76 Obsoletes:      iptables-ipp2p
77 Obsoletes:      iptables24-compat
78 Obsoletes:      netfilter
79 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
81 %description
82 An extensible NAT system, and an extensible packet filtering system.
83 Replacement of ipchains in 2.4 and higher kernels.
84
85 %description -l pl.UTF-8
86 Wydajny system translacji adresów (NAT) oraz system filtrowania
87 pakietów. Zamiennik ipchains w jądrach 2.4 i nowszych.
88
89 %description -l pt_BR.UTF-8
90 Esta é a ferramenta que controla o código de filtragem de pacotes do
91 kernel 2.4, obsoletando ipchains. Com esta ferramenta você pode
92 configurar filtros de pacotes, NAT, mascaramento (masquerading),
93 regras dinâmicas (stateful inspection), etc.
94
95 %description -l ru.UTF-8
96 iptables управляют кодом фильтрации сетевых пакетов в ядре Linux. Они
97 позволяют вам устанавливать межсетевые экраны (firewalls) и IP
98 маскарадинг, и т.п.
99
100 %description -l uk.UTF-8
101 iptables управляють кодом фільтрації пакетів мережі в ядрі Linux. Вони
102 дозволяють вам встановлювати міжмережеві екрани (firewalls) та IP
103 маскарадинг, тощо.
104
105 %package devel
106 Summary:        Libraries and headers for developing iptables extensions
107 Summary(pl.UTF-8):      Biblioteki i nagłówki do tworzenia rozszerzeń iptables
108 Group:          Development/Libraries
109 Obsoletes:      iptables24-devel
110
111 %description devel
112 Libraries and headers for developing iptables extensions.
113
114 %description devel -l pl.UTF-8
115 Biblioteki i pliki nagłówkowe niezbędne do tworzenia rozszerzeń dla
116 iptables.
117
118 %package init
119 Summary:        Iptables init (RedHat style)
120 Summary(pl.UTF-8):      Iptables init (w stylu RedHata)
121 Release:        %{rel}
122 Group:          Networking/Admin
123 Requires(post,preun):   /sbin/chkconfig
124 Requires:       %{name}
125 Requires:       rc-scripts
126 Obsoletes:      firewall-init
127 Obsoletes:      firewall-init-ipchains
128 Obsoletes:      iptables24-init
129
130 %description init
131 Iptables-init is meant to provide an alternate way than firewall-init
132 to start and stop packet filtering through iptables(8).
133
134 %description init -l pl.UTF-8
135 Iptables-init ma na celu udostępnienie alternatywnego w stosunku do
136 firewall-init sposobu włączania i wyłączania filtrów IP jądra poprzez
137 iptables(8).
138
139 %prep
140 %setup -q -a1
141 %patch0 -p1
142 %patch1 -p1
143 %patch2 -p1
144 %patch3 -p0
145 %patch4 -p1
146 %patch5 -p1
147 %patch6 -p1
148 %patch7 -p1
149 %if %{with vserver}
150 #patch8 -p1
151 %patch11 -p1
152 %endif
153 %patch9 -p1
154 %patch10 -p1
155
156 #patch999 -p1
157
158 chmod 755 extensions/.*-test*
159
160 %build
161 %{__libtoolize}
162 %{__aclocal}
163 %{__automake}
164 %configure \
165         --with-kbuild=%{_kernelsrcdir} \
166         --with-ksource=%{_kernelsrcdir} \
167         --enable-devel \
168         --enable-libipq \
169         --enable-shared
170
171 %{__make} -j1 all \
172         CC="%{__cc}" \
173         CFLAGS="%{rpmcflags} -D%{!?debug:N}DEBUG" \
174         KERNEL_DIR="%{_kernelsrcdir}" \
175         LIBDIR="%{_libdir}" \
176         DO_SELINUX=1 \
177         LDLIBS="-ldl"
178
179 %if %{with doc}
180 %{__make} -j1 -C iptables-howtos
181 sed -i 's:$(HTML_HOWTOS)::g; s:$(PSUS_HOWTOS)::g' iptables-howtos/Makefile
182 %endif
183
184 # Make a library, needed for OpenVCP
185 ar rcs libiptables.a iptables.o
186 ar rcs libip6tables.a ip6tables.o
187
188 %install
189 rm -rf $RPM_BUILD_ROOT
190 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir},%{_libdir},%{_mandir}/man3}
191
192 %{__make} install \
193         DESTDIR=$RPM_BUILD_ROOT \
194         BINDIR=%{_sbindir} \
195         MANDIR=%{_mandir} \
196         LIBDIR=%{_libdir}
197
198 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
199 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name6}
200
201 %clean
202 rm -rf $RPM_BUILD_ROOT
203
204 %post init
205 /sbin/chkconfig --add %{name}
206 /sbin/chkconfig --add %{name6}
207
208 %preun init
209 if [ "$1" = "0" ]; then
210         /sbin/chkconfig --del %{name}
211         /sbin/chkconfig --del %{name6}
212 fi
213
214 %files
215 %defattr(644,root,root,755)
216 %{?with_doc:%doc iptables-howtos/{NAT,networking-concepts,packet-filtering}-HOWTO*}
217 %attr(755,root,root) %{_bindir}/iptables-xml
218 %attr(755,root,root) %{_sbindir}/iptables
219 %attr(755,root,root) %{_sbindir}/iptables-batch
220 %attr(755,root,root) %{_sbindir}/iptables-multi
221 %attr(755,root,root) %{_sbindir}/iptables-restore
222 %attr(755,root,root) %{_sbindir}/iptables-save
223 %attr(755,root,root) %{_sbindir}/ip6tables
224 %attr(755,root,root) %{_sbindir}/ip6tables-batch
225 %attr(755,root,root) %{_sbindir}/ip6tables-multi
226 %attr(755,root,root) %{_sbindir}/ip6tables-restore
227 %attr(755,root,root) %{_sbindir}/ip6tables-save
228 %dir %{_libdir}/xtables
229 %if %{with dist_kernel}
230 %attr(755,root,root) %{_libdir}/xtables/libip6t_ah.so
231 %attr(755,root,root) %{_libdir}/xtables/libip6t_dst.so
232 %attr(755,root,root) %{_libdir}/xtables/libip6t_eui64.so
233 %attr(755,root,root) %{_libdir}/xtables/libip6t_frag.so
234 %attr(755,root,root) %{_libdir}/xtables/libip6t_hbh.so
235 %attr(755,root,root) %{_libdir}/xtables/libip6t_hl.so
236 %attr(755,root,root) %{_libdir}/xtables/libip6t_HL.so
237 %attr(755,root,root) %{_libdir}/xtables/libip6t_icmp6.so
238 %attr(755,root,root) %{_libdir}/xtables/libip6t_IMQ.so
239 %attr(755,root,root) %{_libdir}/xtables/libip6t_ipv6header.so
240 %attr(755,root,root) %{_libdir}/xtables/libip6t_LOG.so
241 %attr(755,root,root) %{_libdir}/xtables/libip6t_mh.so
242 %attr(755,root,root) %{_libdir}/xtables/libip6t_policy.so
243 %attr(755,root,root) %{_libdir}/xtables/libip6t_REJECT.so
244 %attr(755,root,root) %{_libdir}/xtables/libip6t_ROUTE.so
245 %attr(755,root,root) %{_libdir}/xtables/libip6t_rt.so
246 %attr(755,root,root) %{_libdir}/xtables/libipt_account.so
247 #attr(755,root,root) %{_libdir}/xtables/libipt_ACCOUNT.so
248 %attr(755,root,root) %{_libdir}/xtables/libipt_addrtype.so
249 %attr(755,root,root) %{_libdir}/xtables/libipt_ah.so
250 %attr(755,root,root) %{_libdir}/xtables/libipt_CLUSTERIP.so
251 %attr(755,root,root) %{_libdir}/xtables/libipt_DNAT.so
252 %attr(755,root,root) %{_libdir}/xtables/libipt_ecn.so
253 %attr(755,root,root) %{_libdir}/xtables/libipt_ECN.so
254 %attr(755,root,root) %{_libdir}/xtables/libipt_icmp.so
255 %attr(755,root,root) %{_libdir}/xtables/libipt_IMQ.so
256 %attr(755,root,root) %{_libdir}/xtables/libipt_ipv4options.so
257 %attr(755,root,root) %{_libdir}/xtables/libipt_IPV4OPTSSTRIP.so
258 %attr(755,root,root) %{_libdir}/xtables/libipt_layer7.so
259 %attr(755,root,root) %{_libdir}/xtables/libipt_LOG.so
260 %attr(755,root,root) %{_libdir}/xtables/libipt_MASQUERADE.so
261 %attr(755,root,root) %{_libdir}/xtables/libipt_MIRROR.so
262 %attr(755,root,root) %{_libdir}/xtables/libipt_NETMAP.so
263 %attr(755,root,root) %{_libdir}/xtables/libipt_policy.so
264 %attr(755,root,root) %{_libdir}/xtables/libipt_realm.so
265 %attr(755,root,root) %{_libdir}/xtables/libipt_recent.so
266 %attr(755,root,root) %{_libdir}/xtables/libipt_REDIRECT.so
267 %attr(755,root,root) %{_libdir}/xtables/libipt_REJECT.so
268 %attr(755,root,root) %{_libdir}/xtables/libipt_ROUTE.so
269 %attr(755,root,root) %{_libdir}/xtables/libipt_rpc.so
270 %attr(755,root,root) %{_libdir}/xtables/libipt_SAME.so
271 %attr(755,root,root) %{_libdir}/xtables/libipt_set.so
272 %attr(755,root,root) %{_libdir}/xtables/libipt_SET.so
273 %attr(755,root,root) %{_libdir}/xtables/libipt_SNAT.so
274 %attr(755,root,root) %{_libdir}/xtables/libipt_stealth.so
275 %attr(755,root,root) %{_libdir}/xtables/libipt_ttl.so
276 %attr(755,root,root) %{_libdir}/xtables/libipt_TTL.so
277 %attr(755,root,root) %{_libdir}/xtables/libipt_ULOG.so
278 %attr(755,root,root) %{_libdir}/xtables/libipt_unclean.so
279 %attr(755,root,root) %{_libdir}/xtables/libxt_CLASSIFY.so
280 %attr(755,root,root) %{_libdir}/xtables/libxt_comment.so
281 %attr(755,root,root) %{_libdir}/xtables/libxt_connbytes.so
282 %attr(755,root,root) %{_libdir}/xtables/libxt_connlimit.so
283 %attr(755,root,root) %{_libdir}/xtables/libxt_connmark.so
284 %attr(755,root,root) %{_libdir}/xtables/libxt_CONNMARK.so
285 %attr(755,root,root) %{_libdir}/xtables/libxt_CONNSECMARK.so
286 %attr(755,root,root) %{_libdir}/xtables/libxt_conntrack.so
287 %attr(755,root,root) %{_libdir}/xtables/libxt_dccp.so
288 %attr(755,root,root) %{_libdir}/xtables/libxt_dscp.so
289 %attr(755,root,root) %{_libdir}/xtables/libxt_DSCP.so
290 %attr(755,root,root) %{_libdir}/xtables/libxt_esp.so
291 %attr(755,root,root) %{_libdir}/xtables/libxt_hashlimit.so
292 %attr(755,root,root) %{_libdir}/xtables/libxt_helper.so
293 %attr(755,root,root) %{_libdir}/xtables/libxt_iprange.so
294 %attr(755,root,root) %{_libdir}/xtables/libxt_length.so
295 %attr(755,root,root) %{_libdir}/xtables/libxt_limit.so
296 %attr(755,root,root) %{_libdir}/xtables/libxt_mac.so
297 %attr(755,root,root) %{_libdir}/xtables/libxt_mark.so
298 %attr(755,root,root) %{_libdir}/xtables/libxt_MARK.so
299 %attr(755,root,root) %{_libdir}/xtables/libxt_multiport.so
300 %attr(755,root,root) %{_libdir}/xtables/libxt_NFLOG.so
301 %attr(755,root,root) %{_libdir}/xtables/libxt_NFQUEUE.so
302 %attr(755,root,root) %{_libdir}/xtables/libxt_NOTRACK.so
303 %attr(755,root,root) %{_libdir}/xtables/libxt_owner.so
304 %attr(755,root,root) %{_libdir}/xtables/libxt_physdev.so
305 %attr(755,root,root) %{_libdir}/xtables/libxt_pkttype.so
306 %attr(755,root,root) %{_libdir}/xtables/libxt_quota.so
307 %attr(755,root,root) %{_libdir}/xtables/libxt_RATEEST.so
308 %attr(755,root,root) %{_libdir}/xtables/libxt_rateest.so
309 %attr(755,root,root) %{_libdir}/xtables/libxt_sctp.so
310 %attr(755,root,root) %{_libdir}/xtables/libxt_SECMARK.so
311 %attr(755,root,root) %{_libdir}/xtables/libxt_socket.so
312 %attr(755,root,root) %{_libdir}/xtables/libxt_standard.so
313 %attr(755,root,root) %{_libdir}/xtables/libxt_state.so
314 %attr(755,root,root) %{_libdir}/xtables/libxt_statistic.so
315 %attr(755,root,root) %{_libdir}/xtables/libxt_string.so
316 %attr(755,root,root) %{_libdir}/xtables/libxt_tcpmss.so
317 %attr(755,root,root) %{_libdir}/xtables/libxt_TCPMSS.so
318 %attr(755,root,root) %{_libdir}/xtables/libxt_TCPOPTSTRIP.so
319 %attr(755,root,root) %{_libdir}/xtables/libxt_tcp.so
320 %attr(755,root,root) %{_libdir}/xtables/libxt_time.so
321 %attr(755,root,root) %{_libdir}/xtables/libxt_tos.so
322 %attr(755,root,root) %{_libdir}/xtables/libxt_TOS.so
323 %attr(755,root,root) %{_libdir}/xtables/libxt_TPROXY.so
324 %attr(755,root,root) %{_libdir}/xtables/libxt_TRACE.so
325 %attr(755,root,root) %{_libdir}/xtables/libxt_u32.so
326 %attr(755,root,root) %{_libdir}/xtables/libxt_udp.so
327 %else
328 %attr(755,root,root) %{_libdir}/xtables/*.so
329 %endif
330 %{_mandir}/man8/*
331
332 %files devel
333 %defattr(644,root,root,755)
334 %{?with_doc:%doc iptables-howtos/netfilter-hacking-HOWTO*}
335 %{_libdir}/lib*.a
336 %{_includedir}/*.h
337 %dir %{_includedir}/libiptc
338 %{_includedir}/libiptc/*.h
339 %{_mandir}/man3/*
340
341 %files init
342 %defattr(644,root,root,755)
343 %attr(754,root,root) /etc/rc.d/init.d/iptables
344 %attr(754,root,root) /etc/rc.d/init.d/ip6tables
This page took 0.076797 seconds and 4 git commands to generate.