2011-05-18 23:54:12 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Sonar < Formula
|
|
|
|
homepage 'http://www.sonarsource.org'
|
2012-12-22 16:42:23 +00:00
|
|
|
url 'http://dist.sonar.codehaus.org/sonar-3.4.zip'
|
|
|
|
sha1 'dbe402d892b7c77626b35aa4efd1e4d7262563e2'
|
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
|