Skip to content

Commit

Permalink
doctl 0.0.16 (new formula)
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#43810.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
  • Loading branch information
David Byrd authored and DomT4 committed Oct 11, 2015
1 parent f1d18b7 commit 42b8766
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions Formula/doctl.rb
@@ -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

0 comments on commit 42b8766

Please sign in to comment.