15
0

Accepting request 618310 from devel:languages:python:singlespec-staging

Clean SPEC file

OBS-URL: https://build.opensuse.org/request/show/618310
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-distorm3?expand=0&rev=17
This commit is contained in:
2018-06-21 12:41:25 +00:00
committed by Git OBS Bridge
parent cc547517c1
commit e690b4ec9b
5 changed files with 44 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-distorm3
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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
@@ -16,45 +16,54 @@
#
Name: python-distorm3
Version: 3.3
%{?!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: GPL-3.0
# TODO Is it so?
License: GPL-3.0-only
Group: Development/Libraries/Python
Url: http://code.google.com/p/distorm/
Source: distorm3-%{version}.zip
URL: https://github.com/gdabah/distorm
Source: https://files.pythonhosted.org/packages/source/d/%{modname}/%{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-devel
BuildRequires: python-rpm-macros
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
%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.
than static text.
%prep
%setup -q -n distorm3
%setup -q -n %{modname}-%{version}
%patch0 -p1
%patch1 -p1
%build
CFLAGS="%{optflags}" python setup.py build
export CFLAGS="%{optflags}"
%python_build
%install
python setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python_sitearch}
%fdupes -s %{buildroot}
%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}
%files
%defattr(-,root,root)
%doc COPYING
# tests are not packaged in the upstream tarball
%files %{python_files}
%license COPYING
%{python_sitearch}/*
%changelog