From dfaa18206b4f039b9d47b07156c54ca71db33856 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Sun, 6 Jul 2014 21:34:58 +0200 Subject: Update to 1.0.4. - Include sysvinit resp. systemd support for autostart of containers. - Do not list explicit requirements for templates. - Add missing dependency on lxc-lua for lxc-top. - Include apidocs. --- .gitignore | 1 + lxc-1.0.4-fix-init.patch | 22 +++++++++ lxc.spec | 119 +++++++++++++++++++++++++++++++++-------------- sources | 2 +- 4 files changed, 108 insertions(+), 36 deletions(-) create mode 100644 lxc-1.0.4-fix-init.patch diff --git a/.gitignore b/.gitignore index 1040811..3ce3db8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ lxc-0.7.2.tar.gz /lxc-0.8.0.tar.gz /lxc-0.9.0.tar.gz /lxc-1.0.3.tar.gz +/lxc-1.0.4.tar.gz diff --git a/lxc-1.0.4-fix-init.patch b/lxc-1.0.4-fix-init.patch new file mode 100644 index 0000000..340ff76 --- /dev/null +++ b/lxc-1.0.4-fix-init.patch @@ -0,0 +1,22 @@ +diff -up lxc-1.0.4/config/init/sysvinit/lxc.in.orig lxc-1.0.4/config/init/sysvinit/lxc.in +--- lxc-1.0.4/config/init/sysvinit/lxc.in.orig 2014-07-05 17:47:14.143145522 +0200 ++++ lxc-1.0.4/config/init/sysvinit/lxc.in 2014-07-05 18:01:40.053721615 +0200 +@@ -2,13 +2,15 @@ + # + # lxc Start/Stop LXC autoboot containers + # +-# chkconfig: 345 99 01 ++# chkconfig: - 99 01 + # description: Starts/Stops all LXC containers configured for autostart. + # + ### BEGIN INIT INFO + # Provides: lxc +-# Default-Start: 3 4 5 +-# Default-Stop: 0 1 6 ++# Required-Start: $local_fs $network ++# Required-Stop: $local_fs $network ++# Default-Start: ++# Default-Stop: + # Short-Description: Bring up/down LXC autostart containers + # Description: Bring up/down LXC autostart containers + ### END INIT INFO diff --git a/lxc.spec b/lxc.spec index ad4ed90..66f0a71 100644 --- a/lxc.spec +++ b/lxc.spec @@ -2,6 +2,14 @@ %global with_python3 1 %endif +%if 0%{?fedora} || 0%{?rhel} >= 7 +%global with_systemd 1 +%endif + +%if 0%{?fedora} || ( 0%{?rhel} >= 7 && %{_arch} != ppc64 ) +%global with_seccomp 1 +%endif + %if 0%{?fedora} > 19 %global luaver 5.2 %else @@ -11,24 +19,33 @@ %global luapkgdir %{_datadir}/lua/%{luaver} Name: lxc -Version: 1.0.3 -Release: 2%{?dist} +Version: 1.0.4 +Release: 1%{?dist} Summary: Linux Resource Containers Group: Applications/System License: LGPLv2+ and GPLv2 URL: http://linuxcontainers.org Source0: http://linuxcontainers.org/downloads/%{name}-%{version}.tar.gz +Patch0: lxc-1.0.4-fix-init.patch BuildRequires: docbook-utils Buildrequires: docbook2X +Buildrequires: doxygen BuildRequires: kernel-headers +BuildRequires: libselinux-devel +%if 0%{?with_seccomp} +BuildRequires: libseccomp-devel +%endif # with_seccomp BuildRequires: libcap-devel BuildRequires: libtool BuildRequires: lua-devel %if 0%{?with_python3} BuildRequires: python3-devel >= 3.2 -%endif +%endif # with_python3 +%if 0%{?with_systemd} BuildRequires: systemd - +%endif # with_systemd +# for lxc-top +Requires: lua-%{name}%{?_isa} = %{version}-%{release} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -40,9 +57,16 @@ overhead of full virtualization. %package libs Summary: Runtime library files for %{name} Group: System Environment/Libraries +%if 0%{?with_systemd} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd +%else +Requires(post): chkconfig +Requires(preun): initscripts, chkconfig +Requires(postun): initscripts +%endif # with_systemd + %description libs Linux Resource Containers provide process and resource isolation without the @@ -75,7 +99,7 @@ Linux Resource Containers provide process and resource isolation without the overhead of full virtualization. This package contains tools needing the Python3 bindings. -%endif +%endif # with_python3 %package -n lua-%{name} @@ -96,14 +120,14 @@ The lua-%{name} package contains the Lua binding for %{name}. Summary: Templates for %{name} Group: System Environment/Libraries Requires: %{name}-libs%{?_isa} = %{version}-%{release} -# needed for lxc-busybox -Requires: busybox -# needed for lxc-debian -Requires: dpkg -# needed for lxc-debian, lxc-ubuntu: -Requires: debootstrap rsync -# needed for lxc-sshd -Requires: openssh-server dhclient +# Note: Requirements for the template scripts (busybox, dpkg, +# debootstrap, rsync, openssh-server, dhclient, apt, pacman, zypper, +# ubuntu-cloudimg-query etc...) are not explicitly mentioned here: +# their presence varies wildly on supported Fedora/EPEL releases and +# archs, and they are in most cases needed for a single template +# only. Also, the templates normally fail graciously when such a tool +# is missing. Moving each template to its own subpackage on the other +# hand would be overkill. %description templates @@ -138,18 +162,31 @@ This package contains documentation for %{name}. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build %configure --with-distro=fedora \ --enable-doc \ + --enable-api-docs \ + --disable-silent-rules \ --docdir=%{_pkgdocdir} \ --disable-rpath \ --disable-apparmor \ + --disable-cgmanager \ + --enable-selinux \ +%if 0%{?with_seccomp} + --enable-seccomp \ +%endif # with_seccomp --enable-lua \ %if 0%{?with_python3} --enable-python \ -%endif +%endif # with_python3 +%if 0%{?with_systemd} + --with-init-script=systemd \ +%else + --with-init-script=sysvinit \ +%endif # with_systemd # intentionally blank line make %{?_smp_mflags} @@ -158,27 +195,15 @@ make %{?_smp_mflags} %{make_install} make DESTDIR=%{buildroot} install mkdir -p %{buildroot}%{_sharedstatedir}/%{name} -%if 0%{?with_lua} chmod -x %{buildroot}%{luapkgdir}/lxc.lua -%endif mkdir -p %{buildroot}%{_pkgdocdir} cp -a AUTHORS COPYING README %{buildroot}%{_pkgdocdir} +cp -a doc/api %{buildroot}%{_pkgdocdir} # cache dir mkdir -p %{buildroot}%{_localstatedir}/cache/%{name} -# move templates with extra dependencies -# - lxc-altlinux needs apt -# - lxc-archlinux needs pacman -# - lxc-opensuse needs zypper -# - lxc-ubuntu-cloud needs ubuntu-cloudimg-query -mkdir -p %{buildroot}%{_pkgdocdir}/templates -for t in altlinux archlinux opensuse ubuntu-cloud ; do - mv %{buildroot}%{_datadir}/%{name}/templates/%{name}-$t \ - %{buildroot}%{_pkgdocdir}/templates -done - %check make check @@ -186,23 +211,42 @@ make check %post libs /sbin/ldconfig +%if 0%{?with_systemd} %systemd_post %{name}.service +%else +/sbin/chkconfig --add %{name} +%endif # with_systemd %preun libs +%if 0%{?with_systemd} %systemd_preun %{name}.service +%else +if [ $1 -eq 0 ]; then + /sbin/service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi +%endif # with_systemd %postun libs /sbin/ldconfig +%if 0%{?with_systemd} %systemd_postun %{name}.service +%else +if [ $1 -ge 1 ]; then + /sbin/service %{name} condrestart > /dev/null 2>&1 || : +fi +%endif # with_systemd %files %{_bindir}/%{name}-* +%exclude %{_bindir}/%{name}-autostart %{_mandir}/man1/%{name}* %{_mandir}/*/man1/%{name}* %{_datadir}/%{name}/lxc.functions +%{_datadir}/%{name}/%{name}-patch.py* %if 0%{?with_python3} %exclude %{_bindir}/%{name}-device %exclude %{_bindir}/%{name}-ls @@ -210,9 +254,6 @@ make check %exclude %{_mandir}/man1/%{name}-device* %exclude %{_mandir}/man1/%{name}-ls* %exclude %{_mandir}/man1/%{name}-start-ephemeral* -%else -%{_bindir}/%{name}-ls -%{_mandir}/man1/%{name}-ls* %endif %dir %{_sysconfdir}/bash_completion.d/ %{_sysconfdir}/bash_completion.d/%{name} @@ -228,6 +269,7 @@ make check %{_libexecdir}/%{name} # fixme: should be in libexecdir? %{_sbindir}/init.%{name} +%{_bindir}/%{name}-autostart %{_sharedstatedir}/%{name} %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/default.conf @@ -239,10 +281,12 @@ make check %{_pkgdocdir}/AUTHORS %{_pkgdocdir}/COPYING %{_pkgdocdir}/README +%if 0%{?with_systemd} %{_unitdir}/%{name}.service +%else +%{_sysconfdir}/rc.d/init.d/%{name} +%endif # with_systemd %dir %{_localstatedir}/cache/%{name} -# fixme: -%exclude %{_datadir}/%{name}/%{name}-patch.py* %if 0%{?with_python3} @@ -257,7 +301,7 @@ make check %{_mandir}/man1/%{name}-device* %{_mandir}/man1/%{name}-ls* %{_mandir}/man1/%{name}-start-ephemeral* -%endif +%endif # with_python3 %files -n lua-%{name} @@ -268,7 +312,6 @@ make check %files templates %{_datadir}/%{name}/templates/lxc-* %{_datadir}/%{name}/config/* -%{_pkgdocdir}/templates %files devel @@ -282,10 +325,16 @@ make check # README, AUTHORS and COPYING intentionally duplicated because -doc # can be installed on its own. %{_pkgdocdir}/* -%exclude %{_pkgdocdir}/templates %changelog +* Sat Jul 5 2014 Thomas Moschny - 1.0.4-1 +- Update to 1.0.4. +- Include sysvinit resp. systemd support for autostart of containers. +- Do not list explicit requirements for templates. +- Add missing dependency on lxc-lua for lxc-top. +- Include apidocs. + * Sat Jun 07 2014 Fedora Release Engineering - 1.0.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild diff --git a/sources b/sources index dc8983a..ebea140 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -55873b1411a606397309aa6c4c4263b3 lxc-1.0.3.tar.gz +2689080af03a8ac1f1ce577728dd3619 lxc-1.0.4.tar.gz -- cgit