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: bfcc92e30a0fcf10ae6e7c4affa03c84
35 Source1: %{pname}.init
36 Patch0: %{pname}-no_kernel.patch
37 Patch1: %{pname}-hash-net-if-fix.patch
38 Patch2: %{pname}-kernel-3.3.patch
39 Patch3: %{pname}-kernel-3.0.patch
40 URL: http://ipset.netfilter.org/
41 BuildRequires: autoconf >= 2.50
42 BuildRequires: automake
43 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.38.6}
44 BuildRequires: libmnl-devel >= 1
45 BuildRequires: libtool
46 %{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.38.6}
47 BuildRequires: pkgconfig
48 BuildRequires: rpmbuild(macros) >= 1.583
49 Suggests: kernel-net-ipset
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 # unresolved ipset_errcode, defined in the ipset binary
53 %define skip_post_check_so libipset\.so.*
56 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
57 can be administered by the ipset utility. Depending on the type,
58 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
59 IP addresses with MAC addresses in a way, which ensures lightning
60 speed when matching an entry against a set.
62 %description -l pl.UTF-8
63 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
64 administrować przy użyciu narzędzia ipset. W zależności od
65 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
66 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
67 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
71 Summary: Header files for ipset interface
72 Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
73 Group: Development/Libraries
74 Requires: %{name} = %{version}-%{release}
75 Requires: libmnl-devel >= 1
78 Header files for IPset interface.
80 %description devel -l pl.UTF-8
81 Pliki nagłówkowe do interfejsu IPset.
84 Summary: Static ipset interface library
85 Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset
86 Group: Development/Libraries
87 Requires: %{name}-devel = %{version}-%{release}
90 Static IPset interface library.
92 %description static -l pl.UTF-8
93 Biblioteka statyczna interfejsu IPset.
96 Summary: IPset init script
97 Summary(pl.UTF-8): Skrypt startowy IPset
98 Group: Networking/Admin
99 Requires(post,preun): /sbin/chkconfig
100 Requires: %{pname} = %{version}-%{release}
104 IPset initialization script.
106 %description init -l pl.UTF-8
107 Skrypt startowy IPset.
109 %package -n kernel%{_alt_kernel}-net-ipset
110 Summary: IPset kernel modules
111 Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
112 Release: %{rel}@%{_kernel_ver_str}
114 %{?with_dist_kernel:%requires_releq_kernel}
115 Requires(post,postun): /sbin/depmod
117 %description -n kernel%{_alt_kernel}-net-ipset
118 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
119 can be administered by the ipset utility. Depending on the type,
120 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
121 IP addresses with MAC addresses in a way, which ensures lightning
122 speed when matching an entry against a set.
124 This package contains kernel modules.
126 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
127 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
128 administrować przy użyciu narzędzia ipset. W zależności od
129 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
130 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
131 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
134 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
137 %setup -q -n %{pname}-%{version}
138 %{!?with_kernel:%patch0 -p1}
150 --with-kbuild=%{_kernelsrcdir}
152 %if %{with userspace}
157 # a hack not to list all modules: list only ip_set, all other are build anyway
158 %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..
162 rm -rf $RPM_BUILD_ROOT
164 %if %{with userspace}
165 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
168 DESTDIR=$RPM_BUILD_ROOT
169 cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset
171 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
175 cd kernel/net/netfilter
176 %install_kernel_modules -m ipset/ip_set -d kernel/net/ipv4/netfilter/ipset
177 install -p ipset/ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
178 install -p xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
183 rm -rf $RPM_BUILD_ROOT
186 /sbin/chkconfig --add %{pname}
189 if [ "$1" = "0" ]; then
190 /sbin/chkconfig --del %{pname}
193 %post -n kernel%{_alt_kernel}-net-ipset
194 %depmod %{_kernel_ver}
196 %postun -n kernel%{_alt_kernel}-net-ipset
197 %depmod %{_kernel_ver}
199 %if %{with userspace}
201 %defattr(644,root,root,755)
202 %doc ChangeLog ChangeLog.ippool README UPGRADE
203 %attr(755,root,root) %{_sbindir}/ipset
204 %attr(755,root,root) %{_libdir}/libipset.so.*.*.*
205 %attr(755,root,root) %ghost %{_libdir}/libipset.so.2
206 %{_mandir}/man8/ipset.8*
209 %defattr(644,root,root,755)
210 %attr(755,root,root) %{_libdir}/libipset.so
211 %{_libdir}/libipset.la
212 %{_includedir}/libipset
215 %defattr(644,root,root,755)
216 %{_libdir}/libipset.a
219 %defattr(644,root,root,755)
220 %attr(754,root,root) /etc/rc.d/init.d/ipset
224 %files -n kernel%{_alt_kernel}-net-ipset
225 %defattr(644,root,root,755)
226 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*
227 %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
228 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*
229 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*