6 %bcond_without dist_kernel # without distribution kernel
7 %bcond_without kernel # don't build kernel modules
8 %bcond_without userspace # # don't build userspace tools
9 %bcond_with verbose # verbose build (V=1)
12 %undefine with_dist_kernel
14 %if "%{_alt_kernel}" != "%{nil}"
15 %undefine with_userspace
17 %if %{without userspace}
18 # nothing to be placed to debuginfo package
19 %define _enable_debug_packages 0
23 Summary: Extensible packet filtering system && extensible NAT system
24 Summary(pl.UTF-8): System filtrowania pakietów oraz system translacji adresów (NAT)
25 Summary(pt_BR.UTF-8): Ferramenta para controlar a filtragem de pacotes no kernel-2.6.x
26 Summary(ru.UTF-8): Утилиты для управления пакетными фильтрами ядра Linux
27 Summary(uk.UTF-8): Утиліти для керування пакетними фільтрами ядра Linux
28 Summary(zh_CN.UTF-8): Linux内核包过滤管理工具
33 Group: Networking/Admin
34 Source0: http://dl.sourceforge.net/xtables-addons/%{name}-%{version}.tar.bz2
35 # Source0-md5: 5a8d2edbf5a3470bba58d6a60c350805
36 URL: http://xtables-addons.sourceforge.net/
37 Patch0: %{name}-libs.patch
38 Patch1: %{name}-geoip-dbpath.patch
39 Patch2: kernelrelease.patch
40 BuildRequires: autoconf
41 BuildRequires: automake
42 BuildRequires: iptables-devel >= 1.4.3
43 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.25}
44 BuildRequires: libtool
45 BuildRequires: pkgconfig
46 BuildRequires: rpmbuild(macros) >= 1.379
47 Requires: iptables >= 1.4.3
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 An extensible NAT system, and an extensible packet filtering system.
52 Replacement of ipchains in 2.6 and higher kernels.
54 %description -l pl.UTF-8
55 Wydajny system translacji adresów (NAT) oraz system filtrowania
56 pakietów. Zamiennik ipchains w jądrach 2.6 i nowszych.
58 %description -l pt_BR.UTF-8
59 Esta é a ferramenta que controla o código de filtragem de pacotes do
60 kernel 2.6, obsoletando ipchains. Com esta ferramenta você pode
61 configurar filtros de pacotes, NAT, mascaramento (masquerading),
62 regras dinâmicas (stateful inspection), etc.
64 %description -l ru.UTF-8
65 xtables-addons управляют кодом фильтрации сетевых пакетов в ядре
66 Linux. Они позволяют вам устанавливать межсетевые экраны (firewalls) и
67 IP маскарадинг, и т.п.
69 %description -l uk.UTF-8
70 xtables-addons управляють кодом фільтрації пакетів мережі в ядрі
71 Linux. Вони дозволяють вам встановлювати міжмережеві екрани
72 (firewalls) та IP маскарадинг, тощо.
74 %package -n kernel%{_alt_kernel}-net-xtables-addons
77 Release: %{release}@%{_kernel_ver_str}
79 Requires: %{name} = %{version}-%{rel}
80 %{?with_dist_kernel:%requires_releq_kernel}
81 Requires(post,postun): /sbin/depmod
83 %description -n kernel%{_alt_kernel}-net-xtables-addons
91 %{__sed} -i -e 's#build_ipset=m#build_ipset=n#' mconfig
99 --with-kbuild=%{_kernelsrcdir} \
100 --with-ksource=%{_kernelsrcdir}
102 export XA_TOPSRCDIR=$PWD
105 %build_kernel_modules -C extensions -m compat_xtables
108 %if %{with userspace}
109 %{__make} -C extensions
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter,%{_mandir}/man8}
118 %install_kernel_modules -m compat_xtables -d kernel/net/netfilter
119 install xt_*ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/netfilter
123 %if %{with userspace}
124 %{__make} -C extensions install \
125 DESTDIR=$RPM_BUILD_ROOT
128 for m in $(cat .manpages.lst); do
129 install libxt_$m.man $RPM_BUILD_ROOT%{_mandir}/man8/libxt_$m.8
135 rm -rf $RPM_BUILD_ROOT
137 %post -n kernel%{_alt_kernel}-net-xtables-addons
138 %depmod %{_kernel_ver}
140 %postun -n kernel%{_alt_kernel}-net-xtables-addons
141 %depmod %{_kernel_ver}
143 %if %{with userspace}
145 %defattr(644,root,root,755)
146 %attr(755,root,root) %{_libdir}/xtables/libxt_CHAOS.so
147 %attr(755,root,root) %{_libdir}/xtables/libxt_DELUDE.so
148 %attr(755,root,root) %{_libdir}/xtables/libxt_DHCPMAC.so
149 %attr(755,root,root) %{_libdir}/xtables/libxt_IPMARK.so
150 %attr(755,root,root) %{_libdir}/xtables/libxt_LOGMARK.so
151 %attr(755,root,root) %{_libdir}/xtables/libxt_RAWDNAT.so
152 %attr(755,root,root) %{_libdir}/xtables/libxt_RAWSNAT.so
153 %attr(755,root,root) %{_libdir}/xtables/libxt_STEAL.so
154 %attr(755,root,root) %{_libdir}/xtables/libxt_SYSRQ.so
155 %attr(755,root,root) %{_libdir}/xtables/libxt_TARPIT.so
156 %attr(755,root,root) %{_libdir}/xtables/libxt_TEE.so
157 %attr(755,root,root) %{_libdir}/xtables/libxt_condition.so
158 %attr(755,root,root) %{_libdir}/xtables/libxt_dhcpmac.so
159 %attr(755,root,root) %{_libdir}/xtables/libxt_fuzzy.so
160 %attr(755,root,root) %{_libdir}/xtables/libxt_geoip.so
161 %attr(755,root,root) %{_libdir}/xtables/libxt_iface.so
162 %attr(755,root,root) %{_libdir}/xtables/libxt_ipp2p.so
163 %attr(755,root,root) %{_libdir}/xtables/libxt_ipv4options.so
164 %attr(755,root,root) %{_libdir}/xtables/libxt_lscan.so
165 %attr(755,root,root) %{_libdir}/xtables/libxt_quota2.so
166 %attr(755,root,root) %{_libdir}/xtables/libxt_length2.so
167 %{_mandir}/man8/libxt_CHAOS.*
168 %{_mandir}/man8/libxt_DELUDE.*
169 %{_mandir}/man8/libxt_DHCPMAC.*
170 %{_mandir}/man8/libxt_ECHO.8
171 %{_mandir}/man8/libxt_IPMARK.*
172 %{_mandir}/man8/libxt_LOGMARK.*
173 %{_mandir}/man8/libxt_RAWDNAT.*
174 %{_mandir}/man8/libxt_RAWSNAT.*
175 %{_mandir}/man8/libxt_STEAL.*
176 %{_mandir}/man8/libxt_SYSRQ.*
177 %{_mandir}/man8/libxt_TARPIT.*
178 %{_mandir}/man8/libxt_TEE.8*
179 %{_mandir}/man8/libxt_condition.*
180 %{_mandir}/man8/libxt_dhcpmac.*
181 %{_mandir}/man8/libxt_fuzzy.*
182 %{_mandir}/man8/libxt_geoip.*
183 %{_mandir}/man8/libxt_iface.*
184 %{_mandir}/man8/libxt_ipp2p.*
185 %{_mandir}/man8/libxt_ipv4options.*
186 %{_mandir}/man8/libxt_lscan.*
187 %{_mandir}/man8/libxt_quota2.*
188 %{_mandir}/man8/libxt_length.8*
192 %files -n kernel%{_alt_kernel}-net-xtables-addons
193 %defattr(644,root,root,755)
194 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz
195 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_CHAOS.ko.gz
196 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_DELUDE.ko.gz
197 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_DHCPMAC.ko.gz
198 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_IPMARK.ko.gz
199 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_LOGMARK.ko.gz
200 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_RAWNAT.ko.gz
201 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_iface.ko.gz
202 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_STEAL.ko.gz
203 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_SYSRQ.ko.gz
204 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_TARPIT.ko.gz
205 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_TEE.ko.gz
206 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_condition.ko.gz
207 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_fuzzy.ko.gz
208 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_geoip.ko.gz
209 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_ipp2p.ko.gz
210 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_ipv4options.ko.gz
211 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_lscan.ko.gz
212 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_quota2.ko.gz
213 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_length2.ko.gz