aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lxd/APKBUILD
blob: e31c900364e1671b5fc88c0d04cc4807549b2704 (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=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"
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
66775331b4d7c3cda3c37d91920f6589  lxd.confd
6e48df5cdd6fb7f474fe4dccbc93d627  lxd.initd"
sha256sums="a7c5e584a6fcb867a3e57818dbbbcd11b13195111fb883e16104d3c72603cd58  lxd-2.6.2.tar.gz
d21ac218217c182b2b5bd8b3b245571dee07acc16f8ac16dd46f6e72bc39f08b  lxd.confd
0d11e2473b1c6bbbeaad1fc0dde8aeb37eb09b7a5152db13e0bc60935e597442  lxd.initd"
sha512sums="160c338a7b99a281ac51357e09ebb3090bb7efd785699e9daeccf8dea8d8bd78f3274d7885a9b9cc0322ab9909f958dc35a64a0017597efd856fc3b0af533358  lxd-2.6.2.tar.gz
bc0966577cdfbf8cb4b810a9a5a85cb7dfd8777d9f47a8bb191cd3ae46e8b390c90810d115dbe60bb94bd800f65a6f5cd14a9fce83a5035ea7d89eb66672ba7a  lxd.confd
b9d0d4b47832ccfe5545112be9b4dda95de2c368bb617295d83d294153db8605581e243464369cfbe660afc2cb67b8f38d99695fd8d77c6710dbab4462a5b0cc  lxd.initd"