2 # - package apparmor stuff
5 %bcond_without seccomp # SecComp syscall filter
6 %bcond_without apparmor # apparmor support
7 %bcond_without lua # Lua binding
8 %bcond_without python # Python binding
9 %bcond_with selinux # SELinux support
10 %bcond_with cgmanager # cgmanager support
12 Summary: Linux Containers userspace tools
13 Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC)
18 Group: Applications/System
19 Source0: https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz
20 # Source0-md5: 197abb5a28ab0b689c737eb1951023fb
21 Source1: %{name}-pld.in.sh
22 # lxc-net based on bridge, macvlan is an alternative/supported lxc network
23 Source2: %{name}_macvlan.sysconfig
24 Source3: %{name}_macvlan
25 Patch0: %{name}-pld.patch
27 Patch2: %{name}-net.patch
28 URL: https://www.linuxcontainers.org/
29 BuildRequires: autoconf >= 2.50
30 BuildRequires: automake
31 %{?with_cgmanager:BuildRequires: cgmanager-devel}
32 %{?with_cgmanager:BuildRequires: dbus-devel >= 1.2.16}
33 BuildRequires: docbook-dtd30-sgml
34 BuildRequires: docbook-utils
35 BuildRequires: docbook2X
36 BuildRequires: gnutls-devel
37 %{?with_apparmor:BuildRequires: libapparmor-devel}
38 BuildRequires: libcap-devel
39 %{?with_cgmanager:BuildRequires: libnih-devel >= 1.0.2}
40 %{?with_seccomp:BuildRequires: libseccomp-devel}
41 BuildRequires: libxslt-progs
42 %{?with_lua:BuildRequires: lua51-devel >= 5.1}
43 BuildRequires: pkgconfig
44 %{?with_python:BuildRequires: python3-devel >= 1:3.2}
45 %{?with_python:BuildRequires: python3-modules}
46 BuildRequires: rpm-pythonprov
47 BuildRequires: rpmbuild(macros) >= 1.671
48 BuildRequires: sed >= 4.0
49 Requires(post): /sbin/ldconfig
50 Requires(post,preun): /sbin/chkconfig
51 # used in lxc-net script
55 # used in lxc-net script to set bridge nat
58 Requires: rc-scripts >= 0.4.6
59 Requires: systemd-units >= 38
62 Suggests: gnupg-plugin-keys_curl
63 Suggests: gnupg-plugin-keys_hkp
67 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 %define configpath /var/lib/lxc
72 Tools to create and manage containers. It contains a full featured
73 container with the isolation / virtualization of the pids, the ipc,
74 the utsname, the mount points, /proc, /sys, the network and it takes
75 into account the control groups. It is very light, flexible, and
76 provides a set of tools around the container like the monitoring with
77 asynchronous events notification, or the freeze of the container. This
78 package is useful to create Virtual Private Server, or to run isolated
79 applications like bash or sshd.
81 %description -l pl.UTF-8
82 Narzędzia do tworzenia i zarządzania kontenerami. System ten obejmuje
83 w pełni funkcjonalne kontenery z izolacją/wirtualizacją pidów, ipc,
84 utsname, punktów montowania, /proc, /sys, sieci oraz uwzględniające
85 grupy kontrolne. Jest bardzo lekki, elastyczny i udostępnia narzędzia
86 do czynności związanych z kontenerami, takich jak monitorowanie z
87 asynchronicznym powiadamianiem o zdarzeniach czy zamrażanie. Ten
88 pakiet jest przydatny do tworzenia wirtualnych serwerów prywatnych
89 oraz uruchamiania izolowanych aplikacji, takich jak bash czy sshd.
92 Summary: Header files for lxc library
93 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki lxc
94 Group: Development/Libraries
95 Requires: %{name} = %{version}-%{release}
98 Header files for lxc library.
100 %description devel -l pl.UTF-8
101 Pliki nagłówkowe biblioteki lxc.
104 Summary: Lua binding for LXC
105 Summary(pl.UTF-8): Wiązanie Lua do LXC
107 Requires: %{name} = %{version}-%{release}
108 Requires: lua51-libs >= 5.1
110 %description -n lua-lxc
113 %description -n lua-lxc -l pl.UTF-8
116 %package -n python3-lxc
117 Summary: Python (3.x) binding for LXC
118 Summary(pl.UTF-8): Wiązanie Pythona (3.x) do LXC
120 Requires: %{name} = %{version}-%{release}
121 Requires: python3-libs >= 3.2
122 Requires: python3-modules
124 %description -n python3-lxc
125 Python (3.x) binding for LXC.
127 %description -n python3-lxc -l pl.UTF-8
128 Wiązanie Pythona (3.x) do LXC.
130 %package -n bash-completion-%{name}
131 Summary: bash-completion for LXC
132 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC
133 Group: Applications/Shells
135 Requires: bash-completion
137 %description -n bash-completion-%{name}
138 bash-completion for LXC.
140 %description -n bash-completion-%{name} -l pl.UTF-8
141 bashowe uzupełnianie nazw dla LXC.
149 cp -p %{SOURCE1} templates/lxc-pld.in
152 %{__aclocal} -I config
157 db2xman=docbook2X2man \
162 %{__enable_disable apparmor} \
163 %{__enable_disable cgmanager} \
164 %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \
165 %{__enable_disable python} \
166 %{__enable_disable seccomp} \
167 %{__enable_disable selinux} \
168 --with-config-path=%{configpath} \
169 --with-init-script=sysvinit,systemd \
170 --with-runtime-path=/var/run \
177 rm -rf $RPM_BUILD_ROOT
178 install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \
179 -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
182 SYSTEMD_UNIT_DIR=%{systemdunitdir} \
183 pcdatadir=%{_pkgconfigdir} \
184 DESTDIR=$RPM_BUILD_ROOT
186 %{__make} -C doc install \
187 DESTDIR=$RPM_BUILD_ROOT
189 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
191 # apparmor profiles are not packaged, remove to avoid packagers confusion
192 %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d
194 # yum plugin, no idea where to package this
195 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py
197 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan
198 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/%{name}/lxc_macvlan
202 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
203 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
206 %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top
210 rm -rf $RPM_BUILD_ROOT
214 /sbin/chkconfig --add lxc
215 /sbin/chkconfig --add lxc-net
216 %systemd_post lxc.service lxc-net.service
219 if [ "$1" = "0" ]; then
221 /sbin/chkconfig --del lxc
222 %service lxc-net stop
223 /sbin/chkconfig --del lxc-net
225 %systemd_preun lxc.service lxc-net.service
232 %defattr(644,root,root,755)
233 %doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf
234 %attr(755,root,root) %{_bindir}/lxc-attach
235 %attr(755,root,root) %{_bindir}/lxc-autostart
236 %attr(755,root,root) %{_bindir}/lxc-cgroup
237 %attr(755,root,root) %{_bindir}/lxc-checkconfig
238 %attr(755,root,root) %{_bindir}/lxc-checkpoint
239 %attr(755,root,root) %{_bindir}/lxc-clone
240 %attr(755,root,root) %{_bindir}/lxc-config
241 %attr(755,root,root) %{_bindir}/lxc-console
242 %attr(755,root,root) %{_bindir}/lxc-create
243 %attr(755,root,root) %{_bindir}/lxc-destroy
244 %attr(755,root,root) %{_bindir}/lxc-execute
245 %attr(755,root,root) %{_bindir}/lxc-freeze
246 %attr(755,root,root) %{_bindir}/lxc-info
247 %attr(755,root,root) %{_bindir}/lxc-monitor
248 %attr(755,root,root) %{_bindir}/lxc-snapshot
249 %attr(755,root,root) %{_bindir}/lxc-start
250 %attr(755,root,root) %{_bindir}/lxc-stop
251 %attr(755,root,root) %{_bindir}/lxc-unfreeze
252 %attr(755,root,root) %{_bindir}/lxc-unshare
253 %attr(755,root,root) %{_bindir}/lxc-usernsexec
254 %attr(755,root,root) %{_bindir}/lxc-wait
255 %attr(755,root,root) %{_sbindir}/init.lxc
256 %attr(755,root,root) %{_libdir}/liblxc.so.*.*.*
257 %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1
258 %attr(754,root,root) /etc/rc.d/init.d/lxc
259 %attr(754,root,root) /etc/rc.d/init.d/lxc-net
261 %{systemdunitdir}/lxc.service
262 %{systemdunitdir}/lxc-net.service
263 %dir %{_libdir}/%{name}
264 %dir %{_libdir}/%{name}/rootfs
265 %{_libdir}/%{name}/rootfs/README
266 %attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load
267 %attr(755,root,root) %{_libdir}/%{name}/lxc-containers
268 %attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup
269 %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord
270 %attr(755,root,root) %{_libdir}/%{name}/lxc-net
271 %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic
272 %attr(755,root,root) %{_libdir}/%{name}/lxc_macvlan
273 %dir %{_sysconfdir}/lxc
274 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan
275 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc
276 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf
277 %dir %{_datadir}/%{name}
278 %{_datadir}/%{name}/lxc.functions
279 # below has been removed in lxc-1.1.3
280 #%attr(755,root,root) %{_datadir}/%{name}/lxc-restore-net
281 %dir %{_datadir}/%{name}/config
282 %{_datadir}/%{name}/config/archlinux.*.conf
283 %{_datadir}/%{name}/config/centos.*.conf
284 %{_datadir}/%{name}/config/common.conf
285 %dir %{_datadir}/%{name}/config/common.conf.d
286 %{_datadir}/%{name}/config/common.conf.d/README
287 %{_datadir}/%{name}/config/common.seccomp
288 %{_datadir}/%{name}/config/debian.*.conf
289 %{_datadir}/%{name}/config/fedora.*.conf
290 %{_datadir}/%{name}/config/gentoo.*.conf
291 %{_datadir}/%{name}/config/opensuse.*.conf
292 %{_datadir}/%{name}/config/openwrt.*.conf
293 %{_datadir}/%{name}/config/oracle.*.conf
294 %{_datadir}/%{name}/config/plamo.*.conf
295 %{_datadir}/%{name}/config/ubuntu-cloud.*.conf
296 %{_datadir}/%{name}/config/ubuntu.*.conf
297 %{_datadir}/%{name}/config/userns.conf
298 %dir %{_datadir}/%{name}/hooks
299 %dir %{_datadir}/%{name}/selinux
300 %{_datadir}/%{name}/selinux/*
301 %dir %{_datadir}/%{name}/templates
302 %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname
303 %attr(755,root,root) %{_datadir}/%{name}/hooks/mount*
304 %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client
305 %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep
306 %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-*
307 %{_mandir}/man1/lxc-attach.1*
308 %{_mandir}/man1/lxc-autostart.1*
309 %{_mandir}/man1/lxc-cgroup.1*
310 %{_mandir}/man1/lxc-checkconfig.1*
311 %{_mandir}/man1/lxc-checkpoint.1*
312 %{_mandir}/man1/lxc-clone.1*
313 %{_mandir}/man1/lxc-config.1*
314 %{_mandir}/man1/lxc-console.1*
315 %{_mandir}/man1/lxc-create.1*
316 %{_mandir}/man1/lxc-destroy.1*
317 %{_mandir}/man1/lxc-execute.1*
318 %{_mandir}/man1/lxc-freeze.1*
319 %{_mandir}/man1/lxc-info.1*
320 %{_mandir}/man1/lxc-monitor.1*
321 %{_mandir}/man1/lxc-snapshot.1*
322 %{_mandir}/man1/lxc-start.1*
323 %{_mandir}/man1/lxc-stop.1*
324 %{_mandir}/man1/lxc-unfreeze.1*
325 %{_mandir}/man1/lxc-unshare.1*
326 %{_mandir}/man1/lxc-user-nic.1*
327 %{_mandir}/man1/lxc-usernsexec.1*
328 %{_mandir}/man1/lxc-wait.1*
329 %{_mandir}/man5/lxc-usernet.5*
330 %{_mandir}/man5/lxc.conf.5*
331 %{_mandir}/man5/lxc.container.conf.5*
332 %{_mandir}/man5/lxc.system.conf.5*
333 %{_mandir}/man7/lxc.7*
334 %lang(ja) %{_mandir}/ja/man1/lxc*.1*
335 %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5*
336 %lang(ja) %{_mandir}/ja/man5/lxc.conf.5*
337 %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5*
338 %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5*
339 %lang(ja) %{_mandir}/ja/man7/lxc.7*
340 %exclude %{_mandir}/ja/man1/lxc-device.1*
341 %exclude %{_mandir}/ja/man1/lxc-ls.1*
342 %exclude %{_mandir}/ja/man1/lxc-start-ephemeral.1*
343 %exclude %{_mandir}/ja/man1/lxc-top.1*
346 %if %{without python}
348 %attr(755,root,root) %{_bindir}/lxc-ls
349 %{_mandir}/man1/lxc-ls.1*
353 %dir %{configpath}snap
354 %dir %attr(750,root,root) /var/log/lxc
355 %dir %attr(750,root,root) /var/cache/lxc
358 %defattr(644,root,root,755)
359 %attr(755,root,root) %{_libdir}/liblxc.so
361 %{_pkgconfigdir}/lxc.pc
365 %defattr(644,root,root,755)
366 %attr(755,root,root) %{_bindir}/lxc-top
367 %dir %{_libdir}/lua/lxc
368 %attr(755,root,root) %{_libdir}/lua/lxc/core.so
369 %{_datadir}/lua/lxc.lua
370 %{_mandir}/man1/lxc-top.1*
371 %lang(ja) %{_mandir}/ja/man1/lxc-top.1*
375 %files -n python3-lxc
376 %defattr(644,root,root,755)
377 %attr(755,root,root) %{_bindir}/lxc-device
378 %attr(755,root,root) %{_bindir}/lxc-ls
379 %attr(755,root,root) %{_bindir}/lxc-start-ephemeral
381 %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so
382 %{py3_sitedir}/_lxc-0.1-py*.egg-info
383 %{_mandir}/man1/lxc-device.1*
384 %{_mandir}/man1/lxc-ls.1*
385 %{_mandir}/man1/lxc-start-ephemeral.1*
386 %lang(ja) %{_mandir}/ja/man1/lxc-device.1*
387 %lang(ja) %{_mandir}/ja/man1/lxc-ls.1*
388 %lang(ja) %{_mandir}/ja/man1/lxc-start-ephemeral.1*
391 %files -n bash-completion-%{name}
392 %defattr(644,root,root,755)
393 /etc/bash_completion.d/lxc