#
# TODO
-# - kernel modules package (or not, 2 packages with mutual R?)
# - descriptions
#
# Conditional build:
%bcond_without dist_kernel # without distribution kernel
-%bcond_without kernel
-%bcond_without userspace
-#
-%define rel 3
+%bcond_without kernel # don't build kernel modules
+%bcond_without userspace # # don't build userspace tools
+%bcond_with verbose # verbose build (V=1)
+
+%if %{without kernel}
+%undefine with_dist_kernel
+%endif
+%if "%{_alt_kernel}" != "%{nil}"
+%undefine with_userspace
+%endif
+%if %{without userspace}
+# nothing to be placed to debuginfo package
+%define _enable_debug_packages 0
+%endif
+
+%define rel 5
Summary: Extensible packet filtering system && extensible NAT system
Summary(pl.UTF-8): System filtrowania pakietów oraz system translacji adresów (NAT)
Summary(pt_BR.UTF-8): Ferramenta para controlar a filtragem de pacotes no kernel-2.6.x
Summary(uk.UTF-8): Утиліти для керування пакетними фільтрами ядра Linux
Summary(zh_CN.UTF-8): Linux内核包过滤管理工具
Name: xtables-addons
-Version: 1.6
-Release: %{rel}@%{_kernel_ver_str}
+Version: 1.18
+Release: %{rel}
License: GPL
-Group: Networking/Daemons
-Source0: http://dev.medozas.de/files/xtables/%{name}-%{version}.tar.bz2
-# Source0-md5: 44ba8faec006efa53cc2cbb5d15ba928
-URL: http://jengelh.medozas.de/projects/xtables/
+Group: Networking/Admin
+Source0: http://dl.sourceforge.net/xtables-addons/%{name}-%{version}.tar.bz2
+# Source0-md5: 5a8d2edbf5a3470bba58d6a60c350805
+URL: http://xtables-addons.sourceforge.net/
Patch0: %{name}-libs.patch
Patch1: %{name}-geoip-dbpath.patch
-Patch2: %{name}-help.patch
+Patch2: kernelrelease.patch
BuildRequires: autoconf
BuildRequires: automake
-BuildRequires: iptables-devel >= 1.4.1
+BuildRequires: iptables-devel >= 1.4.3
%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.25}
BuildRequires: libtool
+BuildRequires: pkgconfig
BuildRequires: rpmbuild(macros) >= 1.379
-%{?with_dist_kernel:%requires_releq_kernel}
-Requires(post,postun): /sbin/depmod
-Requires: iptables >= 1.4.1
+Requires: iptables >= 1.4.3
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Linux. Вони дозволяють вам встановлювати міжмережеві екрани
(firewalls) та IP маскарадинг, тощо.
+%package -n kernel%{_alt_kernel}-net-xtables-addons
+Summary: -
+Summary(pl.UTF-8): -
+Release: %{release}@%{_kernel_ver_str}
+Group: Base/Kernel
+Requires: %{name} = %{version}-%{rel}
+%{?with_dist_kernel:%requires_releq_kernel}
+Requires(post,postun): /sbin/depmod
+
+%description -n kernel%{_alt_kernel}-net-xtables-addons
+
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%{__sed} -i -e 's#build_ipset=m#build_ipset=n#' mconfig
+
%build
%{__libtoolize}
%{__aclocal}
%clean
rm -rf $RPM_BUILD_ROOT
-%post
+%post -n kernel%{_alt_kernel}-net-xtables-addons
%depmod %{_kernel_ver}
-%postun
+%postun -n kernel%{_alt_kernel}-net-xtables-addons
%depmod %{_kernel_ver}
+%if %{with userspace}
%files
%defattr(644,root,root,755)
-%if %{with userspace}
-%attr(755,root,root) %{_libdir}/xtables/libxt_CHAOS.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_DELUDE.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_DHCPADDR.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_IPMARK.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_LOGMARK.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_SYSRQ.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_TARPIT.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_TEE.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_condition.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_dhcpaddr.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_fuzzy.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_geoip.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_ipp2p.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_portscan.so
-%attr(755,root,root) %{_libdir}/xtables/libxt_quota2.so
-%{_mandir}/man8/libxt_CHAOS.*
-%{_mandir}/man8/libxt_DELUDE.*
-%{_mandir}/man8/libxt_DHCPADDR.*
-%{_mandir}/man8/libxt_IPMARK.*
-%{_mandir}/man8/libxt_LOGMARK.*
-%{_mandir}/man8/libxt_SYSRQ.*
-%{_mandir}/man8/libxt_TARPIT.*
-%{_mandir}/man8/libxt_condition.*
-%{_mandir}/man8/libxt_dhcpaddr.*
-%{_mandir}/man8/libxt_fuzzy.*
-%{_mandir}/man8/libxt_geoip.*
-%{_mandir}/man8/libxt_ipp2p.*
-%{_mandir}/man8/libxt_portscan.*
-%{_mandir}/man8/libxt_quota2.*
+%attr(755,root,root) %{_libdir}/xtables/libxt_*.so
+%{_mandir}/man8/libxt_*.*
%endif
+
%if %{with kernel}
+%files -n kernel%{_alt_kernel}-net-xtables-addons
+%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_CHAOS.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_DELUDE.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_DHCPADDR.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_IPMARK.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_LOGMARK.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_SYSRQ.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_TARPIT.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_TEE.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_condition.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_fuzzy.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_geoip.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_ipp2p.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_portscan.ko.gz
-/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_quota2.ko.gz
+/lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz
%endif