64 lines
2.1 KiB
Ruby
64 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.13.5", :revision => "eefcecc7ce2ea2f8dacd3762a484e9de546574fb"
|
|
|
|
head "https://github.com/syncthing/syncthing.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "e048b2386a38234f9ce258956c1a3350afc3d5bafdf0fc564b8dfbb7c98faef9" => :el_capitan
|
|
sha256 "ec753a7e92adb1cd2fa77cd5cba59d9a96faeb221e6b1dcaa0bd2faef21682fe" => :yosemite
|
|
sha256 "83259bd39438611797a8ed876d53eca29a025a08523fcf6dab425966d5324e1e" => :mavericks
|
|
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
|