2017-06-26 07:40:25 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-python-ptrace
|
|
|
|
#
|
2024-03-05 17:03:23 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-06-26 07:40:25 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-09-10 11:06:35 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-06-26 07:40:25 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-03-05 17:03:23 +00:00
|
|
|
%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}
|
2017-06-26 07:40:25 +00:00
|
|
|
Release: 0
|
2017-06-29 17:04:49 +00:00
|
|
|
Summary: Python binding for ptrace
|
2019-09-10 11:06:35 +00:00
|
|
|
License: GPL-2.0-only
|
2017-06-26 07:40:25 +00:00
|
|
|
Group: Development/Languages/Python
|
2019-09-10 11:06:35 +00:00
|
|
|
URL: https://github.com/vstinner/python-ptrace
|
2024-03-05 17:03:23 +00:00
|
|
|
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"
|
2017-06-26 07:40:25 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
2024-03-05 17:03:23 +00:00
|
|
|
%else
|
|
|
|
BuildArch: noarch
|
|
|
|
Recommends: python-cptrace = %{cversion}
|
|
|
|
%endif
|
|
|
|
BuildRequires: %{python_module pip}
|
2017-06-26 07:40:25 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-03-05 17:03:23 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2017-06-26 07:40:25 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires(post): update-alternatives
|
2017-06-27 15:06:51 +00:00
|
|
|
Requires(postun): update-alternatives
|
2024-03-05 17:03:23 +00:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module cptrace = %{cversion}}
|
|
|
|
BuildRequires: %{python_module python-ptrace = %{pyversion}}
|
|
|
|
%endif
|
2017-06-26 07:40:25 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2017-06-29 17:04:49 +00:00
|
|
|
python-ptrace is a debugger using ptrace written in Python.
|
2017-06-26 07:40:25 +00:00
|
|
|
|
|
|
|
%prep
|
2024-03-05 17:03:23 +00:00
|
|
|
%autosetup -p1 -n python-ptrace-%{pyversion}
|
2017-06-26 07:40:25 +00:00
|
|
|
sed -i 's/\x0D$//' doc/*.rst
|
|
|
|
chmod 0644 examples/*.py
|
|
|
|
|
|
|
|
%build
|
2024-03-05 17:03:23 +00:00
|
|
|
%if !%{with test}
|
|
|
|
%if "%{flavor}" == "cptrace"
|
|
|
|
mv setup.py setup_python-ptrace.py
|
|
|
|
mv setup_cptrace.py setup.py
|
|
|
|
%endif
|
|
|
|
%pyproject_wheel
|
|
|
|
%endif
|
2017-06-26 07:40:25 +00:00
|
|
|
|
|
|
|
%install
|
2024-03-05 17:03:23 +00:00
|
|
|
%if !%{with test}
|
|
|
|
%pyproject_install
|
|
|
|
%if "%{flavor}" == "cptrace"
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
%else
|
2017-06-26 07:40:25 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/gdb.py
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/strace.py
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2024-03-05 17:03:23 +00:00
|
|
|
%endif
|
|
|
|
%endif
|
2017-06-26 07:40:25 +00:00
|
|
|
|
2024-03-05 17:03:23 +00:00
|
|
|
%if %{with test}
|
2017-06-26 07:40:25 +00:00
|
|
|
%check
|
2024-03-05 17:03:23 +00:00
|
|
|
%python_exec runtests.py -v
|
|
|
|
%endif
|
2017-06-26 07:40:25 +00:00
|
|
|
|
2024-03-05 17:03:23 +00:00
|
|
|
%if !%{with test}
|
|
|
|
%if "%{flavor}" == ""
|
2017-06-26 07:40:25 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative strace.py
|
|
|
|
%python_install_alternative gdb.py
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative strace.py
|
|
|
|
%python_uninstall_alternative gdb.py
|
|
|
|
|
|
|
|
%files %{python_files}
|
2019-09-10 11:06:35 +00:00
|
|
|
%license COPYING
|
2017-06-26 07:40:25 +00:00
|
|
|
%doc README.rst
|
|
|
|
%doc doc/* examples
|
|
|
|
%python_alternative %{_bindir}/gdb.py
|
|
|
|
%python_alternative %{_bindir}/strace.py
|
|
|
|
%{python_sitelib}/ptrace/
|
2024-03-05 17:03:23 +00:00
|
|
|
%{python_sitelib}/python_ptrace-%{pkgversion}.dist-info
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%{flavor}" == "cptrace"
|
|
|
|
%files %{python_files}
|
|
|
|
%license COPYING
|
|
|
|
%doc README.rst
|
2017-06-26 07:40:25 +00:00
|
|
|
%{python_sitearch}/cptrace*.so
|
2024-03-05 17:03:23 +00:00
|
|
|
%{python_sitearch}/cptrace-%{pkgversion}.dist-info
|
|
|
|
%endif
|
|
|
|
%endif
|
2017-06-26 07:40:25 +00:00
|
|
|
|
|
|
|
%changelog
|