class Syncthing < Formula homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.11.0", :revision => "b35958d024175609a9e07934cdb1bedd3243939c" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any sha256 "fa517a181d96c6d4847a6b5ccb771ca498111fb9d031f43a5cc0730559d2aa70" => :yosemite sha256 "46543563501b826a72722aec9de3866ed5cc17cf6c82e8cd5a04823dd903d830" => :mavericks sha256 "aa6a89ce44ba3ab9c42fa86e03bfe4d1ac3a5e5d837291149464d3e633966cc9" => :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 KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/syncthing -no-browser -no-restart RunAtLoad ProcessType Background StandardErrorPath #{var}/log/syncthing.log StandardOutPath #{var}/log/syncthing.log EOS end test do system bin/"syncthing", "-generate", "./" end end