summaryrefslogtreecommitdiff
path: root/testing/stern/APKBUILD
blob: 7690c46fded301121afb650229b2242cfa3ee52b (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
44
45
46
47
48
49
50
51
52
# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=stern
pkgver=1.22.0
pkgrel=2
pkgdesc="Multi pod and container log tailing for Kubernetes"
url="https://github.com/stern/stern"
arch="all"
license="Apache-2.0"
makedepends="go"
checkdepends="tzdata"
subpackages="
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/stern/stern/archive/refs/tags/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	GOLDFLAGS="
	-X github.com/stern/stern/cmd.version=$pkgver
	-X github.com/stern/stern/cmd.commit=AlpineLinux
	-X github.com/stern/stern/cmd.date=$(date +%FT%T%Z)
	"
	go build -v -o bin/$pkgname -ldflags "$GOLDFLAGS"
	./bin/stern --completion bash > stern.bash
	./bin/stern --completion zsh > stern.zsh
	./bin/stern --completion fish > stern.fish
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname

	install -Dm644 stern.bash \
		"$pkgdir"/usr/share/bash-completion/completions/stern
	install -Dm644 stern.zsh \
		"$pkgdir"/usr/share/zsh/site-functions/_stern
	install -Dm644 stern.fish \
		"$pkgdir"/usr/share/fish/completions/stern.fish
}

sha512sums="
1f11b4613175c3b58bba1b107c6d19f8d32c76836b1092e1063679feb6f33b059c52d5b165b0a5906d5edff6efcb133d7032ab0fcc1e69751e8f184f7f4f7ddc  stern-1.22.0.tar.gz
"