# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=etcd pkgver=3.3.8 pkgrel=0 pkgdesc="A highly-available key value store for shared configuration and service discovery" url="https://github.com/coreos/etcd" arch="x86_64 ppc64le" license="Apache-2.0" makedepends="go bash" options="!strip" install="$pkgname.pre-install" pkgusers="$pkgname" pkggroups="$pkgname" subpackages="$pkgname-doc $pkgname-ctl" source="$pkgname-$pkgver.tar.gz::https://github.com/coreos/etcd/archive/v$pkgver.tar.gz $pkgname.confd $pkgname.initd" builddir="$srcdir"/$pkgname-$pkgver prepare() { default_prepare export GOPATH="$(pwd)/_gopath" _coreos="${GOPATH}/src/github.com/coreos" mkdir -vp ${_coreos} ln -vsf ${srcdir}/${pkgname}-${pkgver} ${_coreos}/${pkgname} } build() { cd "$builddir" bash -x ./build } package() { cd "$builddir" mkdir -p "$pkgdir"/var/lib/$pkgname chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/$pkgname install -Dm755 bin/etcd "$pkgdir"/usr/bin/etcd install -Dm755 $srcdir/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname install -Dm755 $srcdir/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE } ctl() { pkgdesc="A command-line client for etcd" install -Dm755 "$builddir"/bin/etcdctl "$subpkgdir"/usr/bin/etcdctl } sha512sums="c3a3f9ffb614e383854bf5a8819e3dcad8f02b267d74197685b546c856e983c92f8c459185c327adf7ba3d0326e2058fb34caac0896d78494cde86c3f7e04ac7 etcd-3.3.8.tar.gz 440c9f23decb318c565a79d376b107dbd2333e72d5d812ec1460732543348737468b3e66e82e06a1afa0f09760c1eb066804a668a24e92a23977758727e049d2 etcd.confd cee78d665c6449aceed2e12e13a461e614b7c71a4e4800c967bdfff0175e58aad1f8b0b186b8fa49ceffe315e5e68eccf24b8f3a3e3f805df8850f7e81b4ad12 etcd.initd"