class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.5", :revision => "1188ebbb7b0f4545da4bcfceeb63d3c3ce6bb4ee" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "be93113a7cc8be31766979f5792deec1f3ec3d04f1654dfce278cc1b2d20eecd" => :el_capitan sha256 "558676d9f5591470f28e9e16974a7469182334b2c78033936531463fff978217" => :yosemite sha256 "bda91808574f7b8f957e5d8d544e95dee979fb58bd3fd789fff27e9028862c7f" => :mavericks 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