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.1.tgz" sha256 "6611b4e62020a68c23e0a1f0a517b97677e0358c261a3e188d14b02b014a2c9e" bottle do cellar :any revision 1 sha256 "952e669603cf7c4a91dc0af3c1ae0b6b7489d3573da2c88d7074f4558867c7bc" => :el_capitan sha256 "843c3ccbcf004becaaaaa582a1bbcd29b2671143a7fe0323ff14f6df0b5155c5" => :yosemite sha256 "2ead827b843c81e0d3b48c469c665f81a92dbe48dfc530d06060d06e36c49381" => :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 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