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