# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=etcd pkgver=3.4.3 pkgrel=2 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" install="$pkgname.pre-install" pkgusers="$pkgname" pkggroups="$pkgname" subpackages="$pkgname-doc $pkgname-ctl $pkgname-openrc" source="$pkgname-$pkgver.tar.gz::https://github.com/coreos/etcd/archive/v$pkgver.tar.gz $pkgname.yaml::https://raw.githubusercontent.com/etcd-io/etcd/release-${pkgver%.*}/etcd.conf.yml.sample $pkgname.confd $pkgname.initd " export CGO_ENABLED=0 prepare() { default_prepare export GOPATH="$(pwd)/_gopath" _coreos="$GOPATH/src/github.com/coreos" mkdir -vp $_coreos ln -vsf $srcdir/$pkgname-${pkgver} $_coreos/$pkgname } build() { bash -x ./build } package() { mkdir -p "$pkgdir"/var/lib/$pkgname chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/$pkgname install -Dm755 bin/etcd "$pkgdir"/usr/bin/etcd install -Dm644 $srcdir/$pkgname.yaml "$pkgdir"/etc/etcd/conf.yml install -Dm644 $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 } cleanup_srcdir() { go clean -modcache default_cleanup_srcdir } ctl() { pkgdesc="A command-line client for etcd" install -Dm755 "$builddir"/bin/etcdctl "$subpkgdir"/usr/bin/etcdctl } sha512sums="0bc1e857b707be1d348f5ab58a330d259dd30338c28580751142f643b2a081d1fe42a8859fa9463a734ff27f51929dc89f933f044b89d6e549a348add034d752 etcd-3.4.3.tar.gz 1fd53fccc524ab07f2780039d8155ef66af7fb23e13783ac24ab47e7841f417ac98973e7e6eaa6424c4122a9a6826cb0e20f453e02492c789514f096f0243d87 etcd.yaml e2c178b376dc05de7daee6ca3b38cc289e7c73106055dcccde08fe36a392224edf9f98203d50f14c7abeea74552675ff73a061ba20c56628eb657fa15dcd8942 etcd.confd c251f63cbaee2d5edaed3f82b4d0b8918ecee977ee459b59f0b9fef02cfe69f0de997e9a59ad29732c58782c224591b0d27378b24435f1bac0e77a35d8886bba etcd.initd"