2 # - package apparmor stuff
3 # - update (cut down, include /usr/share/lxc/config/common.conf) default pld container config
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 ?
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
17 Summary: Linux Containers userspace tools
18 Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC)
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}
58 # used in lxc-net script to set bridge nat
61 Requires: rc-scripts >= 0.4.6
62 Requires: systemd-units >= 38
64 # used in lxc-net script, but not all cases, may break working setups
67 Suggests: gnupg-plugin-keys_curl
68 Suggests: gnupg-plugin-keys_hkp
72 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 %define configpath /var/lib/lxc
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.
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.
97 Summary: liblxc library
98 Summary(pl.UTF-8): Biblioteka liblxc
100 Conflicts: lxc < 2.0.4-2
105 %description libs -l pl.UTF-8
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}
115 Header files for lxc library.
117 %description devel -l pl.UTF-8
118 Pliki nagłówkowe biblioteki lxc.
121 Summary: Lua binding for LXC
122 Summary(pl.UTF-8): Wiązanie Lua do LXC
124 Requires: %{name} = %{version}-%{release}
125 Requires: lua51-libs >= 5.1
127 %description -n lua-lxc
130 %description -n lua-lxc -l pl.UTF-8
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
137 Requires: %{name} = %{version}-%{release}
138 Requires: python3-libs >= 1:3.2
139 Requires: python3-modules >= 1:3.2
141 %description -n python3-lxc
142 Python (3.x) binding for LXC.
144 %description -n python3-lxc -l pl.UTF-8
145 Wiązanie Pythona (3.x) do LXC.
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
154 %description -n bash-completion-%{name}
155 bash-completion for LXC.
157 %description -n bash-completion-%{name} -l pl.UTF-8
158 bashowe uzupełnianie nazw dla LXC.
165 cp -p %{SOURCE1} templates/lxc-pld.in
169 %{__aclocal} -I config
174 bashcompdir=%{bash_compdir} \
175 db2xman=docbook2X2man \
180 %{__enable_disable apparmor} \
181 %{__enable_disable cgmanager} \
182 %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \
183 %{__enable_disable python} \
184 %{__enable_disable seccomp} \
185 %{__enable_disable selinux} \
186 --with-config-path=%{configpath} \
187 --with-init-script=sysvinit,systemd \
188 --with-runtime-path=/var/run \
195 rm -rf $RPM_BUILD_ROOT
196 install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \
197 -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
200 SYSTEMD_UNIT_DIR=%{systemdunitdir} \
201 pcdatadir=%{_pkgconfigdir} \
202 DESTDIR=$RPM_BUILD_ROOT
204 %{__make} -C doc install \
205 DESTDIR=$RPM_BUILD_ROOT
207 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
209 # apparmor profiles are not packaged, remove to avoid packagers confusion
210 %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d
212 # yum plugin, no idea where to package this
213 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py
215 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan
216 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/%{name}/lxc_macvlan
219 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
220 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
223 %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top
227 rm -rf $RPM_BUILD_ROOT
230 /sbin/chkconfig --add lxc
231 /sbin/chkconfig --add lxc-net
232 %systemd_post lxc.service lxc-net.service
235 if [ "$1" = "0" ]; then
237 /sbin/chkconfig --del lxc
238 %service lxc-net stop
239 /sbin/chkconfig --del lxc-net
241 %systemd_preun lxc.service lxc-net.service
246 %post libs -p /sbin/ldconfig
247 %postun libs -p /sbin/ldconfig
250 %defattr(644,root,root,755)
251 %doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf
252 %attr(755,root,root) %{_bindir}/lxc-attach
253 %attr(755,root,root) %{_bindir}/lxc-autostart
254 %attr(755,root,root) %{_bindir}/lxc-cgroup
255 %attr(755,root,root) %{_bindir}/lxc-checkconfig
256 %attr(755,root,root) %{_bindir}/lxc-checkpoint
257 %attr(755,root,root) %{_bindir}/lxc-copy
258 %attr(755,root,root) %{_bindir}/lxc-config
259 %attr(755,root,root) %{_bindir}/lxc-console
260 %attr(755,root,root) %{_bindir}/lxc-create
261 %attr(755,root,root) %{_bindir}/lxc-destroy
262 %attr(755,root,root) %{_bindir}/lxc-execute
263 %attr(755,root,root) %{_bindir}/lxc-freeze
264 %attr(755,root,root) %{_bindir}/lxc-info
265 %attr(755,root,root) %{_bindir}/lxc-monitor
266 %attr(755,root,root) %{_bindir}/lxc-snapshot
267 %attr(755,root,root) %{_bindir}/lxc-start
268 %attr(755,root,root) %{_bindir}/lxc-stop
269 %attr(755,root,root) %{_bindir}/lxc-unfreeze
270 %attr(755,root,root) %{_bindir}/lxc-unshare
271 %attr(755,root,root) %{_bindir}/lxc-usernsexec
272 %attr(755,root,root) %{_bindir}/lxc-wait
273 %attr(755,root,root) %{_sbindir}/init.lxc
274 %attr(754,root,root) /etc/rc.d/init.d/lxc
275 %attr(754,root,root) /etc/rc.d/init.d/lxc-net
277 %{systemdunitdir}/lxc.service
278 %{systemdunitdir}/lxc@.service
279 %{systemdunitdir}/lxc-net.service
280 %dir %{_libdir}/%{name}
281 %dir %{_libdir}/%{name}/rootfs
282 %{_libdir}/%{name}/rootfs/README
283 %attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load
284 %attr(755,root,root) %{_libdir}/%{name}/lxc-containers
285 %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord
286 %attr(755,root,root) %{_libdir}/%{name}/lxc-net
287 %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic
288 %attr(755,root,root) %{_libdir}/%{name}/lxc_macvlan
289 %dir %{_sysconfdir}/lxc
290 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan
291 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc
292 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf
293 %dir %{_datadir}/%{name}
294 %{_datadir}/%{name}/lxc.functions
295 %dir %{_datadir}/%{name}/config
296 %{_datadir}/%{name}/config/archlinux.*.conf
297 %{_datadir}/%{name}/config/centos.*.conf
298 %{_datadir}/%{name}/config/common.conf
299 %dir %{_datadir}/%{name}/config/common.conf.d
300 %{_datadir}/%{name}/config/common.conf.d/README
301 %{_datadir}/%{name}/config/common.seccomp
302 %{_datadir}/%{name}/config/alpine.*.conf
303 %{_datadir}/%{name}/config/debian.*.conf
304 %{_datadir}/%{name}/config/fedora.*.conf
305 %{_datadir}/%{name}/config/gentoo.*.conf
306 %{_datadir}/%{name}/config/nesting.conf
307 %{_datadir}/%{name}/config/opensuse.*.conf
308 %{_datadir}/%{name}/config/openwrt.*.conf
309 %{_datadir}/%{name}/config/oracle.*.conf
310 %{_datadir}/%{name}/config/plamo.*.conf
311 %{_datadir}/%{name}/config/slackware.*.conf
312 %{_datadir}/%{name}/config/sparclinux.*.conf
313 %{_datadir}/%{name}/config/ubuntu-cloud.*.conf
314 %{_datadir}/%{name}/config/ubuntu.*.conf
315 %{_datadir}/%{name}/config/userns.conf
316 %dir %{_libdir}/%{name}/hooks
317 %dir %{_datadir}/%{name}/hooks
318 %dir %{_datadir}/%{name}/selinux
319 %{_datadir}/%{name}/selinux/*
320 %dir %{_datadir}/%{name}/templates
321 %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname
322 %attr(755,root,root) %{_datadir}/%{name}/hooks/mount*
323 %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client
324 %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep
325 %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-*
326 %attr(755,root,root) %{_libdir}/%{name}/hooks/unmount-namespace
327 %{_mandir}/man1/lxc-attach.1*
328 %{_mandir}/man1/lxc-autostart.1*
329 %{_mandir}/man1/lxc-cgroup.1*
330 %{_mandir}/man1/lxc-checkconfig.1*
331 %{_mandir}/man1/lxc-checkpoint.1*
332 %{_mandir}/man1/lxc-copy.1*
333 %{_mandir}/man1/lxc-config.1*
334 %{_mandir}/man1/lxc-console.1*
335 %{_mandir}/man1/lxc-create.1*
336 %{_mandir}/man1/lxc-destroy.1*
337 %{_mandir}/man1/lxc-execute.1*
338 %{_mandir}/man1/lxc-freeze.1*
339 %{_mandir}/man1/lxc-info.1*
340 %{_mandir}/man1/lxc-monitor.1*
341 %{_mandir}/man1/lxc-snapshot.1*
342 %{_mandir}/man1/lxc-start.1*
343 %{_mandir}/man1/lxc-stop.1*
344 %{_mandir}/man1/lxc-unfreeze.1*
345 %{_mandir}/man1/lxc-unshare.1*
346 %{_mandir}/man1/lxc-user-nic.1*
347 %{_mandir}/man1/lxc-usernsexec.1*
348 %{_mandir}/man1/lxc-wait.1*
349 %{_mandir}/man5/lxc-usernet.5*
350 %{_mandir}/man5/lxc.conf.5*
351 %{_mandir}/man5/lxc.container.conf.5*
352 %{_mandir}/man5/lxc.system.conf.5*
353 %{_mandir}/man7/lxc.7*
354 %lang(ja) %{_mandir}/ja/man1/lxc*.1*
355 %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5*
356 %lang(ja) %{_mandir}/ja/man5/lxc.conf.5*
357 %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5*
358 %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5*
359 %lang(ja) %{_mandir}/ja/man7/lxc.7*
360 %exclude %{_mandir}/ja/man1/lxc-device.1*
361 %exclude %{_mandir}/ja/man1/lxc-ls.1*
362 %exclude %{_mandir}/ja/man1/lxc-top.1*
363 %lang(ko) %{_mandir}/ko/man1/lxc*.1*
364 %lang(ko) %{_mandir}/ko/man5/lxc-usernet.5*
365 %lang(ko) %{_mandir}/ko/man5/lxc.conf.5*
366 %lang(ko) %{_mandir}/ko/man5/lxc.container.conf.5*
367 %lang(ko) %{_mandir}/ko/man5/lxc.system.conf.5*
368 %lang(ko) %{_mandir}/ko/man7/lxc.7*
369 %exclude %{_mandir}/ko/man1/lxc-device.1*
370 %exclude %{_mandir}/ko/man1/lxc-ls.1*
371 %exclude %{_mandir}/ko/man1/lxc-top.1*
373 %if %{without python}
375 %attr(755,root,root) %{_bindir}/lxc-ls
376 %{_mandir}/man1/lxc-ls.1*
377 %lang(ja) %{_mandir}/ja/man1/lxc-ls.1*
378 %lang(ko) %{_mandir}/ko/man1/lxc-ls.1*
382 %dir %{configpath}snap
383 %dir %attr(750,root,root) /var/log/lxc
384 %dir %attr(750,root,root) /var/cache/lxc
387 %defattr(644,root,root,755)
388 %attr(755,root,root) %{_libdir}/liblxc.so.*.*.*
389 %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_libdir}/liblxc.so
395 %{_pkgconfigdir}/lxc.pc
400 %defattr(644,root,root,755)
401 %attr(755,root,root) %{_bindir}/lxc-top
402 %dir %{_libdir}/lua/lxc
403 %attr(755,root,root) %{_libdir}/lua/lxc/core.so
404 %{_datadir}/lua/lxc.lua
405 %{_mandir}/man1/lxc-top.1*
406 %lang(ja) %{_mandir}/ja/man1/lxc-top.1*
407 %lang(ko) %{_mandir}/ko/man1/lxc-top.1*
411 %files -n python3-lxc
412 %defattr(644,root,root,755)
413 %attr(755,root,root) %{_bindir}/lxc-device
414 %attr(755,root,root) %{_bindir}/lxc-ls
416 %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so
417 %{py3_sitedir}/_lxc-0.1-py*.egg-info
418 %{_mandir}/man1/lxc-device.1*
419 %{_mandir}/man1/lxc-ls.1*
420 %lang(ja) %{_mandir}/ja/man1/lxc-device.1*
421 %lang(ja) %{_mandir}/ja/man1/lxc-ls.1*
422 %lang(ko) %{_mandir}/ko/man1/lxc-device.1*
423 %lang(ko) %{_mandir}/ko/man1/lxc-ls.1*
426 %files -n bash-completion-%{name}
427 %defattr(644,root,root,755)