aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lxd/APKBUILD
blob: d533557dd3ece4c8e617dd4122854ebc9ae30b5f (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lxd
pkgver=2.21
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 lxc ip6tables dnsmasq ca-certificates"
makedepends="lxc-dev protobuf-dev rsync go gettext-dev linux-headers acl-dev"
install="$pkgname.pre-install"
options="!check"
source="https://linuxcontainers.org/downloads/$pkgname/$pkgname-$pkgver.tar.gz
	lxd-dont-go-get.patch
	$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"
	default_prepare
}

build() {
	cd "$builddir"
	export GOPATH="$builddir/dist"
	#https://github.com/lxc/lxd/issues/496
	export CGO_LDFLAGS=-lintl
	make -C dist/src/"$_project"
}

package() {
	cd "$builddir"
	for i in fuidshift lxc ; do
		install -Dm 755 "dist/bin/$i" \
			"$pkgdir/usr/bin/$i"
	done
	install -Dm755 "dist/bin/lxd" "$pkgdir/usr/sbin/lxd"
	install -Dm755 "$srcdir"/lxd.initd \
		"$pkgdir"/etc/init.d/lxd
	install -Dm644 "$srcdir"/lxd.confd \
		"$pkgdir"/etc/conf.d/lxd
}

sha512sums="b4edd9873d18d80384b97d7a5c350ef99f47f78005eb891403b25d2d9f219f1d9f8e00c38d9eb8ffce916d29b49646eee0cf97e8631404538c54a69df7ce55b8  lxd-2.21.tar.gz
e2c0c96d0efc33e459cf14365f01d60b73ed03f028d36ca5ea27cd647f5d2a91ec61bcf2723437f7b930aec6ebabac3697e0e3adc6b2918817833c9f182aab49  lxd-dont-go-get.patch
bc32c71f2ce10f508433e1e4651c08c18e8a17e9419a7ce391c0f127fc7cf378c665178926b35eae8813e290d9c5eab3ceb605679fd32efdf2cf98a57cee4127  lxd.confd
94de0c0d5ab63463a929a4151359950b1117d0ada5ccf0944311cc70c6b6d4c437ccb4158734ab35db67bfb4abc437074c3f3515be4531f63adc74da21fefb5b  lxd.initd"