class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.11.24", :revision => "41c131d840ffcb5eb26f930ce73d7185aa54d963" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any sha256 "06e8c8edc74ba997d302ab064a4d678427acb552be36008ae6e6f9d0b6e9378f" => :yosemite sha256 "95a145bbfedc60ee365fc1e4c5a40223870e2f5b4801ca6925b2ff1d68504af1" => :mavericks sha256 "bce0a9baa458a96fe05ea4c444b6bcef73a0cb4092b6df2aeef55f04ea8fe67e" => :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