forked from pool/binwalk
d84165b56e
OBS-URL: https://build.opensuse.org/request/show/330893 OBS-URL: https://build.opensuse.org/package/show/devel:tools/binwalk?expand=0&rev=6
107 lines
3.1 KiB
RPMSpec
107 lines
3.1 KiB
RPMSpec
#
|
|
# spec file for package binwalk
|
|
#
|
|
# Copyright (c) 2015 SUSE LINUX 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
|
|
Source: https://github.com/devttys0/binwalk/archive/v%{version}.tar.gz#/binwalk-%{version}.tar.gz
|
|
Source1: binwalk.1
|
|
BuildRequires: help2man
|
|
# Depends on libmagic.
|
|
Requires: file
|
|
Recommends: bzip2
|
|
Recommends: cabextract
|
|
Recommends: cpio
|
|
Recommends: gzip
|
|
Recommends: p7zip
|
|
Recommends: unrar
|
|
Recommends: xz
|
|
Recommends: zlib
|
|
Suggests: java
|
|
%if 0%{?suse_version} >= 1230
|
|
# Required by help2man.
|
|
BuildRequires: python3-curses
|
|
BuildRequires: python3-devel
|
|
# Depends on libfuzzy.
|
|
Requires: ssdeep
|
|
%else
|
|
# Required by help2man.
|
|
BuildRequires: python-curses
|
|
BuildRequires: python-devel
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
%endif
|
|
|
|
%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
|
|
%configure \
|
|
%if 0%{?suse_version} >= 1230
|
|
--with-python=python3 \
|
|
--disable-libfuzzy \
|
|
%else
|
|
--with-python=python2 \
|
|
%endif
|
|
--disable-libmagic
|
|
|
|
make %{?_smp_mflags}
|
|
%if 0%{?suse_version} >= 1230
|
|
python3 setup.py install --root="$PWD/h2m" --prefix=%{_prefix}
|
|
export PYTHONPATH=./h2m%{python3_sitelib}
|
|
help2man -N --version-string=%{version} ./h2m%{_bindir}/binwalk > binwalk.1
|
|
%else
|
|
sed -e 's/VERSION_STRING/%{version}/g' %{SOURCE1} > binwalk.1
|
|
%endif
|
|
|
|
%install
|
|
%if 0%{?suse_version} >= 1230
|
|
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}
|
|
%else
|
|
python2 setup.py install --root=%{buildroot} --prefix=%{_prefix}
|
|
%endif
|
|
install -Dm 0644 binwalk.1 %{buildroot}%{_mandir}/man1/binwalk.1
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%{_bindir}/%{name}
|
|
%if 0%{?suse_version} >= 1230
|
|
%{python3_sitelib}/binwalk/
|
|
%{python3_sitelib}/binwalk-*
|
|
%else
|
|
%{python_sitelib}/binwalk/
|
|
%{python_sitelib}/binwalk-*
|
|
%endif
|
|
%{_mandir}/man1/binwalk.1%{?ext_man}
|
|
|
|
%changelog
|