]> git.pld-linux.org Git - packages/iptables.git/blob - iptables.spec
- rel 2
[packages/iptables.git] / iptables.spec
1 #
2 # TODO:
3 # - fix makefile (-D_UNKNOWN_KERNEL_POINTER_SIZE issue)
4 # - owner needs rewrite to xt
5 # - batch needs update/rewrite
6 # - add manual sections from xtable-addons
7 # - ACCOUNT has been removed from iptables-20070806.patch, now should be taken
8 #   from http://www.intra2net.com/de/produkte/opensource/ipt_account/libipt_ACCOUNT-1.3.tar.gz
9 #
10 # Conditional build:
11 %bcond_without  doc             # without documentation (HOWTOS) which needed TeX
12 %bcond_without  dist_kernel     # without distribution kernel
13 %bcond_without  vserver         # kernel build without vserver
14 #
15 %define         netfilter_snap          20070806
16 %define         llh_version             7:2.6.22.1
17 %define         name6                   ip6tables
18 #
19 %define         rel 2
20 Summary:        Extensible packet filtering system && extensible NAT system
21 Summary(pl.UTF-8):      System filtrowania pakietów oraz system translacji adresów (NAT)
22 Summary(pt_BR.UTF-8):   Ferramenta para controlar a filtragem de pacotes no kernel-2.6.x
23 Summary(ru.UTF-8):      Утилиты для управления пакетными фильтрами ядра Linux
24 Summary(uk.UTF-8):      Утиліти для керування пакетними фільтрами ядра Linux
25 Summary(zh_CN.UTF-8):   Linux内核包过滤管理工具
26 Name:           iptables
27 Version:        1.4.1.1
28 Release:        %{rel}
29 License:        GPL
30 Group:          Networking/Daemons
31 Source0:        ftp://ftp.netfilter.org/pub/iptables/%{name}-%{version}.tar.bz2
32 # Source0-md5:  723fa88d8a0915e184f99e03e9bf06cb
33 Source1:        cvs://cvs.samba.org/netfilter/%{name}-howtos.tar.bz2
34 # Source1-md5:  2ed2b452daefe70ededd75dc0061fd07
35 Source2:        %{name}.init
36 Source3:        %{name6}.init
37 Patch0:         %{name}-%{netfilter_snap}.patch
38 Patch1:         %{name}-man.patch
39 # based on http://www.linuximq.net/patchs/iptables-1.4.0-imq.diff
40 Patch2:         %{name}-imq.patch
41 # http://www.balabit.com/downloads/files/tproxy/tproxy-iptables-20080204-1915.patch
42 Patch3:         %{name}-tproxy.patch
43 Patch4:         %{name}-stealth.patch
44 # almost based on iptables-1.4-for-kernel-2.6.20forward-layer7-2.18.patch
45 # http://switch.dl.sourceforge.net/sourceforge/l7-filter/netfilter-layer7-v2.18.tar.gz
46 Patch5:         %{name}-layer7.patch
47 Patch6:         %{name}-old-1.3.7.patch
48 # based on http://www.svn.barbara.eu.org/ipt_account/attachment/wiki/Software/ipt_account-0.1.21-20070804164729.tar.gz?format=raw
49 Patch7:         %{name}-account.patch
50 # http://people.linux-vserver.org/~dhozac/p/m/iptables-1.3.5-owner-xid.patch
51 Patch8:         %{name}-1.3.5-owner-xid.patch
52 Patch9:         %{name}-batch.patch
53 Patch10:        %{name}-headers.patch
54 Patch11:        %{name}-owner-struct-size-vs.patch
55 Patch999:       %{name}-llh-dirty-hack.patch
56 URL:            http://www.netfilter.org/
57 BuildRequires:  autoconf
58 BuildRequires:  automake
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 devel
107 Summary:        Libraries and headers for developing iptables extensions
108 Summary(pl.UTF-8):      Biblioteki i nagłówki do tworzenia rozszerzeń iptables
109 Group:          Development/Libraries
110 Obsoletes:      iptables24-devel
111
112 %description devel
113 Libraries and headers for developing iptables extensions.
114
115 %description devel -l pl.UTF-8
116 Biblioteki i pliki nagłówkowe niezbędne do tworzenia rozszerzeń dla
117 iptables.
118
119 %package init
120 Summary:        Iptables init (RedHat style)
121 Summary(pl.UTF-8):      Iptables init (w stylu RedHata)
122 Release:        %{rel}
123 Group:          Networking/Admin
124 Requires(post,preun):   /sbin/chkconfig
125 Requires:       %{name}
126 Requires:       rc-scripts
127 Obsoletes:      firewall-init
128 Obsoletes:      firewall-init-ipchains
129 Obsoletes:      iptables24-init
130
131 %description init
132 Iptables-init is meant to provide an alternate way than firewall-init
133 to start and stop packet filtering through iptables(8).
134
135 %description init -l pl.UTF-8
136 Iptables-init ma na celu udostępnienie alternatywnego w stosunku do
137 firewall-init sposobu włączania i wyłączania filtrów IP jądra poprzez
138 iptables(8).
139
140 %prep
141 %setup -q -a1
142 %patch0 -p1
143 %patch1 -p1
144 %patch2 -p1
145 %patch3 -p0
146 %patch4 -p1
147 %patch5 -p1
148 %patch6 -p1
149 %patch7 -p1
150 %if %{with vserver}
151 #patch8 -p1
152 %patch11 -p1
153 %endif
154 #patch9 -p0
155 %patch10 -p1
156
157 #patch999 -p1
158
159 chmod 755 extensions/.*-test*
160
161 %build
162 %{__libtoolize}
163 %{__aclocal}
164 %{__automake}
165 %configure \
166         --with-kbuild=%{_kernelsrcdir} \
167         --with-ksource=%{_kernelsrcdir} \
168         --enable-devel \
169         --enable-libipq \
170         --enable-shared
171
172 %{__make} -j1 all \
173         CC="%{__cc}" \
174         CFLAGS="%{rpmcflags} -D%{!?debug:N}DEBUG" \
175         KERNEL_DIR="%{_kernelsrcdir}" \
176         LIBDIR="%{_libdir}" \
177         DO_SELINUX=1 \
178         LDLIBS="-ldl"
179
180 %if %{with doc}
181 %{__make} -j1 -C iptables-howtos
182 sed -i 's:$(HTML_HOWTOS)::g; s:$(PSUS_HOWTOS)::g' iptables-howtos/Makefile
183 %endif
184
185 # Make a library, needed for OpenVCP
186 ar rcs libiptables.a iptables.o
187 ar rcs libip6tables.a ip6tables.o
188
189 %install
190 rm -rf $RPM_BUILD_ROOT
191 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir},%{_libdir},%{_mandir}/man3}
192
193 %{__make} install \
194         DESTDIR=$RPM_BUILD_ROOT \
195         BINDIR=%{_sbindir} \
196         MANDIR=%{_mandir} \
197         LIBDIR=%{_libdir}
198
199 #install iptables-batch $RPM_BUILD_ROOT%{_sbindir}
200 #install ip6tables-batch $RPM_BUILD_ROOT%{_sbindir}
201
202 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
203 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name6}
204
205 %clean
206 rm -rf $RPM_BUILD_ROOT
207
208 %post init
209 /sbin/chkconfig --add %{name}
210 /sbin/chkconfig --add %{name6}
211
212 %preun init
213 if [ "$1" = "0" ]; then
214         /sbin/chkconfig --del %{name}
215         /sbin/chkconfig --del %{name6}
216 fi
217
218 %files
219 %defattr(644,root,root,755)
220 %{?with_doc:%doc iptables-howtos/{NAT,networking-concepts,packet-filtering}-HOWTO*}
221 %attr(755,root,root) %{_bindir}/iptables-xml
222 %attr(755,root,root) %{_sbindir}/iptables
223 #attr(755,root,root) %{_sbindir}/iptables-batch
224 %attr(755,root,root) %{_sbindir}/iptables-multi
225 %attr(755,root,root) %{_sbindir}/iptables-restore
226 %attr(755,root,root) %{_sbindir}/iptables-save
227 %attr(755,root,root) %{_sbindir}/ip6tables
228 #attr(755,root,root) %{_sbindir}/ip6tables-batch
229 %attr(755,root,root) %{_sbindir}/ip6tables-multi
230 %attr(755,root,root) %{_sbindir}/ip6tables-restore
231 %attr(755,root,root) %{_sbindir}/ip6tables-save
232 %dir %{_libdir}/xtables
233 %if %{with dist_kernel}
234 %attr(755,root,root) %{_libdir}/xtables/libip6t_ah.so
235 %attr(755,root,root) %{_libdir}/xtables/libip6t_dst.so
236 %attr(755,root,root) %{_libdir}/xtables/libip6t_eui64.so
237 %attr(755,root,root) %{_libdir}/xtables/libip6t_frag.so
238 %attr(755,root,root) %{_libdir}/xtables/libip6t_hbh.so
239 %attr(755,root,root) %{_libdir}/xtables/libip6t_hl.so
240 %attr(755,root,root) %{_libdir}/xtables/libip6t_HL.so
241 %attr(755,root,root) %{_libdir}/xtables/libip6t_icmp6.so
242 %attr(755,root,root) %{_libdir}/xtables/libip6t_IMQ.so
243 %attr(755,root,root) %{_libdir}/xtables/libip6t_ipv6header.so
244 %attr(755,root,root) %{_libdir}/xtables/libip6t_LOG.so
245 %attr(755,root,root) %{_libdir}/xtables/libip6t_mh.so
246 %attr(755,root,root) %{_libdir}/xtables/libip6t_policy.so
247 %attr(755,root,root) %{_libdir}/xtables/libip6t_REJECT.so
248 %attr(755,root,root) %{_libdir}/xtables/libip6t_ROUTE.so
249 %attr(755,root,root) %{_libdir}/xtables/libip6t_rt.so
250 %attr(755,root,root) %{_libdir}/xtables/libipt_account.so
251 #attr(755,root,root) %{_libdir}/xtables/libipt_ACCOUNT.so
252 %attr(755,root,root) %{_libdir}/xtables/libipt_addrtype.so
253 %attr(755,root,root) %{_libdir}/xtables/libipt_ah.so
254 %attr(755,root,root) %{_libdir}/xtables/libipt_CLUSTERIP.so
255 %attr(755,root,root) %{_libdir}/xtables/libipt_DNAT.so
256 %attr(755,root,root) %{_libdir}/xtables/libipt_ecn.so
257 %attr(755,root,root) %{_libdir}/xtables/libipt_ECN.so
258 %attr(755,root,root) %{_libdir}/xtables/libipt_icmp.so
259 %attr(755,root,root) %{_libdir}/xtables/libipt_IMQ.so
260 %attr(755,root,root) %{_libdir}/xtables/libipt_ipv4options.so
261 %attr(755,root,root) %{_libdir}/xtables/libipt_IPV4OPTSSTRIP.so
262 %attr(755,root,root) %{_libdir}/xtables/libipt_layer7.so
263 %attr(755,root,root) %{_libdir}/xtables/libipt_LOG.so
264 %attr(755,root,root) %{_libdir}/xtables/libipt_MASQUERADE.so
265 %attr(755,root,root) %{_libdir}/xtables/libipt_MIRROR.so
266 %attr(755,root,root) %{_libdir}/xtables/libipt_NETMAP.so
267 %attr(755,root,root) %{_libdir}/xtables/libipt_policy.so
268 %attr(755,root,root) %{_libdir}/xtables/libipt_realm.so
269 %attr(755,root,root) %{_libdir}/xtables/libipt_recent.so
270 %attr(755,root,root) %{_libdir}/xtables/libipt_REDIRECT.so
271 %attr(755,root,root) %{_libdir}/xtables/libipt_REJECT.so
272 %attr(755,root,root) %{_libdir}/xtables/libipt_ROUTE.so
273 %attr(755,root,root) %{_libdir}/xtables/libipt_rpc.so
274 %attr(755,root,root) %{_libdir}/xtables/libipt_SAME.so
275 %attr(755,root,root) %{_libdir}/xtables/libipt_set.so
276 %attr(755,root,root) %{_libdir}/xtables/libipt_SET.so
277 %attr(755,root,root) %{_libdir}/xtables/libipt_SNAT.so
278 %attr(755,root,root) %{_libdir}/xtables/libipt_stealth.so
279 %attr(755,root,root) %{_libdir}/xtables/libipt_ttl.so
280 %attr(755,root,root) %{_libdir}/xtables/libipt_TTL.so
281 %attr(755,root,root) %{_libdir}/xtables/libipt_ULOG.so
282 %attr(755,root,root) %{_libdir}/xtables/libipt_unclean.so
283 %attr(755,root,root) %{_libdir}/xtables/libxt_CLASSIFY.so
284 %attr(755,root,root) %{_libdir}/xtables/libxt_comment.so
285 %attr(755,root,root) %{_libdir}/xtables/libxt_connbytes.so
286 %attr(755,root,root) %{_libdir}/xtables/libxt_connlimit.so
287 %attr(755,root,root) %{_libdir}/xtables/libxt_connmark.so
288 %attr(755,root,root) %{_libdir}/xtables/libxt_CONNMARK.so
289 %attr(755,root,root) %{_libdir}/xtables/libxt_CONNSECMARK.so
290 %attr(755,root,root) %{_libdir}/xtables/libxt_conntrack.so
291 %attr(755,root,root) %{_libdir}/xtables/libxt_dccp.so
292 %attr(755,root,root) %{_libdir}/xtables/libxt_dscp.so
293 %attr(755,root,root) %{_libdir}/xtables/libxt_DSCP.so
294 %attr(755,root,root) %{_libdir}/xtables/libxt_esp.so
295 %attr(755,root,root) %{_libdir}/xtables/libxt_hashlimit.so
296 %attr(755,root,root) %{_libdir}/xtables/libxt_helper.so
297 %attr(755,root,root) %{_libdir}/xtables/libxt_iprange.so
298 %attr(755,root,root) %{_libdir}/xtables/libxt_length.so
299 %attr(755,root,root) %{_libdir}/xtables/libxt_limit.so
300 %attr(755,root,root) %{_libdir}/xtables/libxt_mac.so
301 %attr(755,root,root) %{_libdir}/xtables/libxt_mark.so
302 %attr(755,root,root) %{_libdir}/xtables/libxt_MARK.so
303 %attr(755,root,root) %{_libdir}/xtables/libxt_multiport.so
304 %attr(755,root,root) %{_libdir}/xtables/libxt_NFLOG.so
305 %attr(755,root,root) %{_libdir}/xtables/libxt_NFQUEUE.so
306 %attr(755,root,root) %{_libdir}/xtables/libxt_NOTRACK.so
307 %attr(755,root,root) %{_libdir}/xtables/libxt_owner.so
308 %attr(755,root,root) %{_libdir}/xtables/libxt_physdev.so
309 %attr(755,root,root) %{_libdir}/xtables/libxt_pkttype.so
310 %attr(755,root,root) %{_libdir}/xtables/libxt_quota.so
311 %attr(755,root,root) %{_libdir}/xtables/libxt_RATEEST.so
312 %attr(755,root,root) %{_libdir}/xtables/libxt_rateest.so
313 %attr(755,root,root) %{_libdir}/xtables/libxt_sctp.so
314 %attr(755,root,root) %{_libdir}/xtables/libxt_SECMARK.so
315 %attr(755,root,root) %{_libdir}/xtables/libxt_socket.so
316 %attr(755,root,root) %{_libdir}/xtables/libxt_standard.so
317 %attr(755,root,root) %{_libdir}/xtables/libxt_state.so
318 %attr(755,root,root) %{_libdir}/xtables/libxt_statistic.so
319 %attr(755,root,root) %{_libdir}/xtables/libxt_string.so
320 %attr(755,root,root) %{_libdir}/xtables/libxt_tcpmss.so
321 %attr(755,root,root) %{_libdir}/xtables/libxt_TCPMSS.so
322 %attr(755,root,root) %{_libdir}/xtables/libxt_TCPOPTSTRIP.so
323 %attr(755,root,root) %{_libdir}/xtables/libxt_tcp.so
324 %attr(755,root,root) %{_libdir}/xtables/libxt_time.so
325 %attr(755,root,root) %{_libdir}/xtables/libxt_tos.so
326 %attr(755,root,root) %{_libdir}/xtables/libxt_TOS.so
327 %attr(755,root,root) %{_libdir}/xtables/libxt_TPROXY.so
328 %attr(755,root,root) %{_libdir}/xtables/libxt_TRACE.so
329 %attr(755,root,root) %{_libdir}/xtables/libxt_u32.so
330 %attr(755,root,root) %{_libdir}/xtables/libxt_udp.so
331 %else
332 %attr(755,root,root) %{_libdir}/xtables/*.so
333 %endif
334 %{_mandir}/man8/*
335
336 %files devel
337 %defattr(644,root,root,755)
338 %{?with_doc:%doc iptables-howtos/netfilter-hacking-HOWTO*}
339 %{_libdir}/lib*.a
340 %{_includedir}/*.h
341 %dir %{_includedir}/libiptc
342 %{_includedir}/libiptc/*.h
343 %{_mandir}/man3/*
344
345 %files init
346 %defattr(644,root,root,755)
347 %attr(754,root,root) /etc/rc.d/init.d/iptables
348 %attr(754,root,root) /etc/rc.d/init.d/ip6tables
This page took 0.058286 seconds and 4 git commands to generate.