Created
February 13, 2018 13:57
-
-
Save urbanslug/54c97deeabfb40c0dcb745571ee632bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgname='vault-git' | |
pkgdesc='A tool for managing secrets' | |
pkgver=v0.9.3.r129.g6e6b0eb08 | |
pkgrel=1 | |
url='https://vaultproject.io/' | |
license=('MPL') | |
arch=('i686' 'x86_64') | |
makedepends=('gox' 'go') | |
depends=('glibc' 'libcap') | |
provides=("${pkgname%-git}") | |
conflicts=("${provides[@]}") | |
install='vault.install' | |
source=("${pkgname}::git+https://github.com/hashicorp/vault/" | |
'vault.service' | |
'vault.hcl') | |
sha512sums=('SKIP' | |
'a97d10208fd99b29cf532c9b5882fe1bbb3faee1d1d706f95a9c379fef461c65a9f16c8530438920024e69871ebd8c7329e6b65025ad65092950bfb74ce393b3' | |
'8c064aa5dcca84822c1fa85e9d0ff520df46f794b2e9c689a9b4f81f74279387b3aebc08b3ca26cf786c2fcf1a330e765bf5a511074c24f87e5346672346ba1c') | |
pkgver () { | |
cd "${pkgname}" | |
( set -o pipefail | |
git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || | |
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | |
git checkout tags/v0.9.3 | |
) | |
} | |
_srcpath='src/github.com/hashicorp/vault' | |
prepare () { | |
if [[ ! -r ${_srcpath} ]] ; then | |
mkdir -p "$(dirname "${_srcpath}")" | |
ln -s "$(pwd)/${pkgname}" "${_srcpath}" | |
fi | |
} | |
build () { | |
export GOPATH="${srcdir}:$(pwd)" | |
cd "${_srcpath}" | |
gox -verbose -osarch="$(go env GOOS)/$(go env GOARCH)" -output=_build/vault . | |
} | |
package () { | |
cd "${pkgname}" | |
install -Dm755 _build/vault "${pkgdir}/usr/bin/vault" | |
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" | |
install -Dm644 "${srcdir}/vault.hcl" "${pkgdir}/etc/vault.hcl" | |
install -Dm644 "${srcdir}/vault.service" \ | |
"${pkgdir}/usr/lib/systemd/system/vault.service" | |
for file in README.md CHANGELOG.md ; do | |
install -Dm644 "${file}" "${pkgdir}/usr/share/doc/${pkgname}/${file}" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment