summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVianney Bouchaud2023-11-28 09:16:18 +0100
committerVianney Bouchaud2023-11-28 09:19:22 +0100
commit2188b08b352ac1e86ded6370a65d557ec9835931 (patch)
tree9fc11d6e1e6eec0be33c11da363ff5efb2e666b3
parentb17b9769e983fd223bf9f389731824777eb6e211 (diff)
downloadaur-2188b08b352ac1e86ded6370a65d557ec9835931.tar.gz
adding PKGBUILD.tpl to automate updates to kubebuilder
-rw-r--r--.autoupdate0
-rw-r--r--PKGBUILD.tpl54
2 files changed, 54 insertions, 0 deletions
diff --git a/.autoupdate b/.autoupdate
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/.autoupdate
diff --git a/PKGBUILD.tpl b/PKGBUILD.tpl
new file mode 100644
index 000000000000..28e3cb8a2b03
--- /dev/null
+++ b/PKGBUILD.tpl
@@ -0,0 +1,54 @@
+# Maintainer: Vianney Bouchaud <aur dot vianney at bouchaud dot org>
+
+pkgname=kubebuilder
+pkgdesc="SDK for building Kubernetes APIs"
+pkgver=$KUBEBUILDER_VERSION
+pkgrel=2
+arch=('x86_64' 'armv7l' 'armv7h' 'aarch64')
+url="https://github.com/kubernetes-sigs/kubebuilder"
+license=('apache')
+makedepends=(
+ 'go'
+)
+
+_latest() {
+ curl -s https://api.github.com/repos/kubernetes-sigs/kubebuilder/releases | jq -r '.[0].tag_name'
+}
+
+source=(
+ "${pkgname}-${pkgver}.tar.gz::https://github.com/kubernetes-sigs/kubebuilder/archive/v${pkgver}.tar.gz"
+)
+
+build() {
+ export GOPATH="$srcdir"/gopath
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_ENABLED=1
+
+ cd "$srcdir/$pkgname-$pkgver"
+
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "\
+ -linkmode=external \
+ -buildid=''
+ -extldflags=\"${LDFLAGS}\" \
+ -X main.kubeBuilderVersion=v${pkgver} \
+ -X main.goos=$(go env GOOS) \
+ -X main.goarch=$(go env GOARCH) \
+ -X main.gitCommit= \
+ -X main.buildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
+ -o bin/kubebuilder ./cmd
+}
+
+package() {
+ install -D -m0755 "${srcdir}/$pkgname-$pkgver/bin/kubebuilder" "${pkgdir}/usr/bin/kubebuilder"
+
+ "${pkgdir}/usr/bin/kubebuilder" completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/kubebuilder"
+ "${pkgdir}/usr/bin/kubebuilder" completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_kubebuilder"
+}