class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v1.1.2", :revision => "a54d7a32d1f308be63837f1b31d9f468940fc5ef" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "3405384a23fff1ad6dfa0e7dce022b2d44f3d5e1014501dbeb31572d08d294cd" => :mojave sha256 "f40941ff3569a416841dd17beb7a0d1c6326efc375476d1377b4fa45891c5ce8" => :high_sierra sha256 "e68baed7734c3fb56ca01e5ea519bb6c33816531bc746ead45d9a9d0eb7262d4" => :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