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
21 Summary: IP sets utility
22 Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
27 Group: Networking/Admin
28 Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
29 # Source0-md5: 8a7c68a61af525de03edba393743ebb4
30 Source1: %{pname}.init
31 URL: http://ipset.netfilter.org/
32 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
33 %{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.22.1-2}
34 BuildRequires: perl-base
35 BuildRequires: rpmbuild(macros) >= 1.379
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 script
65 Summary(pl.UTF-8): Skrypt startowy IPset
66 Group: Networking/Admin
67 Requires(post,preun): /sbin/chkconfig
68 Requires: %{pname} = %{version}-%{release}
72 IPset initialization script.
74 %description init -l pl.UTF-8
75 Skrypt startowy IPset.
77 %package -n kernel%{_alt_kernel}-net-ipset
78 Summary: IPset kernel modules
79 Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
80 Release: %{rel}@%{_kernel_ver_str}
82 %{?with_dist_kernel:%requires_releq_kernel}
83 Requires(post,postun): /sbin/depmod
85 %description -n kernel%{_alt_kernel}-net-ipset
86 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
87 can be administered by the ipset utility. Depending on the type,
88 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
89 IP addresses with MAC addresses in a way, which ensures lightning
90 speed when matching an entry against a set.
92 This package contains kernel modules.
94 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
95 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
96 administrować przy użyciu narzędzia ipset. W zależności od rodzaju
97 aktualnie zbiór IP może przechowywać adresy IP, numery portów
98 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
99 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
101 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
104 %setup -q -n %{pname}-%{version}
105 mv kernel/{Kbuild,Makefile}
107 # maximum number of ipsets.
108 %{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile
109 # hash size for bindings of IP sets.
110 %{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile
111 # these options can be overriden by module parameters.
114 %if %{with userspace}
117 PREFIX="%{_prefix}" \
118 LIBDIR="%{_libdir}" \
119 MANDIR="%{_mandir}" \
120 BINDIR="%{_sbindir}" \
121 COPT_FLAGS:="%{rpmcflags}"
125 # ugly hack for satisfy rpm build macro. in fact all modules will be build.
126 %build_kernel_modules -C kernel -m ip_set
130 rm -rf $RPM_BUILD_ROOT
132 %if %{with userspace}
133 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}}
135 %{__make} binaries_install \
136 DESTDIR="$RPM_BUILD_ROOT" \
137 PREFIX="%{_prefix}" \
138 LIBDIR="%{_libdir}" \
139 MANDIR="%{_mandir}" \
142 install *.h $RPM_BUILD_ROOT%{_includedir}
143 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
148 %install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter
149 install ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
150 install ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
155 rm -rf $RPM_BUILD_ROOT
158 /sbin/chkconfig --add %{pname}
161 if [ "$1" = "0" ]; then
162 /sbin/chkconfig --del %{pname}
165 %post -n kernel%{_alt_kernel}-net-ipset
166 %depmod %{_kernel_ver}
168 %postun -n kernel%{_alt_kernel}-net-ipset
169 %depmod %{_kernel_ver}
171 %if %{with userspace}
173 %defattr(644,root,root,755)
174 %doc ChangeLog ChangeLog.ippool TODO
175 %attr(755,root,root) %{_sbindir}/*
176 %dir %{_libdir}/ipset
177 %attr(755,root,root) %{_libdir}/ipset/*.so
181 %defattr(644,root,root,755)
185 %defattr(644,root,root,755)
186 %attr(754,root,root) /etc/rc.d/init.d/ipset
190 %files -n kernel%{_alt_kernel}-net-ipset
191 %defattr(644,root,root,755)
192 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/*.ko*