class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v1.3.2", :revision => "45a711570e0019ed532266f712271e8f6749f145" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "b80d71e44d05186815bfdc9c540f8d93515b004e783001856c456fe95f305299" => :mojave sha256 "f4e9550d0bc0374de10dd05644dc249f5c208a04ee3aa67408899d66639d1695" => :high_sierra end depends_on "go" => :build def install ENV["GOPATH"] = buildpath src = buildpath/"src/github.com/syncthing/syncthing" src.install buildpath.children src.cd 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