]> git.pld-linux.org Git - packages/ipset.git/blob - ipset.spec
- fix building with kernel 4.12
[packages/ipset.git] / ipset.spec
1 #
2 # TODO:
3 #       - patch our kernel to provide the needed API and update
4 #         the dependencies here
5 #
6 # Conditional build:
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
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
20 %if %{without userspace}
21 # nothing to be placed to debuginfo package
22 %define         _enable_debug_packages  0
23 %endif
24
25 %define         rel     2
26 %define         pname   ipset
27 Summary:        IP sets utility
28 Summary(pl.UTF-8):      Narzędzie do zarządzania zbiorami IP
29 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
30 Version:        6.32
31 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
32 License:        GPL v2
33 Group:          Networking/Admin
34 #Source0Download: http://ipset.netfilter.org/install.html
35 Source0:        http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
36 # Source0-md5:  857a5c6a6d645196865a82bf6fd7f567
37 Source1:        %{pname}.init
38 Patch0:         linux-4.10.patch
39 Patch1:         linux-4.12.patch
40 URL:            http://ipset.netfilter.org/
41 BuildRequires:  autoconf >= 2.50
42 BuildRequires:  automake
43 BuildRequires:  libmnl-devel >= 1
44 BuildRequires:  libltdl-devel >= 2:2.0
45 BuildRequires:  libtool >= 2:2.0
46 %{?with_userspace:BuildRequires:        linux-libc-headers >= 7:2.6.38.6}
47 BuildRequires:  pkgconfig
48 BuildRequires:  rpmbuild(macros) >= 1.701
49 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
50 Suggests:       kernel-net-ipset
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 # unresolved ipset_errcode, defined in the ipset binary
54 %define         skip_post_check_so      libipset\.so.*
55
56 %description
57 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
58 can be administered by the ipset utility. Depending on the type,
59 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
60 IP addresses with MAC addresses in a way, which ensures lightning
61 speed when matching an entry against a set.
62
63 %description -l pl.UTF-8
64 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
65 administrować przy użyciu narzędzia ipset. W zależności od
66 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
67 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
68 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
69 zbioru.
70
71 %package devel
72 Summary:        Header files for ipset interface
73 Summary(pl.UTF-8):      Pliki nagłówkowe do interfejsu ipset
74 Group:          Development/Libraries
75 Requires:       %{name} = %{version}-%{release}
76 Requires:       libmnl-devel >= 1
77
78 %description devel
79 Header files for IPset interface.
80
81 %description devel -l pl.UTF-8
82 Pliki nagłówkowe do interfejsu IPset.
83
84 %package static
85 Summary:        Static ipset interface library
86 Summary(pl.UTF-8):      Biblioteka statyczna interfejsu ipset
87 Group:          Development/Libraries
88 Requires:       %{name}-devel = %{version}-%{release}
89
90 %description static
91 Static IPset interface library.
92
93 %description static -l pl.UTF-8
94 Biblioteka statyczna interfejsu IPset.
95
96 %package init
97 Summary:        IPset init script
98 Summary(pl.UTF-8):      Skrypt startowy IPset
99 Group:          Networking/Admin
100 Requires(post,preun):   /sbin/chkconfig
101 Requires:       %{pname} = %{version}-%{release}
102 Requires:       rc-scripts
103
104 %description init
105 IPset initialization script.
106
107 %description init -l pl.UTF-8
108 Skrypt startowy IPset.
109
110 %package -n bash-completion-ipset
111 Summary:        Bash completion for ipset command
112 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów polecenia ipset
113 Group:          Applications/Shells
114 Requires:       %{pname} = %{version}-%{release}
115 Requires:       bash-completion >= 2.0
116
117 %description -n bash-completion-ipset
118 Bash completion for ipset command.
119
120 %description -n bash-completion-ipset -l pl.UTF-8
121 Bashowe dopełnianie parametrów polecenia ipset.
122
123 %define kernel_pkg()\
124 %package -n kernel%{_alt_kernel}-net-ipset\
125 Summary:        IPset kernel modules\
126 Summary(pl.UTF-8):      Moduły jądra oferujące wsparcie dla zbiorów IP\
127 Release:        %{rel}@%{_kernel_ver_str}\
128 Group:          Base/Kernel\
129 Requires(post,postun):  /sbin/depmod\
130 %requires_releq_kernel\
131 Requires(postun):       %releq_kernel\
132 \
133 %description -n kernel%{_alt_kernel}-net-ipset\
134 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which\
135 can be administered by the ipset utility. Depending on the type,\
136 currently an IP set may store IP addresses, (TCP/UDP) port numbers or\
137 IP addresses with MAC addresses in a way, which ensures lightning\
138 speed when matching an entry against a set.\
139 \
140 This package contains kernel modules.\
141 \
142 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8\
143 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można\
144 administrować przy użyciu narzędzia ipset. W zależności od\
145 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery\
146 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób\
147 zapewniający maksymalną szybkość przy dopasowywaniu elementu do\
148 zbioru.\
149 \
150 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.\
151 \
152 %if %{with kernel}\
153 %files -n kernel%{_alt_kernel}-net-ipset\
154 %defattr(644,root,root,755)\
155 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*\
156 %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset\
157 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*\
158 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*\
159 %endif\
160 \
161 %post   -n kernel%{_alt_kernel}-net-ipset\
162 %depmod %{_kernel_ver}\
163 \
164 %postun -n kernel%{_alt_kernel}-net-ipset\
165 %depmod %{_kernel_ver}\
166 %{nil}
167
168 %define build_kernel_pkg()\
169 %configure \\\
170         --disable-silent-rules \\\
171         --with-kmod=yes \\\
172         --with-kbuild=%{_kernelsrcdir} \\\
173         --with-settype-modules-list=all\
174 \
175 # a hack not to list all modules: list only ip_set, all other are build anyway\
176 %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..\
177 \
178 for drv in kernel/net/netfilter/ipset/ip_set*.ko ; do\
179 %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter/ipset\
180 done\
181 for drv in kernel/net/netfilter/xt_*.ko ; do\
182 %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter\
183 done\
184 %{nil}
185
186 %{?with_kernel:%{expand:%create_kernel_packages}}
187
188 %prep
189 %setup -q -n %{pname}-%{version}
190 %patch0 -p1
191 %patch1 -p1
192
193 %build
194 %{__aclocal}
195 %{__autoconf}
196 %{__autoheader}
197 %{__automake}
198 %if %{with userspace}
199 install -d build-usr
200 cd build-usr
201 ../%configure \
202         bashcompdir=%{bash_compdir} \
203         --enable-bashcompl \
204         --disable-silent-rules \
205         --with-kmod=no \
206         --with-settype-modules-list=all
207
208 %{__make}
209 cd ..
210 %endif
211
212 %{?with_kernel:%{expand:%build_kernel_packages}}
213
214 %install
215 rm -rf $RPM_BUILD_ROOT
216
217 %if %{with userspace}
218 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
219
220 %{__make} -C build-usr install \
221         DESTDIR=$RPM_BUILD_ROOT
222
223 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
224 %endif
225
226 %if %{with kernel}
227 install -d $RPM_BUILD_ROOT
228 cp -a installed/* $RPM_BUILD_ROOT
229 %endif
230
231 %clean
232 rm -rf $RPM_BUILD_ROOT
233
234 %post init
235 /sbin/chkconfig --add %{pname}
236
237 %preun init
238 if [ "$1" = "0" ]; then
239         /sbin/chkconfig --del %{pname}
240 fi
241
242 %if %{with userspace}
243 %files
244 %defattr(644,root,root,755)
245 %doc ChangeLog ChangeLog.ippool README UPGRADE
246 %attr(755,root,root) %{_sbindir}/ipset
247 %attr(755,root,root) %{_libdir}/libipset.so.*.*.*
248 %attr(755,root,root) %ghost %{_libdir}/libipset.so.3
249 %{_mandir}/man8/ipset.8*
250
251 %files devel
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_libdir}/libipset.so
254 %{_libdir}/libipset.la
255 %{_includedir}/libipset
256 %{_pkgconfigdir}/libipset.pc
257
258 %files static
259 %defattr(644,root,root,755)
260 %{_libdir}/libipset.a
261
262 %files init
263 %defattr(644,root,root,755)
264 %attr(754,root,root) /etc/rc.d/init.d/ipset
265
266 %files -n bash-completion-ipset
267 %defattr(644,root,root,755)
268 %{bash_compdir}/ipset
269 %endif
This page took 0.065159 seconds and 3 git commands to generate.