class Rethinkdb < Formula desc "Distributed database" homepage "http://www.rethinkdb.com/" url "http://download.rethinkdb.com/dist/rethinkdb-2.0.3.tgz" sha1 "90655427495756225a81051f07491a0197104645" bottle do cellar :any sha256 "9b7deae77a9c93e361e7f61ddfbfc974a4995459423a3e1df4c300dbdaf1fc99" => :yosemite sha256 "e9bb64ad3af5e2abe9f208df708629fab553e1b2e8b5355491f75094fe942015" => :mavericks sha256 "fb4196d1fcaea4c299f840599607fcbf515b1a48dfe8a4fcdbb4125512b2cfaf" => :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 Label #{plist_name} ProgramArguments #{opt_bin}/rethinkdb -d #{var}/rethinkdb WorkingDirectory #{HOMEBREW_PREFIX} StandardOutPath #{var}/log/rethinkdb/rethinkdb.log StandardErrorPath #{var}/log/rethinkdb/rethinkdb.log RunAtLoad KeepAlive EOS end test do shell_output("#{bin}/rethinkdb create -d test") assert File.read("test/metadata").start_with?("RethinkDB") end end