forked from pool/python-python-ptrace
Accepting request 1154445 from home:bnavigator:branches:devel:languages:python
- Update to 0.9.8 * Added Arm 64bit (AArch64) support. * Implemented ``PTRACE_GETREGSET`` and ``PTRACE_SETREGSET`` required on AArch64 and available on Linux. * Issue #66: Fix ``SIGTRAP|0x80`` or ``SIGTRAP`` wait in syscall_state.exit (``PTRACE_O_TRACESYSGOOD``). - Build PEP517 wheels separately in multibuild - Add patchtes for Python 3.12: * python-ptrace-pr81-importlib.patch gh#vstinner/python-ptrace#81 * python-ptrace-pr83-importlib.patch gh#vstinner/python-ptrace#83 OBS-URL: https://build.opensuse.org/request/show/1154445 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-ptrace?expand=0&rev=18
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-python-ptrace
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,50 +16,93 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define pkg_name python-ptrace
|
||||
%define skip_python2 1
|
||||
Name: python-%{pkg_name}
|
||||
Version: 0.9.7
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%define pyversion 0.9.8
|
||||
%define cversion 0.6.1
|
||||
%if "%{flavor}" == ""
|
||||
%define pkgname python-ptrace
|
||||
%define pkgversion %{pyversion}
|
||||
%bcond_with test
|
||||
%endif
|
||||
%if "%{flavor}" == "cptrace"
|
||||
%define pkgname cptrace
|
||||
%define pkgversion %{cversion}
|
||||
%bcond_with test
|
||||
%endif
|
||||
%if "%{flavor}" == "test"
|
||||
%define pkgname python-ptrace-test
|
||||
%define pkgversion %{pyversion}+%{cversion}
|
||||
%bcond_without test
|
||||
ExcludeArch: %arm
|
||||
%endif
|
||||
|
||||
Name: python-%{pkgname}
|
||||
Version: %{pkgversion}
|
||||
Release: 0
|
||||
Summary: Python binding for ptrace
|
||||
License: GPL-2.0-only
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/vstinner/python-ptrace
|
||||
Source: https://github.com/haypo/%{pkg_name}/archive/%{version}.tar.gz#!./%{pkg_name}-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM - https://github.com/vstinner/python-ptrace/pull/59
|
||||
Patch1: add-aarch64-support.patch
|
||||
Source: https://github.com/haypo/python-ptrace/archive/%{pyversion}.tar.gz#/python-ptrace-%{pyversion}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM - Add python-ptrace-pr81-importlib.patch gh#vstinner/python-ptrace#81
|
||||
Patch0: https://github.com/vstinner/python-ptrace/pull/81.patch#/python-ptrace-pr81-importlib.patch
|
||||
# PATCH-FIX-UPSTREAM - Add python-ptrace-pr83-importlib.patch gh#vstinner/python-ptrace#83
|
||||
Patch1: https://github.com/vstinner/python-ptrace/pull/83.patch#/python-ptrace-pr83-importlib.patch
|
||||
%if "%{flavor}" == "cptrace"
|
||||
BuildRequires: %{python_module devel}
|
||||
%else
|
||||
BuildArch: noarch
|
||||
Recommends: python-cptrace = %{cversion}
|
||||
%endif
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module cptrace = %{cversion}}
|
||||
BuildRequires: %{python_module python-ptrace = %{pyversion}}
|
||||
%endif
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
python-ptrace is a debugger using ptrace written in Python.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{pkg_name}-%{version}
|
||||
%patch1 -p1
|
||||
%autosetup -p1 -n python-ptrace-%{pyversion}
|
||||
sed -i 's/\x0D$//' doc/*.rst
|
||||
chmod 0644 examples/*.py
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%python_exec setup_cptrace.py build
|
||||
%if !%{with test}
|
||||
%if "%{flavor}" == "cptrace"
|
||||
mv setup.py setup_python-ptrace.py
|
||||
mv setup_cptrace.py setup.py
|
||||
%endif
|
||||
%pyproject_wheel
|
||||
%endif
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%python_exec setup_cptrace.py install -O1 --skip-build --root %{buildroot}
|
||||
%if !%{with test}
|
||||
%pyproject_install
|
||||
%if "%{flavor}" == "cptrace"
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
%else
|
||||
%python_clone -a %{buildroot}%{_bindir}/gdb.py
|
||||
%python_clone -a %{buildroot}%{_bindir}/strace.py
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
%python_exec runtests.py
|
||||
%python_exec runtests.py -v
|
||||
%endif
|
||||
|
||||
%if !%{with test}
|
||||
%if "%{flavor}" == ""
|
||||
%post
|
||||
%python_install_alternative strace.py
|
||||
%python_install_alternative gdb.py
|
||||
@@ -75,8 +118,16 @@ chmod 0644 examples/*.py
|
||||
%python_alternative %{_bindir}/gdb.py
|
||||
%python_alternative %{_bindir}/strace.py
|
||||
%{python_sitelib}/ptrace/
|
||||
%{python_sitelib}/python_ptrace-*-py*.egg-info
|
||||
%{python_sitelib}/python_ptrace-%{pkgversion}.dist-info
|
||||
%endif
|
||||
|
||||
%if "%{flavor}" == "cptrace"
|
||||
%files %{python_files}
|
||||
%license COPYING
|
||||
%doc README.rst
|
||||
%{python_sitearch}/cptrace*.so
|
||||
%{python_sitearch}/cptrace-*-py*.egg-info
|
||||
%{python_sitearch}/cptrace-%{pkgversion}.dist-info
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user