File drgn.spec of Package drgn

#
# spec file for package drgn
#
# Copyright (c) 2022 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
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define skip_python2 1
%define pythons python311
%{?!python_module:%define python_module() python311-%{**}}
Name:           drgn
Version:        0.0.26+git.20250805
Release:        0
Summary:        Scriptable debugger library
License:        GPL-3.0
Group:          Development/Tools/Debuggers
Url:            https://github.com/osandov/drgn
Source:         %{name}-%{version}.tar.gz
BuildRequires:  python311
BuildRequires:  python311-devel
BuildRequires:  python311-setuptools
BuildRequires:  %{pythons}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libelf)
BuildRequires:  pkgconfig(libdw)
BuildRequires:  pkgconfig(python-3.11)
BuildRequires:  python-rpm-macros
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  libkdumpfile-devel
BuildRequires:  check-devel
Requires(post):   update-alternatives
Requires(postun):  update-alternatives
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%python_subpackages

%description
drgn (pronounced "dragon") is a debugger-as-a-library. In contrast to existing
debuggers like GDB which focus on breakpoint-based debugging, drgn excels in
live introspection. drgn exposes the types and variables in a program for
easy, expressive scripting in Python.

%prep
%setup -q

%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_build

%check
# python_exec setup.py test

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/drgn

%post
%python_install_alternative drgn

%postun
%python_uninstall_alternative drgn


%files %{python_files}
%defattr(-,root,root)
%doc README.rst COPYING
%python_alternative %{_bindir}/drgn
%{python_sitearch}/drgn*
%{python_sitearch}/_drgn*

%changelog

openSUSE Build Service is sponsored by