]>
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 | 6 | # Conditional build: |
3bc59268 PS |
7 | %bcond_without kernel # don't build kernel modules |
8 | %bcond_without userspace # don't build userspace tools | |
9 | %bcond_with verbose # verbose build (V=1) | |
10 | ||
22898ccc JR |
11 | # The goal here is to have main, userspace, package built once with |
12 | # simple release number, and only rebuild kernel packages with kernel | |
13 | # version as part of release number, without the need to bump release | |
14 | # with every kernel change. | |
15 | %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace} | |
16 | %{error:kernel and userspace cannot be built at the same time on PLD builders} | |
17 | exit 1 | |
18 | %endif | |
19 | ||
d33761e1 ER |
20 | %if %{without userspace} |
21 | # nothing to be placed to debuginfo package | |
22 | %define _enable_debug_packages 0 | |
23 | %endif | |
3bc59268 | 24 | |
819319f4 | 25 | %define rel 1 |
5b36c760 | 26 | %define pname ipset |
bc9c8d01 | 27 | Summary: IP sets utility |
cb832b79 | 28 | Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP |
c5b122e9 | 29 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
819319f4 | 30 | Version: 7.14 |
c5b122e9 | 31 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
6312651c | 32 | License: GPL v2 |
bc9c8d01 | 33 | Group: Networking/Admin |
6312651c | 34 | #Source0Download: http://ipset.netfilter.org/install.html |
5b36c760 | 35 | Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2 |
819319f4 | 36 | # Source0-md5: a624b3de000a14b9fd2518a9a806ef1c |
5b36c760 | 37 | Source1: %{pname}.init |
bc9c8d01 | 38 | URL: http://ipset.netfilter.org/ |
5f144668 | 39 | BuildRequires: autoconf >= 2.63 |
7e0de454 | 40 | BuildRequires: automake |
64473438 | 41 | BuildRequires: libltdl-devel >= 2:2.0 |
67259089 | 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 |
31575a1c | 46 | BuildRequires: rpmbuild(macros) >= 1.701 |
d2abbe0b | 47 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.24}} |
2a7f4757 | 48 | Suggests: kernel-net-ipset |
bc9c8d01 JK |
49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
50 | ||
13648ed2 JK |
51 | # unresolved ipset_errcode, defined in the ipset binary |
52 | %define skip_post_check_so libipset\.so.* | |
53 | ||
bc9c8d01 JK |
54 | %description |
55 | IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which | |
56 | can be administered by the ipset utility. Depending on the type, | |
57 | currently an IP set may store IP addresses, (TCP/UDP) port numbers or | |
58 | IP addresses with MAC addresses in a way, which ensures lightning | |
59 | speed when matching an entry against a set. | |
60 | ||
00760b7e JR |
61 | %description -l pl.UTF-8 |
62 | Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można | |
67259089 JR |
63 | administrować przy użyciu narzędzia ipset. W zależności od rodzaju |
64 | aktualnie zbiór IP może przechowywać adresy IP, numery portów | |
65 | (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający | |
66 | maksymalną szybkość przy dopasowywaniu elementu do 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 | ||
ab2b1724 JB |
107 | %package -n bash-completion-ipset |
108 | Summary: Bash completion for ipset command | |
109 | Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia ipset | |
110 | Group: Applications/Shells | |
111 | Requires: %{pname} = %{version}-%{release} | |
112 | Requires: bash-completion >= 2.0 | |
113 | ||
114 | %description -n bash-completion-ipset | |
115 | Bash completion for ipset command. | |
116 | ||
117 | %description -n bash-completion-ipset -l pl.UTF-8 | |
118 | Bashowe dopełnianie parametrów polecenia ipset. | |
119 | ||
22898ccc JR |
120 | %define kernel_pkg()\ |
121 | %package -n kernel%{_alt_kernel}-net-ipset\ | |
122 | Summary: IPset kernel modules\ | |
123 | Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP\ | |
124 | Release: %{rel}@%{_kernel_ver_str}\ | |
125 | Group: Base/Kernel\ | |
22898ccc | 126 | Requires(post,postun): /sbin/depmod\ |
31575a1c JR |
127 | %requires_releq_kernel\ |
128 | Requires(postun): %releq_kernel\ | |
22898ccc JR |
129 | \ |
130 | %description -n kernel%{_alt_kernel}-net-ipset\ | |
131 | IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which\ | |
132 | can be administered by the ipset utility. Depending on the type,\ | |
133 | currently an IP set may store IP addresses, (TCP/UDP) port numbers or\ | |
134 | IP addresses with MAC addresses in a way, which ensures lightning\ | |
135 | speed when matching an entry against a set.\ | |
136 | \ | |
137 | This package contains kernel modules.\ | |
138 | \ | |
139 | %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8\ | |
140 | Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można\ | |
141 | administrować przy użyciu narzędzia ipset. W zależności od\ | |
142 | rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery\ | |
143 | portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób\ | |
144 | zapewniający maksymalną szybkość przy dopasowywaniu elementu do\ | |
145 | zbioru.\ | |
146 | \ | |
147 | Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.\ | |
148 | \ | |
149 | %if %{with kernel}\ | |
150 | %files -n kernel%{_alt_kernel}-net-ipset\ | |
151 | %defattr(644,root,root,755)\ | |
152 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*\ | |
153 | %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset\ | |
154 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*\ | |
155 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*\ | |
156 | %endif\ | |
157 | \ | |
158 | %post -n kernel%{_alt_kernel}-net-ipset\ | |
159 | %depmod %{_kernel_ver}\ | |
160 | \ | |
161 | %postun -n kernel%{_alt_kernel}-net-ipset\ | |
162 | %depmod %{_kernel_ver}\ | |
163 | %{nil} | |
164 | ||
165 | %define build_kernel_pkg()\ | |
166 | %configure \\\ | |
167 | --disable-silent-rules \\\ | |
168 | --with-kmod=yes \\\ | |
169 | --with-kbuild=%{_kernelsrcdir} \\\ | |
170 | --with-settype-modules-list=all\ | |
171 | \ | |
172 | # a hack not to list all modules: list only ip_set, all other are build anyway\ | |
173 | %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..\ | |
174 | \ | |
175 | for drv in kernel/net/netfilter/ipset/ip_set*.ko ; do\ | |
176 | %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter/ipset\ | |
177 | done\ | |
178 | for drv in kernel/net/netfilter/xt_*.ko ; do\ | |
179 | %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter\ | |
180 | done\ | |
181 | %{nil} | |
182 | ||
31575a1c | 183 | %{?with_kernel:%{expand:%create_kernel_packages}} |
12667538 | 184 | |
bc9c8d01 | 185 | %prep |
5b36c760 | 186 | %setup -q -n %{pname}-%{version} |
fffbab59 | 187 | |
bc9c8d01 | 188 | %build |
a62cbe33 JR |
189 | %{__aclocal} |
190 | %{__autoconf} | |
191 | %{__autoheader} | |
192 | %{__automake} | |
22898ccc | 193 | %if %{with userspace} |
ab2b1724 JB |
194 | install -d build-usr |
195 | cd build-usr | |
196 | ../%configure \ | |
197 | bashcompdir=%{bash_compdir} \ | |
198 | --enable-bashcompl \ | |
db888aec | 199 | --disable-silent-rules \ |
22898ccc | 200 | --with-kmod=no \ |
1e8acbaa | 201 | --with-settype-modules-list=all |
7e0de454 | 202 | |
13648ed2 | 203 | %{__make} |
ab2b1724 | 204 | cd .. |
3bc59268 PS |
205 | %endif |
206 | ||
31575a1c | 207 | %{?with_kernel:%{expand:%build_kernel_packages}} |
bc9c8d01 JK |
208 | |
209 | %install | |
210 | rm -rf $RPM_BUILD_ROOT | |
3bc59268 PS |
211 | |
212 | %if %{with userspace} | |
13648ed2 | 213 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset} |
bc9c8d01 | 214 | |
ab2b1724 | 215 | %{__make} -C build-usr install \ |
13648ed2 | 216 | DESTDIR=$RPM_BUILD_ROOT |
e791bf9d | 217 | |
fffbab59 | 218 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname} |
3bc59268 PS |
219 | %endif |
220 | ||
221 | %if %{with kernel} | |
22898ccc JR |
222 | install -d $RPM_BUILD_ROOT |
223 | cp -a installed/* $RPM_BUILD_ROOT | |
3bc59268 | 224 | %endif |
12667538 | 225 | |
bc9c8d01 JK |
226 | %clean |
227 | rm -rf $RPM_BUILD_ROOT | |
228 | ||
12667538 | 229 | %post init |
5b36c760 | 230 | /sbin/chkconfig --add %{pname} |
12667538 PS |
231 | |
232 | %preun init | |
233 | if [ "$1" = "0" ]; then | |
5b36c760 | 234 | /sbin/chkconfig --del %{pname} |
12667538 PS |
235 | fi |
236 | ||
3bc59268 | 237 | %if %{with userspace} |
bc9c8d01 JK |
238 | %files |
239 | %defattr(644,root,root,755) | |
13648ed2 | 240 | %doc ChangeLog ChangeLog.ippool README UPGRADE |
de6c94a7 | 241 | %attr(755,root,root) %{_sbindir}/ipset |
67259089 | 242 | %attr(755,root,root) %{_sbindir}/ipset-translate |
6312651c | 243 | %attr(755,root,root) %{_libdir}/libipset.so.*.*.* |
21871c33 | 244 | %attr(755,root,root) %ghost %{_libdir}/libipset.so.13 |
de6c94a7 | 245 | %{_mandir}/man8/ipset.8* |
67259089 JR |
246 | %{_mandir}/man8/ipset-translate.8* |
247 | ||
40d655f1 | 248 | |
249 | %files devel | |
250 | %defattr(644,root,root,755) | |
13648ed2 | 251 | %attr(755,root,root) %{_libdir}/libipset.so |
6312651c JB |
252 | %{_libdir}/libipset.la |
253 | %{_includedir}/libipset | |
1e8acbaa | 254 | %{_pkgconfigdir}/libipset.pc |
67259089 | 255 | %{_mandir}/man3/libipset.3* |
13648ed2 JK |
256 | |
257 | %files static | |
258 | %defattr(644,root,root,755) | |
259 | %{_libdir}/libipset.a | |
12667538 PS |
260 | |
261 | %files init | |
262 | %defattr(644,root,root,755) | |
a264566a | 263 | %attr(754,root,root) /etc/rc.d/init.d/ipset |
ab2b1724 JB |
264 | |
265 | %files -n bash-completion-ipset | |
266 | %defattr(644,root,root,755) | |
267 | %{bash_compdir}/ipset | |
3bc59268 | 268 | %endif |