class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v0.14.46", :revision => "bea6ecaf35d92c95d7b8a7e2145bb56cc4d74d05" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "ddc4166b6faa047a14d341988a8ef6989cca2197b23c63928a736976c42fcdc9" => :high_sierra sha256 "31a7390b06e959a90a2ac67a882ac28d9defc799570c22f0ff44a44a5a39f87c" => :sierra sha256 "d7dc98c3408fd9a8a2079dbeefa5516ffc2c69962c5fbfcf80524ae0a2b1dca6" => :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