# Draft v3 ~ Special Edition ~ Edited 2022-08-10 Name: python-qemu-qmp Version: 0.0.2.dev14+g7f9a044 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 installed is LGPLv2+. URL: https://pypi.org/project/qemu.qmp Source0: https://people.redhat.com/~jsnow/qemu.qmp-0.0.2.dev14+g7f9a044.tar.gz Source101: https://people.redhat.com/~jsnow/qemu.qmp-0.0.2.dev14+g7f9a044.tar.gz.asc Source102: https://people.redhat.com/~jsnow/keys/FAEB9711A12CF475812F18F288A9064D183561EB.txt # NB: Seeking permanent hosting of the above on qemu.org. BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-rtd-theme) BuildRequires: python3dist(avocado-framework) %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-qemu-qmp Summary: %{summary} %description -n python3-qemu-qmp %_description %package -n python-qemu-qmp-doc Summary: Documentation for the %{summary} %description -n python-qemu-qmp-doc %_description This package provides documentation for python3-qemu-qmp. %prep %{gpgverify} --keyring=%{SOURCE102} --signature=%{SOURCE101} --data=%{SOURCE0} %autosetup -n qemu.qmp-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel PYTHONPATH=${PWD} sphinx-build-3 docs html PYTHONPATH=${PWD} sphinx-build-3 -b man docs man # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %pyproject_install # Explicitly exclude the 'qmp-tui' script from rpm release. # # It relies on extra dependencies that are not yet packaged in Fedora to # function. Without them, the entry point script simply exits. rm %{buildroot}%{_bindir}/qmp-tui mkdir -p %{buildroot}%{_mandir}/man1 install -m 0644 man/*.1 %{buildroot}%{_mandir}/man1/ # Use PEP420 namespace name instead of package name: # https://bugzilla.redhat.com/show_bug.cgi?id=1935266 %pyproject_save_files qemu %check %{pyproject_check_import -e qemu.qmp.qmp_tui} # RFC: # # ENV vars copied from: # https://src.fedoraproject.org/rpms/python-rpm-macros/blob/rawhide/f/macros.python3#_82 # # Is there a more sensible way to do this? I peeked at: # https://src.fedoraproject.org/rpms/python-avocado/blob/rawhide/f/python-avocado.spec#_200 # and noticed a similar glob of setup goo. PATH="%{buildroot}%{_bindir}:$PATH" \ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \ _PYTHONSITE="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}" \ PYTHONDONTWRITEBYTECODE=1 \ avocado --config avocado.cfg run tests/*.py %files -n python3-qemu-qmp -f %{pyproject_files} %license LICENSE LICENSE_GPL2 %doc README.rst %{_bindir}/qmp-shell %{_bindir}/qmp-shell-wrap %{_mandir}/man1/qmp-shell.1* %{_mandir}/man1/qmp-shell-wrap.1* %files -n python-qemu-qmp-doc %license LICENSE LICENSE_GPL2 %doc html %changelog * Mon Jul 25 2022 John Snow - 0.0.1-1 - Initial package.