aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lxd/APKBUILD
blob: fca72656c5410490bdd07ad6f592c0a58b67f0b2 (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lxd
pkgver=2.7
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 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/$pkgname/$pkgname-$pkgver.tar.gz
	$pkgname.confd
	$pkgname.initd"
_project="github.com/lxc/lxd"

builddir="$srcdir"/lxd-$pkgver

prepare() {
	cd "$builddir"
	# 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="643aa5863ca2c84a5d60f9068583cd7a  lxd-2.7.tar.gz
7a3132c6cdd5e9ec111dec9ce8dadaf2  lxd.confd
172e64652ad8a79fc7a6a95fa58620f1  lxd.initd"
sha256sums="2af04dea826ab104f8d5c93e7cc53c5e2ea2f88635afe48f8bbce8b0a4de9026  lxd-2.7.tar.gz
18aff7faa03d4f92e78df6bc19cb33e8b701c2d8defcf52a9d354afdeccd8e92  lxd.confd
ca7b7be0b22db669e6489d8035defbf9270c6097044faf36b67a3ee4b39760ab  lxd.initd"
sha512sums="6fe5249c5486577518a8d3b54ccc93a816192cfc6758ee056c5f9d4cdc614c3587829e09c18bb39716f12c8f81b3d03b003922dc3c359dbd9da76a82c11fe7b0  lxd-2.7.tar.gz
7f1fdacacf8bdab49d3a932c41d52aa84b0df5e0fa3d8e67758902ae70b99b23eb0a9e869cc0d06b30ca711b0f3e18ac5dfa9aad2f43d2cf1fda1eb8353c6ba0  lxd.confd
f13a4979402bb572767f8aee0ab7aa9f056cc27f3b2da2e5837809e898a38e407e797a469394e2cd3d0f6408e6a84f516c37314f330346b40bea1326cbd5cdbc  lxd.initd"