homebrew-core/Formula/syncthing.rb
2017-12-05 06:13:35 -08:00

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.41",
:revision => "99b00b6a5e723f7b8214273d694d4ffc7a609bbc"
head "https://github.com/syncthing/syncthing.git"
bottle do
cellar :any_skip_relocation
sha256 "03473fac00e74e9936e019999b946fc68ea12ae8649ae2280d2a00fc5881796c" => :high_sierra
sha256 "4b32c91d179dce88b51cd1c0d0f3c358d773e40af5e8c60a4a214cdba4b70622" => :sierra
sha256 "5918acbbec8c36c597cf4c6875ab1b0c38f97dae8c19625bc3a44f6a1b41e80e" => :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