homebrew-core/Formula/docker-machine.rb
2016-08-20 04:22:57 -07:00

62 lines
2 KiB
Ruby

class DockerMachine < Formula
desc "Create Docker hosts locally and on cloud providers"
homepage "https://docs.docker.com/machine"
url "https://github.com/docker/machine.git",
:tag => "v0.8.1",
:revision => "41b3b253352b8b355d668f5e12b5f329f88c3482"
head "https://github.com/docker/machine.git"
bottle do
cellar :any_skip_relocation
sha256 "6076fc037a2a038567c95692dffe50075bacbc1914457dd71aa5471bda16b601" => :el_capitan
sha256 "d2f8bb096fdab17e49b2794e6fcf9d618a5a2bda34362f4b0439f2ac7af1da2d" => :yosemite
sha256 "a67a2f3cc2c89ea8cb3efde4a3269a65ce397481ee85be9317a33b21a3c9c7c7" => :mavericks
end
depends_on "go" => :build
depends_on "automake" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/docker/machine").install buildpath.children
cd "src/github.com/docker/machine" do
system "make", "build"
bin.install Dir["bin/*"]
bash_completion.install Dir["contrib/completion/bash/*.bash"]
prefix.install_metafiles
end
end
plist_options :manual => "docker-machine start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin</string>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/docker-machine</string>
<string>start</string>
<string>default</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
assert_match version.to_s, shell_output(bin/"docker-machine --version")
end
end