2016-06-09 18:55:09 +00:00
|
|
|
class Dvm < Formula
|
|
|
|
desc "Docker Version Manager"
|
|
|
|
homepage "https://github.com/getcarina/dvm"
|
2016-10-04 14:50:24 +00:00
|
|
|
url "https://github.com/getcarina/dvm/archive/0.6.4.tar.gz"
|
|
|
|
sha256 "7ff3bc5271432b7f5da535cd04228bf212dd2965ed15998837d660452094ff0e"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-06-13 16:06:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-12-08 21:15:09 +00:00
|
|
|
rebuild 1
|
|
|
|
sha256 "29c0477105dffacb2826895fc543d396efbc1563512939f38658b774753f7b80" => :sierra
|
|
|
|
sha256 "fe17b992aa8506e903642162d03addd1b106debff425e75a447f4293ccfdefbc" => :el_capitan
|
|
|
|
sha256 "8c504a35ceb86496fc9d582e9642d4746b525e97c24008fb47957371e642ddfb" => :yosemite
|
2016-06-13 16:06:38 +00:00
|
|
|
end
|
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
depends_on "glide" => :build
|
2016-06-09 18:55:09 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
2016-10-04 14:37:54 +00:00
|
|
|
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"
|
|
|
|
ENV.append_path "PATH", buildpath/"bin"
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
dir = buildpath/"src/github.com/getcarina/dvm"
|
|
|
|
dir.install buildpath.children
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
cd dir do
|
|
|
|
# `depends_on "glide"` already has this covered
|
|
|
|
inreplace "Makefile", %r{^.*go get github.com/Masterminds/glide.*$\n}, ""
|
2016-06-09 18:55:09 +00:00
|
|
|
|
2016-10-04 14:37:54 +00:00
|
|
|
system "make", "VERSION=#{version}", "UPGRADE_DISABLED=true"
|
2016-06-09 18:55:09 +00:00
|
|
|
prefix.install "dvm.sh"
|
2016-12-08 02:51:48 +00:00
|
|
|
bash_completion.install "bash_completion" => "dvm"
|
2016-06-09 18:55:09 +00:00
|
|
|
(prefix/"dvm-helper").install "dvm-helper/dvm-helper"
|
2016-10-04 14:37:54 +00:00
|
|
|
prefix.install_metafiles
|
2016-06-09 18:55:09 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
dvm is a shell function, and must be sourced before it can be used.
|
|
|
|
Add the following command to your bash profile:
|
2016-12-08 02:51:48 +00:00
|
|
|
[ -f #{opt_prefix}/dvm.sh ] && . #{opt_prefix}/dvm.sh
|
2016-06-09 18:55:09 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
output = shell_output("bash -c 'source #{prefix}/dvm.sh && dvm --version'")
|
|
|
|
assert_match "Docker Version Manager version #{version}", output
|
|
|
|
end
|
|
|
|
end
|