homebrew-core/Formula/syncthing.rb
2016-05-07 00:55:09 +01:00

69 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.12.23", :revision => "62142c8ccd7ac08269ce9524eafbeeb0886b4b0d"
head "https://github.com/syncthing/syncthing.git"
bottle do
cellar :any_skip_relocation
sha256 "547115c145c3529d98b37b1bdcc3999619f7e0383509c2cb150983333ed6b189" => :el_capitan
sha256 "0e1915b7476a1c427ef02dc0b692e355c357ee243cc3220cf64083d90b9a87c6" => :yosemite
sha256 "b9f9ab0afb31531fa861e6f4e89b24b4b27b3ab2c5177144c98ed1034aa2ff1c" => :mavericks
end
depends_on "go" => :build
depends_on :hg => :build
def install
ENV["GOPATH"] = cached_download/".gopath"
ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin"
# FIXTHIS: do this without mutating the cache!
hack_dir = cached_download/".gopath/src/github.com/syncthing"
rm_rf hack_dir
mkdir_p hack_dir
ln_s cached_download, "#{hack_dir}/syncthing"
system "./build.sh", "noupgrade"
bin.install "syncthing"
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