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.0.tgz" sha256 "8b059ce9f19dc6bba0fe303d238daa91485aef23dd1bc4e3f5f1d76c573ce82c" bottle do cellar :any sha256 "44f80c47cabb99785877b0ec9f74add72eee544608c625528b05a81b1f96e2dd" => :el_capitan sha256 "4fdfb2b7ed81dc4b7189165be0f1874f28d26f6b72af8863103b17cb3442cd38" => :yosemite sha256 "15ab1519359d25bfa5026740eab4c8e643ee454d6bebf5a7bf69183d52269b6c" => :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