aboutsummaryrefslogtreecommitdiffstats
path: root/testing/etcd/APKBUILD
blob: 020b46fd54408ad5a4bbdb6aa2d575d6c3102fc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=etcd
pkgver=3.4.5
pkgrel=0
pkgdesc="A highly-available key value store for shared configuration and service discovery"
options="chmod-clean"
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-$pkgver::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-$pkgver  "$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="cd8845433e208cbe1cf0e0a001ee503d42b73f44ac0e0578d9ee8692f95262929c0cec3a2622f9cd3ea8d393a136de47a7e0d0875b4e0cd9d8eeddd45ca3bea5  etcd-3.4.5.tar.gz
aa42b93eb4bf762173563ffd0b93dd82f3aafdf277248ca356daa4aaf82da945d5f740c07db7e95d05895bb44a2bb303041f0a7b3329f7ce483d2785df011f9e  etcd.yaml-3.4.5
e2c178b376dc05de7daee6ca3b38cc289e7c73106055dcccde08fe36a392224edf9f98203d50f14c7abeea74552675ff73a061ba20c56628eb657fa15dcd8942  etcd.confd
c251f63cbaee2d5edaed3f82b4d0b8918ecee977ee459b59f0b9fef02cfe69f0de997e9a59ad29732c58782c224591b0d27378b24435f1bac0e77a35d8886bba  etcd.initd"