homebrew-core/Formula/rethinkdb.rb
2015-04-30 09:30:19 +01:00

70 lines
2 KiB
Ruby

class Rethinkdb < Formula
homepage "http://www.rethinkdb.com/"
url "http://download.rethinkdb.com/dist/rethinkdb-2.0.1.tgz"
sha1 "fbd19c82f44f897e4c43716b4447226c2f1bf66b"
revision 1
bottle do
cellar :any
sha256 "7303ea71262cf871fd601ec1034afe052b2a035da225ca691dbf9c2a9cab537a" => :yosemite
sha256 "32cde2355c1dd9d242d2d9aa238ee3e4a9a11b9e1c7a123f918d42c147a8ba6a" => :mavericks
sha256 "2d745594fda00f48a9f247b4c8383c99ba1d49dd3ef472cab3b264e53591ec96" => :mountain_lion
end
depends_on :macos => :lion
depends_on "boost" => :build
depends_on "openssl"
depends_on "icu4c"
fails_with :gcc do
build 5666 # GCC 4.2.1
cause "RethinkDB uses C++0x"
end
def install
args = ["--prefix=#{prefix}"]
# rethinkdb requires that protobuf be linked against libc++
# but brew's protobuf is sometimes linked against libstdc++
args += ["--fetch", "protobuf"]
system "./configure", *args
system "make"
system "make", "install-osx"
mkdir_p "#{var}/log/rethinkdb"
end
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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}/rethinkdb</string>
<string>-d</string>
<string>#{var}/rethinkdb</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
<key>StandardOutPath</key>
<string>#{var}/log/rethinkdb/rethinkdb.log</string>
<key>StandardErrorPath</key>
<string>#{var}/log/rethinkdb/rethinkdb.log</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
EOS
end
test do
shell_output("#{bin}/rethinkdb create -d test")
assert File.read("test/metadata").start_with?("RethinkDB")
end
end