# Contributor: Carlo Landmeter # Maintainer: Francesco Colista pkgname=lxd pkgver=2.8 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="ecb4ab66b2ed9a1ff2dc659c716f1b62 lxd-2.8.tar.gz 7a3132c6cdd5e9ec111dec9ce8dadaf2 lxd.confd 29018e596d4faf80cbd394352570d746 lxd.initd" sha256sums="47d831933ca448e1eb72731c4ae089c26b3409a7852c7fb9e474f19b7abc258c lxd-2.8.tar.gz 18aff7faa03d4f92e78df6bc19cb33e8b701c2d8defcf52a9d354afdeccd8e92 lxd.confd e51c17bb326dc3650c54956eff3e7b4eccbfc449444ee07d556cc7e4487c8b91 lxd.initd" sha512sums="fae7eedc924b2bc6d2ed474790b5f2859f589749514751e7ffb814a5548fe3eeb23b01b99f6df41a20f332cfe290cf92d202ba763c9a00180b2bc8b092d1148d lxd-2.8.tar.gz 7f1fdacacf8bdab49d3a932c41d52aa84b0df5e0fa3d8e67758902ae70b99b23eb0a9e869cc0d06b30ca711b0f3e18ac5dfa9aad2f43d2cf1fda1eb8353c6ba0 lxd.confd 94de0c0d5ab63463a929a4151359950b1117d0ada5ccf0944311cc70c6b6d4c437ccb4158734ab35db67bfb4abc437074c3f3515be4531f63adc74da21fefb5b lxd.initd"