diff options
author | Zac Medico <zmedico@gentoo.org> | 2024-03-29 14:15:09 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2024-03-29 14:21:50 -0700 |
commit | 90acc6a830b4aad16e75e7395db7fd1b7e854390 (patch) | |
tree | e6457fa3d75103107ed15b92aee17ba2f1d480dc /app-admin/vault | |
parent | profiles: Apply workaround for broken x32 systemd stage bootstrap (diff) | |
download | gentoo-90acc6a830b4aad16e75e7395db7fd1b7e854390.tar.gz gentoo-90acc6a830b4aad16e75e7395db7fd1b7e854390.tar.bz2 gentoo-90acc6a830b4aad16e75e7395db7fd1b7e854390.zip |
app-admin/vault: add 1.15.6
Includes stubmaker patch from here:
https://github.com/hashicorp/vault/pull/24678
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'app-admin/vault')
-rw-r--r-- | app-admin/vault/Manifest | 3 | ||||
-rw-r--r-- | app-admin/vault/files/vault-1.15.6-stubmaker-outside-git-repo-24678.patch | 92 | ||||
-rw-r--r-- | app-admin/vault/vault-1.15.6.ebuild | 86 |
3 files changed, 181 insertions, 0 deletions
diff --git a/app-admin/vault/Manifest b/app-admin/vault/Manifest index ed9fdd0f316c..e143138c3666 100644 --- a/app-admin/vault/Manifest +++ b/app-admin/vault/Manifest @@ -4,3 +4,6 @@ DIST vault-1.14.8-vendor.tar.gz 71869146 BLAKE2B 5875056d5ec53396ed53db7fd4891a6 DIST vault-1.14.8-webui.tar.xz 1680312 BLAKE2B c698adc325633b1dc59dea3b09692da0476a5f3dbd1f69f1e68243fa903e4590b152846f2dabd4b7f5f492467fcdc52c0afd82bfe1a956b1b69f11da403fab9c SHA512 a25faa74614b31688bb91c4ac2b6a105426be632cc417e94ef14c60a388f076eaec006e07a9784047422b70ce9d9c9fd33e6fb8ef3595b7f1a6468739da8e1c6 DIST vault-1.14.9-vendor.tar.gz 71845081 BLAKE2B ea25a6ba8ac293971170688b4ce3845ba19a5af746c3d96860420d74f8c0af33ea118a47d17117dbd520675739c44ed76118ef126c5b53e4c4adb0924cda58d5 SHA512 00ff45f986889d17ebe59c27aeaf8132270e5f06883bf84ce10721c9e2943a25ad8b86be3271991c824369ad5545258b3c01600f1dda06487751ff806b1d76b9 DIST vault-1.14.9-webui.tar.xz 1677212 BLAKE2B db4da051a8c0a62e99c1f2070f3c022fc934350b255d21b360b3b3b53555942f1ac6c4ef15ed7d8a2519f05752406add63837317615afb387b0fc407f5ab8410 SHA512 2f54dd24fb9a4e2e774dd4212a605126a9d4e4975a97a01c88c94bce8e6f10174fe07235d402dd43ae31aacf4371f77272e4446d972d2e7304745186b0e6dbb7 +DIST vault-1.15.6-deps.tar.xz 20736608 BLAKE2B 53e21d0664f9bbd8c851a486334e04d3b3151aaee709c8fe88ab4969a81ebd4562cf3a350e383647140bd4826a0aa75b34ef136c81920b868dff7ae6f0522e37 SHA512 c1c24c2c646a441c551849af2d3165fc15db2b61f261608f44b7371214cdef0e76263b5b2f295c19606057e80316b4864fff64bc5603b99901fc8a5d900c6550 +DIST vault-1.15.6-webui.tar.xz 1721320 BLAKE2B 3f2d31767c6086e7b17f7445f0cff34ce4ebd7a6a1daeaede96443758096a6b8b94b971af5a74e8bcfb2c95c07b496b1babf3f8ce82f9b360fafe5a4d5138cac SHA512 6a532258a5c7734863967926d95699b2611959177b9dbf4e60cff115331237e65f3dbc41e842443ee5af9020c69280b27a511f887528dc914f9d9e642f9a3a63 +DIST vault-1.15.6.tar.gz 31923253 BLAKE2B 8a4e7b9d8d6753b6f717c6699b2d4822cecff299e3cebd8945d3c34232ff77611611d4e6259ab9c9c4ff91a2e52b7eef707df7da68960be36c314ceba18b124b SHA512 52be0e47f3028f9c1f3ce5d2a72356c955f20fcaf6e8396a6d5938226d72cd8353bed398ba66a6821fc609aaed465e82c3449aeaa0dfaabe80ff0412a73779b3 diff --git a/app-admin/vault/files/vault-1.15.6-stubmaker-outside-git-repo-24678.patch b/app-admin/vault/files/vault-1.15.6-stubmaker-outside-git-repo-24678.patch new file mode 100644 index 000000000000..5b47f39cb81b --- /dev/null +++ b/app-admin/vault/files/vault-1.15.6-stubmaker-outside-git-repo-24678.patch @@ -0,0 +1,92 @@ +From cd6d0e1c593e158b8641529410d95e4b1722d5b2 Mon Sep 17 00:00:00 2001 +From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com> +Date: Thu, 4 Jan 2024 17:03:09 -0600 +Subject: [PATCH] Allow stubmaker to work outside of a git repository + +https://github.com/hashicorp/vault/pull/24678 + +Fixes: https://github.com/hashicorp/vault/issues/24677 +--- + tools/stubmaker/main.go | 58 +++++++++++++++++++++++------------------ + 1 file changed, 33 insertions(+), 25 deletions(-) + +diff --git a/tools/stubmaker/main.go b/tools/stubmaker/main.go +index 53676e08b8c84..15e95b6a45f60 100644 +--- a/tools/stubmaker/main.go ++++ b/tools/stubmaker/main.go +@@ -43,15 +43,21 @@ func main() { + DetectDotGit: true, + }) + if err != nil { +- fatal(err) ++ if err.Error() != "repository does not exist" { ++ fatal(err) ++ } ++ repo = nil + } + +- wt, err := repo.Worktree() +- if err != nil { +- fatal(err) +- } +- if !isEnterprise(wt) { +- return ++ var wt *git.Worktree ++ if repo != nil { ++ wt, err = repo.Worktree() ++ if err != nil { ++ fatal(err) ++ } ++ if !isEnterprise(wt) { ++ return ++ } + } + + // Read the file and figure out if we need to do anything. +@@ -80,26 +86,28 @@ func main() { + + // We'd like to write the file, but first make sure that we're not going + // to blow away anyone's work or overwrite a file already in git. +- head, err := repo.Head() +- if err != nil { +- fatal(err) +- } +- obj, err := repo.Object(plumbing.AnyObject, head.Hash()) +- if err != nil { +- fatal(err) +- } ++ if repo != nil { ++ head, err := repo.Head() ++ if err != nil { ++ fatal(err) ++ } ++ obj, err := repo.Object(plumbing.AnyObject, head.Hash()) ++ if err != nil { ++ fatal(err) ++ } + +- st, err := wt.Status() +- if err != nil { +- fatal(err) +- } ++ st, err := wt.Status() ++ if err != nil { ++ fatal(err) ++ } + +- tracked, err := inGit(wt, st, obj, outputFile) +- if err != nil { +- fatal(err) +- } +- if tracked { +- fatal(fmt.Errorf("output file %s exists in git, not overwriting", outputFile)) ++ tracked, err := inGit(wt, st, obj, outputFile) ++ if err != nil { ++ fatal(err) ++ } ++ if tracked { ++ fatal(fmt.Errorf("output file %s exists in git, not overwriting", outputFile)) ++ } + } + + // Now we can finally write the file diff --git a/app-admin/vault/vault-1.15.6.ebuild b/app-admin/vault/vault-1.15.6.ebuild new file mode 100644 index 000000000000..2a8f84f25ca1 --- /dev/null +++ b/app-admin/vault/vault-1.15.6.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit fcaps go-module systemd + +DESCRIPTION="A tool for managing secrets" +HOMEPAGE="https://vaultproject.io/" + +VAULT_WEBUI_ARCHIVE="${P}-webui.tar.xz" +SRC_URI="https://github.com/hashicorp/vault/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" webui? ( https://dev.gentoo.org/~zmedico/dist/${VAULT_WEBUI_ARCHIVE} )" +SRC_URI+=" https://dev.gentoo.org/~zmedico/dist/${P}-deps.tar.xz" + +LICENSE="MPL-2.0 Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~riscv" +IUSE="+webui" + +BDEPEND=" + app-arch/zip + dev-go/gox + >=dev-lang/go-1.21" +COMMON_DEPEND="acct-group/vault + acct-user/vault" + DEPEND="${COMMON_DEPEND}" + RDEPEND="${COMMON_DEPEND}" + +FILECAPS=( + -m 755 'cap_ipc_lock=+ep' usr/bin/${PN} +) + +RESTRICT="test" +S=${WORKDIR}/${P} +PATCHES=("${FILESDIR}/${P}-stubmaker-outside-git-repo-24678.patch") + +src_unpack() { + default +} + +src_prepare() { + default + # Avoid the need to have a git checkout + sed -e 's:^\(GIT_COMMIT=\).*:\1:' \ + -e 's:^\(GIT_DIRTY=\).*:\1:' \ + -e s:\'\${GIT_COMMIT}\${GIT_DIRTY}\':: \ + -e "s|^BUILD_DATE=.*|BUILD_DATE=$(date +%Y-%m-%dT%H:%M:%SZ)|" \ + -i scripts/build.sh || die + sed -e "/hooks/d" \ + -e 's|^\([[:space:]]*\)goimports .*)|\1true|' \ + -e "s/gofumpt/gofmt/g" \ + -i Makefile || die + if [[ -d "${WORKDIR}/http/web_ui" ]]; then + rm -rf "${S}/http/web_ui" || die + mv "${WORKDIR}/http/web_ui" "${S}/http/web_ui" || + die "mv failed" + else + mkdir -p "${S}/http/web_ui" || die + touch "${S}/http/web_ui/no_web_ui" || die + fi +} + +src_compile() { + mkdir "${T}"/bin || die + BUILD_TAGS="$(usex webui ui '')" \ + GOPATH="${T}" \ + XC_ARCH=$(go env GOARCH) \ + XC_OS=$(go env GOOS) \ + XC_OSARCH=$(go env GOOS)/$(go env GOARCH) \ + emake bin +} + +src_install() { + dobin bin/${PN} + dodoc CHANGELOG.md CONTRIBUTING.md README.md + insinto /etc/${PN}.d + doins "${FILESDIR}/"*.json.example + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotated" "${PN}" + newinitd "${FILESDIR}/${PN}.initd" "${PN}" + newconfd "${FILESDIR}/${PN}.confd" "${PN}" + systemd_dounit "${FILESDIR}/${PN}.service" + keepdir /var/log/${PN} + fowners ${PN}:${PN} /var/log/${PN} +} |