aboutsummaryrefslogtreecommitdiffstats
path: root/community/cosign/APKBUILD
blob: 5c8f85bd01f1f8ddd8afcdb2da802db673935a56 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=cosign
pkgver=1.10.1
pkgrel=2
pkgdesc="container signing tool with support for ephemeral keys and Sigstore signing"
url="https://github.com/sigstore/cosign"
arch="all"
license="Apache-2.0"
# pcsc-lite-libs needed at runtime for smartcard support
depends="pcsc-lite-libs"
makedepends="go pcsc-lite-dev"
# NOTE: We can't use the default bashcomp, etc splitters because they take everything,
# the default splitters should be improved somehow.
subpackages="
	sget
	sget-bash-completion:_sget_bashcomp
	sget-fish-completion:_sget_fishcomp
	sget-zsh-completion:_sget_zshcomp

	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://github.com/sigstore/cosign/archive/v$pkgver/cosign-$pkgver.tar.gz"
options="!check"

# secfixes:
#   1.10.1-r0:
#     - CVE-2022-35929
#   1.5.2-r0:
#     - CVE-2022-23649

build() {
	mkdir build
	go build -o build/ -tags -tags=pivkey,pkcs11key "$builddir"/cmd/...

	for i in bash fish zsh; do
		"$builddir"/build/cosign completion $i > "$builddir"/cosign.$i
		"$builddir"/build/sget completion $i > "$builddir"/sget.$i
	done
}

check() {
	make test
}

package() {
	install -Dm755 "$builddir"/build/cosign "$pkgdir"/usr/bin/cosign
	install -Dm755 "$builddir"/build/sget "$pkgdir"/usr/bin/sget

	for i in cosign sget; do
		install -Dm644 "$builddir"/$i.bash "$pkgdir"/usr/share/bash-completion/completions/$i
		install -Dm644 "$builddir"/$i.fish "$pkgdir"/usr/share/fish/completions/$i.fish
		install -Dm644 "$builddir"/$i.zsh "$pkgdir"/usr/share/zsh/site-functions/_$i
	done
}

sget() {
	pkgdesc="secure container image fetching tool"
	amove /usr/bin/sget
}

_sget_bashcomp() {
	amove /usr/share/bash-completion/completions/sget
}

_sget_fishcomp() {
	amove /usr/share/fish/completions/sget.fish
}

_sget_zshcomp() {
	amove /usr/share/zsh/site-functions/_sget
}

sha512sums="
6ae94b8d0572f7240457ad208e3ae45a7ca8bcde95b1b10c3bd0a5bae4801eb2d3c4f9b18162d4c157cbd0fe2269dd9a909323d8c2a216ce2cf52f98e95e6af9  cosign-1.10.1.tar.gz
"