## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. However, we need latexmk, # and would prefer to have python3-docs, and neither is yet available in EPEL9. %bcond_with doc_pdf Name: python-frozenlist Version: 1.2.0 Release: %autorelease Summary: List-like structure which can be made immutable License: ASL 2.0 URL: https://github.com/aio-libs/frozenlist Source0: %{pypi_source frozenlist} # Binary distributions such as wheels include C sources # https://github.com/aio-libs/frozenlist/issues/250 # https://github.com/aio-libs/frozenlist/pull/251 Patch0: %{url}/pull/251.patch BuildRequires: python3-devel BuildRequires: gcc BuildRequires: python3dist(cython) BuildRequires: python3dist(pytest) %if %{with doc_pdf} BuildRequires: make BuildRequires: python3dist(sphinx) BuildRequires: python3-sphinx-latex BuildRequires: latexmk BuildRequires: python3-docs %endif %global common_description %{expand: FrozenList is a list-like structure which implements collections.abc.MutableSequence, and which can be made immutable.} %description %{common_description} %package -n python3-frozenlist Summary: %{summary} %description -n python3-frozenlist %{common_description} %package doc Summary: Documentation for python-frozenlist BuildArch: noarch %description doc %{common_description} %prep %autosetup -n frozenlist-%{version} -p1 # Remove Cython-generated sources; we must ensure they are regenerated. find . -type f -name '*.c*' -print -delete # Use local inventory in intersphinx mappings, where available; where # unavailable, remove them explicitly. sed -r -i \ -e 's|https?://docs.python.org/3|/%{_docdir}/python3-docs/html|' \ -e "/(https?:\/\/docs\.aiohttp\.org|'aiohttp':)/d" \ docs/conf.py %generate_buildrequires %pyproject_buildrequires -r %build # Re-generate C sources with Cython. Imitates Makefile on GitHub. %{python3} -m cython -3 frozenlist/*.pyx -I frozenlist %pyproject_wheel %if %{with doc_pdf} %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files frozenlist %check %pytest %files -n python3-frozenlist -f %{pyproject_files} # pyproject-rpm-macros marks LICENSE in dist-info; verify with “rpm -qL -p …” %files doc %license LICENSE %doc CHANGES.rst %doc CONTRIBUTORS.txt %doc README.rst %if %{with doc_pdf} %doc docs/_build/latex/frozenlist.pdf %endif %changelog * Mon Dec 13 2021 Benjamin A. Beasley 1.2.0-2 - Disable PDF docs in EPEL9 for now * Mon Dec 13 2021 Benjamin A. Beasley 1.2.0-1 - Initial package (close RHBZ#2029651)