class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.47", :revision => "a1b5a3d5c0d29cbf653804740cb2e0080284b8e4" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "aed3d56d786f6bfad3b04d511be8c24755c3657d78f930798bf98a65135ad3db" => :high_sierra sha256 "771c5e0f5e7a18ed91bf5d6ea0d11b68782b602cc6dbde796212588576c1fb2f" => :sierra sha256 "2e562ecb0ea6f70fcdbbc8d5c9cac378aca296410f5482b5ed1572522ea19444" => :el_capitan end depends_on "go" => :build def install ENV["GOPATH"] = buildpath (buildpath/"src/github.com/syncthing/syncthing").install buildpath.children ENV.append_path "PATH", buildpath/"bin" cd buildpath/"src/github.com/syncthing/syncthing" do system "./build.sh", "noupgrade" bin.install "syncthing" man1.install Dir["man/*.1"] man5.install Dir["man/*.5"] man7.install Dir["man/*.7"] prefix.install_metafiles end end plist_options :manual => "syncthing" def plist; <<~EOS 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