2014-11-02 00:59:16 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Gnatsd < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Lightweight cloud messaging system"
|
2014-11-02 00:59:16 +00:00
|
|
|
homepage "http://nats.io"
|
|
|
|
url "https://github.com/apcera/gnatsd/archive/v0.5.6.tar.gz"
|
|
|
|
head "https://github.com/apcera/gnatsd.git"
|
|
|
|
sha1 "b22a0252b838cff91586fb02d9efe31b428e5be2"
|
|
|
|
|
2014-11-02 11:14:06 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "f430b3bae19808ceaa007a681b9b5fe9704ff6e3" => :yosemite
|
|
|
|
sha1 "a17cccfd22645af9f895a23a1adc1a65a6bd6852" => :mavericks
|
|
|
|
sha1 "5699c0b45fd4f38d3a24555eef856435cd6e257b" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2014-11-02 00:59:16 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
mkdir_p "src/github.com/apcera"
|
|
|
|
ln_s buildpath, "src/github.com/apcera/gnatsd"
|
|
|
|
system "go", "install", "github.com/apcera/gnatsd"
|
|
|
|
system "go", "build", "gnatsd.go"
|
|
|
|
|
|
|
|
bin.install "gnatsd"
|
|
|
|
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}/gnatsd</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "gnatsd", "-v"
|
|
|
|
end
|
|
|
|
end
|