class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.10", :revision => "b7e21984a1128c1f31c7c5bdf1d3a3ba386e7f70" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "497c0c67d2b7cb62b63dcefbdd73a28b281b922437f56e69cdfe9d12150ca749" => :sierra sha256 "db53e1c2b1bd5cd05645e37598bcb2b3652b1a159f2b19f394b7398ae2b50e7f" => :el_capitan sha256 "1d4e1717f4d8a51717559c374ea73961fb0c7ea91c66fda86e544dbfbce558a6" => :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