4 Commits

Author SHA256 Message Date
Petr Tesarik
c8ccbd4f20 Make drgn subpackage depend on the exact version of the module
Any version will not do for the CLI. We need a compatible one.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-12-18 17:43:56 +01:00
Petr Tesarik
44a63993db Exclude from build on ancient distributions
Use a dummy architecture name ("nothere") to prevent build attempts for
ancient distributions.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-12-18 17:42:50 +01:00
Petr Tesarik
22af1f16e0 Restore build for older distributions
Some distributions ship with default Python < 3.8, but a newer Python
version is available through a module. The package currently does not
build at all for those distributions, but the build environment provides
a handy macro precisely for this purpose.

As a side note, primary_python is not provided either, breaking
dependencies for the CLI subpackage. Fall back to the first Python
version in %pythons in that case.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-12-18 16:58:59 +01:00
Petr Tesarik
bba0fbe6f6 Do not build if Python 3.8+ is unavailable
The %{primary_python} macro is defined only for build targets which have
Python 3.8 or newer. Until a better solution is available, use this
trick to make the package unbuildable if Python is too old (rather than
fail the build).

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-11-12 10:48:12 +01:00

View File

@@ -15,8 +15,11 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
%if %{undefined primary_python}
%define primary_python python3
%define first_arg() %1
%define primary_python %{first_arg %pythons}
%endif
Name: python-drgn
@@ -41,6 +44,11 @@ BuildRequires: libtool
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
# Do not even try for ancient distributions
%if %{undefined pythons}
ExclusiveArch: nothere
%endif
%python_subpackages
%description
@@ -54,7 +62,7 @@ This package contains the Python module.
Summary: Scriptable debugger CLI
Conflicts: %{python_module drgn < 0.0.33}
Provides: %{python_module drgn:/usr/bin/drgn}
Requires: %{primary_python}-drgn
Requires: %{primary_python}-drgn = %{version}
%description -n drgn
drgn (pronounced “dragon”) is a debugger with an emphasis on