blob: 58301d428fe221836bfe4dff47ba1297ec99dbc5 (
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
|
# Maintainer: Phillip Schichtel <phillip@schich.tel>
pkgname=k0sctl
pkgver=0.23.0
pkgrel=1
pkgdesc="A bootstrapping and management tool for k0s clusters."
arch=('x86_64' 'armv7h' 'aarch64')
url="https://github.com/k0sproject/k0sctl"
license=('Apache-2.0')
makedepends=('go>=1.22')
provides=(k0sctl)
validpgpkeys=(5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23)
source=("git+https://github.com/k0sproject/k0sctl.git#commit=2b58332880abd68b094303820f7df81e4c869d4b")
sha256sums=('946bc511a677cb3af9d96fdbf8b5770cde18ab5376fcb54272094dea6b616eea')
build() {
cd "k0sctl"
local git_tag="$(git rev-parse --short=7 HEAD)"
local definitions="-X 'github.com/k0sproject/k0sctl/version.Environment=production' -X 'github.com/carlmjohnson/versioninfo.Revision=${git_tag}' -X 'github.com/carlmjohnson/versioninfo.Version=${pkgver}'"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "${definitions} -linkmode external -extldflags \"${LDFLAGS}\"" \
-o k0sctl \
main.go
}
package() {
local bin="$pkgdir/usr/bin/k0sctl"
install -D -m755 "$srcdir/k0sctl/k0sctl" "$bin"
"$bin" completion --shell bash | install -Dm644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/k0sctl"
"$bin" completion --shell zsh | install -Dm644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_k0sctl"
"$bin" completion --shell fish | install -Dm644 /dev/stdin "$pkgdir/usr/share/fish/vendor_completions.d/k0sctl.fish"
}
|