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
12 %if "%{_alt_kernel}" != "%{nil}"
13 %undefine with_userspace
16 Summary: IP sets utility
17 Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
23 Group: Networking/Admin
24 Source0: http://ipset.netfilter.org/%{name}-%{version}.tar.bz2
25 # Source0-md5: 3c97324d04562a8bc25b0177100673ee
27 URL: http://ipset.netfilter.org/
28 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
29 %{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.22.1-2}
30 BuildRequires: perl-base
31 BuildRequires: rpmbuild(macros) >= 1.379
32 Requires(post,postun): /sbin/depmod
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
37 can be administered by the ipset utility. Depending on the type,
38 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
39 IP addresses with MAC addresses in a way, which ensures lightning
40 speed when matching an entry against a set.
42 %description -l pl.UTF-8
43 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
44 administrować przy użyciu narzędzia ipset. W zależności od rodzaju
45 aktualnie zbiór IP może przechowywać adresy IP, numery portów
46 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
47 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
50 Summary: Header files for ipset interface
51 Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
52 Group: Development/Libraries
55 Header files for IPset interface.
57 %description devel -l pl.UTF-8
58 Pliki nagłówkowe do interfejsu IPset.
61 Summary: IPset init (RedHat style)
62 Group: Networking/Admin
63 Requires(post,preun): /sbin/chkconfig
68 IPset initialization script.
70 %package -n kernel%{_alt_kernel}-net-ipset
71 Summary: IPset kernel modules
72 Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
73 Release: %{rel}@%{_kernel_ver_str}
76 %{?with_dist_kernel:%requires_releq_kernel}
77 Requires(post,postun): /sbin/depmod
79 %description -n kernel%{_alt_kernel}-net-ipset
80 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
81 can be administered by the ipset utility. Depending on the type,
82 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
83 IP addresses with MAC addresses in a way, which ensures lightning
84 speed when matching an entry against a set.
86 This package contains kernel modules.
88 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
89 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
90 administrować przy użyciu narzędzia ipset. W zależności od rodzaju
91 aktualnie zbiór IP może przechowywać adresy IP, numery portów
92 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
93 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
95 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
99 mv kernel/{Kbuild,Makefile}
101 # maximum number of ipsets.
102 %{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile
103 # hash size for bindings of IP sets.
104 %{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile
105 # these options can be overriden by module parameters.
108 %if %{with userspace}
111 PREFIX="%{_prefix}" \
112 LIBDIR="%{_libdir}" \
113 MANDIR="%{_mandir}" \
114 BINDIR="%{_sbindir}" \
115 COPT_FLAGS:="%{rpmcflags}"
119 # ugly hack for satisfy rpm build macro. in fact all modules will be build.
120 %build_kernel_modules -C kernel -m ip_set
124 rm -rf $RPM_BUILD_ROOT
126 %if %{with userspace}
127 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}}
129 %{__make} binaries_install \
130 DESTDIR="$RPM_BUILD_ROOT" \
131 PREFIX="%{_prefix}" \
132 LIBDIR="%{_libdir}" \
133 MANDIR="%{_mandir}" \
136 install *.h $RPM_BUILD_ROOT%{_includedir}
137 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
142 %install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter
143 install ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
144 install ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
149 rm -rf $RPM_BUILD_ROOT
152 /sbin/chkconfig --add %{name}
155 if [ "$1" = "0" ]; then
156 /sbin/chkconfig --del %{name}
159 %post -n kernel%{_alt_kernel}-net-ipset
160 %depmod %{_kernel_ver}
162 %postun -n kernel%{_alt_kernel}-net-ipset
163 %depmod %{_kernel_ver}
165 %if %{with userspace}
167 %defattr(644,root,root,755)
168 %doc ChangeLog ChangeLog.ippool TODO
169 %attr(755,root,root) %{_sbindir}/*
170 %dir %{_libdir}/ipset
171 %attr(755,root,root) %{_libdir}/ipset/*.so
175 %defattr(644,root,root,755)
179 %defattr(644,root,root,755)
180 %attr(754,root,root) /etc/rc.d/init.d/*
184 %files -n kernel%{_alt_kernel}-net-ipset
185 %defattr(644,root,root,755)
186 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/*.ko*