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.1.tgz" sha256 "4a2a84a57a5a03523b66d9ec551e92d5e8bd6b04b7275db1aae890d357387ceb" bottle do cellar :any sha256 "ac064ca6edab270b0ddd5699645aa8395621d719f9cf5be5055e9222b6f0df32" => :el_capitan sha256 "b2a6864359f57320af5644bfd1b3e32c262707e2be3333a0bbb02b78ffd91e6f" => :yosemite sha256 "220ebbcc2c24a1efa827006c635b0752b87ba36d32831223a50bc9c933aa1868" => :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