require "formula" class Awscli < Formula homepage "https://aws.amazon.com/cli/" url "https://pypi.python.org/packages/source/a/awscli/awscli-1.6.2.tar.gz" sha1 "af3b239ea14e174928ad4b3850c22afa67e5afe9" revision 1 bottle do cellar :any sha1 "29bf3ce1f3bd7134f8b91dca4176a1adbe6c3e3a" => :yosemite sha1 "06e9c22d9db9a33104df2efaf68408dea142406c" => :mavericks sha1 "3b378ca4db598db882c11ca06e774e07f212a5d6" => :mountain_lion 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 "bcdoc" do url "https://github.com/boto/bcdoc.git", :branch => "develop" end resource "jmespath" do url "https://github.com/boto/jmespath.git", :branch => "develop" end end depends_on :python if MacOS.version <= :snow_leopard resource "six" do url "https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz" sha1 "aa3b0659cbc85c6c7a91efc51f2d1007040070cd" end resource "python-dateutil" do url "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz" sha1 "fbafcd19ea0082b3ecb17695b4cb46070181699f" end resource "colorama" do url "https://pypi.python.org/packages/source/c/colorama/colorama-0.3.2.tar.gz" sha1 "f2da891543421eeb423c469dff13faf1e70187e5" end resource "jmespath" do url "https://pypi.python.org/packages/source/j/jmespath/jmespath-0.5.0.tar.gz" sha1 "c9ce28e08fd24cdaa23e1183008b67ded302ef27" end resource "botocore" do url "https://pypi.python.org/packages/source/b/botocore/botocore-0.73.0.tar.gz" sha1 "bee0e6fa263002bea01718ea853839d4bacbe85d" end resource "docutils" do url "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz" sha1 "002450621b33c5690060345b0aac25bc2426d675" end resource "bcdoc" do url "https://pypi.python.org/packages/source/b/bcdoc/bcdoc-0.12.2.tar.gz" sha1 "31b2a714c2803658d9d028c8edf4623fd0daaf18" end resource "pyasn1" do url "https://pypi.python.org/packages/source/p/pyasn1/pyasn1-0.1.7.tar.gz" sha1 "e32b91c5a5d9609fb1d07d8685a884bab22ca6d0" end resource "rsa" do url "https://pypi.python.org/packages/source/r/rsa/rsa-3.1.4.tar.gz" sha1 "208583c49489b7ab415a4455eae7618b7055feca" 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 { Language::Python.setup_install "python", libexec/"vendor" } end Language::Python.setup_install "python", libexec # Install zsh completion zsh_completion.install "bin/aws_zsh_completer.sh" => "_aws" # Install the examples (share+"awscli").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: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html EOS end test do system "#{bin}/aws", "--version" end end