class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.12", :revision => "5bb74ee61ca43da27120ad99ea98e10e0a1f76a3" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "c98d2f2281ad48904a3d96dc7b3e69830d494125eb28c7d5bd7717c75c89923f" => :sierra sha256 "979b5980ed7be51648ac2ab2f8b7803a48c28f645b4fadf016ee3a267daf7751" => :el_capitan sha256 "53c49f8e919e9c9bf487c1305ef617372b90dcf5a4dec788b1928de491af2603" => :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