2021-04-06 22:00:11 +00:00
|
|
|
# Created by pyp2rpm-3.3.5
|
|
|
|
%if 0%{?rhel}
|
|
|
|
%bcond_with docs
|
|
|
|
%else
|
|
|
|
%bcond_without docs
|
|
|
|
%endif
|
|
|
|
%bcond_without tests
|
|
|
|
|
|
|
|
%global pypi_name drgn
|
|
|
|
|
2021-08-12 21:53:50 +00:00
|
|
|
%global _description %{expand:
|
2021-04-06 22:00:11 +00:00
|
|
|
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.}
|
|
|
|
|
|
|
|
Name: python-%{pypi_name}
|
2023-06-28 22:55:05 +00:00
|
|
|
Version: 0.0.23
|
2021-08-12 20:30:18 +00:00
|
|
|
Release: %autorelease
|
2021-12-09 23:33:51 +00:00
|
|
|
Summary: Programmable debugger
|
2021-04-06 22:00:11 +00:00
|
|
|
|
2023-01-06 05:08:08 +00:00
|
|
|
License: LGPL-2.1-or-later
|
2021-04-06 22:00:11 +00:00
|
|
|
URL: https://github.com/osandov/drgn
|
|
|
|
Source0: %{pypi_source}
|
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3dist(setuptools)
|
|
|
|
%if %{with docs}
|
|
|
|
BuildRequires: sed
|
|
|
|
BuildRequires: python3dist(sphinx)
|
|
|
|
BuildRequires: python3-docs
|
|
|
|
%endif
|
|
|
|
%if %{with tests}
|
|
|
|
BuildRequires: python3dist(pytest)
|
|
|
|
%endif
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: make
|
|
|
|
BuildRequires: bzip2-devel
|
|
|
|
BuildRequires: elfutils-devel
|
|
|
|
BuildRequires: libkdumpfile-devel
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
BuildRequires: xz-devel
|
2021-10-26 16:16:01 +00:00
|
|
|
# These are needed when building from git snapshots
|
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
|
|
|
BuildRequires: libtool
|
2021-04-06 22:00:11 +00:00
|
|
|
|
2021-08-12 21:53:50 +00:00
|
|
|
%description %{_description}
|
2021-04-06 22:00:11 +00:00
|
|
|
|
|
|
|
%package -n %{pypi_name}
|
|
|
|
Summary: %{summary}
|
|
|
|
|
2021-08-12 21:53:50 +00:00
|
|
|
%description -n %{pypi_name} %{_description}
|
2021-04-06 22:00:11 +00:00
|
|
|
|
|
|
|
%if %{with docs}
|
|
|
|
%package -n %{pypi_name}-doc
|
|
|
|
Summary: %{pypi_name} documentation
|
|
|
|
BuildArch: noarch
|
|
|
|
Requires: python3-docs
|
|
|
|
|
2021-08-12 21:53:50 +00:00
|
|
|
%description -n %{pypi_name}-doc %{_description}
|
|
|
|
|
|
|
|
This package contains additional documentation for %{pypi_name}.
|
2021-04-06 22:00:11 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n %{pypi_name}-%{version} -p1
|
|
|
|
# Remove bundled egg-info
|
|
|
|
rm -rf %{pypi_name}.egg-info
|
|
|
|
%if %{with docs}
|
|
|
|
# Use local intersphinx inventory
|
|
|
|
sed -r \
|
|
|
|
-e 's|https://docs.python.org/3|%{_docdir}/python3-docs/html|' \
|
|
|
|
-i docs/conf.py
|
|
|
|
%endif
|
2021-10-26 16:16:01 +00:00
|
|
|
# Ensure version is always set, even when building from git snapshots
|
|
|
|
if [ ! -f drgn/internal/version.py ]; then
|
|
|
|
echo '__version__ = "%{version}"' > drgn/internal/version.py
|
|
|
|
fi
|
2021-04-06 22:00:11 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
# verbose build
|
|
|
|
V=1 %py3_build
|
|
|
|
|
|
|
|
%if %{with docs}
|
|
|
|
# generate html docs
|
|
|
|
PYTHONPATH=${PWD} sphinx-build-3 docs html
|
|
|
|
# remove the sphinx-build leftovers
|
|
|
|
rm -rf html/.{doctrees,buildinfo}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
|
|
|
%py3_install
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/drgn
|
2023-01-06 05:08:08 +00:00
|
|
|
cp -PR contrib tools %{buildroot}%{_datadir}/drgn
|
2021-04-06 22:00:11 +00:00
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
%check
|
|
|
|
%pytest
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files -n %{pypi_name}
|
|
|
|
%license COPYING
|
2023-01-06 05:08:08 +00:00
|
|
|
%license LICENSES
|
2021-04-06 22:00:11 +00:00
|
|
|
%doc README.rst
|
|
|
|
%{_bindir}/drgn
|
|
|
|
%{_datadir}/drgn
|
|
|
|
%{python3_sitearch}/_%{pypi_name}.pyi
|
|
|
|
%{python3_sitearch}/_%{pypi_name}.cpython*.so
|
|
|
|
%{python3_sitearch}/%{pypi_name}
|
|
|
|
%{python3_sitearch}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
|
|
|
|
|
|
|
|
%if %{with docs}
|
|
|
|
%files -n %{pypi_name}-doc
|
|
|
|
%license COPYING
|
2023-01-06 05:08:08 +00:00
|
|
|
%license LICENSES
|
2021-04-06 22:00:11 +00:00
|
|
|
%doc html
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|
2021-08-12 20:30:18 +00:00
|
|
|
%autochangelog
|