consul 1.0.3

Closes #23255.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
commitay 2018-01-25 12:59:57 +10:00 committed by ilovezfs
parent 0218d0ab66
commit 86d415c7ff

View file

@ -1,9 +1,11 @@
require "language/go"
class Consul < Formula
desc "Tool for service discovery, monitoring and configuration"
homepage "https://www.consul.io"
url "https://github.com/hashicorp/consul.git",
:tag => "v1.0.2",
:revision => "b55059fc3d0327c92c41431e57dfd2df3f956b03"
:tag => "v1.0.3",
:revision => "48f3dd5642374d079f5a64359023fb8318eb81cc"
head "https://github.com/hashicorp/consul.git",
:shallow => false
@ -16,20 +18,69 @@ class Consul < Formula
end
depends_on "go" => :build
depends_on "gox" => :build
go_resource "github.com/axw/gocov" do
url "https://github.com/axw/gocov.git",
:revision => "3a69a0d2a4ef1f263e2d92b041a69593d6964fe8"
end
go_resource "github.com/elazarl/go-bindata-assetfs" do
url "https://github.com/elazarl/go-bindata-assetfs.git",
:revision => "30f82fa23fd844bd5bb1e5f216db87fd77b5eb43"
end
go_resource "github.com/jteeuwen/go-bindata" do
url "https://github.com/jteeuwen/go-bindata.git",
:revision => "a0ff2567cfb70903282db057e799fd826784d41d"
end
go_resource "github.com/magiconair/vendorfmt" do
url "https://github.com/magiconair/vendorfmt.git",
:revision => "0fde667441ebc14dbd64a1de758ab656b78c607b"
end
go_resource "github.com/matm/gocov-html" do
url "https://github.com/matm/gocov-html.git",
:revision => "f6dd0fd0ebc7c8cff8b24c0a585caeef250627a3"
end
go_resource "golang.org/x/tools" do
url "https://go.googlesource.com/tools.git",
:branch => "release-branch.go1.9"
end
def install
# Avoid running `go get`
inreplace "GNUmakefile", "go get -u -v $(GOTOOLS)", ""
ENV["GOPATH"] = buildpath
contents = Dir["{*,.git,.gitignore}"]
gopath = buildpath/"gopath"
(gopath/"src/github.com/hashicorp/consul").install contents
(buildpath/"src/github.com/hashicorp/consul").install contents
ENV["GOPATH"] = gopath
ENV.prepend_create_path "PATH", gopath/"bin"
ENV.prepend_create_path "PATH", buildpath/"bin"
Language::Go.stage_deps resources, buildpath/"src"
cd gopath/"src/github.com/hashicorp/consul" do
build_tools = [
"github.com/axw/gocov/gocov",
"github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs",
"github.com/jteeuwen/go-bindata/go-bindata",
"github.com/magiconair/vendorfmt/cmd/vendorfmt",
"github.com/matm/gocov-html",
"golang.org/x/tools/cmd/cover",
"golang.org/x/tools/cmd/stringer",
]
build_tools.each do |tool|
cd "src/#{tool}" do
system "go", "install"
end
end
cd "src/github.com/hashicorp/consul" do
system "make"
bin.install "bin/consul"
prefix.install_metafiles
zsh_completion.install "contrib/zsh-completion/_consul"
end
end