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.3.2.tgz" sha256 "af8760271c63496fdeaa8de8bae834febd4b6c09a57743570b30134e9837eaac" bottle do cellar :any sha256 "63143edee8f4d3282bca1bb3023b541864bd9a9a25ad14cc67a2868590e22369" => :el_capitan sha256 "15ec4cf8ad3bc698016b2d085457ce34ea2426d8b4ca9c11113493332a5ffc3e" => :yosemite sha256 "e6b78651eaf01831b46ad95310b1b983d287417580db285fcc250dee276aa22e" => :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 inreplace "packaging/assets/config/default.conf.sample", /^# directory=.*/, "directory=#{var}/rethinkdb" etc.install "packaging/assets/config/default.conf.sample" => "rethinkdb.conf" end plist_options :manual => "rethinkdb start" def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_bin}/rethinkdb --config-file #{etc}/rethinkdb.conf 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