homebrew-core/Formula/awscli.rb

51 lines
1.8 KiB
Ruby

class Awscli < Formula
include Language::Python::Virtualenv
desc "Official Amazon AWS command-line interface"
homepage "https://aws.amazon.com/cli/"
url "https://github.com/aws/aws-cli/archive/1.11.50.tar.gz"
sha256 "38b66340ee03bafbf942e6ee4d14eef40da45778520040ebc0fc591313171694"
head "https://github.com/aws/aws-cli.git", :branch => "develop"
bottle do
cellar :any_skip_relocation
sha256 "985d819ab23d795b15596769d11a4980aa03ab3361fa65b9fd7638755bea76c4" => :sierra
sha256 "c1d0e867616a6b7f037c62afe5c28f2f18de5e18bd62fd52501b0b8f91e79721" => :el_capitan
sha256 "1f834dbee8cd7450c4dc8e7bc6152702edb0b9d0b2d30a90224a32ea4b54081f" => :yosemite
end
# Use :python on Lion to avoid urllib3 warning
# https://github.com/Homebrew/homebrew/pull/37240
depends_on :python if MacOS.version <= :lion
def install
venv = virtualenv_create(libexec)
system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:",
"--ignore-installed", buildpath
system libexec/"bin/pip", "uninstall", "-y", "awscli"
venv.pip_install_and_link buildpath
pkgshare.install "awscli/examples"
bash_completion.install "bin/aws_bash_completer"
zsh_completion.install "bin/aws_zsh_completer.sh" => "_aws"
end
def caveats; <<-EOS.undent
The "examples" directory has been installed to:
#{HOMEBREW_PREFIX}/share/awscli/examples
Before using aws-cli, you need to tell it about your AWS credentials.
The quickest way to do this is to run:
aws configure
More information:
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
https://pypi.python.org/pypi/awscli#getting-started
EOS
end
test do
assert_match "topics", shell_output("#{bin}/aws help")
end
end