class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.31", :revision => "93a04158fd62c902080d160a0c8d7430921ef740" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "626e6300b55eca69a6308751e91997c68d27b858009249e85dc274cffe6e823d" => :sierra sha256 "1fe25715cb8f21f6e844c33e163bea82a0369682b55d7a1e09a15bf70858c3c4" => :el_capitan sha256 "3b356c5e751e391c181e9a429a1386374abc2800c5784621e35de2ec6ae226ab" => :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