# Contributor: Carlo Landmeter # Maintainer: Francesco Colista pkgname=lxd pkgver=2.12 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" 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 } sha512sums="207503a0ed49be36e762492ce0f24fc36b20486e3643529e6b39b874450b51fc0123002bff0be7d0f50d4de121961fe59e24f648ad8979f5b1f1eb4bd3848a99 lxd-2.12.tar.gz 7f1fdacacf8bdab49d3a932c41d52aa84b0df5e0fa3d8e67758902ae70b99b23eb0a9e869cc0d06b30ca711b0f3e18ac5dfa9aad2f43d2cf1fda1eb8353c6ba0 lxd.confd 94de0c0d5ab63463a929a4151359950b1117d0ada5ccf0944311cc70c6b6d4c437ccb4158734ab35db67bfb4abc437074c3f3515be4531f63adc74da21fefb5b lxd.initd"