aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lxd/APKBUILD
blob: 8be26f9a2782e3aa4981c67459a311a64b0014ea (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.6.2
pkgrel=2
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 ; 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="59a4f949c7cc6bb3846998e9d4e9adaa  lxd-2.6.2.tar.gz
7a3132c6cdd5e9ec111dec9ce8dadaf2  lxd.confd
6e48df5cdd6fb7f474fe4dccbc93d627  lxd.initd"
sha256sums="a7c5e584a6fcb867a3e57818dbbbcd11b13195111fb883e16104d3c72603cd58  lxd-2.6.2.tar.gz
18aff7faa03d4f92e78df6bc19cb33e8b701c2d8defcf52a9d354afdeccd8e92  lxd.confd
0d11e2473b1c6bbbeaad1fc0dde8aeb37eb09b7a5152db13e0bc60935e597442  lxd.initd"
sha512sums="160c338a7b99a281ac51357e09ebb3090bb7efd785699e9daeccf8dea8d8bd78f3274d7885a9b9cc0322ab9909f958dc35a64a0017597efd856fc3b0af533358  lxd-2.6.2.tar.gz
7f1fdacacf8bdab49d3a932c41d52aa84b0df5e0fa3d8e67758902ae70b99b23eb0a9e869cc0d06b30ca711b0f3e18ac5dfa9aad2f43d2cf1fda1eb8353c6ba0  lxd.confd
b9d0d4b47832ccfe5545112be9b4dda95de2c368bb617295d83d294153db8605581e243464369cfbe660afc2cb67b8f38d99695fd8d77c6710dbab4462a5b0cc  lxd.initd"