homebrew-core/Formula/syncthing.rb
2017-09-21 01:39:02 +02: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.38",
:revision => "a9aa375109184f0c124f8a1575c58baa2656a61b"
head "https://github.com/syncthing/syncthing.git"
bottle do
cellar :any_skip_relocation
sha256 "026e16ffdc78e8fa4438ef9c23a62311a541456a97a0634f33b0786b7fd4b515" => :high_sierra
sha256 "de583ce477da137ac9642aba355b2171925c213e7766505658687451063baaef" => :sierra
sha256 "e4243ee9bb3b69dac48a5d1b630e08a6b1792d1c4e9093d834ca73bca7cc6033" => :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.undent
<?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