class Tile38 < Formula desc "In-memory geolocation data store, spatial index, and realtime geofence" homepage "https://tile38.com/" url "https://github.com/tidwall/tile38/archive/1.14.3.tar.gz" sha256 "639476e62db8fad309924ad8c9f38b04cfb2de18906bdf30d89c1525ff35abe1" head "https://github.com/tidwall/tile38.git" bottle do cellar :any_skip_relocation sha256 "7ad4e24a99f18faa8208bbf26f799cdd48af74f8c379c4a7d227accc85314cec" => :mojave sha256 "920eea6e118f02995d82bf549348e598fc6de93f4554020e0a997b7c94387766" => :high_sierra sha256 "23912c1dec5da3e4b19c65692003b5c58264f307b6cbbe5f20ed59e8f734fe27" => :sierra end depends_on "go" => :build depends_on "godep" => :build def datadir var/"tile38/data" end def install ENV["GOPATH"] = buildpath system "make" bin.install "tile38-cli", "tile38-server" end def post_install # Make sure the data directory exists datadir.mkpath end def caveats; <<~EOS To connect: tile38-cli EOS end plist_options :manual => "tile38-server -d #{HOMEBREW_PREFIX}/var/tile38/data" def plist; <<~EOS KeepAlive SuccessfulExit Label #{plist_name} ProgramArguments #{opt_bin}/tile38-server -d #{datadir} RunAtLoad WorkingDirectory #{var} StandardErrorPath #{var}/log/tile38.log StandardOutPath #{var}/log/tile38.log EOS end test do system bin/"tile38-cli", "-h" end end