homebrew-core/Formula/syncthing.rb
2016-05-19 09:03:59 +01:00

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.13.1", :revision => "8e060e23e345c8135b149e570444b515607c5205"
head "https://github.com/syncthing/syncthing.git"
bottle do
cellar :any_skip_relocation
sha256 "a2909a0ff991884096372213dfcab2c3df8a079b2f8d8afa4c611306cd4b54ef" => :el_capitan
sha256 "78e667c9c704bc47c954cc92a7ea9ee3c0c65de7690503aa91d50ca2e8a165b3" => :yosemite
sha256 "2b375a3383cd779e41712553837cd7289dc9be4c48e68d1337c45c8da69c33b7" => :mavericks
end
depends_on "go" => :build
depends_on :hg => :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