# Edited by jsnow & kchamart 2022-08-03 %global pypi_name qemu.qmp %global pkg_name qemu-qmp Name: python-%{pkg_name} Version: 0.0.1 Release: 1%{?dist} Summary: QEMU Monitor Protocol library License: GPL-2.0-only AND LGPL-2.0-or-later # NB: qemu/qmp/legacy.py is GPLv2 only. # Everything else is LGPLv2+. URL: https://pypi.org/project/%{pypi_name} Source: %{pypi_source} BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-rtd-theme) %global _description %{expand: The QEMU Monitor Protocol library is a QEMU Monitor Protocol (“QMP”) library written in Python, using asyncio. It is used to send QMP messages to running QEMU emulators. It requires Python 3.6+ and has no mandatory dependencies. This library can be used to communicate with QEMU emulators, the QEMU Guest Agent (QGA), the QEMU Storage Daemon (QSD), or any other utility or application that speaks QMP.} %description %_description %package -n python3-%{pkg_name} Summary: %{summary} %description -n python3-%{pkg_name} %_description %package -n python3-%{pkg_name}-doc Summary: Documentation for %{pkg_name} %description -n python3-%{pkg_name}-doc Documentation for %{pkg_name} %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel # generate html docs # Note: v0.0.1 has a bug where Sphinx won't find the correct version info. # This will be fixed in v0.0.2. See: # https://gitlab.com/qemu-project/python-qemu-qmp/-/commit/57049d4a PYTHONPATH=${PWD} sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %pyproject_install # Explicitly exclude the 'qmp-tui' script from rpm release. # # It's an "extra" and without optional deps, it installs only a useless # stub script that informs you that you are missing necessary # dependencies. In the future, I may create a subpackage to bundle the # optional functionality, and may even split it out upstream into a new # PyPI package. But, for now, it isn't ready for primetime and doesn't # need to be packaged. rm %{buildroot}%{_bindir}/qmp-tui # Use pep420 namespace name instead of package name # https://bugzilla.redhat.com/show_bug.cgi?id=1935266 %pyproject_save_files qemu %files -n python3-%{pkg_name} -f %{pyproject_files} %doc README.rst %{_bindir}/qmp-shell %{_bindir}/qmp-shell-wrap %files -n python3-%{pkg_name}-doc %doc html %changelog * Mon Jul 25 2022 John Snow - 0.0.1-1 - Initial package.