class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.29", :revision => "8f3f787a343d9f93a4127d2a9e6dd76969082306" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "fc00f7bae698e6a2f1f5ad7eb070ad23e352b7b035cda00b2aca3497d432c48c" => :sierra sha256 "d4ddc9b519a2b245c6b7940fcedcca86c1106f5c4cc9cd77a49b9c7e5f84da98" => :el_capitan sha256 "8e416316346cbb5d5d9ed6abe993247cc672805af86267f1cca174f8e01057c6" => :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