diff options
author | German Lashevich | 2024-01-21 14:11:20 +0100 |
---|---|---|
committer | German Lashevich | 2024-01-21 14:11:20 +0100 |
commit | 1994ffa7dd61ac746e074b2ed5adc32cbebd27d0 (patch) | |
tree | be1134be67a06dd53fa6731cd5265322fa68305e | |
parent | 8ff486458dbbc93d46a136636c4b02e931bd91f0 (diff) | |
download | aur-1994ffa7dd61ac746e074b2ed5adc32cbebd27d0.tar.gz |
Cleanup
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rwxr-xr-x | generate-pkgbuild.sh | 108 |
3 files changed, 0 insertions, 119 deletions
diff --git a/.gitignore b/.gitignore index 9b4b1035243b..4df5cbd2d036 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ * !.SRCINFO !.gitignore -!Makefile !PKGBUILD -!generate-pkgbuild.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index b8825daeac64..000000000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -update:: - ./generate-pkgbuild.sh regular > PKGBUILD - makepkg --printsrcinfo > .SRCINFO - -install:: - makepkg -si - -clean:: - git clean -fdx diff --git a/generate-pkgbuild.sh b/generate-pkgbuild.sh deleted file mode 100755 index 25188eec6007..000000000000 --- a/generate-pkgbuild.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/bash - -set -euo pipefail - -usage() { - echo "Usage: $0 [{stable|regular|rapid}]" >&2 -} - -get_channel() { - echo ${PWD##*/} | grep -Eo '\-(stable|regular|rapid)-' | tr -d '\-' -} - -get_major_version() { - curl https://cloud.google.com/feeds/gke-stable-channel-release-notes.xml \ - | sed 's/xmlns=".*"//g' \ - | xmllint --nocdata --xpath '(/feed/entry)[1]/content/text()' - \ - | rg -o 'v?(\d\.\d+)\.\d+-gke\.\d+' -r '$1' \ - | head -n 1 -} - -if [[ $# -eq 0 ]]; -then - readonly channel=$(get_channel) - echo "Channel is not specified, automatically detected: $channel" >&2 - read -p "Is it correct? y/n " yn - case $yn in - [Yy]* ) set -- "$channel" ;; - * ) usage; exit 0;; - esac -else - readonly channel=$1 -fi - -case $1 in - -h) - usage - exit 0 - ;; - stable | regular | rapid) - readonly major_version=$(get_major_version $1) - ;; - *) - usage - exit 1 - ;; -esac - - -readonly pkgname=kubectl - -readonly version=$(curl -sSL "https://gcsweb.k8s.io/gcs/kubernetes-release/release/stable-$major_version.txt") - -readonly arches=$( \ - curl -sSL https://gcsweb.k8s.io/gcs/kubernetes-release/release/$version/bin/linux/ \ - | rg -o --pcre2 '(?<=/icons/dir.png"> )(\w+)' \ - | sed -r "/386|amd64|arm|arm64/!d; \ - s/386/i686/; \ - s/amd64/x86_64/; \ - s/\<arm\>/armv5 armv6h armv7h/; \ - s/arm64/aarch64/" \ - | tr '\n' ' ' \ -) - -cat <<EOF -# Maintainer: German Lashevich <german.lashevich@gmail.com> - -pkgname=$pkgname-gke-$channel-bin -pkgver=$version -pkgrel=1 -pkgdesc='Kubernetes.io client binary, compatible with the GKE version from the $channel channel' -provides=("$pkgname=$version") -conflicts=($pkgname $pkgname-bin) -arch=($arches) -url="https://github.com/kubernetes/kubectl" -license=('Apache-2.0') - -package() { - install -Dm755 "\$srcdir/$pkgname-$version" "\$pkgdir/usr/bin/kubectl" -} - -EOF - -for arch in $arches; do - case $arch in - i686) - _arch=386 - ;; - x86_64) - _arch=amd64 - ;; - arm*) - _arch=arm - ;; - aarch64) - _arch=arm64 - ;; - *) - echo "Unsupported architecture: $arch" >&2 - exit 1 - ;; - esac - - base_url="https://storage.googleapis.com/kubernetes-release/release/$version/bin/linux/$_arch" - - echo "source_$arch=('$pkgname-$version::$base_url/kubectl')" - echo "sha256sums_$arch=('$(curl -sSL $base_url/kubectl.sha256)')" -done - |