class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.16", :revision => "722b81c6f0ea451efdd029612bec71e93e170264" head "https://github.com/syncthing/syncthing.git" bottle do sha256 "866bfc04e2991f8a8f22c262261d7cd00d6c087cc9989954e85ba5ef24269907" => :sierra sha256 "97c5e0d7afbff33ab98660b4a9d64c5796ae078faed85dc6a2247304f6fcdeba" => :el_capitan sha256 "e5db3db8a5605a775838ca725476a543f552cc46e58ecade53208f72bb7fe4cd" => :yosemite end depends_on "go" => :build def install ENV["GOPATH"] = buildpath/".syncthing-gopath" mkdir_p buildpath/".syncthing-gopath/src/github.com/syncthing" cp_r cached_download, buildpath/".syncthing-gopath/src/github.com/syncthing/syncthing" ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin" cd buildpath/".syncthing-gopath/src/github.com/syncthing/syncthing" system "./build.sh", "noupgrade" bin.install "syncthing" end plist_options :manual => "syncthing" def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_bin}/syncthing -no-browser -no-restart KeepAlive Crashed SuccessfulExit ProcessType Background StandardErrorPath #{var}/log/syncthing.log StandardOutPath #{var}/log/syncthing.log EOS end test do system bin/"syncthing", "-generate", "./" end end