2012-01-06 21:14:46 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Binwalk < Formula
|
2014-03-19 19:56:29 +00:00
|
|
|
homepage 'http://binwalk.org/'
|
2014-02-16 14:32:12 +00:00
|
|
|
url 'https://github.com/devttys0/binwalk/archive/v1.3.0.tar.gz'
|
|
|
|
sha1 '6cab158b69e508081302305b354da12f45658272'
|
2012-01-06 21:14:46 +00:00
|
|
|
|
2014-02-16 14:32:12 +00:00
|
|
|
head 'https://github.com/devttys0/binwalk.git'
|
2013-10-29 22:15:26 +00:00
|
|
|
|
|
|
|
option 'with-matplotlib', 'Check for presence of matplotlib, which is required for entropy graphing support'
|
2014-02-16 14:32:12 +00:00
|
|
|
|
|
|
|
depends_on 'swig' => :build
|
|
|
|
depends_on :fortran
|
|
|
|
depends_on 'libmagic' => 'with-python'
|
2014-01-04 13:02:23 +00:00
|
|
|
depends_on 'matplotlib' => :python if build.with? 'matplotlib'
|
2014-02-16 14:32:12 +00:00
|
|
|
depends_on 'pyside'
|
2014-01-04 13:02:23 +00:00
|
|
|
depends_on :python
|
2012-01-06 21:14:46 +00:00
|
|
|
|
2014-02-16 14:32:12 +00:00
|
|
|
resource 'pyqtgraph' do
|
|
|
|
url 'http://www.pyqtgraph.org/downloads/pyqtgraph-0.9.8.tar.gz'
|
|
|
|
sha1 '4ea6891f562c09ff13555ccb33fe05c315a70cf1'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'numpy' do
|
|
|
|
url 'http://downloads.sourceforge.net/project/numpy/NumPy/1.8.0/numpy-1.8.0.tar.gz'
|
|
|
|
sha1 'a2c02c5fb2ab8cf630982cddc6821e74f5769974'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'scipy' do
|
|
|
|
url 'http://downloads.sourceforge.net/project/scipy/scipy/0.13.3/scipy-0.13.3.tar.gz'
|
|
|
|
sha1 '2c7d53fc1d7bfe0a3ab5818ef6d84cb5d8cfcca4'
|
|
|
|
end
|
|
|
|
|
2012-01-06 21:14:46 +00:00
|
|
|
def install
|
2014-02-16 14:32:12 +00:00
|
|
|
ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'
|
|
|
|
numpy_args = [ "build", "--fcompiler=gnu95",
|
|
|
|
"install", "--prefix=#{libexec}" ]
|
|
|
|
resource('numpy').stage { system "python", "setup.py", *numpy_args }
|
|
|
|
scipy_args = [ "build", "--fcompiler=gnu95",
|
|
|
|
"install", "--prefix=#{libexec}" ]
|
|
|
|
resource('scipy').stage { system "python", "setup.py", *scipy_args }
|
|
|
|
pyqtgraph_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
|
|
|
|
resource('pyqtgraph').stage { system "python", *pyqtgraph_args }
|
|
|
|
|
2012-02-21 06:07:32 +00:00
|
|
|
cd "src" do
|
2014-02-16 14:32:12 +00:00
|
|
|
binwalk_args = [ "install", "--prefix=#{prefix}" ]
|
|
|
|
system "python", "setup.py", *binwalk_args
|
2014-01-04 14:54:03 +00:00
|
|
|
bin.env_script_all_files(libexec+'bin', :PYTHONPATH => ENV['PYTHONPATH'])
|
2012-02-21 06:07:32 +00:00
|
|
|
end
|
2012-01-06 21:14:46 +00:00
|
|
|
end
|
2014-01-04 14:53:54 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
touch "binwalk.test"
|
|
|
|
system "#{bin}/binwalk", "binwalk.test"
|
|
|
|
end
|
2012-01-06 21:14:46 +00:00
|
|
|
end
|