class Pilosa < Formula desc "Distributed bitmap index that queries across data sets" homepage "https://www.pilosa.com" url "https://github.com/pilosa/pilosa/archive/v1.0.1.tar.gz" sha256 "0aecb01e548e751578faa752be51616c6bc1f4475b4c036d7ffa3c86faf1b176" bottle do cellar :any_skip_relocation sha256 "68dc1b039b378cb107775bdfaf191bf4eb287b9eebb460339a5a4f90d639ae64" => :high_sierra sha256 "fe686b4fe524cb7f1a0609ed7ad3ed6cf86721cba4d24fb7d097dbf6fd34c698" => :sierra sha256 "f161ad115836835c565acff64b387e2272618e31e232d34405ce26c20051edfa" => :el_capitan end depends_on "dep" => :build depends_on "go" => :build def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/pilosa/pilosa").install buildpath.children cd "src/github.com/pilosa/pilosa" do system "make", "build", "FLAGS=-o #{bin}/pilosa", "VERSION=v#{version}" prefix.install_metafiles end end plist_options :manual => "pilosa server" def plist; <<~EOS Label #{plist_name} ProgramArguments #{opt_bin}/pilosa server RunAtLoad KeepAlive SuccessfulExit WorkingDirectory #{var} EOS end test do begin server = fork do exec "#{bin}/pilosa", "server" end sleep 0.5 assert_match("Welcome. Pilosa is running.", shell_output("curl localhost:10101")) ensure Process.kill "TERM", server Process.wait server end end end