aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ssh-cert-authority/APKBUILD
blob: 57d19ab5191639ee89d2830693adde7095cdba15 (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
# Contributor: Carlgo11 <carlgo11@carlgo11.com>
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer:
pkgname=ssh-cert-authority
pkgver=2.0.0
pkgrel=2
pkgdesc="An implementation of an SSH certificate authority"
url="https://github.com/cloudtools/ssh-cert-authority"
arch="all"
license="BSD-2-Clause"
makedepends="go"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/cloudtools/ssh-cert-authority/archive/$pkgver.tar.gz"

build() {
	local pkg=github.com/cloudtools/ssh-cert-authority

	# Fix build on riscv64
	HOME="$srcdir" go mod edit -replace \
		golang.org/x/sys=golang.org/x/sys@v0.0.0-20210630005230-0f9fa26af87c
	HOME="$srcdir" go mod download golang.org/x/sys

	HOME="$srcdir" go build \
		-ldflags "-X $pkg/version.Tag=$pkgver \
			-X $pkg/version.BuildVersion=$pkgver" \
			-o bin/$pkgname
}

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

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

cleanup_srcdir() {
	if [ -d "$srcdir" ]; then
		find "$srcdir" -print0 | xargs -0 chmod +w
	fi
	default_cleanup_srcdir
}

sha512sums="495b4ba72b848eeeb86869ffe312f37d4f49e6e281e840f5680e8f55cc2d29b33c771bc46ee2755d25d198e58e5dea0ce28a649321f4f979f59a1c22ed4d6f1c  ssh-cert-authority-2.0.0.tar.gz"