class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.27", :revision => "bcfd18ceb14641e8fcef973d6499bcad9d03effb" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "a45d47fd749beafe8a1f9727cc95ede4cc20d97f9286124051606c90000ea2a1" => :sierra sha256 "7bb0b38a26de7734ee512a974039f4015f12894ca808f7e37091c9e996425fef" => :el_capitan sha256 "dadcd75b56c1accc0567c1cb16fa33ed65ee67b0f2efea97a0d9498bf846a140" => :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