X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=lxc.spec;h=9dc9149e75726fa9fb2132eea760aa941ae85864;hb=ef5bd4a472a864105ef770c2b881f89cdd0e0423;hp=89ee268c103b1e12d3fd9e50e129dd3ebbe5ef47;hpb=67c70229b1b693a7567ac34c397c1ddea62f8e87;p=packages%2Flxc.git diff --git a/lxc.spec b/lxc.spec index 89ee268..9dc9149 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,34 +1,51 @@ -# TODO: move lua/python-dependent utils to lya-/python- -# +# TODO +# - package apparmor stuff + # Conditional build: %bcond_without seccomp # SecComp syscall filter +%bcond_without apparmor # apparmor %bcond_without lua # Lua binding %bcond_without python # Python binding -# -Summary: Linux Container Tools +%bcond_with selinux # SELinux +%bcond_with cgmanager # Enable cgmanager (BR: libcgmanager, libnih >= 1.0.2, libnih-dbus >= 1.0.0, dbus-1 >= 1.2.16) + +Summary: Linux Containers userspace tools Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC) Name: lxc -Version: 0.9.0 -Release: 1 -License: GPL +Version: 1.0.5 +Release: 3 +License: LGPL v2.1+ Group: Applications/System -Source0: http://lxc.sourceforge.net/download/lxc/%{name}-%{version}.tar.gz -# Source0-md5: 8552a4479090616f4bc04d8473765fc9 -Patch0: %{name}-devpts.patch +Source0: https://www.linuxcontainers.org/downloads/%{name}-%{version}.tar.gz +# Source0-md5: 9d9af9e9e69a831cd50b58d91c786013 +Source1: %{name}-pld.in.sh +Source2: %{name}.init Patch1: %{name}-pld.patch -URL: http://lxc.sourceforge.net/ +URL: https://www.linuxcontainers.org/ BuildRequires: autoconf >= 2.50 BuildRequires: automake -BuildRequires: docbook2X BuildRequires: docbook-dtd30-sgml BuildRequires: docbook-utils -BuildRequires: libapparmor-devel +BuildRequires: docbook2X +BuildRequires: gnutls-devel +%{?with_apparmor:BuildRequires: libapparmor-devel} BuildRequires: libcap-devel %{?with_seccomp:BuildRequires: libseccomp-devel} +BuildRequires: libxslt-progs %{?with_lua:BuildRequires: lua51-devel >= 5.1} BuildRequires: pkgconfig %{?with_python:BuildRequires: python3-devel >= 3.2} +BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.612 +BuildRequires: sed >= 4.0 +Requires: rc-scripts >= 0.4.6 +Requires: which +Suggests: gnupg +Suggests: gnupg-plugin-keys_curl +Suggests: gnupg-plugin-keys_hkp +Suggests: net-tools +Suggests: python3-lxc +Suggests: rsync BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define configpath /var/lib/lxc @@ -84,6 +101,7 @@ Summary(pl.UTF-8): Wiązanie Pythona (3.x) do LXC Group: Libraries Requires: %{name} = %{version}-%{release} Requires: python3-libs >= 3.2 +Requires: python3-modules %description -n python3-lxc Python (3.x) binding for LXC. @@ -91,11 +109,25 @@ Python (3.x) binding for LXC. %description -n python3-lxc -l pl.UTF-8 Wiązanie Pythona (3.x) do LXC. +%package -n bash-completion-%{name} +Summary: bash-completion for LXC +Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC +Group: Applications/Shells +Requires: %{name} +Requires: bash-completion + +%description -n bash-completion-%{name} +bash-completion for LXC. + +%description -n bash-completion-%{name} -l pl.UTF-8 +bashowe uzupełnianie nazw dla LXC. + %prep %setup -q -%patch0 -p1 %patch1 -p1 +cp -p %{SOURCE1} templates/lxc-pld.in + %build %{__aclocal} -I config %{__autoconf} @@ -104,11 +136,17 @@ Wiązanie Pythona (3.x) do LXC. %configure \ db2xman=docbook2X2man \ --disable-rpath \ + --enable-bash \ --enable-doc \ - %{?with_lua:--enable-lua} \ - %{?with_python:--enable-python} \ - %{?with_seccomp:--enable-seccomp} \ + --enable-examples \ + %{__enable_disable apparmor} \ + %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \ + %{__enable_disable python} \ + %{__enable_disable seccomp} \ + %{__enable_disable selinux} \ --with-config-path=%{configpath} \ + --with-init-script=sysvinit,systemd \ + --with-runtime-path=/var/run \ --with-distro=pld %{__make} @@ -116,22 +154,35 @@ Wiązanie Pythona (3.x) do LXC. %install rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \ + -d $RPM_BUILD_ROOT/etc/rc.d/init.d + %{__make} install \ - DESTDIR=$RPM_BUILD_ROOT \ - pcdatadir=%{_pkgconfigdir} + SYSTEMD_UNIT_DIR=%{systemdunitdir} \ + pcdatadir=%{_pkgconfigdir} \ + DESTDIR=$RPM_BUILD_ROOT %{__make} -C doc install \ DESTDIR=$RPM_BUILD_ROOT -%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/doc +%{__rm} -r $RPM_BUILD_ROOT%{_docdir} + +# apparmor profiles are not packaged, remove to avoid packagers confusion +%{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d -install -d $RPM_BUILD_ROOT%{configpath} +# yum plugin, no idea where to package this +%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py + +install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc %if %{with python} %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc %endif +%if %{with lua} +%{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top +%endif %clean rm -rf $RPM_BUILD_ROOT @@ -141,21 +192,108 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc AUTHORS ChangeLog CONTRIBUTING MAINTAINERS README TODO doc/FAQ.txt doc/examples/*.conf -%attr(755,root,root) %{_bindir}/lxc-* +%doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf +%attr(755,root,root) %{_bindir}/lxc-attach +%attr(755,root,root) %{_bindir}/lxc-autostart +%attr(755,root,root) %{_bindir}/lxc-cgroup +%attr(755,root,root) %{_bindir}/lxc-checkconfig +%attr(755,root,root) %{_bindir}/lxc-clone +%attr(755,root,root) %{_bindir}/lxc-config +%attr(755,root,root) %{_bindir}/lxc-console +%attr(755,root,root) %{_bindir}/lxc-create +%attr(755,root,root) %{_bindir}/lxc-destroy +%attr(755,root,root) %{_bindir}/lxc-execute +%attr(755,root,root) %{_bindir}/lxc-freeze +%attr(755,root,root) %{_bindir}/lxc-info +%attr(755,root,root) %{_bindir}/lxc-monitor +%attr(755,root,root) %{_bindir}/lxc-snapshot +%attr(755,root,root) %{_bindir}/lxc-start +%attr(755,root,root) %{_bindir}/lxc-stop +%attr(755,root,root) %{_bindir}/lxc-unfreeze +%attr(755,root,root) %{_bindir}/lxc-unshare +%attr(755,root,root) %{_bindir}/lxc-usernsexec +%attr(755,root,root) %{_bindir}/lxc-wait +%attr(755,root,root) %{_sbindir}/init.lxc %attr(755,root,root) %{_libdir}/liblxc.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/liblxc.so.0 -%dir %{configpath} -%dir %{_libdir}/lxc -%dir %{_libdir}/lxc/rootfs -%{_libdir}/lxc/rootfs/README -%attr(755,root,root) %{_libdir}/lxc/lxc-init +%attr(755,root,root) %ghost %{_libdir}/liblxc.so.1 +%attr(754,root,root) /etc/rc.d/init.d/lxc +%{systemdunitdir}/lxc.service +%dir %{_libdir}/%{name} +%dir %{_libdir}/%{name}/rootfs +%{_libdir}/%{name}/rootfs/README +%attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup +%attr(755,root,root) %{_libdir}/%{name}/lxc-monitord +%attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic +%attr(755,root,root) %{_libdir}/%{name}/lxc-autostart-helper %dir %{_sysconfdir}/lxc %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf -%{_datadir}/lxc -%{_mandir}/man1/lxc-*.1* +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/lxc.functions +%dir %{_datadir}/%{name}/config +%{_datadir}/%{name}/config/centos.*.conf +%{_datadir}/%{name}/config/common.seccomp +%{_datadir}/%{name}/config/debian.*.conf +%{_datadir}/%{name}/config/fedora.*.conf +%{_datadir}/%{name}/config/gentoo.*.conf +%{_datadir}/%{name}/config/oracle.*.conf +%{_datadir}/%{name}/config/plamo.*.conf +%{_datadir}/%{name}/config/ubuntu-cloud.*.conf +%{_datadir}/%{name}/config/ubuntu.*.conf +%dir %{_datadir}/%{name}/hooks +%dir %{_datadir}/%{name}/templates +%attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname +%attr(755,root,root) %{_datadir}/%{name}/hooks/mount* +%attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client +%attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep +%attr(755,root,root) %{_datadir}/%{name}/templates/lxc-* +%{_mandir}/man1/lxc-attach.1* +%{_mandir}/man1/lxc-autostart.1* +%{_mandir}/man1/lxc-cgroup.1* +%{_mandir}/man1/lxc-checkconfig.1* +%{_mandir}/man1/lxc-clone.1* +%{_mandir}/man1/lxc-config.1* +%{_mandir}/man1/lxc-console.1* +%{_mandir}/man1/lxc-create.1* +%{_mandir}/man1/lxc-destroy.1* +%{_mandir}/man1/lxc-execute.1* +%{_mandir}/man1/lxc-freeze.1* +%{_mandir}/man1/lxc-info.1* +%{_mandir}/man1/lxc-monitor.1* +%{_mandir}/man1/lxc-snapshot.1* +%{_mandir}/man1/lxc-start.1* +%{_mandir}/man1/lxc-stop.1* +%{_mandir}/man1/lxc-unfreeze.1* +%{_mandir}/man1/lxc-unshare.1* +%{_mandir}/man1/lxc-user-nic.1* +%{_mandir}/man1/lxc-usernsexec.1* +%{_mandir}/man1/lxc-wait.1* +%{_mandir}/man5/lxc-usernet.5* %{_mandir}/man5/lxc.conf.5* +%{_mandir}/man5/lxc.container.conf.5* +%{_mandir}/man5/lxc.system.conf.5* %{_mandir}/man7/lxc.7* +%lang(ja) %{_mandir}/ja/man1/lxc*.1* +%lang(ja) %{_mandir}/ja/man5/lxc-usernet.5* +%lang(ja) %{_mandir}/ja/man5/lxc.conf.5* +%lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5* +%lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5* +%lang(ja) %{_mandir}/ja/man7/lxc.7* +%exclude %{_mandir}/ja/man1/lxc-device.1* +%exclude %{_mandir}/ja/man1/lxc-ls.1* +%exclude %{_mandir}/ja/man1/lxc-start-ephemeral.1* +%exclude %{_mandir}/ja/man1/lxc-top.1* + + +%if %{without python} +# legacy version +%attr(755,root,root) %{_bindir}/lxc-ls +%{_mandir}/man1/lxc-ls.1* +%endif + +%dir %{configpath} +%dir %{configpath}snap +%dir %attr(750,root,root) /var/log/lxc +%dir %attr(750,root,root) /var/cache/lxc %files devel %defattr(644,root,root,755) @@ -166,15 +304,31 @@ rm -rf $RPM_BUILD_ROOT %if %{with lua} %files -n lua-lxc %defattr(644,root,root,755) -%dir %{_libdir}/lua/5.1/lxc -%attr(755,root,root) %{_libdir}/lua/5.1/lxc/core.so -%{_datadir}/lua/5.1/lxc.lua +%attr(755,root,root) %{_bindir}/lxc-top +%dir %{_libdir}/lua/lxc +%attr(755,root,root) %{_libdir}/lua/lxc/core.so +%{_datadir}/lua/lxc.lua +%{_mandir}/man1/lxc-top.1* +%lang(ja) %{_mandir}/ja/man1/lxc-top.1* %endif %if %{with python} %files -n python3-lxc %defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/lxc-device +%attr(755,root,root) %{_bindir}/lxc-ls +%attr(755,root,root) %{_bindir}/lxc-start-ephemeral %{py3_sitedir}/lxc %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so %{py3_sitedir}/_lxc-0.1-py*.egg-info +%{_mandir}/man1/lxc-device.1* +%{_mandir}/man1/lxc-ls.1* +%{_mandir}/man1/lxc-start-ephemeral.1* +%lang(ja) %{_mandir}/ja/man1/lxc-device.1* +%lang(ja) %{_mandir}/ja/man1/lxc-ls.1* +%lang(ja) %{_mandir}/ja/man1/lxc-start-ephemeral.1* %endif + +%files -n bash-completion-%{name} +%defattr(644,root,root,755) +/etc/bash_completion.d/lxc