2017-12-03 00:43:53 +00:00
|
|
|
# Maintainer : Christian Rebischke <Chris.Rebischke@archlinux.org>
|
2018-05-01 15:35:14 +00:00
|
|
|
# Contributor: Tim Meusel <tim@bastelfreak.de>
|
2021-05-21 23:30:49 +00:00
|
|
|
# Contributor: Sebastian Rakel <sebastian@devunit.eu>
|
2021-09-29 18:22:45 +00:00
|
|
|
# Contributor: Justin Kromlinger <hashworks@archlinux.org>
|
2021-12-10 08:50:03 +00:00
|
|
|
# Contributor: Andrew Tyler <assimilat@gmail.com>
|
2018-01-09 14:04:37 +00:00
|
|
|
|
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-20 21:11:43 +00:00
|
|
|
pkgver=1.13.4
|
|
|
|
pkgrel=1
|
2018-05-01 15:35:14 +00:00
|
|
|
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')
|
2023-05-21 19:16:29 +00:00
|
|
|
makedepends=('go' 'git' 'yarn' 'bower' 'nodejs-lts-gallium' 'npm' 'zip' 'gox' 'go-tools')
|
2022-06-16 14:34:17 +00:00
|
|
|
install=vault.install
|
2023-06-11 15:13:33 +00:00
|
|
|
backup=('etc/vault.hcl' 'etc/default/vault')
|
2023-06-20 21:11:43 +00:00
|
|
|
_vault_commit='a212330c7b4b3d1ec958a06227b27689790d98b4'
|
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'
|
2018-01-09 14:04:37 +00:00
|
|
|
'92616ccf83fa5ca9f8b0d022cf8ceb1f3549e12b66bf21d9f77f3eb26bd75ec1dc36c155948ec987c642067b85fbfc30a9217d6c503d952a402aa5ef63e50928'
|
2023-06-11 15:13:33 +00:00
|
|
|
'db327aae6f821ee1ea608abdb3fc82aeeae72ce873d78ada44461644add32afd6c0197019427734498bc28ae187b6f741a02196e40a620caab597e5eef32ca7a'
|
|
|
|
'75d654ec4eadfe983f57951d470fff8b9eb953b42c08e7b6b3a1baaa0721fd7a9d5be37480b0e4f4fd8518f375348bdd8394848f0fb27cb1d425279acb67f693')
|
2017-12-03 00:43:53 +00:00
|
|
|
|
2021-09-30 13:04:05 +00:00
|
|
|
pkgver() {
|
2023-02-21 13:11:07 +00:00
|
|
|
cd vault
|
2021-09-30 13:04:05 +00:00
|
|
|
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
|
|
|
}
|
|
|
|
|
2023-06-11 15:13:33 +00:00
|
|
|
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() {
|
2018-05-01 15:35:14 +00:00
|
|
|
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-06-11 15:13:33 +00:00
|
|
|
|
2023-02-21 13:11:07 +00:00
|
|
|
cd "${srcdir}/vault"
|
2023-06-11 15:13:33 +00:00
|
|
|
|
|
|
|
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"
|
2023-06-11 15:13:33 +00:00
|
|
|
|
2021-05-21 23:30:49 +00:00
|
|
|
for file in README.md CHANGELOG.md CONTRIBUTING.md; do
|
2018-05-01 15:35:14 +00:00
|
|
|
install -Dm644 "${file}" "${pkgdir}/usr/share/doc/${pkgname}/${file}"
|
|
|
|
done
|
2017-12-03 00:43:53 +00:00
|
|
|
}
|