aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/binwalk.rb
blob: ae9e44f5574f666b3c94cb8abf449d908c76f7fb (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
require 'formula'

class Binwalk < Formula
  homepage 'http://code.google.com/p/binwalk/'
  url 'https://binwalk.googlecode.com/files/binwalk-1.2.2-1.tar.gz'
  sha1 '3422427a326f58a5b04616111ee66a8c2fddec1d'

  depends_on 'libmagic' => 'with-python'

  option 'with-matplotlib', 'Check for presence of matplotlib, which is required for entropy graphing support'
  depends_on 'matplotlib' => :python if build.with? 'matplotlib'
  depends_on :python

  def install
    cd "src" do
      system "python", "setup.py", "install", "--no-prereq-checks", "--prefix=#{prefix}"
      bin.env_script_all_files(libexec+'bin', :PYTHONPATH => ENV['PYTHONPATH'])
    end
  end

  test do
    touch "binwalk.test"
    system "#{bin}/binwalk", "binwalk.test"
  end
end