class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.17", :revision => "54911d44c509255c2bbd5408ea8f9fd78c866f01" head "https://github.com/syncthing/syncthing.git" bottle do sha256 "da508e49efc64447586117b7ebc6651f89ffb1646ef7ae27c85d0090005dc07b" => :sierra sha256 "b4acc76176fc5d0aa5f55eb5d0c845cad695ca4724ed9d446e132b813befbe87" => :el_capitan sha256 "44cd94118e79d5834b16b1e6299f9763fbd51644e0089fb8af1cc981c9a017da" => :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