class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.11.20", :revision => "98afc3e99c7bc465cc2a17820f4ea9597f5db7b9" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any sha256 "8befbf7ab7119fbe8f6b5881fb299fe985bf765f7c8de0a7c09fbb1674e4a8fc" => :yosemite sha256 "01c647edd7d2931d25faf3902b1a3dc0ee0a63c213b2d64595188956acacd524" => :mavericks sha256 "6fbe1aee1662bcbfd664170a240c0a973005a5fbc53f5171550ce7a37b1c4b35" => :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