2014-03-07 21:58:04 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Awscli < Formula
|
|
|
|
homepage "https://aws.amazon.com/cli/"
|
2014-11-02 19:53:19 +00:00
|
|
|
url "https://pypi.python.org/packages/source/a/awscli/awscli-1.5.4.tar.gz"
|
|
|
|
sha1 "40d4427bd623ce695ed060e9bb3fdb9959375485"
|
2014-03-07 21:58:04 +00:00
|
|
|
|
2014-07-17 07:26:17 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-11-02 20:01:07 +00:00
|
|
|
sha1 "04bbe41b9a06f71ecd2b07624477233f7ed94861" => :yosemite
|
|
|
|
sha1 "90d4e388ad7d8ffb5008f52ca5d96c96065901d1" => :mavericks
|
|
|
|
sha1 "0e897363015e92bce11d872f0b7d7d7f511cd8e1" => :mountain_lion
|
2014-07-17 07:26:17 +00:00
|
|
|
end
|
|
|
|
|
2014-03-07 21:58:04 +00:00
|
|
|
head do
|
2014-10-13 00:34:24 +00:00
|
|
|
url "https://github.com/aws/aws-cli.git", :branch => "develop"
|
2014-03-07 21:58:04 +00:00
|
|
|
|
|
|
|
resource "botocore" do
|
2014-10-13 00:34:24 +00:00
|
|
|
url "https://github.com/boto/botocore.git", :branch => "develop"
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "bcdoc" do
|
2014-10-13 00:34:24 +00:00
|
|
|
url "https://github.com/boto/bcdoc.git", :branch => "develop"
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "jmespath" do
|
2014-10-13 00:34:24 +00:00
|
|
|
url "https://github.com/boto/jmespath.git", :branch => "develop"
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-04-30 22:35:52 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
2014-03-07 21:58:04 +00:00
|
|
|
|
|
|
|
resource "botocore" do
|
2014-11-02 19:53:19 +00:00
|
|
|
url "https://pypi.python.org/packages/source/b/botocore/botocore-0.68.0.tar.gz"
|
|
|
|
sha1 "5704babdf525e5443d1ef7189a2ed07ae023a0f4"
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "bcdoc" do
|
|
|
|
url "https://pypi.python.org/packages/source/b/bcdoc/bcdoc-0.12.2.tar.gz"
|
|
|
|
sha1 "31b2a714c2803658d9d028c8edf4623fd0daaf18"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "six" do
|
2014-09-14 11:39:25 +00:00
|
|
|
url "https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz"
|
|
|
|
sha1 "aa3b0659cbc85c6c7a91efc51f2d1007040070cd"
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "colorama" do
|
|
|
|
url "https://pypi.python.org/packages/source/c/colorama/colorama-0.2.5.tar.gz"
|
|
|
|
sha1 "87507210c5a7d400b27d23e8dd42734198663d66"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "docutils" do
|
2014-07-21 22:48:16 +00:00
|
|
|
url "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz"
|
|
|
|
sha1 "002450621b33c5690060345b0aac25bc2426d675"
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "rsa" do
|
|
|
|
url "https://bitbucket.org/sybren/python-rsa/get/version-3.1.2.tar.gz"
|
|
|
|
sha1 "6a7515221e50ee87cfb54cb36e96f2a39df9badd"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2014-04-30 22:35:52 +00:00
|
|
|
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
|
2014-03-07 21:58:04 +00:00
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
|
|
|
|
|
2014-07-19 03:42:47 +00:00
|
|
|
resources.each do |r|
|
|
|
|
r.stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
|
2014-03-07 21:58:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
system "python", "setup.py", "install", "--prefix=#{prefix}",
|
|
|
|
"--single-version-externally-managed", "--record=installed.txt"
|
|
|
|
|
|
|
|
# Install zsh completion
|
|
|
|
zsh_completion.install "bin/aws_zsh_completer.sh" => "_aws"
|
|
|
|
|
|
|
|
# Install the examples
|
|
|
|
(share+"awscli").install "awscli/examples"
|
|
|
|
|
|
|
|
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:
|
|
|
|
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/aws", "--version"
|
|
|
|
end
|
|
|
|
end
|