%bcond_without userspace # don't build userspace tools
%bcond_with verbose # verbose build (V=1)
-%if !%{with kernel}
+%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
+%define pname ipset
Summary: IP sets utility
Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
-Name: ipset
-Version: 2.4.3
-%define rel 1
+Name: %{pname}%{_alt_kernel}
+Version: 4.4
Release: %{rel}
License: GPL
Group: Networking/Admin
-Source0: http://ipset.netfilter.org/%{name}-%{version}.tar.bz2
-# Source0-md5: 3c97324d04562a8bc25b0177100673ee
-Source1: %{name}.init
+Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
+# Source0-md5: e21e9d9dfb8a01fc0122323ff1d6cbdb
+Source1: %{pname}.init
+Patch0: shadow-args.patch
URL: http://ipset.netfilter.org/
%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
%{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.22.1-2}
-BuildRequires: perl-base
BuildRequires: rpmbuild(macros) >= 1.379
-Requires(post,postun): /sbin/depmod
+Suggests: kernel-net-ipset
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Pliki nagłówkowe do interfejsu IPset.
%package init
-Summary: IPset init (RedHat style)
+Summary: IPset init script
+Summary(pl.UTF-8): Skrypt startowy IPset
Group: Networking/Admin
Requires(post,preun): /sbin/chkconfig
-Requires: %{name}
+Requires: %{pname} = %{version}-%{release}
Requires: rc-scripts
%description init
IPset initialization script.
+%description init -l pl.UTF-8
+Skrypt startowy IPset.
+
%package -n kernel%{_alt_kernel}-net-ipset
Summary: IPset kernel modules
Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
Release: %{rel}@%{_kernel_ver_str}
-License: GPL
Group: Base/Kernel
%{?with_dist_kernel:%requires_releq_kernel}
Requires(post,postun): /sbin/depmod
Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
%prep
-%setup -q
+%setup -q -n %{pname}-%{version}
+%patch0 -p1
mv kernel/{Kbuild,Makefile}
+# these options can be overriden by module parameters.
# maximum number of ipsets.
%{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile
# hash size for bindings of IP sets.
%{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile
-# these options can be overriden by module parameters.
+
+%if "%{cc_version}" < "3.4"
+%{__sed} -i -e 's/-Wextra//' Makefile
+%{__sed} -i -e 's/-Winit-self//' Makefile
+%{__sed} -i -e 's/-Wold-style-definition//' Makefile
+%{__sed} -i -e 's/-Wno-missing-field-initializers//' Makefile
+%endif
%build
%if %{with userspace}
%endif
%if %{with kernel}
-# ugly hack for satisfy rpm build macro. in fact all modules will be build.
+# ugly hack for satisfy rpm build macro. in fact all modules will be built.
%build_kernel_modules -C kernel -m ip_set
%endif
MANDIR="%{_mandir}" \
BINDIR="%{_sbindir}"
-install *.h $RPM_BUILD_ROOT%{_includedir}
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -a *.h $RPM_BUILD_ROOT%{_includedir}
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
%endif
%if %{with kernel}
cd kernel
%install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter
-install ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
-install ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
+install -p ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
+install -p ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
cd -
%endif
rm -rf $RPM_BUILD_ROOT
%post init
-/sbin/chkconfig --add %{name}
+/sbin/chkconfig --add %{pname}
%preun init
if [ "$1" = "0" ]; then
- /sbin/chkconfig --del %{name}
+ /sbin/chkconfig --del %{pname}
fi
%post -n kernel%{_alt_kernel}-net-ipset
%files
%defattr(644,root,root,755)
%doc ChangeLog ChangeLog.ippool TODO
-%attr(755,root,root) %{_sbindir}/*
+%attr(755,root,root) %{_sbindir}/ipset
%dir %{_libdir}/ipset
-%attr(755,root,root) %{_libdir}/ipset/*.so
-%{_mandir}/man8/*
+%attr(755,root,root) %{_libdir}/ipset/libipset_*.so
+%{_mandir}/man8/ipset.8*
%files devel
%defattr(644,root,root,755)
-%{_includedir}/*.h
+%{_includedir}/ipset.h
+%{_includedir}/libipt_set.h
%files init
%defattr(644,root,root,755)
-%attr(754,root,root) /etc/rc.d/init.d/*
+%attr(754,root,root) /etc/rc.d/init.d/ipset
%endif
%if %{with kernel}
%files -n kernel%{_alt_kernel}-net-ipset
%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/*.ko*
+/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ip_set*.ko*
+/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipt_set*.ko*
+/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipt_SET*.ko*
%endif