115 lines
3.9 KiB
Ruby
115 lines
3.9 KiB
Ruby
class Awscli < Formula
|
|
desc "Official Amazon AWS command-line interface"
|
|
homepage "https://aws.amazon.com/cli/"
|
|
url "https://pypi.python.org/packages/source/a/awscli/awscli-1.9.15.tar.gz"
|
|
mirror "https://github.com/aws/aws-cli/archive/1.9.15.tar.gz"
|
|
sha256 "21ce3edd76d8ad6ebb6edab212f7b0fb501f75f13236f931bab5bad6976484fa"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "1c7a19b8753ffaac69c9ce94e8bac9bcd33fd74daf1f1efd4439a2a82234494c" => :el_capitan
|
|
sha256 "d4cc9761026ed044e4a21d2914722ee7aa7d512aafb25ac8fb20deaa4a51ff06" => :yosemite
|
|
sha256 "e800a7de33f12cf9f0bf6006c9f31ac0820a6711727ad8dfed109bba4ac7c2b7" => :mavericks
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/aws/aws-cli.git", :branch => "develop"
|
|
|
|
resource "botocore" do
|
|
url "https://github.com/boto/botocore.git", :branch => "develop"
|
|
end
|
|
|
|
resource "jmespath" do
|
|
url "https://github.com/boto/jmespath.git", :branch => "develop"
|
|
end
|
|
end
|
|
|
|
# Use :python on Lion to avoid urllib3 warning
|
|
# https://github.com/Homebrew/homebrew/pull/37240
|
|
depends_on :python if MacOS.version <= :lion
|
|
|
|
resource "six" do
|
|
url "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
|
|
sha256 "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5"
|
|
end
|
|
|
|
resource "python-dateutil" do
|
|
url "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.2.tar.gz"
|
|
sha256 "3e95445c1db500a344079a47b171c45ef18f57d188dffdb0e4165c71bea8eb3d"
|
|
end
|
|
|
|
resource "colorama" do
|
|
url "https://pypi.python.org/packages/source/c/colorama/colorama-0.3.3.tar.gz"
|
|
sha256 "eb21f2ba718fbf357afdfdf6f641ab393901c7ca8d9f37edd0bee4806ffa269c"
|
|
end
|
|
|
|
resource "jmespath" do
|
|
url "https://pypi.python.org/packages/source/j/jmespath/jmespath-0.9.0.tar.gz"
|
|
sha256 "08dfaa06d4397f283a01e57089f3360e3b52b5b9da91a70e1fd91e9f0cdd3d3d"
|
|
end
|
|
|
|
resource "botocore" do
|
|
url "https://pypi.python.org/packages/source/b/botocore/botocore-1.3.15.tar.gz"
|
|
sha256 "7cc7e9c03d1c15550c71806bc0fb41ee7291b4051d5ca6b7d93d15891bac04ea"
|
|
end
|
|
|
|
resource "docutils" do
|
|
url "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz"
|
|
sha256 "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
|
|
end
|
|
|
|
resource "pyasn1" do
|
|
url "https://pypi.python.org/packages/source/p/pyasn1/pyasn1-0.1.8.tar.gz"
|
|
sha256 "5d33be7ca0ec5997d76d29ea4c33b65c00c0231407fff975199d7f40530b8347"
|
|
end
|
|
|
|
resource "rsa" do
|
|
url "https://pypi.python.org/packages/source/r/rsa/rsa-3.1.4.tar.gz"
|
|
sha256 "e2b0b05936c276b1edd2e1525553233b666df9e29b5c3ba223eed738277c82a0"
|
|
end
|
|
|
|
def install
|
|
ENV["PYTHONPATH"] = libexec/"lib/python2.7/site-packages"
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
|
|
|
|
resources.each do |r|
|
|
r.stage do
|
|
system "python", *Language::Python.setup_install_args(libexec/"vendor")
|
|
end
|
|
end
|
|
|
|
system "python", *Language::Python.setup_install_args(libexec)
|
|
|
|
# Install zsh completion
|
|
zsh_completion.install "bin/aws_zsh_completer.sh" => "_aws"
|
|
|
|
# Install the examples
|
|
pkgshare.install "awscli/examples"
|
|
|
|
bin.install Dir[libexec/"bin/*"]
|
|
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
The "examples" directory has been installed to:
|
|
#{HOMEBREW_PREFIX}/share/awscli/examples
|
|
|
|
Add the following to ~/.bashrc to enable bash completion:
|
|
complete -C aws_completer aws
|
|
|
|
Add the following to ~/.zshrc to enable zsh completion:
|
|
source #{HOMEBREW_PREFIX}/share/zsh/site-functions/_aws
|
|
|
|
Before using awscli, you need to tell it about your AWS credentials.
|
|
The easiest way to do this is to run:
|
|
aws configure
|
|
|
|
More information:
|
|
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/aws", "--version"
|
|
end
|
|
end
|