class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.11.8", :revision => "a8b43ae5984a71ff92913293fab5f5058edeb339" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any sha256 "8ab2bb238f8fef99732b8bb7beef3a234fd9f6d6e6d248aeb5385d581864ce31" => :yosemite sha256 "d1304f6c00fc4667c739ef7928630b324019e73af67555bc961d595f52364ecd" => :mavericks sha256 "fbea166953c32ad23da4b34c617c0dbe7ae98d1f11808fbecb5c3ded9190f7b0" => :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