From ece73d2980ed3e86c47eb70870f93a314c9d2a40 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Sun, 29 Apr 2012 19:05:01 +0200 Subject: Sonar: Upgrade to 3.0 and provide LaunchAgent Signed-off-by: Adam Vandenberg --- Library/Formula/sonar.rb | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'Library') 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 + + + + + Label + #{plist_name} + ProgramArguments + + #{HOMEBREW_PREFIX}/bin/sonar + start + + RunAtLoad + + + +EOS end end -- cgit v1.2.3