Commit dcfb4368 authored by Jakub Jirutka's avatar Jakub Jirutka

testing/vault: improve abuild, fix code-style

parent e62b778c
......@@ -6,51 +6,43 @@ pkgrel=0
pkgdesc="Vault is a tool for securely accessing secrets."
url="https://www.vaultproject.io/"
arch="all"
license="MPL 2.0"
license="MPL-2.0"
depends=""
depends_dev=""
makedepends="go $depends_dev"
makedepends="go"
install="$pkgname.pre-install"
pkgusers="vault"
pkggroups="vault"
subpackages=""
options="!strip"
source="${pkgname}-${pkgver}.tar.gz::https://github.com/hashicorp/${pkgname}/archive/v${pkgver}.tar.gz
vault.confd
vault.hcl
vault.initd"
_builddir="${srcdir}/${pkgname}-${pkgver}"
prepare() {
cd "${_builddir}"
local i
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/$pkgname/archive/v$pkgver.tar.gz
vault.confd
vault.hcl
vault.initd"
builddir="$srcdir/$pkgname-$pkgver"
build() {
cd "$_builddir" || return 1
mkdir -p "${_builddir}/src/github.com/hashicorp"
ln -s "${_builddir}" "${_builddir}/src/github.com/hashicorp/vault"
GOPATH="${_builddir}" go build -x -v -o bin/${pkgname} || return 1
cd "$builddir"
mkdir -p "$builddir/src/github.com/hashicorp"
ln -s "$builddir" "$builddir/src/github.com/hashicorp/vault"
GOPATH="$builddir" go build -x -v -o bin/$pkgname || return 1
}
package() {
cd "$_builddir"
install -m755 -D "${srcdir}/${pkgname}.initd" \
"${pkgdir}/etc/init.d/${pkgname}" || return 1
install -m644 -D "${srcdir}/${pkgname}.confd" \
"${pkgdir}/etc/conf.d/$pkgname" || return 1
install -m750 -o root -g vault \
-D "${_builddir}/bin/${pkgname}" \
"${pkgdir}/usr/sbin/${pkgname}" || return 1
install -m750 -o vault -g vault -d "$pkgdir/var/lib/${pkgname}" || return 1
install -m750 -o root -g vault -D "$srcdir/${pkgname}.hcl" \
"$pkgdir/etc/${pkgname}.hcl" || return 1
cd "$builddir"
install -m755 -D "$srcdir/$pkgname.initd" \
"$pkgdir/etc/init.d/$pkgname" || return 1
install -m644 -D "$srcdir/$pkgname.confd" \
"$pkgdir/etc/conf.d/$pkgname" || return 1
install -m750 -o root -g vault -D bin/$pkgname \
"$pkgdir/usr/sbin/$pkgname" || return 1
install -m750 -o root -g vault -D "$srcdir/$pkgname.hcl" \
"$pkgdir/etc/$pkgname.hcl" || return 1
install -m750 -o vault -g vault -d "$pkgdir/var/lib/$pkgname" || return 1
}
md5sums="246bf47e3a90eb5b7c855b83befd5841 vault-0.6.1.tar.gz
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment