class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.30", :revision => "803da92ca93c44439eaae8faf0afbbfb4d60928b" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "398566544e2b89d7c0a2a723e65975356fc1214fb2853fab40e4394459885cec" => :sierra sha256 "9a159876965ba5a22e8645e413990055109da32adf1a5b2ca4651995dc3ed23c" => :el_capitan sha256 "3655c139807fe918110366d3c04dac0b220b1cc8dfa438a6984cbddcfab268b3" => :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