]>
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 | |
74a6b67e | 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} |
7ae2f2bc | 30 | Version: 6.29 |
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 |
7ae2f2bc | 36 | # Source0-md5: fd8ea35997115c5c630eee22f0beecec |
5b36c760 | 37 | Source1: %{pname}.init |
bc9c8d01 | 38 | URL: http://ipset.netfilter.org/ |
6312651c | 39 | BuildRequires: autoconf >= 2.50 |
7e0de454 | 40 | BuildRequires: automake |
8aa8458e | 41 | BuildRequires: libmnl-devel >= 1 |
64473438 | 42 | BuildRequires: libltdl-devel >= 2:2.0 |
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 JR |
46 | BuildRequires: rpmbuild(macros) >= 1.701 |
47 | %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}} | |
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 | |
13648ed2 JK |
63 | administrować przy użyciu narzędzia ipset. W zależności od |
64 | rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery | |
65 | portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób | |
66 | zapewniający maksymalną szybkość przy dopasowywaniu elementu do | |
67 | zbioru. | |
9e9bc01b | 68 | |
40d655f1 | 69 | %package devel |
e791bf9d | 70 | Summary: Header files for ipset interface |
cb832b79 | 71 | Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset |
f62f2152 | 72 | Group: Development/Libraries |
6312651c | 73 | Requires: %{name} = %{version}-%{release} |
8aa8458e | 74 | Requires: libmnl-devel >= 1 |
40d655f1 | 75 | |
76 | %description devel | |
3bc59268 | 77 | Header files for IPset interface. |
40d655f1 | 78 | |
00760b7e | 79 | %description devel -l pl.UTF-8 |
3bc59268 | 80 | Pliki nagłówkowe do interfejsu IPset. |
40d655f1 | 81 | |
13648ed2 JK |
82 | %package static |
83 | Summary: Static ipset interface library | |
84 | Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset | |
85 | Group: Development/Libraries | |
86 | Requires: %{name}-devel = %{version}-%{release} | |
87 | ||
88 | %description static | |
89 | Static IPset interface library. | |
90 | ||
91 | %description static -l pl.UTF-8 | |
92 | Biblioteka statyczna interfejsu IPset. | |
93 | ||
12667538 | 94 | %package init |
a264566a JB |
95 | Summary: IPset init script |
96 | Summary(pl.UTF-8): Skrypt startowy IPset | |
12667538 | 97 | Group: Networking/Admin |
12667538 | 98 | Requires(post,preun): /sbin/chkconfig |
a264566a | 99 | Requires: %{pname} = %{version}-%{release} |
af1d549a | 100 | Requires: rc-scripts |
12667538 PS |
101 | |
102 | %description init | |
3bc59268 PS |
103 | IPset initialization script. |
104 | ||
a264566a JB |
105 | %description init -l pl.UTF-8 |
106 | Skrypt startowy IPset. | |
107 | ||
22898ccc JR |
108 | %define kernel_pkg()\ |
109 | %package -n kernel%{_alt_kernel}-net-ipset\ | |
110 | Summary: IPset kernel modules\ | |
111 | Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP\ | |
112 | Release: %{rel}@%{_kernel_ver_str}\ | |
113 | Group: Base/Kernel\ | |
22898ccc | 114 | Requires(post,postun): /sbin/depmod\ |
31575a1c JR |
115 | %requires_releq_kernel\ |
116 | Requires(postun): %releq_kernel\ | |
22898ccc JR |
117 | \ |
118 | %description -n kernel%{_alt_kernel}-net-ipset\ | |
119 | IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which\ | |
120 | can be administered by the ipset utility. Depending on the type,\ | |
121 | currently an IP set may store IP addresses, (TCP/UDP) port numbers or\ | |
122 | IP addresses with MAC addresses in a way, which ensures lightning\ | |
123 | speed when matching an entry against a set.\ | |
124 | \ | |
125 | This package contains kernel modules.\ | |
126 | \ | |
127 | %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8\ | |
128 | Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można\ | |
129 | administrować przy użyciu narzędzia ipset. W zależności od\ | |
130 | rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery\ | |
131 | portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób\ | |
132 | zapewniający maksymalną szybkość przy dopasowywaniu elementu do\ | |
133 | zbioru.\ | |
134 | \ | |
135 | Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.\ | |
136 | \ | |
137 | %if %{with kernel}\ | |
138 | %files -n kernel%{_alt_kernel}-net-ipset\ | |
139 | %defattr(644,root,root,755)\ | |
140 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*\ | |
141 | %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset\ | |
142 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*\ | |
143 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*\ | |
144 | %endif\ | |
145 | \ | |
146 | %post -n kernel%{_alt_kernel}-net-ipset\ | |
147 | %depmod %{_kernel_ver}\ | |
148 | \ | |
149 | %postun -n kernel%{_alt_kernel}-net-ipset\ | |
150 | %depmod %{_kernel_ver}\ | |
151 | %{nil} | |
152 | ||
153 | %define build_kernel_pkg()\ | |
154 | %configure \\\ | |
155 | --disable-silent-rules \\\ | |
156 | --with-kmod=yes \\\ | |
157 | --with-kbuild=%{_kernelsrcdir} \\\ | |
158 | --with-settype-modules-list=all\ | |
159 | \ | |
160 | # a hack not to list all modules: list only ip_set, all other are build anyway\ | |
161 | %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..\ | |
162 | \ | |
163 | for drv in kernel/net/netfilter/ipset/ip_set*.ko ; do\ | |
164 | %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter/ipset\ | |
165 | done\ | |
166 | for drv in kernel/net/netfilter/xt_*.ko ; do\ | |
167 | %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter\ | |
168 | done\ | |
169 | %{nil} | |
170 | ||
31575a1c | 171 | %{?with_kernel:%{expand:%create_kernel_packages}} |
12667538 | 172 | |
bc9c8d01 | 173 | %prep |
5b36c760 | 174 | %setup -q -n %{pname}-%{version} |
fffbab59 | 175 | |
bc9c8d01 | 176 | %build |
22898ccc | 177 | %if %{with userspace} |
7e0de454 | 178 | %configure \ |
db888aec | 179 | --disable-silent-rules \ |
22898ccc | 180 | --with-kmod=no \ |
1e8acbaa | 181 | --with-settype-modules-list=all |
7e0de454 | 182 | |
13648ed2 | 183 | %{__make} |
3bc59268 PS |
184 | %endif |
185 | ||
31575a1c | 186 | %{?with_kernel:%{expand:%build_kernel_packages}} |
bc9c8d01 JK |
187 | |
188 | %install | |
189 | rm -rf $RPM_BUILD_ROOT | |
3bc59268 PS |
190 | |
191 | %if %{with userspace} | |
13648ed2 | 192 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset} |
bc9c8d01 | 193 | |
13648ed2 JK |
194 | %{__make} install \ |
195 | DESTDIR=$RPM_BUILD_ROOT | |
196 | cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset | |
e791bf9d | 197 | |
fffbab59 | 198 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname} |
3bc59268 PS |
199 | %endif |
200 | ||
201 | %if %{with kernel} | |
22898ccc JR |
202 | install -d $RPM_BUILD_ROOT |
203 | cp -a installed/* $RPM_BUILD_ROOT | |
3bc59268 | 204 | %endif |
12667538 | 205 | |
bc9c8d01 JK |
206 | %clean |
207 | rm -rf $RPM_BUILD_ROOT | |
208 | ||
12667538 | 209 | %post init |
5b36c760 | 210 | /sbin/chkconfig --add %{pname} |
12667538 PS |
211 | |
212 | %preun init | |
213 | if [ "$1" = "0" ]; then | |
5b36c760 | 214 | /sbin/chkconfig --del %{pname} |
12667538 PS |
215 | fi |
216 | ||
3bc59268 | 217 | %if %{with userspace} |
bc9c8d01 JK |
218 | %files |
219 | %defattr(644,root,root,755) | |
13648ed2 | 220 | %doc ChangeLog ChangeLog.ippool README UPGRADE |
de6c94a7 | 221 | %attr(755,root,root) %{_sbindir}/ipset |
6312651c | 222 | %attr(755,root,root) %{_libdir}/libipset.so.*.*.* |
22898ccc | 223 | %attr(755,root,root) %ghost %{_libdir}/libipset.so.3 |
de6c94a7 | 224 | %{_mandir}/man8/ipset.8* |
40d655f1 | 225 | |
226 | %files devel | |
227 | %defattr(644,root,root,755) | |
13648ed2 | 228 | %attr(755,root,root) %{_libdir}/libipset.so |
6312651c JB |
229 | %{_libdir}/libipset.la |
230 | %{_includedir}/libipset | |
1e8acbaa | 231 | %{_pkgconfigdir}/libipset.pc |
13648ed2 JK |
232 | |
233 | %files static | |
234 | %defattr(644,root,root,755) | |
235 | %{_libdir}/libipset.a | |
12667538 PS |
236 | |
237 | %files init | |
238 | %defattr(644,root,root,755) | |
a264566a | 239 | %attr(754,root,root) /etc/rc.d/init.d/ipset |
3bc59268 | 240 | %endif |