8 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
Petr Tesarik
39f67b829b Make drgn conflict with old python*-drgn packages
Since the old Python module packages also contain a /usr/bin/drgn file,
installing drgn subpackage also requires upgrading the module package.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-11-06 14:37:31 +01:00
Petr Tesarik
1f5e145a05 Split off a drgn subpackage
Move /usr/bin/drgn to a separate package. We may need multiple Python
packages with the modules, but there should be only one package with the
CLI binary.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-11-06 14:16:42 +01:00
Petr Tesarik
a2bfb0beb4 Update to drgn-0.0.33 2025-11-04 20:53:57 +01:00
Petr Tesarik
b8b05b65e4 Fix build for legacy distributions
The readline module is part of Python itself, but it must be required
explicitly on newer distributions (16.0, Factory). However, Python
packages in older distributions (15.x and earlier) do not have the
corresponding Provides. :-(

Solve it by Build-requiring %pythons. Yes, it does bring a lot of
unneded stuff into the build environment...

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2025-05-28 19:16:27 +02:00
5 changed files with 55 additions and 17 deletions

Binary file not shown.

BIN
drgn-0.0.33.tar.xz LFS Normal file

Binary file not shown.

View File

@@ -1,4 +1,4 @@
name: drgn
version: 0.0.31
mtime: 1744828823
commit: 8209a147fb61deed38ca376d063bbff0343ca234
version: 0.0.33
mtime: 1761770492
commit: 781a21cb057ce07f17fd6edf0ffd299426abcbf7

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Thu Nov 6 13:15:51 UTC 2025 - Petr Tesařík <ptesarik@suse.com>
- Split off a drgn package with the CLI program.
-------------------------------------------------------------------
Tue Nov 4 19:48:45 UTC 2025 - Petr Tesařík <ptesarik@suse.com>
- Update to drgn-0.0.33:
* Lots of new helpers.
* Address Identification Improvements
* Array Slices
* More Reliable Interrupt Stack Traces
* Kmodify Bit Field Fix
* Linux 6.17 and 6.18 Support
-------------------------------------------------------------------
Thu Apr 17 06:47:43 UTC 2025 - Petr Tesařík <ptesarik@suse.com>

View File

@@ -15,9 +15,15 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
%if %{undefined primary_python}
%define first_arg() %1
%define primary_python %{first_arg %pythons}
%endif
Name: python-drgn
Version: 0.0.31
Version: 0.0.33
Release: 0
Summary: Scriptable debugger library
License: LGPL-2.1-or-later
@@ -25,8 +31,8 @@ Group: Development/Tools/Debuggers
URL: https://github.com/osandov/drgn
Source: drgn-%{version}.tar.xz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module readline}
BuildRequires: %{python_module setuptools}
BuildRequires: %{pythons}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: check-devel
@@ -38,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
@@ -45,6 +56,21 @@ drgn (pronounced “dragon”) is a debugger with an emphasis on
programmability. drgn exposes the types and variables in a program
for easy, expressive scripting in Python.
This package contains the Python module.
%package -n drgn
Summary: Scriptable debugger CLI
Conflicts: %{python_module drgn < 0.0.33}
Provides: %{python_module drgn:/usr/bin/drgn}
Requires: %{primary_python}-drgn = %{version}
%description -n drgn
drgn (pronounced “dragon”) is a debugger with an emphasis on
programmability. drgn exposes the types and variables in a program
for easy, expressive scripting in Python.
This package contains the CLI program.
%prep
%setup -q -n drgn-%{version}
@@ -54,26 +80,22 @@ export CFLAGS="%{optflags}"
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/drgn
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%pyunittest_arch discover -v
%post
%python_install_alternative drgn
%postun
%python_uninstall_alternative drgn
%files %{python_files}
%doc README.rst
%license COPYING
%python_alternative %{_bindir}/drgn
%{python_sitearch}/drgn
%{python_sitearch}/drgn-%{version}*-info
%{python_sitearch}/_drgn*.pyi
%{python_sitearch}/_drgn*.so
%{python_sitearch}/_drgn_util
%files -n drgn
%doc README.rst
%license COPYING
%{_bindir}/drgn
%changelog