require "formula" class Tutum < Formula homepage "https://www.tutum.co/" url "https://github.com/tutumcloud/tutum-cli/archive/0.9.8.tar.gz" sha1 "3ee6842960decc5b8875bef90732b616f28db553" bottle do cellar :any sha1 "deb8e33f7fcf271707bb8494f50cf7e290c065d2" => :yosemite sha1 "983779f2c064e1a9be03fe22e654d3b9fa34f292" => :mavericks sha1 "4e8584bfb10d7fc0abe509c8349f866f509a8a9e" => :mountain_lion end depends_on :python if MacOS.version <= :snow_leopard depends_on "libyaml" resource "pyyaml" do url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz" sha1 "476dcfbcc6f4ebf3c06186229e8e2bd7d7b20e73" end resource "requests" do url "https://pypi.python.org/packages/source/r/requests/requests-2.4.3.tar.gz" sha1 "411f1bfa44556f7dd0f34cd822047c31baa7d741" end resource "ago" do url "https://pypi.python.org/packages/source/a/ago/ago-0.0.6.tar.gz" sha1 "b48b99151370de0c1642748a3f3b206649645d8d" end resource "docker-py" do url "https://pypi.python.org/packages/source/d/docker-py/docker-py-0.5.1.tar.gz" sha1 "9514ea08b84ffab8d28046dd3b5dcd359d239b13" 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 "python-tutum" do url "https://pypi.python.org/packages/source/p/python-tutum/python-tutum-0.9.8.tar.gz" sha1 "e99c08e6ca7d9b1bb422d1954318e9e17b29fa27" end resource "six" do url "https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz" sha1 "aa3b0659cbc85c6c7a91efc51f2d1007040070cd" end resource "tabulate" do url "https://pypi.python.org/packages/source/t/tabulate/tabulate-0.7.2.tar.gz" sha1 "da057c6d4faab9847436c3221c98f34911e623df" end def install ENV["PYTHONPATH"] = lib+"python2.7/site-packages" ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages" ENV.prepend_create_path "PYTHONPATH", prefix+"lib/python2.7/site-packages" resources.each do |r| r.stage { system "python", "setup.py", "install", "--prefix=#{libexec}" } end system "python", "setup.py", "install", "--prefix=#{prefix}" rm "#{lib}/python2.7/site-packages/site.py" rm "#{lib}/python2.7/site-packages/easy-install.pth" bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"]) end test do system "#{bin}/tutum", "container" end end