64 lines
2 KiB
Ruby
64 lines
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.15",
|
|
:revision => "0437f6dd663b3d8c6f1732d65825066c4d7ef37b"
|
|
|
|
head "https://github.com/syncthing/syncthing.git"
|
|
|
|
bottle do
|
|
sha256 "a40e866d8d417099e33fc43a4493d428d2fdb282f1e54dc32c8296679d5ae3d4" => :sierra
|
|
sha256 "fef5bc63d562c4e0d83a96b8ab941f56bab01c96f99311d1f5a745d81b1f6d89" => :el_capitan
|
|
sha256 "ec4f85c8bc9f9502a5f2cab9e7a925eab46260ea2c10a960edf5ef59841123a2" => :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
|