mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-05-01 03:00:26 -04:00
* Gcloud 557.0.0 => 558.0.0 * Mark packages from successful builds as automatically buildable. * update-gcloud: Package File Update Run on linux/386 container. * update-gcloud: Package File Update Run on linux/amd64 container. * update-gcloud: Package File Update Run on linux/arm/v7 container. --------- Co-authored-by: Ed Reel <edreel@gmail.com> Co-authored-by: uberhacker <uberhacker@users.noreply.github.com> Co-authored-by: chromebrew-actions[bot] <220035932+chromebrew-actions[bot]@users.noreply.github.com> Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
71 lines
2.7 KiB
Ruby
71 lines
2.7 KiB
Ruby
require 'package'
|
|
|
|
class Gcloud < Package
|
|
description 'Command-line interface for Google Cloud Platform products and services'
|
|
homepage 'https://cloud.google.com/sdk/gcloud/'
|
|
version '558.0.0'
|
|
license 'Apache-2.0'
|
|
compatibility 'all'
|
|
source_url({
|
|
aarch64: "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-#{version}-linux-arm.tar.gz",
|
|
armv7l: "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-#{version}-linux-arm.tar.gz",
|
|
i686: "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-#{version}-linux-x86.tar.gz",
|
|
x86_64: "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-#{version}-linux-x86_64.tar.gz"
|
|
})
|
|
source_sha256({
|
|
aarch64: 'eb357e8c8ee89897dec6ebe71d43a3fa17f69b903eaeab81a28f558942d39c0c',
|
|
armv7l: 'eb357e8c8ee89897dec6ebe71d43a3fa17f69b903eaeab81a28f558942d39c0c',
|
|
i686: 'c3bab320b8f928db419a69a87b99b8d4aee9652c791c7967c389e7bbd2e7b307',
|
|
x86_64: '45b728afa73e68907535eb62c9183310dd8cfdf5180cf32d3237220a70c57b95'
|
|
})
|
|
|
|
depends_on 'python3'
|
|
depends_on 'xdg_base'
|
|
|
|
no_shrink
|
|
no_compile_needed
|
|
print_source_bashrc
|
|
|
|
def self.build
|
|
@gcloudenv = <<~EOF
|
|
|
|
# The next line updates PATH for the Google Cloud SDK.
|
|
if [ -f '#{CREW_PREFIX}/share/gcloud/path.bash.inc' ]; then . '#{CREW_PREFIX}/share/gcloud/path.bash.inc'; fi
|
|
|
|
# The next line enables shell command completion for gcloud.
|
|
if [ -f '#{CREW_PREFIX}/share/gcloud/completion.bash.inc' ]; then . '#{CREW_PREFIX}/share/gcloud/completion.bash.inc'; fi
|
|
EOF
|
|
end
|
|
|
|
def self.install
|
|
FileUtils.mkdir_p "#{CREW_DEST_HOME}/.config/gcloud"
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/gcloud"
|
|
FileUtils.cp_r Dir['.'], "#{CREW_DEST_PREFIX}/share/gcloud"
|
|
FileUtils.cd "#{CREW_DEST_PREFIX}/share/gcloud" do
|
|
system "./install.sh \
|
|
--usage-reporting false \
|
|
--rc-path #{HOME}/.bashrc \
|
|
--quiet"
|
|
end
|
|
Dir.mkdir "#{CREW_DEST_PREFIX}/bin"
|
|
Dir.chdir "#{CREW_DEST_PREFIX}/share/gcloud/bin" do
|
|
system "find -type f -maxdepth 1 -exec ln -s #{CREW_PREFIX}/share/gcloud/bin/{} #{CREW_DEST_PREFIX}/bin/{} \\;"
|
|
end
|
|
FileUtils.mv "#{HOME}/.bashrc.backup", "#{HOME}/.bashrc"
|
|
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/env.d/"
|
|
File.write "#{CREW_DEST_PREFIX}/etc/env.d/gcloud", @gcloudenv
|
|
end
|
|
|
|
def self.postinstall
|
|
ExitMessage.add <<~EOM
|
|
To finish the installation, execute the following:
|
|
gcloud init
|
|
EOM
|
|
end
|
|
|
|
def self.postremove
|
|
Package.agree_to_remove("#{HOME}/.config/gcloud")
|
|
Package.agree_to_remove("#{CREW_PREFIX}/share/gcloud")
|
|
end
|
|
end
|