summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaykel Moya2024-04-18 10:27:03 +0200
committerMaykel Moya2024-04-18 10:27:04 +0200
commit6ad6f7cc4b8e1d7efc71d0e5c7a1588b00b74360 (patch)
treee616f5f81fd1a54d2b8018c5ee305be811042f77
downloadaur-6ad6f7cc4b8e1d7efc71d0e5c7a1588b00b74360.tar.gz
Release 472.0.0
-rw-r--r--.SRCINFO25
-rw-r--r--.gitignore6
-rw-r--r--0003-add-compdef-to-zsh-completion.patch9
-rw-r--r--PKGBUILD75
-rw-r--r--google-cloud-cli.sh5
5 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..73e87c88c9fe
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = google-cloud-cli-lite
+ pkgdesc = A distribution of the gcloud CLI that strips these unnessary dependencies to reduce the size by > 75%
+ pkgver = 472.0.0
+ pkgrel = 1
+ url = https://github.com/tonymet/gcloud-lite
+ arch = x86_64
+ license = Apache-2.0
+ depends = python
+ optdepends = python-crcmod: [gsutil] verify the integrity of GCS object contents
+ provides = google-cloud-sdk
+ provides = google-cloud-cli
+ conflicts = google-cloud-sdk
+ conflicts = google-cloud-cli
+ replaces = google-cloud-sdk
+ options = !strip
+ options = staticlibs
+ options = !zipman
+ source = google-cloud-cli-lite-472.0.0.orig.tar.gz::https://github.com/tonymet/gcloud-lite/releases/download/472.0.0/google-cloud-cli-472.0.0-linux-x86_64-lite.tar.gz
+ source = google-cloud-cli.sh
+ source = 0003-add-compdef-to-zsh-completion.patch
+ sha256sums = d47d9d94d718a96189f6cd82cc6840df8d7d34d483d77b1e173af8d4b2ae8a51
+ sha256sums = e03ffb8a534b175dc497621a0396bcc29884279daa519e2cb90bd98c61d6530a
+ sha256sums = c19dbe916e6fd18d9b17b3309ee60c5d389035c5520822d2c14c045d8b853924
+
+pkgname = google-cloud-cli-lite
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..3ca0333c14ed
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
+!*.patch
+!google-cloud-cli.sh \ No newline at end of file
diff --git a/0003-add-compdef-to-zsh-completion.patch b/0003-add-compdef-to-zsh-completion.patch
new file mode 100644
index 000000000000..b932a401b361
--- /dev/null
+++ b/0003-add-compdef-to-zsh-completion.patch
@@ -0,0 +1,9 @@
+diff -urN --color a/completion.zsh.inc b/completion.zsh.inc
+--- a/completion.zsh.inc 2020-05-04 13:47:11.211895195 +0200
++++ b/completion.zsh.inc 2020-05-04 13:47:32.197626189 +0200
+@@ -1,3 +1,5 @@
++#compdef gcloud gsutil bq
++
+ autoload -U +X bashcompinit && bashcompinit
+ zmodload -i zsh/parameter
+ if ! (( $+functions[compdef] )) ; then
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..db89d62af502
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,75 @@
+# Maintainer: Maykel Moya <mmoya [at] mmoya [dot] org>
+
+_extractedName="google-cloud-sdk"
+_pkgname="google-cloud-cli"
+pkgname="${_pkgname}-lite"
+pkgver=472.0.0
+pkgrel=1
+pkgdesc="A distribution of the gcloud CLI that strips these unnessary dependencies to reduce the size by > 75%"
+url="https://github.com/tonymet/gcloud-lite"
+license=('Apache-2.0')
+arch=('x86_64')
+depends=('python')
+optdepends=(
+ "python-crcmod: [gsutil] verify the integrity of GCS object contents"
+)
+options=('!strip' 'staticlibs' !zipman)
+source=(
+ "$pkgname-$pkgver.orig.tar.gz::${url}/releases/download/${pkgver}/google-cloud-cli-${pkgver}-linux-x86_64-lite.tar.gz"
+ "google-cloud-cli.sh"
+ "0003-add-compdef-to-zsh-completion.patch"
+)
+# Conflict the old package name to force migration
+conflicts=('google-cloud-sdk' 'google-cloud-cli')
+provides=('google-cloud-sdk' 'google-cloud-cli')
+replaces=('google-cloud-sdk')
+sha256sums=('d47d9d94d718a96189f6cd82cc6840df8d7d34d483d77b1e173af8d4b2ae8a51'
+ 'e03ffb8a534b175dc497621a0396bcc29884279daa519e2cb90bd98c61d6530a'
+ 'c19dbe916e6fd18d9b17b3309ee60c5d389035c5520822d2c14c045d8b853924')
+
+prepare() {
+ cd "${_extractedName}"
+
+ for f in "${source[@]}"; do
+ [[ "$f" =~ \.patch$ ]] && \
+ ( \
+ patch -p1 -i "${srcdir}/${f}" > /dev/null 2>&1 ||\
+ ( \
+ echo "failed to apply patch: $(basename ${f})" && \
+ exit 1 \
+ ) \
+ )
+ done
+}
+
+package() {
+ mkdir "${pkgdir}/opt"
+ cp -r "${_extractedName}" "${pkgdir}/opt/${_pkgname}"
+
+ # The Google code uses a _TraceAction() method which spams the screen even
+ # in "quiet" mode, we're throwing away output on purpose to keep it clean
+ # ref: lib/googlecloudsdk/core/platforms_install.py
+ "${pkgdir}/opt/${_pkgname}/install.sh" \
+ --quiet \
+ --usage-reporting false \
+ --path-update false \
+ --bash-completion false \
+ > /dev/null
+
+ find $pkgdir -name '__pycache__' -type d -exec rm -rf {} +
+
+ install -D -m 0755 "${srcdir}/${source[1]}" \
+ "${pkgdir}/etc/profile.d/google-cloud-cli.sh"
+
+ install -d -m 0755 \
+ "${pkgdir}/etc/bash_completion.d" \
+ "${pkgdir}/usr/share/zsh/site-functions" \
+
+ ln -rsT "${pkgdir}/opt/${_pkgname}/completion.bash.inc" \
+ "${pkgdir}/etc/bash_completion.d/google-cloud-cli"
+
+ for cmd in gcloud gsutil bq; do
+ ln -rsT "${pkgdir}/opt/${_pkgname}/completion.zsh.inc" \
+ "${pkgdir}/usr/share/zsh/site-functions/_${cmd}"
+ done
+}
diff --git a/google-cloud-cli.sh b/google-cloud-cli.sh
new file mode 100644
index 000000000000..d014905553af
--- /dev/null
+++ b/google-cloud-cli.sh
@@ -0,0 +1,5 @@
+export CLOUDSDK_ROOT_DIR=/opt/google-cloud-cli
+export CLOUDSDK_PYTHON=/usr/bin/python
+export CLOUDSDK_PYTHON_ARGS=-S
+export PATH=$CLOUDSDK_ROOT_DIR/bin:$PATH
+export GOOGLE_CLOUD_SDK_HOME=$CLOUDSDK_ROOT_DIR