61abc3d
%global srcname ROPGadget
61abc3d
61abc3d
Name:           python-%{srcname}
f8c3405
Version:        7.4
2b92710
Release:        %autorelease
61abc3d
Summary:        A tool to find ROP gadgets in program files
61abc3d
a37ea80
License:        BSD
61abc3d
URL:            https://pypi.python.org/pypi/%{srcname}
ccea9db
Source0:        https://files.pythonhosted.org/packages/source/R/%{srcname}/%{srcname}-%{version}.tar.gz
a37ea80
Source1:        https://raw.githubusercontent.com/JonathanSalwan/ROPgadget/c29c50773ec7fb3df56396ce27fb71c3898c53ae/LICENSE_BSD.txt
a37ea80
Source2:        https://raw.githubusercontent.com/JonathanSalwan/ROPgadget/c29c50773ec7fb3df56396ce27fb71c3898c53ae/README.md
61abc3d
61abc3d
BuildArch:      noarch
61abc3d
BuildRequires:  python3-devel
61abc3d
BuildRequires:  %{py3_dist capstone}
74994b6
BuildRequires:  %{py3_dist setuptools}
61abc3d
61abc3d
%description
61abc3d
ROPGadget lets you search your gadgets on your binaries to facilitate
61abc3d
your ROP exploitation. ROPgadget supports ELF, PE and Mach-O format on
61abc3d
x86, x64, ARM, ARM64, PowerPC, SPARC and MIPS architectures.
61abc3d
61abc3d
%package -n python3-%{srcname}
61abc3d
Summary:        %{summary}
61abc3d
%{?python_provide:%python_provide python3-%{srcname}}
61abc3d
Requires:       %{py3_dist capstone}
61abc3d
61abc3d
%description -n python3-%{srcname}
61abc3d
ROPGadget lets you search your gadgets on your binaries to facilitate
61abc3d
your ROP exploitation. ROPgadget supports ELF, PE and Mach-O format on
61abc3d
x86, x64, ARM, ARM64, PowerPC, SPARC and MIPS architectures.
61abc3d
61abc3d
%prep
ccea9db
%autosetup -n %{srcname}-%{version}
54620de
54620de
# Requires capstone that is not yet released. Be less selective.
54620de
sed -i 's/>=5.0.0rc2//g' setup.py
54620de
61abc3d
cp -p %SOURCE1 .
61abc3d
cp -p %SOURCE2 .
61abc3d
61abc3d
%build
61abc3d
%py3_build
61abc3d
61abc3d
%install
61abc3d
%py3_install
ee71ed3
for lib in $(find %{buildroot}%{python3_sitelib}/ropgadget/ -name "*.py"); do
61abc3d
  sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
61abc3d
  touch -r $lib $lib.new &&
61abc3d
  mv $lib.new $lib
61abc3d
done
61abc3d
61abc3d
%files -n python3-%{srcname}
a37ea80
%doc LICENSE_BSD.txt README.md
61abc3d
%{python3_sitelib}/ropgadget
aa26b69
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
61abc3d
%{_bindir}/*
61abc3d
61abc3d
%changelog
2b92710
%autochangelog