X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=lxc.spec;h=ffbd69d4ad98ae8f573e65c35569275c22679dfa;hb=5e7929a20b5647a54b6d6ef06038098198a35fb7;hp=baf547967509974d8193dfefbdf32596ef13ee21;hpb=1e436f204ab431a33c96c91a49d6d4f3c856ccc0;p=packages%2Flxc.git diff --git a/lxc.spec b/lxc.spec index baf5479..ffbd69d 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,5 +1,5 @@ # TODO -# - bash-completion: /etc/bash_completion.d/lxc +# - what to do lxc_macvlan.init, when upstream provided lxc-net.init? # - package apparmor stuff # Conditional build: @@ -13,15 +13,18 @@ Summary: Linux Containers userspace tools Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC) Name: lxc -Version: 1.0.0 -Release: 0.2 +Version: 1.1.1 +Release: 0.1 License: LGPL v2.1+ Group: Applications/System -Source0: http://linuxcontainers.org/downloads/%{name}-%{version}.tar.gz -# Source0-md5: 87a9d168a6e55326303cce3b2cb7f82e +Source0: https://www.linuxcontainers.org/downloads/%{name}-%{version}.tar.gz +# Source0-md5: d80cb08f0edf36f0887e32c96aec8c13 Source1: %{name}-pld.in.sh -Patch1: %{name}-pld.patch -URL: http://linuxcontainers.org/ +Source2: %{name}_macvlan.init +Source3: %{name}_macvlan.sysconfig +Patch0: %{name}-pld.patch +Patch1: x32.patch +URL: https://www.linuxcontainers.org/ BuildRequires: autoconf >= 2.50 BuildRequires: automake BuildRequires: docbook-dtd30-sgml @@ -31,14 +34,24 @@ 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: rpmbuild(macros) >= 1.612 +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.671 BuildRequires: sed >= 4.0 Requires: rc-scripts >= 0.4.6 Requires: which +Requires: iproute2 +Requires: systemd-units >= 38 +Requires(post,preun): /sbin/chkconfig +Requires(post): /sbin/ldconfig +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) @@ -103,8 +116,22 @@ 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 @@ -135,7 +162,9 @@ cp -p %{SOURCE1} templates/lxc-pld.in %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{configpath},/var/{cache,log}/lxc} +install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \ + -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} + %{__make} install \ SYSTEMD_UNIT_DIR=%{systemdunitdir} \ pcdatadir=%{_pkgconfigdir} \ @@ -146,27 +175,56 @@ install -d $RPM_BUILD_ROOT{%{configpath},/var/{cache,log}/lxc} %{__rm} -r $RPM_BUILD_ROOT%{_docdir} +# apparmor profiles are not packaged, remove to avoid packagers confusion +%{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d + +# 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_macvlan +install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan + %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/lua51,' $RPM_BUILD_ROOT%{_bindir}/lxc-top +%{__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 -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%post +/sbin/ldconfig +/sbin/chkconfig --add lxc +/sbin/chkconfig --add lxc-net +/sbin/chkconfig --add lxc_macvlan +%systemd_post lxc.service lxc-net.service + +%preun +if [ "$1" = "0" ]; then + %service lxc stop + /sbin/chkconfig --del lxc + %service lxc-net stop + /sbin/chkconfig --del lxc-net + %service lxc_macvlan stop + /sbin/chkconfig --del lxc_macvlan +fi +%systemd_preun lxc.service lxc-net.service + +%postun +/sbin/ldconfig +%systemd_reload %files %defattr(644,root,root,755) -%doc AUTHORS CONTRIBUTING MAINTAINERS README TODO doc/FAQ.txt doc/examples/*.conf +%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-checkpoint %attr(755,root,root) %{_bindir}/lxc-clone %attr(755,root,root) %{_bindir}/lxc-config %attr(755,root,root) %{_bindir}/lxc-console @@ -183,31 +241,51 @@ rm -rf $RPM_BUILD_ROOT %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.1 %attr(754,root,root) /etc/rc.d/init.d/lxc +%attr(754,root,root) /etc/rc.d/init.d/lxc-net +%attr(754,root,root) /etc/rc.d/init.d/lxc_macvlan + %{systemdunitdir}/lxc.service +%{systemdunitdir}/lxc-net.service %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/rootfs %{_libdir}/%{name}/rootfs/README +%attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load +%attr(755,root,root) %{_libdir}/%{name}/lxc-containers %attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup -%attr(755,root,root) %{_libdir}/%{name}/lxc-init %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord +%attr(755,root,root) %{_libdir}/%{name}/lxc-net %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic %dir %{_sysconfdir}/lxc +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf %dir %{_datadir}/%{name} %{_datadir}/%{name}/lxc.functions +%attr(755,root,root) %{_datadir}/%{name}/lxc-restore-net %dir %{_datadir}/%{name}/config +%{_datadir}/%{name}/config/archlinux.*.conf %{_datadir}/%{name}/config/centos.*.conf +%{_datadir}/%{name}/config/common.conf +%dir %{_datadir}/%{name}/config/common.conf.d +%{_datadir}/%{name}/config/common.conf.d/README +%{_datadir}/%{name}/config/common.seccomp %{_datadir}/%{name}/config/debian.*.conf %{_datadir}/%{name}/config/fedora.*.conf %{_datadir}/%{name}/config/gentoo.*.conf +%{_datadir}/%{name}/config/opensuse.*.conf +%{_datadir}/%{name}/config/openwrt.*.conf %{_datadir}/%{name}/config/oracle.*.conf %{_datadir}/%{name}/config/plamo.*.conf %{_datadir}/%{name}/config/ubuntu-cloud.*.conf %{_datadir}/%{name}/config/ubuntu.*.conf +%{_datadir}/%{name}/config/userns.conf %dir %{_datadir}/%{name}/hooks +%dir %{_datadir}/%{name}/selinux +%{_datadir}/%{name}/selinux/* %dir %{_datadir}/%{name}/templates %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname %attr(755,root,root) %{_datadir}/%{name}/hooks/mount* @@ -218,6 +296,7 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/lxc-autostart.1* %{_mandir}/man1/lxc-cgroup.1* %{_mandir}/man1/lxc-checkconfig.1* +%{_mandir}/man1/lxc-checkpoint.1* %{_mandir}/man1/lxc-clone.1* %{_mandir}/man1/lxc-config.1* %{_mandir}/man1/lxc-console.1* @@ -251,6 +330,7 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -258,6 +338,7 @@ rm -rf $RPM_BUILD_ROOT %endif %dir %{configpath} +%dir %{configpath}snap %dir %attr(750,root,root) /var/log/lxc %dir %attr(750,root,root) /var/cache/lxc @@ -294,3 +375,7 @@ rm -rf $RPM_BUILD_ROOT %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