68 lines
2.3 KiB
Ruby
68 lines
2.3 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.16.2",
|
|
revision: "bd45ab13d88c32a3dd701485983354514abc41fa"
|
|
license "Apache-2.0"
|
|
head "https://github.com/docker/machine.git"
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "da044dcd33a56a30d48a65bcccfc481aeab60401dc67ba05a6f335a11baf97c8"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "1f748f5d9d62d898d1f281573a366f33d6f2cc1916458499ac8a79fbc8166208"
|
|
sha256 cellar: :any_skip_relocation, catalina: "99b99466af55891199daccd77e78e6006c193c00b8ffb1e624945c6f5a378119"
|
|
sha256 cellar: :any_skip_relocation, mojave: "b01a09ab4be172d932acb5b8b8a203df5454117023b9454c617ba383a27e2195"
|
|
end
|
|
|
|
depends_on "automake" => :build
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
ENV["GO111MODULE"] = "auto"
|
|
(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"]
|
|
zsh_completion.install "contrib/completion/zsh/_docker-machine"
|
|
prefix.install_metafiles
|
|
end
|
|
end
|
|
|
|
plist_options manual: "docker-machine start"
|
|
|
|
def plist
|
|
<<~EOS
|
|
<?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
|