56 lines
1.6 KiB
Ruby
56 lines
1.6 KiB
Ruby
require "formula"
|
|
|
|
class Boot2docker < Formula
|
|
homepage "https://github.com/boot2docker/boot2docker-cli"
|
|
# Boot2docker and docker are generally updated at the same time.
|
|
# Please update the version of docker too
|
|
url "https://github.com/boot2docker/boot2docker-cli.git", :tag => "v1.3.1"
|
|
head "https://github.com/boot2docker/boot2docker-cli.git", :branch => "master"
|
|
|
|
bottle do
|
|
revision 3
|
|
sha1 "42298f5d491248fb0d2620f5d698300ec7a79b33" => :yosemite
|
|
sha1 "30f49d694bc92a6f38f7d825b5e5399b8e4d2dba" => :mavericks
|
|
sha1 "08295a0b656181207c2a33b2685d876cba1048ca" => :mountain_lion
|
|
end
|
|
|
|
depends_on "docker" => :recommended
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
(buildpath + "src/github.com/boot2docker/boot2docker-cli").install Dir[buildpath/"*"]
|
|
|
|
cd "src/github.com/boot2docker/boot2docker-cli" do
|
|
ENV["GOPATH"] = buildpath
|
|
system "go", "get", "-d"
|
|
|
|
ENV["GIT_DIR"] = cached_download/".git"
|
|
system "make", "goinstall"
|
|
end
|
|
|
|
bin.install "bin/boot2docker-cli" => "boot2docker"
|
|
end
|
|
|
|
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>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/boot2docker</string>
|
|
<string>up</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/boot2docker", "version"
|
|
end
|
|
end
|