From 58946b26df711570b61dbc262a2bc64cae255ef5 Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Thu, 13 Dec 2018 09:32:47 -0800 Subject: [PATCH] New package: lxd-lts-3.0.3 Closes: #4842 [via git-merge-pr] --- srcpkgs/lxd-lts/INSTALL.msg | 15 +++++++++++++ srcpkgs/lxd-lts/files/lxd/run | 9 ++++++++ srcpkgs/lxd-lts/template | 40 +++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100755 srcpkgs/lxd-lts/INSTALL.msg create mode 100755 srcpkgs/lxd-lts/files/lxd/run create mode 100644 srcpkgs/lxd-lts/template diff --git a/srcpkgs/lxd-lts/INSTALL.msg b/srcpkgs/lxd-lts/INSTALL.msg new file mode 100755 index 00000000000..082eea4c78a --- /dev/null +++ b/srcpkgs/lxd-lts/INSTALL.msg @@ -0,0 +1,15 @@ +Add sub{u,g}ids for root to create unprivileged containers: + + $ echo "root:1000000:65536" | sudo tee -a /etc/subuid /etc/subgid + +Start lxd service: + + $ sudo ln -s /etc/sv/lxd /var/service + +Run LXD initialization: + + $ sudo lxd init + +To use lxd client your user must be added to the 'lxd' group: + + $ sudo usermod -aG lxd diff --git a/srcpkgs/lxd-lts/files/lxd/run b/srcpkgs/lxd-lts/files/lxd/run new file mode 100755 index 00000000000..147eb64e74d --- /dev/null +++ b/srcpkgs/lxd-lts/files/lxd/run @@ -0,0 +1,9 @@ +#!/bin/sh +_systemd_cgrp="/sys/fs/cgroup/systemd" +if [ ! -d ${_systemd_cgrp} ]; then + mkdir ${_systemd_cgrp} +fi +if ! mountpoint -q "${_systemd_cgrp}"; then + mount -t cgroup -o none,name=systemd cgroup ${_systemd_cgrp} +fi +exec lxd --group lxd 2>&1 diff --git a/srcpkgs/lxd-lts/template b/srcpkgs/lxd-lts/template new file mode 100644 index 00000000000..ad372aa0143 --- /dev/null +++ b/srcpkgs/lxd-lts/template @@ -0,0 +1,40 @@ +# Template file for 'lxd-lts' +pkgname=lxd-lts +version=3.0.3 +revision=1 +wrksrc="lxd-$version" +build_style=go +go_import_path="github.com/lxc/lxd" +go_build_tags="libsqlite3" +go_package="${go_import_path}/lxd ${go_import_path}/lxc + ${go_import_path}/lxd-p2c ${go_import_path}/fuidshift" +hostmakedepends="pkg-config" +makedepends="lxc-devel acl-devel dqlite-devel" +depends="lxc acl acl-progs rsync squashfs-tools xz dnsmasq iptables" +short_desc="Next generation system container manager (long term support channel)" +maintainer="Cameron Nemo " +license="Apache-2.0" +homepage="https://linuxcontainers.org/lxd" +distfiles="https://linuxcontainers.org/downloads/lxd/${wrksrc}.tar.gz" +checksum=55b4ae1844e95ad8c283a22ac6c2f661fddedf17fd39d1fdbe60f07895986453 +conflicts="lxd" +provides="lxd-${version}_${revision}" +system_groups="lxd" + +do_configure() { + # the LXD tarball packages up the required dependencies + ln -s "$wrksrc/dist" "$GOPATH" +} + +do_build() { + # don't go-get the dependencies, just install with what's there + cd "$GOSRCPATH" + go_package=${go_package:-$go_import_path} + go install -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package} +} + +post_install() { + vinstall scripts/bash/lxd-client 644 /usr/share/bash-completion/completions lxd + vlicense COPYING LICENSE + vsv lxd +}