vault-bin-arm/PKGBUILD

80 lines
3.0 KiB
Bash
Raw Normal View History

2017-12-03 00:43:53 +00:00
# Maintainer : Christian Rebischke <Chris.Rebischke@archlinux.org>
# Contributor: Tim Meusel <tim@bastelfreak.de>
2021-05-21 23:30:49 +00:00
# Contributor: Sebastian Rakel <sebastian@devunit.eu>
# Contributor: Justin Kromlinger <hashworks@archlinux.org>
2021-12-10 08:50:03 +00:00
# Contributor: Andrew Tyler <assimilat@gmail.com>
2022-06-16 14:34:17 +00:00
pkgname=vault
2017-12-03 00:43:53 +00:00
pkgdesc='A tool for managing secrets'
2023-06-10 10:03:34 +00:00
pkgver=1.13.3
pkgrel=2
url="https://vaultproject.io/"
2017-12-03 00:43:53 +00:00
license=('MPL')
arch=('x86_64')
2023-02-21 13:11:07 +00:00
depends=('glibc')
makedepends=('go' 'git' 'yarn' 'bower' 'nodejs-lts-gallium' 'npm' 'zip' 'gox' 'go-tools')
2022-06-16 14:34:17 +00:00
install=vault.install
backup=('etc/vault.hcl' 'etc/default/vault')
2023-06-10 10:03:34 +00:00
_vault_commit='3bedf816cbf851656ae9e6bd65dd4a67a9ddff5e'
2017-12-03 00:43:53 +00:00
source=("git+https://github.com/hashicorp/vault#commit=${_vault_commit}"
2021-12-10 08:50:03 +00:00
'vault.sysusers'
'vault.tmpfiles'
'vault.hcl')
2017-12-03 00:43:53 +00:00
sha512sums=('SKIP'
'92616ccf83fa5ca9f8b0d022cf8ceb1f3549e12b66bf21d9f77f3eb26bd75ec1dc36c155948ec987c642067b85fbfc30a9217d6c503d952a402aa5ef63e50928'
'db327aae6f821ee1ea608abdb3fc82aeeae72ce873d78ada44461644add32afd6c0197019427734498bc28ae187b6f741a02196e40a620caab597e5eef32ca7a'
'75d654ec4eadfe983f57951d470fff8b9eb953b42c08e7b6b3a1baaa0721fd7a9d5be37480b0e4f4fd8518f375348bdd8394848f0fb27cb1d425279acb67f693')
2017-12-03 00:43:53 +00:00
pkgver() {
2023-02-21 13:11:07 +00:00
cd vault
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd vault
sed -i 's|/etc/vault.d/vault.hcl|/etc/vault.hcl|g' .release/linux/package/usr/lib/systemd/system/vault.service
sed -i 's|/etc/vault.d/vault.env|/etc/default/vault|g' .release/linux/package/usr/lib/systemd/system/vault.service
}
2021-12-10 08:50:03 +00:00
build() {
2023-02-21 13:11:07 +00:00
mkdir -p "${srcdir}/vault/http/web_ui"
cd "${srcdir}/vault/ui"
yarn install --ignore-optional
npm rebuild node-sass
yarn --verbose run build
cd "${srcdir}/vault"
2020-07-05 14:11:49 +00:00
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
2023-02-21 13:11:07 +00:00
export GOPATH="${srcdir}"
mkdir -p bin
go build \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode=external -compressdwarf=false -X github.com/hashicorp/vault/sdk/version.Version=${pkgver} -X github.com/hashicorp/vault/sdk/version.GitCommit=${_vault_commit} -X github.com/hashicorp/vault/sdk/version.BuildDate=$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
-tags ui \
-o dist/ \
.
2017-12-03 00:43:53 +00:00
}
2021-12-10 08:50:03 +00:00
package() {
install -Dm644 "${srcdir}/vault.hcl" "${pkgdir}/etc/vault.hcl"
install -Dm644 "${srcdir}/vault.sysusers" "${pkgdir}/usr/lib/sysusers.d/vault.conf"
install -Dm644 "${srcdir}/vault.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/vault.conf"
2023-02-21 13:11:07 +00:00
cd "${srcdir}/vault"
install -Dm644 ".release/linux/package/etc/vault.d/vault.env" "${pkgdir}/etc/default/vault"
install -Dm644 ".release/linux/package/usr/lib/systemd/system/vault.service" "${pkgdir}/usr/lib/systemd/system/vault.service"
2023-02-21 13:11:07 +00:00
install -Dm755 "dist/vault" "${pkgdir}/usr/bin/vault"
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
2021-05-21 23:30:49 +00:00
for file in README.md CHANGELOG.md CONTRIBUTING.md; do
install -Dm644 "${file}" "${pkgdir}/usr/share/doc/${pkgname}/${file}"
done
2017-12-03 00:43:53 +00:00
}