summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVianney Bouchaud2023-11-28 09:43:33 +0100
committerVianney Bouchaud2023-11-28 09:43:33 +0100
commit089aaef05abb524db77ac8a405be59122b70b723 (patch)
tree3434c49cc5015daf73e35facbc1274585265b75f
parent98d77d57571315a15f1a6c0e9eed5137fc016ec1 (diff)
downloadaur-089aaef05abb524db77ac8a405be59122b70b723.tar.gz
upgpkg: vcluster 0.16.3-1
upstream release adding auto-updates to vcluster package
-rw-r--r--.autoupdate0
-rw-r--r--PKGBUILD4
-rw-r--r--PKGBUILD.tpl63
3 files changed, 67 insertions, 0 deletions
diff --git a/.autoupdate b/.autoupdate
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/.autoupdate
diff --git a/PKGBUILD b/PKGBUILD
index 8ab9dd93c543..4cee7aa3dddc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,6 +16,10 @@ depends=(
'glibc'
)
+_latest() {
+ curl -s https://api.github.com/repos/loft-sh/vcluster/releases | jq -r '.[0].tag_name'
+}
+
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/loft-sh/vcluster/archive/refs/tags/v${pkgver}.tar.gz"
)
diff --git a/PKGBUILD.tpl b/PKGBUILD.tpl
new file mode 100644
index 000000000000..4f5caad29372
--- /dev/null
+++ b/PKGBUILD.tpl
@@ -0,0 +1,63 @@
+# Maintainer: Joshua Wong <joshuawong AT anticentri DOT st>
+# Contributor: Joshua Wong <joshuawong AT anticentri DOT st>
+# Contributor: Vianney Bouchaud <aur dot vianney at bouchaud dot org>
+
+pkgname=vcluster
+pkgdesc='Create fully functional virtual Kubernetes clusters'
+pkgver=$VCLUSTER_VERSION
+pkgrel=1
+arch=('x86_64' 'armv7l' 'armv7h' 'aarch64')
+url="https://vcluster.com"
+license=('apache')
+makedepends=(
+ 'go'
+)
+depends=(
+ 'glibc'
+)
+
+_latest() {
+ curl -s https://api.github.com/repos/loft-sh/vcluster/releases | jq -r '.[0].tag_name'
+}
+
+source=(
+ "${pkgname}-${pkgver}.tar.gz::https://github.com/loft-sh/vcluster/archive/refs/tags/v${pkgver}.tar.gz"
+)
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ mkdir -p build/
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ export GOPATH="$srcdir/gopath"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "\
+ -linkmode=external \
+ -buildid='' \
+ -extldflags=\"${LDFLAGS}\"" \
+ -o build/$pkgname ./cmd/vclusterctl/main.go
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+ go test ./cmd/vclusterctl/...
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+
+ install -Dm755 build/"$pkgname" "$pkgdir/usr/bin/$pkgname"
+
+ build/"$pkgname" completion bash | install -Dm644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/$pkgname"
+ build/"$pkgname" completion zsh | install -Dm644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
+}