2011-05-18 23:54:12 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Sonar < Formula
|
|
|
|
homepage 'http://www.sonarsource.org'
|
2013-03-14 21:38:22 +00:00
|
|
|
url 'http://dist.sonar.codehaus.org/sonar-3.5.zip'
|
2013-03-15 15:13:53 +00:00
|
|
|
sha1 '5fca23ff8939ebe8a6fe7323769a512bca5b7c91'
|
2011-05-18 23:54:12 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# Delete native bin directories for other systems
|
|
|
|
rm_rf Dir['bin/{aix,hpux,linux,solaris,windows}-*']
|
|
|
|
|
|
|
|
if MacOS.prefer_64_bit?
|
|
|
|
rm_rf Dir['bin/macosx-universal-32']
|
2012-02-22 00:48:12 +00:00
|
|
|
else
|
2011-05-18 23:54:12 +00:00
|
|
|
rm_rf Dir['bin/macosx-universal-64']
|
|
|
|
end
|
|
|
|
|
|
|
|
# Delete Windows files
|
|
|
|
rm_f Dir['war/*.bat']
|
|
|
|
libexec.install Dir['*']
|
|
|
|
|
|
|
|
if MacOS.prefer_64_bit?
|
|
|
|
bin.install_symlink "#{libexec}/bin/macosx-universal-64/sonar.sh" => "sonar"
|
2012-02-22 00:48:12 +00:00
|
|
|
else
|
2011-05-18 23:54:12 +00:00
|
|
|
bin.install_symlink "#{libexec}/bin/macosx-universal-32/sonar.sh" => "sonar"
|
|
|
|
end
|
2012-04-29 17:05:01 +00:00
|
|
|
end
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/sonar/bin/sonar console"
|
|
|
|
|
|
|
|
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_prefix}/bin/sonar</string>
|
|
|
|
<string>start</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
2012-10-03 11:03:08 +00:00
|
|
|
EOS
|
2012-04-29 17:05:01 +00:00
|
|
|
end
|
2011-05-18 23:54:12 +00:00
|
|
|
end
|