class Syncthing < Formula desc "Open source continuous file synchronization application" homepage "https://syncthing.net/" url "https://github.com/syncthing/syncthing.git", :tag => "v1.0.0", :revision => "952ab7db1cdbf282af3c7ce2a07e359431099e25" head "https://github.com/syncthing/syncthing.git" bottle do cellar :any_skip_relocation sha256 "2a34570abc74eb52bb4ef134742c2605eca7bf0be60a42e3862586f68d1217b9" => :mojave sha256 "e015cd29dd87f1363b876d0ad0f8a03b35df8cb0588353d3098ea57407f1af7b" => :high_sierra sha256 "81c09a0b42bce91f4c909c6a4440734a0666dc9f95b3704a047310ae7b799a5f" => :sierra 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 "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