diff options
| author | David Gageot | 2012-04-29 19:05:01 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2012-04-29 11:07:53 -0700 |
| commit | ece73d2980ed3e86c47eb70870f93a314c9d2a40 (patch) | |
| tree | 76a1e7db41b4a9ee01cb1bf0a934cfe7c594eea6 /Library | |
| parent | 1a3c5acdca4e93ddd164cdf569ad1026b95b3562 (diff) | |
| download | homebrew-ece73d2980ed3e86c47eb70870f93a314c9d2a40.tar.bz2 | |
Sonar: Upgrade to 3.0 and provide LaunchAgent
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -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 |
