require "formula" class Syncthing < Formula homepage "http://syncthing.net" url "https://github.com/calmh/syncthing.git", :tag => "v0.9.19" bottle do sha1 "12d6322bf120802c66c0c6275d16f93aae4ed17c" => :mavericks sha1 "17c353fd14876cd729403a47965a64ebf2bc627a" => :mountain_lion sha1 "6d0465e283838eaabb55930f466c27bbac179c86" => :lion end depends_on "go" => :build depends_on :hg => :build def install ENV["GOPATH"] = cached_download/".gopath" ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin" hack_dir = cached_download/".gopath/src/github.com/syncthing" rm_rf hack_dir mkdir_p hack_dir ln_s cached_download, "#{hack_dir}/syncthing" ln_s cached_download/".git", ".git" system "./build.sh", "noupgrade" bin.install "syncthing" end def plist; <<-EOS.undent EnvironmentVariables STNORESTART yes KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/syncthing -no-browser RunAtLoad EOS end test do system "#{bin}/syncthing", "-generate", "./" end end