summaryrefslogtreecommitdiff
path: root/sys-cluster/flux/flux-2.9.3.ebuild
blob: 6b13a73b693f1d708871fb15af13e98b3b6a5c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
inherit go-module shell-completion

MY_PN="flux2"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="Flux is a tool for keeping Kubernetes clusters in sync"
HOMEPAGE="https://fluxcd.io https://github.com/fluxcd/flux2"
SRC_URI="https://github.com/fluxcd/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"
SRC_URI+=" https://github.com/fluxcd/${MY_PN}/releases/download/v${PV}/manifests.tar.gz -> ${MY_P}-manifests.tar.gz"
SRC_URI+=" https://distfiles.gentoo.org/pub/dev/concord@gentoo.org/${MY_P}-deps.tar.xz"
S="${WORKDIR}/${MY_P}"

LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND=">=dev-lang/go-1.26.0:="

RESTRICT+=" test"

QA_PRESTRIPPED="usr/bin/flux"

src_unpack() {
	default
	mkdir -p "${S}/cmd/${PN}/manifests" || die
	mv "${WORKDIR}"/*.yaml "${S}/cmd/${PN}/manifests" || die
}

src_compile() {
	ego build -ldflags="-s -w -X main.VERSION=${PV}" -o ./bin/${PN} ./cmd/${PN}
}

src_install() {
	dobin bin/${PN}
	bin/${PN} completion bash > ${PN}.bash || die
	bin/${PN} completion zsh > ${PN}.zsh || die
	newbashcomp ${PN}.bash ${PN}
	newzshcomp ${PN}.zsh _${PN}
}