aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lxd
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-12-09 10:12:38 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-12-09 10:12:44 +0000
commit1b88bb358a603c4b665475558bee220b38003971 (patch)
tree5150fe74f9f5066dc7dfc5599392490106070969 /testing/lxd
parentcc7493a69275a64cf6584a872bed5b4508cc6003 (diff)
downloadaports-1b88bb358a603c4b665475558bee220b38003971.tar.bz2
aports-1b88bb358a603c4b665475558bee220b38003971.tar.xz
testing/lxd: improve APKBUILD, initd rewritten from scratch
Diffstat (limited to 'testing/lxd')
-rw-r--r--testing/lxd/APKBUILD35
-rw-r--r--testing/lxd/lxd.initd49
2 files changed, 20 insertions, 64 deletions
diff --git a/testing/lxd/APKBUILD b/testing/lxd/APKBUILD
index 8be26f9a27..9ffcd42367 100644
--- a/testing/lxd/APKBUILD
+++ b/testing/lxd/APKBUILD
@@ -2,31 +2,24 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lxd
pkgver=2.6.2
-pkgrel=2
+pkgrel=4
pkgdesc="a container hypervisor and a new user experience for LXC"
url="https://linuxcontainers.org/lxd/"
arch="all"
license="Apache-2.0"
-depends="acl xz netcat-openbsd cgmanager squashfs-tools rsync"
-depends_dev=""
-makedepends="$depends_dev lxc-dev protobuf-dev rsync go gettext-dev"
+depends="acl xz netcat-openbsd cgmanager squashfs-tools rsync shadow-uidmap"
+makedepends="lxc-dev protobuf-dev rsync go gettext-dev"
install="$pkgname.pre-install"
subpackages=""
-source="https://linuxcontainers.org/downloads/lxd/lxd-$pkgver.tar.gz
- lxd.confd
- lxd.initd"
+source="https://linuxcontainers.org/downloads/$pkgname/$pkgname-$pkgver.tar.gz
+ $pkgname.confd
+ $pkgname.initd"
_project="github.com/lxc/lxd"
-_builddir="$srcdir"/lxd-$pkgver
+builddir="$srcdir"/lxd-$pkgver
prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
+ cd "$builddir"
# symlink links to a path outside of $GOPATH
# copy src to project directory to replace the symlink
rm -f dist/src/"$_project"
@@ -34,8 +27,8 @@ prepare() {
}
build() {
- cd "$_builddir"
- export GOPATH="$_builddir/dist"
+ cd "$builddir"
+ export GOPATH="$builddir/dist"
#https://github.com/lxc/lxd/issues/496
export CGO_LDFLAGS=-lintl
go build -v -work -x "$_project"
@@ -43,7 +36,7 @@ build() {
}
package() {
- cd "$_builddir"
+ cd "$builddir"
for i in fuidshift lxc ; do
install -Dm 755 "dist/bin/$i" \
"$pkgdir/usr/bin/$i" || return 1
@@ -57,10 +50,10 @@ package() {
md5sums="59a4f949c7cc6bb3846998e9d4e9adaa lxd-2.6.2.tar.gz
7a3132c6cdd5e9ec111dec9ce8dadaf2 lxd.confd
-6e48df5cdd6fb7f474fe4dccbc93d627 lxd.initd"
+172e64652ad8a79fc7a6a95fa58620f1 lxd.initd"
sha256sums="a7c5e584a6fcb867a3e57818dbbbcd11b13195111fb883e16104d3c72603cd58 lxd-2.6.2.tar.gz
18aff7faa03d4f92e78df6bc19cb33e8b701c2d8defcf52a9d354afdeccd8e92 lxd.confd
-0d11e2473b1c6bbbeaad1fc0dde8aeb37eb09b7a5152db13e0bc60935e597442 lxd.initd"
+ca7b7be0b22db669e6489d8035defbf9270c6097044faf36b67a3ee4b39760ab lxd.initd"
sha512sums="160c338a7b99a281ac51357e09ebb3090bb7efd785699e9daeccf8dea8d8bd78f3274d7885a9b9cc0322ab9909f958dc35a64a0017597efd856fc3b0af533358 lxd-2.6.2.tar.gz
7f1fdacacf8bdab49d3a932c41d52aa84b0df5e0fa3d8e67758902ae70b99b23eb0a9e869cc0d06b30ca711b0f3e18ac5dfa9aad2f43d2cf1fda1eb8353c6ba0 lxd.confd
-b9d0d4b47832ccfe5545112be9b4dda95de2c368bb617295d83d294153db8605581e243464369cfbe660afc2cb67b8f38d99695fd8d77c6710dbab4462a5b0cc lxd.initd"
+f13a4979402bb572767f8aee0ab7aa9f056cc27f3b2da2e5837809e898a38e407e797a469394e2cd3d0f6408e6a84f516c37314f330346b40bea1326cbd5cdbc lxd.initd"
diff --git a/testing/lxd/lxd.initd b/testing/lxd/lxd.initd
index c1aef377ab..9d3c666b0c 100644
--- a/testing/lxd/lxd.initd
+++ b/testing/lxd/lxd.initd
@@ -1,50 +1,13 @@
#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
+# (c) 2016 Alpine Linux
-DAEMON=/usr/sbin/lxd
-PIDFILE=/run/lxd.pid
-
-extra_commands="stopall"
+command="/usr/sbin/lxd"
+command_args="${LXD_OPTIONS}"
+command_background="true"
+pidfile="/var/run/${RC_SVCNAME}.pid"
depend() {
need net
use lxcfs
-
- # remove with 2.0 release
- need cgmanager
-}
-
-start() {
- ebegin "Starting lxd server"
-
- start-stop-daemon --start \
- --pidfile ${PIDFILE} \
- --exec ${DAEMON} \
- --background \
- --make-pidfile \
- -- \
- ${LXD_OPTIONS}
-
- eend $?
-}
-
-stop() {
- if [[ $RC_GOINGDOWN = YES ]] || [[ $RC_REBOOT = YES ]]; then
- stopall
- else
- ebegin "Stopping lxd service (but not containers)"
- start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
- eend $?
- fi
-}
-
-stopall() {
- ebegin "Stopping lxd service and containers"
- if "${DAEMON}" shutdown; then
- /etc/init.d/lxd zap
- rm -f ${PIDFILE}
- fi
- eend $?
+ after firewall
}