[packages/lxd] up to 3.22
mis
mis at pld-linux.org
Sun Mar 8 22:09:53 CET 2020
commit f03a3fec0e16d54b7d38d48fa89e545b0eebabc3
Author: mis <mis at pld-linux.org>
Date: Sun Mar 8 22:09:34 2020 +0100
up to 3.22
lxd.spec | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 61 insertions(+), 17 deletions(-)
---
diff --git a/lxd.spec b/lxd.spec
index 4bc8148..824d349 100644
--- a/lxd.spec
+++ b/lxd.spec
@@ -1,36 +1,38 @@
-# TODO
-# - Consider use of lxd group for lxd
-
-Summary: Fast, dense and secure container management
+Summary: Fast, dense and secure container and virtual machine management
Name: lxd
-Version: 3.6
-Release: 1
+Version: 3.22
+Release: 1
License: Apache v2.0
Group: Applications/System
Source0: https://linuxcontainers.org/downloads/lxd/%{name}-%{version}.tar.gz
-# Source0-md5: 5da7becd8c9809535093149b7360c0e7
+# Source0-md5: 3bbcfd764058f0383dfb599df635e0bb
Source1: %{name}.service
Source2: %{name}.init
Source3: %{name}.sysconfig
Source4: %{name}.sh
URL: http://linuxcontainers.org/
+BuildRequires: acl-devel
%ifarch %{x8664} arm aarch64 ppc64
BuildRequires: criu-devel >= 1.7
%endif
BuildRequires: dqlite-devel
BuildRequires: golang >= 1.5
+BuildRequires: libco-devel
+BuildRequires: libuv-devel
BuildRequires: lxc-devel >= 3.0
BuildRequires: pkgconfig
+BuildRequires: raft-devel
BuildRequires: rpmbuild(macros) >= 1.228
+BuildRequires: udev-devel
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
Requires(pre): /usr/bin/getgid
Requires(pre): /usr/sbin/groupadd
-Requires: rc-scripts >= 0.4.0.10
Requires: dnsmasq
+Requires: iproute2
+Requires: rc-scripts >= 0.4.0.10
Requires: rsync
Requires: squashfs
-Requires: iproute2
Requires: uname(release) >= 4.1
Provides: group(lxd)
ExclusiveArch: %{ix86} %{x8664} %{arm}
@@ -38,12 +40,13 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _enable_debug_packages 0
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
+%define goinstall go install -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x
%define gopath %{_libdir}/golang
%define import_path github.com/lxc/lxd
%define _libexecdir %{_prefix}/lib
%description
-LXD is a container "hypervisor" and a new user experience for LXC.
+LXD is a next generation system container and virtual machine manager.
Specifically, it is made of three components:
- A system-wide daemon (lxd)
@@ -62,28 +65,57 @@ them and even move them around while they are running.
The OpenStack plugin then allows you to use your lxd hosts as compute
nodes, running workloads on containers rather than virtual machines.
+%package agent
+Summary: LXD Agent
+
+%description agent
+This package contains lxd-agent program to be used inside virtual
+machines (not containers) managed by LXD.
+
+%package -n bash-completion-%{name}
+Summary: bash-completion for %{name}
+Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla %{name}
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: bash-completion >= 2.0
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
+
+%description -n bash-completion-%{name}
+bash-completion for %{name}
+
+%description -n bash-completion-%{name} -l pl.UTF-8
+Bashowe dopełnianie parametrów dla %{name}
+
%prep
%setup -q
%build
-export GOPATH=$(pwd)/dist
-cd $GOPATH/src/%{import_path}
+export GOPATH=$(pwd)/_dist
+export GOBIN=$GOPATH/bin
-%gobuild -o dist/bin/lxd ./lxd
-%gobuild -o dist/bin/lxc ./lxc
+%goinstall -tags libsqlite3 ./...
+CGO_ENABLED=0 %goinstall -tags netgo ./lxd-p2c
+%goinstall -tags agent ./lxd-agent
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
$RPM_BUILD_ROOT%{_libexecdir} \
+ $RPM_BUILD_ROOT%{bash_compdir} \
$RPM_BUILD_ROOT/var/lib/%{name}/{containers,devices,devlxd,images,security,shmounts,snapshots} \
$RPM_BUILD_ROOT/var/log/%{name}
# lxd refuses to start containter without this directory
install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/rootfs
-install -p dist/bin/lxd $RPM_BUILD_ROOT%{_sbindir}
-install -p dist/bin/lxc $RPM_BUILD_ROOT%{_bindir}
+install -p _dist/bin/{lxd,lxd-agent,lxc-to-lxd,lxd-p2c} $RPM_BUILD_ROOT%{_sbindir}
+install -p _dist/bin/{lxc,fuidshift} $RPM_BUILD_ROOT%{_bindir}
+
+# FIXME: it seems that bash completions must be named as command (lxc), so
+# it conflicts with lxc completions (bash-completion-lxc)
+install -p scripts/bash/lxd-client $RPM_BUILD_ROOT%{bash_compdir}/lxc
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
@@ -99,6 +131,7 @@ install -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/lxd-wrapper
%service -n %{name} restart
%systemd_post %{name}.service
+
%preun
if [ "$1" = "0" ]; then
%service -q %{name} stop
@@ -121,13 +154,16 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%attr(755,root,root) %{_bindir}/lxc
+%attr(755,root,root) %{_bindir}/fuidshift
%attr(755,root,root) %{_sbindir}/lxd
+%attr(755,root,root) %{_sbindir}/lxd-p2c
+%attr(755,root,root) %{_sbindir}/lxc-to-lxd
%{systemdunitdir}/%{name}.service
%dir %attr(750,root,root) %{_libdir}/%{name}
%dir %attr(750,root,root) %{_libdir}/%{name}/rootfs
%attr(750,root,root) %{_libexecdir}/%{name}-wrapper
%dir %attr(750,root,logs) /var/log/%{name}
-%dir %attr(711,root,root) /var/lib/%{name}
+%dir %attr(711,root,lxd) /var/lib/%{name}
%dir %attr(711,root,root) /var/lib/%{name}/containers
%dir %attr(700,root,root) /var/lib/%{name}/devices
%dir %attr(700,root,root) /var/lib/%{name}/devlxd
@@ -135,3 +171,11 @@ rm -rf $RPM_BUILD_ROOT
%dir %attr(700,root,root) /var/lib/%{name}/security
%dir %attr(711,root,root) /var/lib/%{name}/shmounts
%dir %attr(700,root,root) /var/lib/%{name}/snapshots
+
+%files agent
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_sbindir}/lxd-agent
+
+%files -n bash-completion-%{name}
+%defattr(644,root,root,755)
+%{bash_compdir}/lxc
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lxd.git/commitdiff/f03a3fec0e16d54b7d38d48fa89e545b0eebabc3
More information about the pld-cvs-commit
mailing list