]>
Commit | Line | Data |
---|---|---|
bc9c8d01 | 1 | # |
13648ed2 JK |
2 | # TODO: |
3 | # - patch our kernel to provide the needed API and update | |
4 | # the dependencies here | |
5 | # | |
3bc59268 PS |
6 | # Conditional build: |
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) | |
11 | ||
d33761e1 | 12 | %if %{without kernel} |
3bc59268 PS |
13 | %undefine with_dist_kernel |
14 | %endif | |
3bc59268 PS |
15 | %if "%{_alt_kernel}" != "%{nil}" |
16 | %undefine with_userspace | |
17 | %endif | |
d33761e1 ER |
18 | %if %{without userspace} |
19 | # nothing to be placed to debuginfo package | |
20 | %define _enable_debug_packages 0 | |
21 | %endif | |
3bc59268 | 22 | |
be0ce2dd | 23 | %define rel 12 |
5b36c760 | 24 | %define pname ipset |
bc9c8d01 | 25 | Summary: IP sets utility |
cb832b79 | 26 | Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP |
4d9c906c | 27 | Name: %{pname}%{_alt_kernel} |
db888aec | 28 | Version: 6.12.1 |
3bc59268 | 29 | Release: %{rel} |
6312651c | 30 | License: GPL v2 |
bc9c8d01 | 31 | Group: Networking/Admin |
6312651c | 32 | #Source0Download: http://ipset.netfilter.org/install.html |
5b36c760 | 33 | Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2 |
db888aec | 34 | # Source0-md5: 80df500a4d93cb14e1373ae290716cda |
5b36c760 | 35 | Source1: %{pname}.init |
71ed84f0 JR |
36 | Patch0: %{pname}-no_kernel.patch |
37 | Patch1: %{pname}-hash-net-if-fix.patch | |
bc9c8d01 | 38 | URL: http://ipset.netfilter.org/ |
6312651c | 39 | BuildRequires: autoconf >= 2.50 |
7e0de454 | 40 | BuildRequires: automake |
6312651c | 41 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.38.6} |
8aa8458e | 42 | BuildRequires: libmnl-devel >= 1 |
db888aec | 43 | BuildRequires: libtool >= 2:2.0 |
6312651c | 44 | %{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.38.6} |
2bf78421 | 45 | BuildRequires: pkgconfig |
13648ed2 | 46 | BuildRequires: rpmbuild(macros) >= 1.583 |
2a7f4757 | 47 | Suggests: kernel-net-ipset |
bc9c8d01 JK |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
13648ed2 JK |
50 | # unresolved ipset_errcode, defined in the ipset binary |
51 | %define skip_post_check_so libipset\.so.* | |
52 | ||
bc9c8d01 JK |
53 | %description |
54 | IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which | |
55 | can be administered by the ipset utility. Depending on the type, | |
56 | currently an IP set may store IP addresses, (TCP/UDP) port numbers or | |
57 | IP addresses with MAC addresses in a way, which ensures lightning | |
58 | speed when matching an entry against a set. | |
59 | ||
00760b7e JR |
60 | %description -l pl.UTF-8 |
61 | Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można | |
13648ed2 JK |
62 | administrować przy użyciu narzędzia ipset. W zależności od |
63 | rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery | |
64 | portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób | |
65 | zapewniający maksymalną szybkość przy dopasowywaniu elementu do | |
66 | zbioru. | |
9e9bc01b | 67 | |
40d655f1 | 68 | %package devel |
e791bf9d | 69 | Summary: Header files for ipset interface |
cb832b79 | 70 | Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset |
f62f2152 | 71 | Group: Development/Libraries |
6312651c | 72 | Requires: %{name} = %{version}-%{release} |
8aa8458e | 73 | Requires: libmnl-devel >= 1 |
40d655f1 | 74 | |
75 | %description devel | |
3bc59268 | 76 | Header files for IPset interface. |
40d655f1 | 77 | |
00760b7e | 78 | %description devel -l pl.UTF-8 |
3bc59268 | 79 | Pliki nagłówkowe do interfejsu IPset. |
40d655f1 | 80 | |
13648ed2 JK |
81 | %package static |
82 | Summary: Static ipset interface library | |
83 | Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset | |
84 | Group: Development/Libraries | |
85 | Requires: %{name}-devel = %{version}-%{release} | |
86 | ||
87 | %description static | |
88 | Static IPset interface library. | |
89 | ||
90 | %description static -l pl.UTF-8 | |
91 | Biblioteka statyczna interfejsu IPset. | |
92 | ||
12667538 | 93 | %package init |
a264566a JB |
94 | Summary: IPset init script |
95 | Summary(pl.UTF-8): Skrypt startowy IPset | |
12667538 | 96 | Group: Networking/Admin |
12667538 | 97 | Requires(post,preun): /sbin/chkconfig |
a264566a | 98 | Requires: %{pname} = %{version}-%{release} |
af1d549a | 99 | Requires: rc-scripts |
12667538 PS |
100 | |
101 | %description init | |
3bc59268 PS |
102 | IPset initialization script. |
103 | ||
a264566a JB |
104 | %description init -l pl.UTF-8 |
105 | Skrypt startowy IPset. | |
106 | ||
3bc59268 PS |
107 | %package -n kernel%{_alt_kernel}-net-ipset |
108 | Summary: IPset kernel modules | |
109 | Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP | |
110 | Release: %{rel}@%{_kernel_ver_str} | |
3bc59268 PS |
111 | Group: Base/Kernel |
112 | %{?with_dist_kernel:%requires_releq_kernel} | |
113 | Requires(post,postun): /sbin/depmod | |
114 | ||
115 | %description -n kernel%{_alt_kernel}-net-ipset | |
116 | IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which | |
117 | can be administered by the ipset utility. Depending on the type, | |
118 | currently an IP set may store IP addresses, (TCP/UDP) port numbers or | |
119 | IP addresses with MAC addresses in a way, which ensures lightning | |
120 | speed when matching an entry against a set. | |
121 | ||
122 | This package contains kernel modules. | |
123 | ||
124 | %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8 | |
125 | Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można | |
13648ed2 JK |
126 | administrować przy użyciu narzędzia ipset. W zależności od |
127 | rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery | |
128 | portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób | |
129 | zapewniający maksymalną szybkość przy dopasowywaniu elementu do | |
130 | zbioru. | |
3bc59268 PS |
131 | |
132 | Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP. | |
12667538 | 133 | |
bc9c8d01 | 134 | %prep |
5b36c760 | 135 | %setup -q -n %{pname}-%{version} |
71ed84f0 | 136 | %{!?with_kernel:%patch0 -p1} |
13648ed2 | 137 | %patch1 -p1 |
fffbab59 | 138 | |
bc9c8d01 | 139 | %build |
7e0de454 | 140 | %{__libtoolize} |
13648ed2 | 141 | %{__aclocal} -I m4 |
7e0de454 JK |
142 | %{__autoconf} |
143 | %{__autoheader} | |
144 | %{__automake} | |
145 | %configure \ | |
db888aec | 146 | --disable-silent-rules \ |
7e0de454 JK |
147 | --with-kbuild=%{_kernelsrcdir} |
148 | ||
3bc59268 | 149 | %if %{with userspace} |
13648ed2 | 150 | %{__make} |
3bc59268 PS |
151 | %endif |
152 | ||
153 | %if %{with kernel} | |
13648ed2 JK |
154 | # a hack not to list all modules: list only ip_set, all other are build anyway |
155 | %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../.. | |
3bc59268 | 156 | %endif |
bc9c8d01 JK |
157 | |
158 | %install | |
159 | rm -rf $RPM_BUILD_ROOT | |
3bc59268 PS |
160 | |
161 | %if %{with userspace} | |
13648ed2 | 162 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset} |
bc9c8d01 | 163 | |
13648ed2 JK |
164 | %{__make} install \ |
165 | DESTDIR=$RPM_BUILD_ROOT | |
166 | cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset | |
e791bf9d | 167 | |
fffbab59 | 168 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname} |
3bc59268 PS |
169 | %endif |
170 | ||
171 | %if %{with kernel} | |
13648ed2 JK |
172 | cd kernel/net/netfilter |
173 | %install_kernel_modules -m ipset/ip_set -d kernel/net/ipv4/netfilter/ipset | |
174 | install -p ipset/ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset | |
175 | install -p xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter | |
3bc59268 PS |
176 | cd - |
177 | %endif | |
12667538 | 178 | |
bc9c8d01 JK |
179 | %clean |
180 | rm -rf $RPM_BUILD_ROOT | |
181 | ||
12667538 | 182 | %post init |
5b36c760 | 183 | /sbin/chkconfig --add %{pname} |
12667538 PS |
184 | |
185 | %preun init | |
186 | if [ "$1" = "0" ]; then | |
5b36c760 | 187 | /sbin/chkconfig --del %{pname} |
12667538 PS |
188 | fi |
189 | ||
3bc59268 PS |
190 | %post -n kernel%{_alt_kernel}-net-ipset |
191 | %depmod %{_kernel_ver} | |
192 | ||
193 | %postun -n kernel%{_alt_kernel}-net-ipset | |
194 | %depmod %{_kernel_ver} | |
195 | ||
196 | %if %{with userspace} | |
bc9c8d01 JK |
197 | %files |
198 | %defattr(644,root,root,755) | |
13648ed2 | 199 | %doc ChangeLog ChangeLog.ippool README UPGRADE |
de6c94a7 | 200 | %attr(755,root,root) %{_sbindir}/ipset |
6312651c | 201 | %attr(755,root,root) %{_libdir}/libipset.so.*.*.* |
b04ef6fb | 202 | %attr(755,root,root) %ghost %{_libdir}/libipset.so.2 |
de6c94a7 | 203 | %{_mandir}/man8/ipset.8* |
40d655f1 | 204 | |
205 | %files devel | |
206 | %defattr(644,root,root,755) | |
13648ed2 | 207 | %attr(755,root,root) %{_libdir}/libipset.so |
6312651c JB |
208 | %{_libdir}/libipset.la |
209 | %{_includedir}/libipset | |
13648ed2 JK |
210 | |
211 | %files static | |
212 | %defattr(644,root,root,755) | |
213 | %{_libdir}/libipset.a | |
12667538 PS |
214 | |
215 | %files init | |
216 | %defattr(644,root,root,755) | |
a264566a | 217 | %attr(754,root,root) /etc/rc.d/init.d/ipset |
3bc59268 PS |
218 | %endif |
219 | ||
220 | %if %{with kernel} | |
221 | %files -n kernel%{_alt_kernel}-net-ipset | |
222 | %defattr(644,root,root,755) | |
13648ed2 | 223 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko* |
f6c45fde | 224 | %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset |
13648ed2 JK |
225 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko* |
226 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko* | |
3bc59268 | 227 | %endif |