class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.12.7", :revision => "1b6e4645b1a784fce05b78b841cd68f9aa266484" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "5f3c435e1b0c934dcec6f619a49597e077466f15461233dc5e7e5922e99d7e30" => :el_capitan sha256 "d17e8a88efa12214c4a38ba29df95e5707bb90caa88df1ef455ffd05f22d6df8" => :yosemite sha256 "f51246dd413257d04a30ed4733ec23c05aa31dbaf5c17a1471a8dbf427d301ab" => :mavericks 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