# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=etcd pkgver=3.1.5 pkgrel=2 pkgdesc="A highly-available key value store for shared configuration and service discovery" url="https://github.com/coreos/etcd" arch="x86_64" license="ASL 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() { pkgname="A command-line client for etcd" install -Dm755 "$builddir"/bin/etcdctl "$subpkgdir"/usr/bin/etcdctl } sha512sums="6a91be81721179579fbe2b054c23c196aae3c10e3af2ff4e3472e501c7dbbb3dd1adc796d9d2c9f91d46fff7caab45d2cab082a5275c1b90a0f7ded8e67985bb etcd-3.1.5.tar.gz 440c9f23decb318c565a79d376b107dbd2333e72d5d812ec1460732543348737468b3e66e82e06a1afa0f09760c1eb066804a668a24e92a23977758727e049d2 etcd.confd 99271b1ae4a5636ae2332a98d35a5d9e27cac9154d5ede7952b0627caca53ef0b0d8164aa18f53c25e42e969b80e534930c2a3ed0bd0a1fdaec093075016355c etcd.initd"