]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - package apparmor stuff | |
3 | # - update (cut down, include /usr/share/lxc/config/common.conf) default pld container config | |
4 | # NOTE: | |
5 | # - does not work properly (dead symlink /proc/self) with PLD kernel 4.1.13 | |
6 | # but seems to work on 4.3.3, vserver issue ? | |
7 | # | |
8 | ||
9 | # Conditional build: | |
10 | %bcond_without seccomp # SecComp syscall filter | |
11 | %bcond_without apparmor # apparmor support | |
12 | %bcond_without lua # Lua binding | |
13 | %bcond_without python # Python binding | |
14 | %bcond_with selinux # SELinux support | |
15 | %bcond_with cgmanager # cgmanager support | |
16 | ||
17 | Summary: Linux Containers userspace tools | |
18 | Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC) | |
19 | Name: lxc | |
20 | Version: 2.0.6 | |
21 | Release: 1 | |
22 | License: LGPL v2.1+ | |
23 | Group: Applications/System | |
24 | Source0: https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz | |
25 | # Source0-md5: 5fd4b7af8026e8ae20b3065ee18fe974 | |
26 | Source1: %{name}-pld.in.sh | |
27 | # lxc-net based on bridge, macvlan is an alternative/supported lxc network | |
28 | Source2: %{name}_macvlan.sysconfig | |
29 | Source3: %{name}_macvlan | |
30 | Patch0: %{name}-pld.patch | |
31 | Patch1: %{name}-net.patch | |
32 | URL: https://www.linuxcontainers.org/ | |
33 | BuildRequires: autoconf >= 2.50 | |
34 | BuildRequires: automake | |
35 | %{?with_cgmanager:BuildRequires: cgmanager-devel} | |
36 | %{?with_cgmanager:BuildRequires: dbus-devel >= 1.2.16} | |
37 | BuildRequires: docbook-dtd45-xml | |
38 | BuildRequires: docbook2X >= 0.8 | |
39 | BuildRequires: doxygen | |
40 | BuildRequires: gnutls-devel | |
41 | %{?with_apparmor:BuildRequires: libapparmor-devel} | |
42 | BuildRequires: libcap-devel | |
43 | %{?with_cgmanager:BuildRequires: libnih-devel >= 1.0.2} | |
44 | %{?with_seccomp:BuildRequires: libseccomp-devel} | |
45 | BuildRequires: libxslt-progs | |
46 | %{?with_lua:BuildRequires: lua51-devel >= 5.1} | |
47 | BuildRequires: pkgconfig | |
48 | %{?with_python:BuildRequires: python3-devel >= 1:3.2} | |
49 | %{?with_python:BuildRequires: python3-modules >= 1:3.2} | |
50 | BuildRequires: rpm-pythonprov | |
51 | BuildRequires: rpmbuild(macros) >= 1.671 | |
52 | BuildRequires: sed >= 4.0 | |
53 | Requires(post): /sbin/ldconfig | |
54 | Requires(post,preun): /sbin/chkconfig | |
55 | Requires: %{name}-libs = %{version}-%{release} | |
56 | # lxc_macvlan script | |
57 | Requires: gawk | |
58 | # used in lxc-net script to set bridge nat | |
59 | Requires: iproute2 | |
60 | Requires: iptables | |
61 | Requires: rc-scripts >= 0.4.6 | |
62 | Requires: systemd-units >= 38 | |
63 | Requires: which | |
64 | # used in lxc-net script, but not all cases, may break working setups | |
65 | Suggests: dnsmasq | |
66 | Suggests: gnupg | |
67 | Suggests: gnupg-plugin-keys_curl | |
68 | Suggests: gnupg-plugin-keys_hkp | |
69 | Suggests: net-tools | |
70 | Suggests: python3-lxc | |
71 | Suggests: rsync | |
72 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
73 | ||
74 | %define configpath /var/lib/lxc | |
75 | ||
76 | %description | |
77 | Tools to create and manage containers. It contains a full featured | |
78 | container with the isolation / virtualization of the pids, the ipc, | |
79 | the utsname, the mount points, /proc, /sys, the network and it takes | |
80 | into account the control groups. It is very light, flexible, and | |
81 | provides a set of tools around the container like the monitoring with | |
82 | asynchronous events notification, or the freeze of the container. This | |
83 | package is useful to create Virtual Private Server, or to run isolated | |
84 | applications like bash or sshd. | |
85 | ||
86 | %description -l pl.UTF-8 | |
87 | Narzędzia do tworzenia i zarządzania kontenerami. System ten obejmuje | |
88 | w pełni funkcjonalne kontenery z izolacją/wirtualizacją pidów, ipc, | |
89 | utsname, punktów montowania, /proc, /sys, sieci oraz uwzględniające | |
90 | grupy kontrolne. Jest bardzo lekki, elastyczny i udostępnia narzędzia | |
91 | do czynności związanych z kontenerami, takich jak monitorowanie z | |
92 | asynchronicznym powiadamianiem o zdarzeniach czy zamrażanie. Ten | |
93 | pakiet jest przydatny do tworzenia wirtualnych serwerów prywatnych | |
94 | oraz uruchamiania izolowanych aplikacji, takich jak bash czy sshd. | |
95 | ||
96 | %package libs | |
97 | Summary: liblxc library | |
98 | Summary(pl.UTF-8): Biblioteka liblxc | |
99 | Group: Libraries | |
100 | Conflicts: lxc < 2.0.4-2 | |
101 | ||
102 | %description libs | |
103 | liblxc library. | |
104 | ||
105 | %description libs -l pl.UTF-8 | |
106 | Biblioteka liblxc. | |
107 | ||
108 | %package devel | |
109 | Summary: Header files for lxc library | |
110 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki lxc | |
111 | Group: Development/Libraries | |
112 | Requires: %{name}-libs = %{version}-%{release} | |
113 | ||
114 | %description devel | |
115 | Header files for lxc library. | |
116 | ||
117 | %description devel -l pl.UTF-8 | |
118 | Pliki nagłówkowe biblioteki lxc. | |
119 | ||
120 | %package -n lua-lxc | |
121 | Summary: Lua binding for LXC | |
122 | Summary(pl.UTF-8): Wiązanie Lua do LXC | |
123 | Group: Libraries | |
124 | Requires: %{name} = %{version}-%{release} | |
125 | Requires: lua51-libs >= 5.1 | |
126 | ||
127 | %description -n lua-lxc | |
128 | Lua binding for LXC. | |
129 | ||
130 | %description -n lua-lxc -l pl.UTF-8 | |
131 | Wiązanie Lua do LXC. | |
132 | ||
133 | %package -n python3-lxc | |
134 | Summary: Python (3.x) binding for LXC | |
135 | Summary(pl.UTF-8): Wiązanie Pythona (3.x) do LXC | |
136 | Group: Libraries | |
137 | Requires: %{name} = %{version}-%{release} | |
138 | Requires: python3-libs >= 1:3.2 | |
139 | Requires: python3-modules >= 1:3.2 | |
140 | ||
141 | %description -n python3-lxc | |
142 | Python (3.x) binding for LXC. | |
143 | ||
144 | %description -n python3-lxc -l pl.UTF-8 | |
145 | Wiązanie Pythona (3.x) do LXC. | |
146 | ||
147 | %package -n bash-completion-%{name} | |
148 | Summary: bash-completion for LXC | |
149 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC | |
150 | Group: Applications/Shells | |
151 | Requires: %{name} = %{version}-%{release} | |
152 | Requires: bash-completion | |
153 | ||
154 | %description -n bash-completion-%{name} | |
155 | bash-completion for LXC. | |
156 | ||
157 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
158 | bashowe uzupełnianie nazw dla LXC. | |
159 | ||
160 | %prep | |
161 | %setup -q | |
162 | %patch0 -p0 | |
163 | %patch1 -p1 | |
164 | ||
165 | cp -p %{SOURCE1} templates/lxc-pld.in | |
166 | ||
167 | %build | |
168 | %{__aclocal} -I config | |
169 | %{__autoconf} | |
170 | %{__autoheader} | |
171 | %{__automake} | |
172 | %configure \ | |
173 | db2xman=docbook2X2man \ | |
174 | --disable-rpath \ | |
175 | --enable-bash \ | |
176 | --enable-doc \ | |
177 | --enable-examples \ | |
178 | %{__enable_disable apparmor} \ | |
179 | %{__enable_disable cgmanager} \ | |
180 | %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \ | |
181 | %{__enable_disable python} \ | |
182 | %{__enable_disable seccomp} \ | |
183 | %{__enable_disable selinux} \ | |
184 | --with-config-path=%{configpath} \ | |
185 | --with-init-script=sysvinit,systemd \ | |
186 | --with-runtime-path=/var/run \ | |
187 | --with-distro=pld | |
188 | ||
189 | %{__make} | |
190 | %{__make} -C doc | |
191 | ||
192 | %install | |
193 | rm -rf $RPM_BUILD_ROOT | |
194 | install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \ | |
195 | -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} | |
196 | ||
197 | %{__make} install \ | |
198 | SYSTEMD_UNIT_DIR=%{systemdunitdir} \ | |
199 | pcdatadir=%{_pkgconfigdir} \ | |
200 | DESTDIR=$RPM_BUILD_ROOT | |
201 | ||
202 | %{__make} -C doc install \ | |
203 | DESTDIR=$RPM_BUILD_ROOT | |
204 | ||
205 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
206 | ||
207 | # apparmor profiles are not packaged, remove to avoid packagers confusion | |
208 | %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d | |
209 | ||
210 | # yum plugin, no idea where to package this | |
211 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py | |
212 | ||
213 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan | |
214 | install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/%{name}/lxc_macvlan | |
215 | ||
216 | %if %{with python} | |
217 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc | |
218 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc | |
219 | %endif | |
220 | %if %{with lua} | |
221 | %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top | |
222 | %endif | |
223 | ||
224 | %clean | |
225 | rm -rf $RPM_BUILD_ROOT | |
226 | ||
227 | %post | |
228 | /sbin/chkconfig --add lxc | |
229 | /sbin/chkconfig --add lxc-net | |
230 | %systemd_post lxc.service lxc-net.service | |
231 | ||
232 | %preun | |
233 | if [ "$1" = "0" ]; then | |
234 | %service lxc stop | |
235 | /sbin/chkconfig --del lxc | |
236 | %service lxc-net stop | |
237 | /sbin/chkconfig --del lxc-net | |
238 | fi | |
239 | %systemd_preun lxc.service lxc-net.service | |
240 | ||
241 | %postun | |
242 | %systemd_reload | |
243 | ||
244 | %post libs -p /sbin/ldconfig | |
245 | %postun libs -p /sbin/ldconfig | |
246 | ||
247 | %files | |
248 | %defattr(644,root,root,755) | |
249 | %doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf | |
250 | %attr(755,root,root) %{_bindir}/lxc-attach | |
251 | %attr(755,root,root) %{_bindir}/lxc-autostart | |
252 | %attr(755,root,root) %{_bindir}/lxc-cgroup | |
253 | %attr(755,root,root) %{_bindir}/lxc-checkconfig | |
254 | %attr(755,root,root) %{_bindir}/lxc-checkpoint | |
255 | %attr(755,root,root) %{_bindir}/lxc-copy | |
256 | %attr(755,root,root) %{_bindir}/lxc-config | |
257 | %attr(755,root,root) %{_bindir}/lxc-console | |
258 | %attr(755,root,root) %{_bindir}/lxc-create | |
259 | %attr(755,root,root) %{_bindir}/lxc-destroy | |
260 | %attr(755,root,root) %{_bindir}/lxc-execute | |
261 | %attr(755,root,root) %{_bindir}/lxc-freeze | |
262 | %attr(755,root,root) %{_bindir}/lxc-info | |
263 | %attr(755,root,root) %{_bindir}/lxc-monitor | |
264 | %attr(755,root,root) %{_bindir}/lxc-snapshot | |
265 | %attr(755,root,root) %{_bindir}/lxc-start | |
266 | %attr(755,root,root) %{_bindir}/lxc-stop | |
267 | %attr(755,root,root) %{_bindir}/lxc-unfreeze | |
268 | %attr(755,root,root) %{_bindir}/lxc-unshare | |
269 | %attr(755,root,root) %{_bindir}/lxc-usernsexec | |
270 | %attr(755,root,root) %{_bindir}/lxc-wait | |
271 | %attr(755,root,root) %{_sbindir}/init.lxc | |
272 | %attr(754,root,root) /etc/rc.d/init.d/lxc | |
273 | %attr(754,root,root) /etc/rc.d/init.d/lxc-net | |
274 | ||
275 | %{systemdunitdir}/lxc.service | |
276 | %{systemdunitdir}/lxc@.service | |
277 | %{systemdunitdir}/lxc-net.service | |
278 | %dir %{_libdir}/%{name} | |
279 | %dir %{_libdir}/%{name}/rootfs | |
280 | %{_libdir}/%{name}/rootfs/README | |
281 | %attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load | |
282 | %attr(755,root,root) %{_libdir}/%{name}/lxc-containers | |
283 | %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord | |
284 | %attr(755,root,root) %{_libdir}/%{name}/lxc-net | |
285 | %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic | |
286 | %attr(755,root,root) %{_libdir}/%{name}/lxc_macvlan | |
287 | %dir %{_sysconfdir}/lxc | |
288 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan | |
289 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc | |
290 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf | |
291 | %dir %{_datadir}/%{name} | |
292 | %{_datadir}/%{name}/lxc.functions | |
293 | %dir %{_datadir}/%{name}/config | |
294 | %{_datadir}/%{name}/config/archlinux.*.conf | |
295 | %{_datadir}/%{name}/config/centos.*.conf | |
296 | %{_datadir}/%{name}/config/common.conf | |
297 | %dir %{_datadir}/%{name}/config/common.conf.d | |
298 | %{_datadir}/%{name}/config/common.conf.d/README | |
299 | %{_datadir}/%{name}/config/common.seccomp | |
300 | %{_datadir}/%{name}/config/alpine.*.conf | |
301 | %{_datadir}/%{name}/config/debian.*.conf | |
302 | %{_datadir}/%{name}/config/fedora.*.conf | |
303 | %{_datadir}/%{name}/config/gentoo.*.conf | |
304 | %{_datadir}/%{name}/config/nesting.conf | |
305 | %{_datadir}/%{name}/config/opensuse.*.conf | |
306 | %{_datadir}/%{name}/config/openwrt.*.conf | |
307 | %{_datadir}/%{name}/config/oracle.*.conf | |
308 | %{_datadir}/%{name}/config/plamo.*.conf | |
309 | %{_datadir}/%{name}/config/slackware.*.conf | |
310 | %{_datadir}/%{name}/config/sparclinux.*.conf | |
311 | %{_datadir}/%{name}/config/ubuntu-cloud.*.conf | |
312 | %{_datadir}/%{name}/config/ubuntu.*.conf | |
313 | %{_datadir}/%{name}/config/userns.conf | |
314 | %dir %{_libdir}/%{name}/hooks | |
315 | %dir %{_datadir}/%{name}/hooks | |
316 | %dir %{_datadir}/%{name}/selinux | |
317 | %{_datadir}/%{name}/selinux/* | |
318 | %dir %{_datadir}/%{name}/templates | |
319 | %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname | |
320 | %attr(755,root,root) %{_datadir}/%{name}/hooks/mount* | |
321 | %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client | |
322 | %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep | |
323 | %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-* | |
324 | %attr(755,root,root) %{_libdir}/%{name}/hooks/unmount-namespace | |
325 | %{_mandir}/man1/lxc-attach.1* | |
326 | %{_mandir}/man1/lxc-autostart.1* | |
327 | %{_mandir}/man1/lxc-cgroup.1* | |
328 | %{_mandir}/man1/lxc-checkconfig.1* | |
329 | %{_mandir}/man1/lxc-checkpoint.1* | |
330 | %{_mandir}/man1/lxc-copy.1* | |
331 | %{_mandir}/man1/lxc-config.1* | |
332 | %{_mandir}/man1/lxc-console.1* | |
333 | %{_mandir}/man1/lxc-create.1* | |
334 | %{_mandir}/man1/lxc-destroy.1* | |
335 | %{_mandir}/man1/lxc-execute.1* | |
336 | %{_mandir}/man1/lxc-freeze.1* | |
337 | %{_mandir}/man1/lxc-info.1* | |
338 | %{_mandir}/man1/lxc-monitor.1* | |
339 | %{_mandir}/man1/lxc-snapshot.1* | |
340 | %{_mandir}/man1/lxc-start.1* | |
341 | %{_mandir}/man1/lxc-stop.1* | |
342 | %{_mandir}/man1/lxc-unfreeze.1* | |
343 | %{_mandir}/man1/lxc-unshare.1* | |
344 | %{_mandir}/man1/lxc-user-nic.1* | |
345 | %{_mandir}/man1/lxc-usernsexec.1* | |
346 | %{_mandir}/man1/lxc-wait.1* | |
347 | %{_mandir}/man5/lxc-usernet.5* | |
348 | %{_mandir}/man5/lxc.conf.5* | |
349 | %{_mandir}/man5/lxc.container.conf.5* | |
350 | %{_mandir}/man5/lxc.system.conf.5* | |
351 | %{_mandir}/man7/lxc.7* | |
352 | %lang(ja) %{_mandir}/ja/man1/lxc*.1* | |
353 | %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5* | |
354 | %lang(ja) %{_mandir}/ja/man5/lxc.conf.5* | |
355 | %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5* | |
356 | %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5* | |
357 | %lang(ja) %{_mandir}/ja/man7/lxc.7* | |
358 | %exclude %{_mandir}/ja/man1/lxc-device.1* | |
359 | %exclude %{_mandir}/ja/man1/lxc-ls.1* | |
360 | %exclude %{_mandir}/ja/man1/lxc-top.1* | |
361 | %lang(ko) %{_mandir}/ko/man1/lxc*.1* | |
362 | %lang(ko) %{_mandir}/ko/man5/lxc-usernet.5* | |
363 | %lang(ko) %{_mandir}/ko/man5/lxc.conf.5* | |
364 | %lang(ko) %{_mandir}/ko/man5/lxc.container.conf.5* | |
365 | %lang(ko) %{_mandir}/ko/man5/lxc.system.conf.5* | |
366 | %lang(ko) %{_mandir}/ko/man7/lxc.7* | |
367 | %exclude %{_mandir}/ko/man1/lxc-device.1* | |
368 | %exclude %{_mandir}/ko/man1/lxc-ls.1* | |
369 | %exclude %{_mandir}/ko/man1/lxc-top.1* | |
370 | ||
371 | %if %{without python} | |
372 | # legacy version | |
373 | %attr(755,root,root) %{_bindir}/lxc-ls | |
374 | %{_mandir}/man1/lxc-ls.1* | |
375 | %lang(ja) %{_mandir}/ja/man1/lxc-ls.1* | |
376 | %lang(ko) %{_mandir}/ko/man1/lxc-ls.1* | |
377 | %endif | |
378 | ||
379 | %dir %{configpath} | |
380 | %dir %{configpath}snap | |
381 | %dir %attr(750,root,root) /var/log/lxc | |
382 | %dir %attr(750,root,root) /var/cache/lxc | |
383 | ||
384 | %files libs | |
385 | %defattr(644,root,root,755) | |
386 | %attr(755,root,root) %{_libdir}/liblxc.so.*.*.* | |
387 | %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1 | |
388 | ||
389 | %files devel | |
390 | %defattr(644,root,root,755) | |
391 | %attr(755,root,root) %{_libdir}/liblxc.so | |
392 | %{_includedir}/lxc | |
393 | %{_pkgconfigdir}/lxc.pc | |
394 | %{_libdir}/liblxc.la | |
395 | ||
396 | %if %{with lua} | |
397 | %files -n lua-lxc | |
398 | %defattr(644,root,root,755) | |
399 | %attr(755,root,root) %{_bindir}/lxc-top | |
400 | %dir %{_libdir}/lua/lxc | |
401 | %attr(755,root,root) %{_libdir}/lua/lxc/core.so | |
402 | %{_datadir}/lua/lxc.lua | |
403 | %{_mandir}/man1/lxc-top.1* | |
404 | %lang(ja) %{_mandir}/ja/man1/lxc-top.1* | |
405 | %lang(ko) %{_mandir}/ko/man1/lxc-top.1* | |
406 | %endif | |
407 | ||
408 | %if %{with python} | |
409 | %files -n python3-lxc | |
410 | %defattr(644,root,root,755) | |
411 | %attr(755,root,root) %{_bindir}/lxc-device | |
412 | %attr(755,root,root) %{_bindir}/lxc-ls | |
413 | %{py3_sitedir}/lxc | |
414 | %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so | |
415 | %{py3_sitedir}/_lxc-0.1-py*.egg-info | |
416 | %{_mandir}/man1/lxc-device.1* | |
417 | %{_mandir}/man1/lxc-ls.1* | |
418 | %lang(ja) %{_mandir}/ja/man1/lxc-device.1* | |
419 | %lang(ja) %{_mandir}/ja/man1/lxc-ls.1* | |
420 | %lang(ko) %{_mandir}/ko/man1/lxc-device.1* | |
421 | %lang(ko) %{_mandir}/ko/man1/lxc-ls.1* | |
422 | %endif | |
423 | ||
424 | %files -n bash-completion-%{name} | |
425 | %defattr(644,root,root,755) | |
426 | %{bash_compdir}/lxc |