class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v1.2.1", :revision => "d0c36971523d72dc1619b405891929e745809400" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "9be30c2cae528ab2c01a901f2167b7fa65295050990dc00210f62260b0dbef2a" => :mojave sha256 "68a38f0b5af18c6d1cc3a84cee8417b8bf89e7f721b57851fba901a07da75b62" => :high_sierra sha256 "2538544e3a1d69e3b44fa6611b7b04c92f2940862e9437ed4f44fa4d6e839745" => :sierra end depends_on "go" => :build def install ENV["GO111MODULE"] = "on" 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