aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lxd/APKBUILD
blob: ae3e2ca089bd4e01a2e5286a1bab2a4c7aec509e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lxd
pkgver=2.0.3
pkgrel=1
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"
install="$pkgname.pre-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"
	#https://github.com/lxc/lxd/issues/496
	export CGO_LDFLAGS=-lintl
	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="b420f40537527cccc399eed057e5fa35  lxd-2.0.3.tar.gz
370234287e61d9a8fa80e7779629f908  lxd.confd
b51c126976c5c6fc26e520eb7431315c  lxd.initd"
sha256sums="da42cda515dd1a3b407050137e787f97d9f45820588d009c65c5464f718b50bf  lxd-2.0.3.tar.gz
7a8dd2b4bd74463fc912800b4242c1368b479ffde97f58e2ac4f28983fd90c67  lxd.confd
44fec1554786d833a04295beada70ddd8724146727fb54f580b458d714f43e03  lxd.initd"
sha512sums="c792917dfdd382d01700381a74569d26645ae45e492903ae43a3764e2f95945b6108d88632c35151b97e53e101e6879da0a41be07e2e79f93ec982d7fd8bb9e3  lxd-2.0.3.tar.gz
683669afe46c5cf72ef11b86f420ca22b09f61e8299ec0c59be515917a912da30e46be82327f6cd76096ac2bfba02ca259771cddd3de5b2068e5ce06533b26f3  lxd.confd
9e12a7399b009d0d42c20263f8abd51b164dd76f42c1074c721559edc17df0b31432389c429e3d3680a5bea366f6c7c52ed546bb6d8a4171671045998a2e2c00  lxd.initd"