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