3 # - patch our kernel to provide the needed API and update
4 # the dependencies here
7 %bcond_without dist_kernel # allow non-distribution kernel
8 %bcond_without kernel # don't build kernel modules
9 %bcond_without userspace # don't build userspace tools
10 %bcond_with verbose # verbose build (V=1)
13 %undefine with_dist_kernel
15 %if "%{_alt_kernel}" != "%{nil}"
16 %undefine with_userspace
18 %if %{without userspace}
19 # nothing to be placed to debuginfo package
20 %define _enable_debug_packages 0
25 Summary: IP sets utility
26 Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
27 Name: %{pname}%{_alt_kernel}
31 Group: Networking/Admin
32 #Source0Download: http://ipset.netfilter.org/install.html
33 Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
34 # Source0-md5: 14eafc915f559b900ed2256b761af9d4
35 Source1: %{pname}.init
36 Patch0: %{pname}-config_dist.patch
37 Patch1: %{pname}-no_kernel.patch
38 URL: http://ipset.netfilter.org/
39 BuildRequires: autoconf >= 2.50
40 BuildRequires: automake
41 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.38.6}
42 BuildRequires: libmnl-devel
43 BuildRequires: libtool
44 %{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.38.6}
45 BuildRequires: rpmbuild(macros) >= 1.583
46 Suggests: kernel-net-ipset
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 # unresolved ipset_errcode, defined in the ipset binary
50 %define skip_post_check_so libipset\.so.*
53 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
54 can be administered by the ipset utility. Depending on the type,
55 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
56 IP addresses with MAC addresses in a way, which ensures lightning
57 speed when matching an entry against a set.
59 %description -l pl.UTF-8
60 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
61 administrować przy użyciu narzędzia ipset. W zależności od
62 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
63 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
64 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
68 Summary: Header files for ipset interface
69 Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
70 Group: Development/Libraries
71 Requires: %{name} = %{version}-%{release}
72 Requires: libmnl-devel
75 Header files for IPset interface.
77 %description devel -l pl.UTF-8
78 Pliki nagłówkowe do interfejsu IPset.
81 Summary: Static ipset interface library
82 Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset
83 Group: Development/Libraries
84 Requires: %{name}-devel = %{version}-%{release}
87 Static IPset interface library.
89 %description static -l pl.UTF-8
90 Biblioteka statyczna interfejsu IPset.
93 Summary: IPset init script
94 Summary(pl.UTF-8): Skrypt startowy IPset
95 Group: Networking/Admin
96 Requires(post,preun): /sbin/chkconfig
97 Requires: %{pname} = %{version}-%{release}
101 IPset initialization script.
103 %description init -l pl.UTF-8
104 Skrypt startowy IPset.
106 %package -n kernel%{_alt_kernel}-net-ipset
107 Summary: IPset kernel modules
108 Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
109 Release: %{rel}@%{_kernel_ver_str}
111 %{?with_dist_kernel:%requires_releq_kernel}
112 Requires(post,postun): /sbin/depmod
114 %description -n kernel%{_alt_kernel}-net-ipset
115 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
116 can be administered by the ipset utility. Depending on the type,
117 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
118 IP addresses with MAC addresses in a way, which ensures lightning
119 speed when matching an entry against a set.
121 This package contains kernel modules.
123 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
124 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
125 administrować przy użyciu narzędzia ipset. W zależności od
126 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
127 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
128 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
131 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
134 %setup -q -n %{pname}-%{version}
136 %{?with_dist_kernel:%patch0 -p1}
148 --with-kbuild=%{_kernelsrcdir}
150 %if %{with userspace}
155 # a hack not to list all modules: list only ip_set, all other are build anyway
156 %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..
160 rm -rf $RPM_BUILD_ROOT
162 %if %{with userspace}
163 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
166 DESTDIR=$RPM_BUILD_ROOT
167 cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset
169 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
173 cd kernel/net/netfilter
174 %install_kernel_modules -m ipset/ip_set -d kernel/net/ipv4/netfilter/ipset
175 install -p ipset/ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
176 install -p xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
181 rm -rf $RPM_BUILD_ROOT
184 /sbin/chkconfig --add %{pname}
187 if [ "$1" = "0" ]; then
188 /sbin/chkconfig --del %{pname}
191 %post -n kernel%{_alt_kernel}-net-ipset
192 %depmod %{_kernel_ver}
194 %postun -n kernel%{_alt_kernel}-net-ipset
195 %depmod %{_kernel_ver}
197 %if %{with userspace}
199 %defattr(644,root,root,755)
200 %doc ChangeLog ChangeLog.ippool README UPGRADE
201 %attr(755,root,root) %{_sbindir}/ipset
202 %attr(755,root,root) %{_libdir}/libipset.so.*.*.*
203 %attr(755,root,root) %ghost %{_libdir}/libipset.so.1
204 %{_mandir}/man8/ipset.8*
207 %defattr(644,root,root,755)
208 %attr(755,root,root) %{_libdir}/libipset.so
209 %{_libdir}/libipset.la
210 %{_includedir}/libipset
213 %defattr(644,root,root,755)
214 %{_libdir}/libipset.a
217 %defattr(644,root,root,755)
218 %attr(754,root,root) /etc/rc.d/init.d/ipset
222 %files -n kernel%{_alt_kernel}-net-ipset
223 %defattr(644,root,root,755)
224 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*
225 %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
226 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*
227 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*