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: rc-scripts >= 0.4.6
50 Requires: dnsmasq # used in lxc-net script
51 Requires: gawk # lxc_macvlan script
52 Requires: iptables # used in lxc-net script to set bridge nat
55 Requires: systemd-units >= 38
56 Requires(post,preun): /sbin/chkconfig
57 Requires(post): /sbin/ldconfig
59 Suggests: gnupg-plugin-keys_curl
60 Suggests: gnupg-plugin-keys_hkp
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 %define configpath /var/lib/lxc
69 Tools to create and manage containers. It contains a full featured
70 container with the isolation / virtualization of the pids, the ipc,
71 the utsname, the mount points, /proc, /sys, the network and it takes
72 into account the control groups. It is very light, flexible, and
73 provides a set of tools around the container like the monitoring with
74 asynchronous events notification, or the freeze of the container. This
75 package is useful to create Virtual Private Server, or to run isolated
76 applications like bash or sshd.
78 %description -l pl.UTF-8
79 Narzędzia do tworzenia i zarządzania kontenerami. System ten obejmuje
80 w pełni funkcjonalne kontenery z izolacją/wirtualizacją pidów, ipc,
81 utsname, punktów montowania, /proc, /sys, sieci oraz uwzględniające
82 grupy kontrolne. Jest bardzo lekki, elastyczny i udostępnia narzędzia
83 do czynności związanych z kontenerami, takich jak monitorowanie z
84 asynchronicznym powiadamianiem o zdarzeniach czy zamrażanie. Ten
85 pakiet jest przydatny do tworzenia wirtualnych serwerów prywatnych
86 oraz uruchamiania izolowanych aplikacji, takich jak bash czy sshd.
89 Summary: Header files for lxc library
90 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki lxc
91 Group: Development/Libraries
92 Requires: %{name} = %{version}-%{release}
95 Header files for lxc library.
97 %description devel -l pl.UTF-8
98 Pliki nagłówkowe biblioteki lxc.
101 Summary: Lua binding for LXC
102 Summary(pl.UTF-8): Wiązanie Lua do LXC
104 Requires: %{name} = %{version}-%{release}
105 Requires: lua51-libs >= 5.1
107 %description -n lua-lxc
110 %description -n lua-lxc -l pl.UTF-8
113 %package -n python3-lxc
114 Summary: Python (3.x) binding for LXC
115 Summary(pl.UTF-8): Wiązanie Pythona (3.x) do LXC
117 Requires: %{name} = %{version}-%{release}
118 Requires: python3-libs >= 3.2
119 Requires: python3-modules
121 %description -n python3-lxc
122 Python (3.x) binding for LXC.
124 %description -n python3-lxc -l pl.UTF-8
125 Wiązanie Pythona (3.x) do LXC.
127 %package -n bash-completion-%{name}
128 Summary: bash-completion for LXC
129 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC
130 Group: Applications/Shells
132 Requires: bash-completion
134 %description -n bash-completion-%{name}
135 bash-completion for LXC.
137 %description -n bash-completion-%{name} -l pl.UTF-8
138 bashowe uzupełnianie nazw dla LXC.
146 cp -p %{SOURCE1} templates/lxc-pld.in
149 %{__aclocal} -I config
154 db2xman=docbook2X2man \
159 %{__enable_disable apparmor} \
160 %{__enable_disable cgmanager} \
161 %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \
162 %{__enable_disable python} \
163 %{__enable_disable seccomp} \
164 %{__enable_disable selinux} \
165 --with-config-path=%{configpath} \
166 --with-init-script=sysvinit,systemd \
167 --with-runtime-path=/var/run \
174 rm -rf $RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \
176 -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
179 SYSTEMD_UNIT_DIR=%{systemdunitdir} \
180 pcdatadir=%{_pkgconfigdir} \
181 DESTDIR=$RPM_BUILD_ROOT
183 %{__make} -C doc install \
184 DESTDIR=$RPM_BUILD_ROOT
186 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
188 # apparmor profiles are not packaged, remove to avoid packagers confusion
189 %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d
191 # yum plugin, no idea where to package this
192 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py
194 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan
195 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/%{name}/lxc_macvlan
199 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
200 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
203 %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top
207 rm -rf $RPM_BUILD_ROOT
211 /sbin/chkconfig --add lxc
212 /sbin/chkconfig --add lxc-net
213 %systemd_post lxc.service lxc-net.service
216 if [ "$1" = "0" ]; then
218 /sbin/chkconfig --del lxc
219 %service lxc-net stop
220 /sbin/chkconfig --del lxc-net
222 %systemd_preun lxc.service lxc-net.service
229 %defattr(644,root,root,755)
230 %doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf
231 %attr(755,root,root) %{_bindir}/lxc-attach
232 %attr(755,root,root) %{_bindir}/lxc-autostart
233 %attr(755,root,root) %{_bindir}/lxc-cgroup
234 %attr(755,root,root) %{_bindir}/lxc-checkconfig
235 %attr(755,root,root) %{_bindir}/lxc-checkpoint
236 %attr(755,root,root) %{_bindir}/lxc-clone
237 %attr(755,root,root) %{_bindir}/lxc-config
238 %attr(755,root,root) %{_bindir}/lxc-console
239 %attr(755,root,root) %{_bindir}/lxc-create
240 %attr(755,root,root) %{_bindir}/lxc-destroy
241 %attr(755,root,root) %{_bindir}/lxc-execute
242 %attr(755,root,root) %{_bindir}/lxc-freeze
243 %attr(755,root,root) %{_bindir}/lxc-info
244 %attr(755,root,root) %{_bindir}/lxc-monitor
245 %attr(755,root,root) %{_bindir}/lxc-snapshot
246 %attr(755,root,root) %{_bindir}/lxc-start
247 %attr(755,root,root) %{_bindir}/lxc-stop
248 %attr(755,root,root) %{_bindir}/lxc-unfreeze
249 %attr(755,root,root) %{_bindir}/lxc-unshare
250 %attr(755,root,root) %{_bindir}/lxc-usernsexec
251 %attr(755,root,root) %{_bindir}/lxc-wait
252 %attr(755,root,root) %{_sbindir}/init.lxc
253 %attr(755,root,root) %{_libdir}/liblxc.so.*.*.*
254 %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1
255 %attr(754,root,root) /etc/rc.d/init.d/lxc
256 %attr(754,root,root) /etc/rc.d/init.d/lxc-net
258 %{systemdunitdir}/lxc.service
259 %{systemdunitdir}/lxc-net.service
260 %dir %{_libdir}/%{name}
261 %dir %{_libdir}/%{name}/rootfs
262 %{_libdir}/%{name}/rootfs/README
263 %attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load
264 %attr(755,root,root) %{_libdir}/%{name}/lxc-containers
265 %attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup
266 %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord
267 %attr(755,root,root) %{_libdir}/%{name}/lxc-net
268 %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic
269 %attr(755,root,root) %{_libdir}/%{name}/lxc_macvlan
270 %dir %{_sysconfdir}/lxc
271 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan
272 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc
273 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf
274 %dir %{_datadir}/%{name}
275 %{_datadir}/%{name}/lxc.functions
276 # below has been removed in lxc-1.1.3
277 #%attr(755,root,root) %{_datadir}/%{name}/lxc-restore-net
278 %dir %{_datadir}/%{name}/config
279 %{_datadir}/%{name}/config/archlinux.*.conf
280 %{_datadir}/%{name}/config/centos.*.conf
281 %{_datadir}/%{name}/config/common.conf
282 %dir %{_datadir}/%{name}/config/common.conf.d
283 %{_datadir}/%{name}/config/common.conf.d/README
284 %{_datadir}/%{name}/config/common.seccomp
285 %{_datadir}/%{name}/config/debian.*.conf
286 %{_datadir}/%{name}/config/fedora.*.conf
287 %{_datadir}/%{name}/config/gentoo.*.conf
288 %{_datadir}/%{name}/config/opensuse.*.conf
289 %{_datadir}/%{name}/config/openwrt.*.conf
290 %{_datadir}/%{name}/config/oracle.*.conf
291 %{_datadir}/%{name}/config/plamo.*.conf
292 %{_datadir}/%{name}/config/ubuntu-cloud.*.conf
293 %{_datadir}/%{name}/config/ubuntu.*.conf
294 %{_datadir}/%{name}/config/userns.conf
295 %dir %{_datadir}/%{name}/hooks
296 %dir %{_datadir}/%{name}/selinux
297 %{_datadir}/%{name}/selinux/*
298 %dir %{_datadir}/%{name}/templates
299 %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname
300 %attr(755,root,root) %{_datadir}/%{name}/hooks/mount*
301 %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client
302 %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep
303 %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-*
304 %{_mandir}/man1/lxc-attach.1*
305 %{_mandir}/man1/lxc-autostart.1*
306 %{_mandir}/man1/lxc-cgroup.1*
307 %{_mandir}/man1/lxc-checkconfig.1*
308 %{_mandir}/man1/lxc-checkpoint.1*
309 %{_mandir}/man1/lxc-clone.1*
310 %{_mandir}/man1/lxc-config.1*
311 %{_mandir}/man1/lxc-console.1*
312 %{_mandir}/man1/lxc-create.1*
313 %{_mandir}/man1/lxc-destroy.1*
314 %{_mandir}/man1/lxc-execute.1*
315 %{_mandir}/man1/lxc-freeze.1*
316 %{_mandir}/man1/lxc-info.1*
317 %{_mandir}/man1/lxc-monitor.1*
318 %{_mandir}/man1/lxc-snapshot.1*
319 %{_mandir}/man1/lxc-start.1*
320 %{_mandir}/man1/lxc-stop.1*
321 %{_mandir}/man1/lxc-unfreeze.1*
322 %{_mandir}/man1/lxc-unshare.1*
323 %{_mandir}/man1/lxc-user-nic.1*
324 %{_mandir}/man1/lxc-usernsexec.1*
325 %{_mandir}/man1/lxc-wait.1*
326 %{_mandir}/man5/lxc-usernet.5*
327 %{_mandir}/man5/lxc.conf.5*
328 %{_mandir}/man5/lxc.container.conf.5*
329 %{_mandir}/man5/lxc.system.conf.5*
330 %{_mandir}/man7/lxc.7*
331 %lang(ja) %{_mandir}/ja/man1/lxc*.1*
332 %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5*
333 %lang(ja) %{_mandir}/ja/man5/lxc.conf.5*
334 %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5*
335 %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5*
336 %lang(ja) %{_mandir}/ja/man7/lxc.7*
337 %exclude %{_mandir}/ja/man1/lxc-device.1*
338 %exclude %{_mandir}/ja/man1/lxc-ls.1*
339 %exclude %{_mandir}/ja/man1/lxc-start-ephemeral.1*
340 %exclude %{_mandir}/ja/man1/lxc-top.1*
343 %if %{without python}
345 %attr(755,root,root) %{_bindir}/lxc-ls
346 %{_mandir}/man1/lxc-ls.1*
350 %dir %{configpath}snap
351 %dir %attr(750,root,root) /var/log/lxc
352 %dir %attr(750,root,root) /var/cache/lxc
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_libdir}/liblxc.so
358 %{_pkgconfigdir}/lxc.pc
362 %defattr(644,root,root,755)
363 %attr(755,root,root) %{_bindir}/lxc-top
364 %dir %{_libdir}/lua/lxc
365 %attr(755,root,root) %{_libdir}/lua/lxc/core.so
366 %{_datadir}/lua/lxc.lua
367 %{_mandir}/man1/lxc-top.1*
368 %lang(ja) %{_mandir}/ja/man1/lxc-top.1*
372 %files -n python3-lxc
373 %defattr(644,root,root,755)
374 %attr(755,root,root) %{_bindir}/lxc-device
375 %attr(755,root,root) %{_bindir}/lxc-ls
376 %attr(755,root,root) %{_bindir}/lxc-start-ephemeral
378 %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so
379 %{py3_sitedir}/_lxc-0.1-py*.egg-info
380 %{_mandir}/man1/lxc-device.1*
381 %{_mandir}/man1/lxc-ls.1*
382 %{_mandir}/man1/lxc-start-ephemeral.1*
383 %lang(ja) %{_mandir}/ja/man1/lxc-device.1*
384 %lang(ja) %{_mandir}/ja/man1/lxc-ls.1*
385 %lang(ja) %{_mandir}/ja/man1/lxc-start-ephemeral.1*
388 %files -n bash-completion-%{name}
389 %defattr(644,root,root,755)
390 /etc/bash_completion.d/lxc