class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.15", :revision => "0437f6dd663b3d8c6f1732d65825066c4d7ef37b" head "https://github.com/syncthing/syncthing.git" bottle do sha256 "a40e866d8d417099e33fc43a4493d428d2fdb282f1e54dc32c8296679d5ae3d4" => :sierra sha256 "fef5bc63d562c4e0d83a96b8ab941f56bab01c96f99311d1f5a745d81b1f6d89" => :el_capitan sha256 "ec4f85c8bc9f9502a5f2cab9e7a925eab46260ea2c10a960edf5ef59841123a2" => :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