class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.11.17", :revision => "a5f6e3bba05611ef69b9e51b8969f1e4e7f9944b" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any sha256 "e350be3ba0e2a7b7b27578d51e4f77ea98d05f22e62c9e000477b60c91fe0160" => :yosemite sha256 "2a74a3b9b1e713ad4f07476ac555ab3703e7160126eac2462af5e07aeb2dab3d" => :mavericks sha256 "a1a6174122700d9c6ece717cefb7ac9970872d9c2376ae1fe29a4f26a1816621" => :mountain_lion end depends_on "go" => :build depends_on :hg => :build def install ENV["GOPATH"] = cached_download/".gopath" ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin" # FIXTHIS: do this without mutating the cache! hack_dir = cached_download/".gopath/src/github.com/syncthing" rm_rf hack_dir mkdir_p hack_dir ln_s cached_download, "#{hack_dir}/syncthing" system "./build.sh", "noupgrade" bin.install "syncthing" end 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