69 lines
2.2 KiB
Ruby
69 lines
2.2 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.49",
|
|
:revision => "6b82538e623feb4df2bef9fc4b37d581de96309a"
|
|
head "https://github.com/syncthing/syncthing.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "3a26783cde5ad67e0b8b98a5ec0e5f3328fedea532f4c240b7c243b41c7f3aba" => :mojave
|
|
sha256 "a8b3a24dfd2c2cc05370999d0366e4ccc286d26f6527f6070592e9a6be30f263" => :high_sierra
|
|
sha256 "734eb4c3b62015ef1a8cec32b6cb18a9563f00ac9aacd19f90dbfc1ea3956f6c" => :sierra
|
|
sha256 "a491e90ab72f271bf5275df4988d6f0e1eb817cbbb9f93c07fc2361637a83dba" => :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 "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
|