doctl 0.0.16 (new formula)

Closes Homebrew/homebrew#43810.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
David Byrd 2015-09-10 19:35:22 -04:00 committed by Dominyk Tiller
parent f1d18b7f12
commit 42b87665c1

46
Formula/doctl.rb Normal file
View file

@ -0,0 +1,46 @@
require "language/go"
class Doctl < Formula
desc "Command-line tool for DigitalOcean"
homepage "https://github.com/digitalocean/doctl"
url "https://github.com/digitalocean/doctl/archive/0.0.16.tar.gz"
sha256 "4f4805f36fd0d437331c25a183471419d10a680721f7f5a890b4109319d605ed"
head "https://github.com/digitalocean/doctl.git"
depends_on "go" => :build
go_resource "github.com/tools/godep" do
url "https://github.com/tools/godep.git", :revision => "58d90f262c13357d3203e67a33c6f7a9382f9223"
end
go_resource "github.com/kr/fs" do
url "https://github.com/kr/fs.git", :revision => "2788f0dbd16903de03cb8186e5c7d97b69ad387b"
end
go_resource "golang.org/x/tools" do
url "https://github.com/golang/tools.git", :revision => "473fd854f8276c0b22f17fb458aa8f1a0e2cf5f5"
end
go_resource "golang.org/x/crypto" do
url "https://github.com/golang/crypto.git", :revision => "8b27f58b78dbd60e9a26b60b0d908ea642974b6d"
end
def install
ENV["GOPATH"] = buildpath
mkdir_p buildpath/"src/github.com/digitalocean/"
ln_sf buildpath, buildpath/"src/github.com/digitalocean/doctl"
Language::Go.stage_deps resources, buildpath/"src"
cd "src/github.com/tools/godep" do
system "go", "install"
end
ENV["GOPATH"] = buildpath/"src/github.com/digitalocean/doctl/Godeps/_workspace"
system "./bin/godep", "restore"
system "./bin/godep", "go", "build", "-o", "doctl", "."
bin.install "doctl"
end
test do
system bin/"doctl", "help"
end
end