# # spec file for package binwalk # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: binwalk Version: 2.0.1 Release: 0 Summary: Firmware Analysis Tool License: MIT Group: Development/Tools/Debuggers Url: https://github.com/devttys0/binwalk Source0: https://github.com/devttys0/binwalk/archive/v%{version}/binwalk-%{version}.tar.gz Source1: binwalk.1 BuildRequires: file-devel BuildRequires: python-devel BuildRequires: python-magic %if 0%{?suse_version} >= 1230 BuildRequires: libfuzzy-devel %endif # Required by help2man BuildRequires: python-curses BuildRequires: help2man Requires: python-magic Requires: python-pyqtgraph Requires: python-scipy %if 0%{?suse_version} >= 1230 Requires: libfuzzy2 %endif # sle requires it... BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Binwalk is a tool for searching a given binary image for embedded files and executable code. Specifically, it is designed for identifying files and code embedded inside of firmware images. Binwalk uses the libmagic library, so it is compatible with magic signatures created for the Unix file utility. Binwalk also includes a custom magic signature file which contains improved signatures for files that are commonly found in firmware images such as compressed/archived files, firmware headers, Linux kernels, bootloaders, filesystems, etc. %prep %setup -q %build %if 0%{?suse_version} >= 1230 %configure --disable-bundles %else %configure --disable-libmagic --disable-pyqtgraph %endif make %{?_smp_mflags} %{__python} setup.py build %if 0%{?suse_version} >= 1140 %{__python} setup.py install --prefix=%{_prefix} --root=$(pwd)/h2m echo |PYTHONPATH=./h2m/%{_prefix}/%{python_sitelib} help2man -N --version-string=%{version} ./h2m/%{_prefix}/bin/binwalk > binwalk.1 rm -rf h2m %else sed -e 's/VERSION_STRING/%{version}/g' %{S:1} > binwalk.1 %endif %install %{__python} setup.py install --prefix=%{_prefix} --root=%{buildroot} install -Dm0644 binwalk.1 %{buildroot}%{_mandir}/man1/binwalk.1 %files %defattr(-,root,root) %{_bindir}/%{name} %{python_sitelib}/%{name}/ %{python_sitelib}/binwalk-*-py%{py_ver}.egg-info %{_mandir}/man1/binwalk.1* %changelog