# Contributor: Christian Kampka # Maintainer: Gennady Feldman pkgname=vault pkgver=1.2.2 pkgrel=2 pkgdesc="Vault is a tool for securely accessing secrets" url="https://www.vaultproject.io/" arch="all !s390x" license="MPL-2.0" makedepends="libcap bash make go python2 yarn npm go-bindata-assetfs" install="$pkgname.pre-install" pkgusers="vault" pkggroups="vault" subpackages="$pkgname-openrc" options="!check" source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/$pkgname/archive/v$pkgver.tar.gz static-assets.patch vault.confd vault.hcl vault.initd" builddir="$srcdir/src/github.com/hashicorp/$pkgname" prepare() { mkdir -p "$srcdir/src/github.com/hashicorp" mv "$srcdir"/$pkgname-$pkgver "$builddir"/ default_prepare } build() { GOPATH="$srcdir" CGO_ENABLED=0 make static-dist prep GOPATH="$srcdir" CGO_ENABLED=0 go build -v -o bin/$pkgname \ -ldflags "-X github.com/hashicorp/vault/version.GitDescribe='$pkgver'" \ --tags ui } package() { install -m755 -D "$srcdir/$pkgname.initd" \ "$pkgdir/etc/init.d/$pkgname" install -m644 -D "$srcdir/$pkgname.confd" \ "$pkgdir/etc/conf.d/$pkgname" install -m750 -o root -g vault -D bin/$pkgname \ "$pkgdir/usr/sbin/$pkgname" # Allow vault to use mlock as "vault" user. setcap cap_ipc_lock=+ep \ "$pkgdir/usr/sbin/$pkgname" install -m750 -o root -g vault -D "$srcdir/$pkgname.hcl" \ "$pkgdir/etc/$pkgname.hcl" install -m750 -o vault -g vault -d "$pkgdir/var/lib/$pkgname" } sha512sums="ce9211b3deb1839759646f8488fe2b89fec379bafed472921a62cd507f842ed05647fe4da7cb9482d195b028a29eb576f947da24aecd8b19181c7282fd3a155d vault-1.2.2.tar.gz e551aa366287ca86436b14c72c254d739c2492dec7a877da135ba81bf2170bbe694f2ac98798d5855004a0aca406a27c1bdf0c791844f1bd330ea3a1160c6327 static-assets.patch 6f3f30e5c9d9dd5117f18fce0e669f0cd752a6be4910405d6b394f15273372731ee887a5ba4c700293e5b8bc2bf40fd69d4337156f77b03549d2dc2c0a666bec vault.confd 8c064aa5dcca84822c1fa85e9d0ff520df46f794b2e9c689a9b4f81f74279387b3aebc08b3ca26cf786c2fcf1a330e765bf5a511074c24f87e5346672346ba1c vault.hcl dfaa3b246c51e527cda99ca12b18f52416286d2d0cbbe418ba01075dd43d54b7e8350a10985e96690a2768314326586e05a1ec931fcff7d8c78729f1869d3293 vault.initd"