15
0
Files
python-distorm3/python-distorm3.spec

68 lines
2.3 KiB
RPMSpec

#
# spec file for package python-distorm3
#
# Copyright (c) 2018 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define modname distorm3
Name: python-%{modname}
Version: 3.3.4
Release: 0
Summary: Powerful Disassembler Library For x86/AMD64
License: BSD-3-Clause
Group: Development/Libraries/Python
URL: https://github.com/gdabah/distorm
Source: https://files.pythonhosted.org/packages/source/d/distorm3/%{modname}-%{version}.zip
# Issue filed upstream https://github.com/gdabah/distorm/issues/123
Patch0: 0001-don-t-stutter-static-on-BigEndian.patch
# PATCH-FIX-UPSTREAM https://github.com/gdabah/distorm/pull/116
Patch1: reproducible.patch
BuildRequires: %{python_module devel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
%python_subpackages
%description
No more parsing strings! - diStorm3 is really a decomposer, which means it
takes an instruction and returns a binary structure which describes it rather
than static text.
%prep
%setup -q -n %{modname}-%{version}
%patch0 -p1
%patch1 -p1
%build
export CFLAGS="%{optflags}"
%python_build
%install
%python_install
# setup.py install puts files into wrong directory
# https://github.com/gdabah/distorm/issues/124
%python_expand mkdir -p %{buildroot}%{$python_sitearch}
%python_expand mv -v %{buildroot}%{$python_sitelib}/%{modname}* %{buildroot}%{$python_sitearch}
%python_expand %fdupes %{buildroot}%{$python_sitearch}
# tests are not packaged in the upstream tarball
%files %{python_files}
%license COPYING
%{python_sitearch}/*
%changelog