Last active
October 22, 2025 05:44
-
-
Save guymers/2d8856aefba1793fd50614d58620bf5f to your computer and use it in GitHub Desktop.
AUR google-cloud-cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| post_install() { | |
| echo "Disable usage reporting by running: gcloud config set disable_usage_reporting true" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export CLOUDSDK_ROOT_DIR=/opt/google-cloud-sdk | |
| export CLOUDSDK_PYTHON=/usr/bin/python | |
| export CLOUDSDK_PYTHON_ARGS=-S | |
| export GOOGLE_CLOUD_SDK_HOME=$CLOUDSDK_ROOT_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pkgname="google-cloud-cli" | |
| pkgver=544.0.0 | |
| pkgrel=1 | |
| pkgdesc="Create and manage Google Cloud resources and services directly on the command line or via scripts using the Google Cloud CLI." | |
| url="https://cloud.google.com/cli" | |
| license=("Apache") | |
| arch=('x86_64') | |
| depends=('python') | |
| optdepends=( | |
| "python-crcmod: [gsutil] verify the integrity of GCS object contents" | |
| ) | |
| conflicts=('google-cloud-sdk') | |
| provides=('google-cloud-sdk') | |
| install='google-cloud-cli.install' | |
| options=('!strip' '!zipman') | |
| source=( | |
| "$pkgname-$pkgver.tar.gz::https://dl.google.com/dl/cloudsdk/release/downloads/for_packagers/linux/${pkgname}_${pkgver}.orig_amd64.tar.gz" | |
| "gke-gcloud-auth-plugin-$pkgver.tar.gz::https://storage.googleapis.com/cloud-sdk-release/for_packagers/linux/google-cloud-cli-gke-gcloud-auth-plugin_${pkgver}.orig_amd64.tar.gz" | |
| "google-cloud-cli.sh" | |
| ) | |
| sha256sums=( | |
| '23fe55a153e23f99af8b6d8b345be35f96d5cd4b181dc2d5aceb5a204569c5f3' | |
| '31038eaecf9e33d96b04d2755e1535cfa161b3a786dead833b3c8e9967db63c9' | |
| 'cf98888bdb378411ccabd749cd26ad442746978dc6c66b521149537994dbe411' | |
| ) | |
| package() { | |
| # remove all of the unnecessary files included in the tarball... | |
| find "$srcdir/google-cloud-sdk" -name '__pycache__' -type d -exec rm -r {} + | |
| find "$srcdir/google-cloud-sdk" -name "tests" -type d -exec rm -r {} + | |
| find "$srcdir/google-cloud-sdk" -name "test.py" -type f -exec rm {} \; | |
| find "$srcdir/google-cloud-sdk" -name "*_test.py" -type f -exec rm {} \; | |
| find "$srcdir/google-cloud-sdk/lib/third_party/botocore/data" -mindepth 1 -maxdepth 1 -type d -not -name s3 -exec rm -r {} + | |
| find "$srcdir/google-cloud-sdk/platform/gsutil/third_party" -name "docs" -type d -exec rm -r {} + | |
| find "$srcdir/google-cloud-sdk/platform/gsutil/third_party" -name "examples" -type d -exec rm -r {} + | |
| find "$srcdir/google-cloud-sdk/platform/gsutil/third_party" -name "samples" -type d -exec rm -r {} + | |
| rm -r "$srcdir/google-cloud-sdk/platform/gsutil/third_party/requests/ext/" | |
| rm -r "$srcdir/google-cloud-sdk/deb" | |
| rm -r "$srcdir/google-cloud-sdk/rpm" | |
| rm "$srcdir/google-cloud-sdk/"install.* | |
| rm "$srcdir/google-cloud-sdk/"path.*.inc | |
| rm -r "$srcdir/google-cloud-sdk/platform/bundledpythonunix" | |
| rm "$srcdir/google-cloud-sdk/.install/bundled-python3-unix"* | |
| mkdir "$pkgdir/opt" | |
| installdir="$pkgdir/opt/$pkgname" | |
| cp -r "$srcdir/google-cloud-sdk" "$installdir" | |
| install -D -m 0755 "$srcdir/google-cloud-cli.sh" "$pkgdir/etc/profile.d/google-cloud-cli.sh" | |
| install -D -m 0644 "$installdir/completion.bash.inc" "$pkgdir/usr/share/bash-completion/completions/gcloud" | |
| (cd "$pkgdir/usr/share/bash-completion/completions/" && ln -s "gcloud" "bq") | |
| (cd "$pkgdir/usr/share/bash-completion/completions/" && ln -s "gcloud" "gsutil") | |
| rm "$installdir/completion.bash.inc" | |
| install -D -m 0644 "$installdir/completion.zsh.inc" "$pkgdir/usr/share/zsh/site-functions/_gcloud" | |
| rm "$installdir/completion.zsh.inc" | |
| mkdir -p "$pkgdir/usr/share" | |
| mv -f "$installdir/help/man" "$pkgdir/usr/share/" | |
| rm -r "$installdir/help" | |
| install -D -m 0644 "$installdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | |
| rm "$installdir/LICENSE" | |
| install -d -m 0755 "$pkgdir/usr/bin" | |
| ln -s "/opt/$pkgname/bin/bq" "$pkgdir/usr/bin/bq" | |
| ln -s "/opt/$pkgname/bin/docker-credential-gcloud" "$pkgdir/usr/bin/docker-credential-gcloud" | |
| ln -s "/opt/$pkgname/bin/gcloud" "$pkgdir/usr/bin/gcloud" | |
| ln -s "/opt/$pkgname/bin/gcloud-crc32c" "$pkgdir/usr/bin/gcloud-crc32c" | |
| ln -s "/opt/$pkgname/bin/gsutil" "$pkgdir/usr/bin/gsutil" | |
| ln -s "/opt/$pkgname/bin/gke-gcloud-auth-plugin" "$pkgdir/usr/bin/gke-gcloud-auth-plugin" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment