68 lines
2.1 KiB
Ruby
68 lines
2.1 KiB
Ruby
class Syncthing < Formula
|
|
desc "Open source continuous file synchronization application"
|
|
homepage "https://syncthing.net/"
|
|
url "https://github.com/syncthing/syncthing.git",
|
|
:tag => "v0.14.43",
|
|
:revision => "a9f0659f2f4bf910f82b652fd27a864074ec7ab8"
|
|
head "https://github.com/syncthing/syncthing.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "38b51fc2079f67d34f3f82829f5219ed8bcf0c2b58f1e05f242bc6bc87f3c3b9" => :high_sierra
|
|
sha256 "1387e7fbdb3b113477d32e948c57e9121d893962730fc9eca91f9beb302a51d6" => :sierra
|
|
sha256 "9e38fffd7bfe40e5aba8c81bc6e73961e00f716afc32609c5667141e28719245" => :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
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/syncthing</string>
|
|
<string>-no-browser</string>
|
|
<string>-no-restart</string>
|
|
</array>
|
|
<key>KeepAlive</key>
|
|
<dict>
|
|
<key>Crashed</key>
|
|
<true/>
|
|
<key>SuccessfulExit</key>
|
|
<false/>
|
|
</dict>
|
|
<key>ProcessType</key>
|
|
<string>Background</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/syncthing.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/syncthing.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system bin/"syncthing", "-generate", "./"
|
|
end
|
|
end
|