diff options
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/sonar.rb | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/Library/Formula/sonar.rb b/Library/Formula/sonar.rb index 1f1709cea..c6b278946 100644 --- a/Library/Formula/sonar.rb +++ b/Library/Formula/sonar.rb @@ -2,8 +2,8 @@ require 'formula' class Sonar < Formula homepage 'http://www.sonarsource.org' - url 'http://dist.sonar.codehaus.org/sonar-2.13.1.zip' - md5 '37e0502e07e197b8e3a382c64fac8e1d' + url 'http://dist.sonar.codehaus.org/sonar-3.0.zip' + md5 'bcf8b56d3b12a5e212cb4c7fa778180b' def install # Delete native bin directories for other systems @@ -24,5 +24,44 @@ class Sonar < Formula else bin.install_symlink "#{libexec}/bin/macosx-universal-32/sonar.sh" => "sonar" end + + plist_path.write startup_plist + plist_path.chmod 0644 + end + + def caveats; <<-EOS +If this is your first install, automatically load on login with: + mkdir -p ~/Library/LaunchAgents + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + +If this is an upgrade and you already have the #{plist_path.basename} loaded: + launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename} + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + +Or start it manually: + #{HOMEBREW_PREFIX}/bin/sonar console +EOS + end + + def startup_plist + return <<-EOS +<?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>#{HOMEBREW_PREFIX}/bin/sonar</string> + <string>start</string> + </array> + <key>RunAtLoad</key> + <true/> +</dict> +</plist> +EOS end end |
