3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without userspace # don't build userspace tools
6 %bcond_with verbose # verbose build (V=1)
9 %undefine with_dist_kernel
11 %if "%{_alt_kernel}" != "%{nil}"
12 %undefine with_userspace
14 %if %{without userspace}
15 # nothing to be placed to debuginfo package
16 %define _enable_debug_packages 0
20 Summary: IP sets utility
21 Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
26 Group: Networking/Admin
27 Source0: http://ipset.netfilter.org/%{name}-%{version}.tar.bz2
28 # Source0-md5: 3c97324d04562a8bc25b0177100673ee
30 URL: http://ipset.netfilter.org/
31 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
32 %{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.22.1-2}
33 BuildRequires: perl-base
34 BuildRequires: rpmbuild(macros) >= 1.379
35 Requires(post,postun): /sbin/depmod
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
40 can be administered by the ipset utility. Depending on the type,
41 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
42 IP addresses with MAC addresses in a way, which ensures lightning
43 speed when matching an entry against a set.
45 %description -l pl.UTF-8
46 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
47 administrować przy użyciu narzędzia ipset. W zależności od rodzaju
48 aktualnie zbiór IP może przechowywać adresy IP, numery portów
49 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
50 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
53 Summary: Header files for ipset interface
54 Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
55 Group: Development/Libraries
58 Header files for IPset interface.
60 %description devel -l pl.UTF-8
61 Pliki nagłówkowe do interfejsu IPset.
64 Summary: IPset init (RedHat style)
65 Group: Networking/Admin
66 Requires(post,preun): /sbin/chkconfig
71 IPset initialization script.
73 %package -n kernel%{_alt_kernel}-net-ipset
74 Summary: IPset kernel modules
75 Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
76 Release: %{rel}@%{_kernel_ver_str}
79 %{?with_dist_kernel:%requires_releq_kernel}
80 Requires(post,postun): /sbin/depmod
82 %description -n kernel%{_alt_kernel}-net-ipset
83 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
84 can be administered by the ipset utility. Depending on the type,
85 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
86 IP addresses with MAC addresses in a way, which ensures lightning
87 speed when matching an entry against a set.
89 This package contains kernel modules.
91 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
92 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
93 administrować przy użyciu narzędzia ipset. W zależności od rodzaju
94 aktualnie zbiór IP może przechowywać adresy IP, numery portów
95 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
96 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
98 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
102 mv kernel/{Kbuild,Makefile}
104 # maximum number of ipsets.
105 %{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile
106 # hash size for bindings of IP sets.
107 %{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile
108 # these options can be overriden by module parameters.
111 %if %{with userspace}
114 PREFIX="%{_prefix}" \
115 LIBDIR="%{_libdir}" \
116 MANDIR="%{_mandir}" \
117 BINDIR="%{_sbindir}" \
118 COPT_FLAGS:="%{rpmcflags}"
122 # ugly hack for satisfy rpm build macro. in fact all modules will be build.
123 %build_kernel_modules -C kernel -m ip_set
127 rm -rf $RPM_BUILD_ROOT
129 %if %{with userspace}
130 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}}
132 %{__make} binaries_install \
133 DESTDIR="$RPM_BUILD_ROOT" \
134 PREFIX="%{_prefix}" \
135 LIBDIR="%{_libdir}" \
136 MANDIR="%{_mandir}" \
139 install *.h $RPM_BUILD_ROOT%{_includedir}
140 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
145 %install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter
146 install ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
147 install ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
152 rm -rf $RPM_BUILD_ROOT
155 /sbin/chkconfig --add %{name}
158 if [ "$1" = "0" ]; then
159 /sbin/chkconfig --del %{name}
162 %post -n kernel%{_alt_kernel}-net-ipset
163 %depmod %{_kernel_ver}
165 %postun -n kernel%{_alt_kernel}-net-ipset
166 %depmod %{_kernel_ver}
168 %if %{with userspace}
170 %defattr(644,root,root,755)
171 %doc ChangeLog ChangeLog.ippool TODO
172 %attr(755,root,root) %{_sbindir}/*
173 %dir %{_libdir}/ipset
174 %attr(755,root,root) %{_libdir}/ipset/*.so
178 %defattr(644,root,root,755)
182 %defattr(644,root,root,755)
183 %attr(754,root,root) /etc/rc.d/init.d/*
187 %files -n kernel%{_alt_kernel}-net-ipset
188 %defattr(644,root,root,755)
189 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/*.ko*