class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.24", :revision => "28449f9f5bc8e5e994c5e9027dfc36c6f02d3a2c" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "054c11aeb65375f46d773cdf9e751c7e2f2775addb1246072e5d79565dab19aa" => :sierra sha256 "6c3c0dd47d0d9643ac15ba92ff958bafb65f5f40a11e4f635ede3771dd3ef082" => :el_capitan sha256 "6632823226c663a3e65cbd1b91c5848d53330de1d848ba3899571fee75bd68c6" => :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