class Syncthing < Formula homepage "http://syncthing.net" url "https://github.com/syncthing/syncthing.git", :tag => "v0.10.23" bottle do sha1 "d10dd496944f10cfac8e3f07bba77bd1630bd552" => :yosemite sha1 "d187b4b578f1d7b836de2afe01228c646babf7b4" => :mavericks sha1 "8572dc71400738e97484006ae83244deac97dfae" => :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 EOS end test do system "#{bin}/syncthing", "-generate", "./" end end