homebrew-core/Formula/rethinkdb.rb
2015-11-12 19:36:46 +00:00

69 lines
2 KiB
Ruby

class Rethinkdb < Formula
desc "The open-source database for the realtime web"
homepage "https://www.rethinkdb.com/"
url "https://download.rethinkdb.com/dist/rethinkdb-2.2.0.tgz"
sha256 "5f51cecbb05282fff084bf838f9258a1d7171157c09e5f669f54b50f08489676"
bottle do
cellar :any
sha256 "252e12b53cc076d59f7c2ed19eb27921b742f159d0b59db18ee68b0d62901607" => :el_capitan
sha256 "912fac8790c60a88faa4faa81ce761c8691e27483981bc230fe578040e9ef542" => :yosemite
sha256 "fe6dce9c89c03adc4bbafd61d89ebb333625d01232ca99d937fdb35e58883ca3" => :mavericks
end
depends_on :macos => :lion
depends_on "boost" => :build
depends_on "openssl"
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"
(var/"log/rethinkdb").mkpath
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