aboutsummaryrefslogtreecommitdiffstats
path: root/testing/etcd/APKBUILD
blob: 791ece06c37bbd01a3a07f549be50ea86dfb032b (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
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=etcd
pkgver=3.3.12
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"
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-3.3/etcd.conf.yml.sample
	$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 -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
}

ctl() {
	pkgdesc="A command-line client for etcd"
	install -Dm755 "$builddir"/bin/etcdctl "$subpkgdir"/usr/bin/etcdctl
}

sha512sums="63ba6130bd93471260b8d90760455bccef2755e672a9df39224491188c69e4e3e8c1157cfb639c4002fb8a6d16950f7ff448a83e0acbc389162b742f3df6234f  etcd-3.3.12.tar.gz
1fd53fccc524ab07f2780039d8155ef66af7fb23e13783ac24ab47e7841f417ac98973e7e6eaa6424c4122a9a6826cb0e20f453e02492c789514f096f0243d87  etcd.yaml
bd385f6eddd88e7bef77470c5f19f1bea839c3cfcbb08679037d2d7d1f761249430d1eee70dab62ca00c5f2c361f5aa0b0b0435b02aba72c62cd9e06aacf8a7b  etcd.confd
b86181b6dc4e9336c533086e80f88b28e7c3af2a9415a21cfde058ece11419e93f36664592f762785db3c64a41b79e1e372dc794d649927394b5644630d53cb5  etcd.initd"