65 lines
2.1 KiB
Ruby
65 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.8",
|
|
:revision => "fe9c2b98577f1a871ef0ecd4d7baa79482d046aa"
|
|
|
|
head "https://github.com/syncthing/syncthing.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "7d715c55713f6399115faff1de98ce456b89c3058492804fba1ddf0d9d67cb85" => :sierra
|
|
sha256 "0ab846a768c86fd6b6425f63894e59df9c7498887f3e7d15ad58e390571e23ed" => :el_capitan
|
|
sha256 "1e1ae5910dab07b7b4a57df5125f7b67f519cf36f7da3b1bce9cca3008f66ab3" => :yosemite
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath/".syncthing-gopath"
|
|
mkdir_p buildpath/".syncthing-gopath/src/github.com/syncthing"
|
|
cp_r cached_download, buildpath/".syncthing-gopath/src/github.com/syncthing/syncthing"
|
|
ENV.append_path "PATH", "#{ENV["GOPATH"]}/bin"
|
|
cd buildpath/".syncthing-gopath/src/github.com/syncthing/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
|