homebrew-core/Formula/syncthing.rb
2015-06-07 18:55:21 +02:00

64 lines
1.9 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.11.8", :revision => "a8b43ae5984a71ff92913293fab5f5058edeb339"
head "https://github.com/syncthing/syncthing.git"
bottle do
cellar :any
sha256 "8ab2bb238f8fef99732b8bb7beef3a234fd9f6d6e6d248aeb5385d581864ce31" => :yosemite
sha256 "d1304f6c00fc4667c739ef7928630b324019e73af67555bc961d595f52364ecd" => :mavericks
sha256 "fbea166953c32ad23da4b34c617c0dbe7ae98d1f11808fbecb5c3ded9190f7b0" => :mountain_lion
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
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>KeepAlive</key>
<true/>
<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>RunAtLoad</key>
<true/>
<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