aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/findbugs.rb
blob: 97e3c269f6fe7f5191cdca2be985fdb0edab8341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'formula'

class Findbugs < Formula
  homepage 'http://findbugs.sourceforge.net/index.html'
  url 'http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.0/findbugs-2.0.0.tar.gz'
  md5 '646b4b65f4d542e69102b99c649b5f81'

  def startup_script name
    <<-EOS.undent
      #!/bin/bash
      exec "#{libexec}/bin/#{name}" "$@"
    EOS
  end

  def install
    # Remove windows files
    rm_f Dir["bin/*.bat"]
    prefix.install 'README.txt'
    libexec.install Dir['*']

    (bin+'fb').write startup_script('fb')
    (bin+'findbugs').write startup_script('findbugs')
  end

  def caveats; <<-EOS.undent
    Some tools might refer findbugs by env variable.
    After installation, set $FINDBUGS_HOME in your profile:
      export FINDBUGS_HOME=#{libexec}
    EOS
  end

  def test
    system "#{bin}/fb"
  end
end