class Tile38 < Formula desc "In-memory geolocation data store, spatial index, and realtime geofence" homepage "http://tile38.com" url "https://github.com/tidwall/tile38/archive/1.12.3.tar.gz" sha256 "cce456df7a98a8901e3c6d7d468a9b20e841475cb255493ce368b991d1ab8d95" head "https://github.com/tidwall/tile38.git" bottle do cellar :any_skip_relocation sha256 "6bbcbcf7701962b5b83c7b158d5db755a133d7330842690e6420d14ab5cb9c5b" => :mojave sha256 "bc285c25b979226de61fe087c90b9d6c3582514c54d2a911b633c611c5ded766" => :high_sierra sha256 "e075a2b606cb8bd29bce4187647985c23049a2f1e4dee756c88bb274b1f4ccf9" => :sierra sha256 "14dc2cbbd5b28b952e34eea1156ffd856b18c22da74580b404aba0b481389086" => :el_capitan 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