diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2015-09-24 15:18:31 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2015-09-24 15:18:35 +0200 |
commit | 7c054e680a155b2680e8435a2f35b6a4bb939f90 (patch) | |
tree | b67f392c6eaa1258f9e841f22f0671618a46a27d /testing/lxd | |
parent | f9370f02b599e6739d1311f7d5ec0e95c6f76497 (diff) | |
download | aports-7c054e680a155b2680e8435a2f35b6a4bb939f90.tar.bz2 aports-7c054e680a155b2680e8435a2f35b6a4bb939f90.tar.xz |
testing/lxd: new aport
Diffstat (limited to 'testing/lxd')
-rw-r--r-- | testing/lxd/APKBUILD | 64 | ||||
-rw-r--r-- | testing/lxd/lxd.confd | 26 | ||||
-rw-r--r-- | testing/lxd/lxd.initd | 35 |
3 files changed, 125 insertions, 0 deletions
diff --git a/testing/lxd/APKBUILD b/testing/lxd/APKBUILD new file mode 100644 index 0000000000..732fbc9620 --- /dev/null +++ b/testing/lxd/APKBUILD @@ -0,0 +1,64 @@ +# Contributor: Carlo Landmeter <clandmeter@gmail.com> +# Maintainer: +pkgname=lxd +pkgver=0.18 +pkgrel=0 +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" +depends_dev="" +makedepends="$depends_dev lxc-dev protobuf-dev rsync go" +install="" +subpackages="" +source="https://linuxcontainers.org/downloads/lxd/lxd-$pkgver.tar.gz + lxd.confd + lxd.initd" +_project="github.com/lxc/lxd" + +_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 + # symlink links to a path outside of $GOPATH + # copy src to project directory to replace the symlink + rm -f dist/src/"$_project" + rsync -a . --exclude="dist" dist/src/"$_project" +} + +build() { + cd "$_builddir" + export GOPATH="$_builddir/dist" + go build -v -work -x "$_project" + make -C dist/src/"$_project" +} + +package() { + cd "$_builddir" + for i in fuidshift lxc lxd-bridge-proxy; do + install -Dm 755 "dist/bin/$i" \ + "$pkgdir/usr/bin/$i" || return 1 + done + install -Dm755 "dist/bin/lxd" "$pkgdir/usr/sbin/lxd" || return 1 + install -Dm755 "$srcdir"/lxd.initd \ + "$pkgdir"/etc/init.d/lxd || return 1 + install -Dm644 "$srcdir"/lxd.confd \ + "$pkgdir"/etc/conf.d/lxd || return 1 +} + +md5sums="b60c50742af1c066ad27dcd90b792d2e lxd-0.18.tar.gz +370234287e61d9a8fa80e7779629f908 lxd.confd +b51c126976c5c6fc26e520eb7431315c lxd.initd" +sha256sums="c7615e29afec617f1a8e46d3c01247549678c1cfeeabee4f0b0a299a21642fff lxd-0.18.tar.gz +7a8dd2b4bd74463fc912800b4242c1368b479ffde97f58e2ac4f28983fd90c67 lxd.confd +44fec1554786d833a04295beada70ddd8724146727fb54f580b458d714f43e03 lxd.initd" +sha512sums="4615688a7214d0dd6214c98bedd6df003f9887e792fb465e154ccad8c3a3c8b98a6c898634d1e139976debe9c45a21112c3506597de88a3ef456742f5bbd5832 lxd-0.18.tar.gz +683669afe46c5cf72ef11b86f420ca22b09f61e8299ec0c59be515917a912da30e46be82327f6cd76096ac2bfba02ca259771cddd3de5b2068e5ce06533b26f3 lxd.confd +9e12a7399b009d0d42c20263f8abd51b164dd76f42c1074c721559edc17df0b31432389c429e3d3680a5bea366f6c7c52ed546bb6d8a4171671045998a2e2c00 lxd.initd" diff --git a/testing/lxd/lxd.confd b/testing/lxd/lxd.confd new file mode 100644 index 0000000000..086198a55c --- /dev/null +++ b/testing/lxd/lxd.confd @@ -0,0 +1,26 @@ +LXD_OPTIONS="" + +# Group which owns the shared socket +LXD_OPTIONS="${LXD_OPTIONS} --group lxd" + +# TCP address <addr:port> to listen on in addition to the unix socket (e.g., 127.0.0.1:8443) +#LXD_OPTIONS="${LXD_OPTIONS} --tcp 127.0.0.1:8443" + + + +# Enable cpu profiling into the specified file +#LXD_OPTIONS="${LXD_OPTIONS} --cpuprofile ''" + +# Enable memory profiling into the specified file +#LXD_OPTIONS="${LXD_OPTIONS} --memprofile ''" + + + +# Enables debug mode +#LXD_OPTIONS="${LXD_OPTIONS} --debug" + +# For debugging, print a complete stack trace every n seconds +#LXD_OPTIONS="${LXD_OPTIONS} --print-goroutines-every 5" + +# Enables verbose mode +#LXD_OPTIONS="${LXD_OPTIONS} -v" diff --git a/testing/lxd/lxd.initd b/testing/lxd/lxd.initd new file mode 100644 index 0000000000..6f5576cdc1 --- /dev/null +++ b/testing/lxd/lxd.initd @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxd/files/lxd.initd,v 1.1 2015/07/19 20:36:34 alunduil Exp $ + +DAEMON=/usr/sbin/lxd +PIDFILE=/run/lxd.pid + +depend() { + need cgmanager + + if echo "${LXD_OPTIONS}" | grep -e "--tcp" >/dev/null; then + need net + fi +} + +start() { + ebegin "Starting lxd server" + + start-stop-daemon --start \ + --pidfile ${PIDFILE} \ + --exec ${DAEMON} \ + --background \ + --make-pidfile \ + -- \ + ${LXD_OPTIONS} + + eend $? +} + +stop() { + ebegin "Stopping lxd server" + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} + eend $? +} |