class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.28", :revision => "8c108b4d2092afc139428dbb9a7d7f76eaf97c6d" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "0858bbcbf444b03c3f63e63685f5547028e25833e341ec2a3be8895661e5d7f3" => :sierra sha256 "19ed2ef9a03e60740f74b54c95a6b4d84c50d412b5522ef02674b36419aaa272" => :el_capitan sha256 "b69c7b7ba6a6c659d2804705dc6340d1ded5c2b05fef1c055605f9b70260d351" => :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