%global python3_pkgversion 3.11 Name: python-frozenlist Version: 1.4.1 Release: 2.ac12.py3.11%{?dist} Summary: List-like structure which can be made immutable License: Apache-2.0 URL: https://github.com/aio-libs/frozenlist Source: %{pypi_source frozenlist} # Downstream-only: Build normal wheels in-place # # Upstream wants to build only editable wheels in-place, building normal # wheels in a temporary directory. This is reasonable in principle, but # the implementation conflicts with the pyproject-rpm-macros, resulting in # an unbounded recursion of nested temporary directories. Patch: 0001-Downstream-only-Build-normal-wheels-in-place.patch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: gcc BuildRequires: %{py3_dist pytest} %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 python%{python3_pkgversion}-frozenlist Summary: %{summary} %description -n python%{python3_pkgversion}-frozenlist %{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 # Patch out coverage-related pytest options: # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters sed -r -i 's/^([[:blank:]]*)(.*[-_]cov)/\1# \2/' pytest.ini %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files frozenlist %check %pytest -v for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-frozenlist -f %{pyproject_files} %doc CHANGES.rst %doc CONTRIBUTORS.txt %doc README.rst %changelog * Tue Apr 16 2024 Ding-Yi Chen - 1.4.1-2.ac12.py3.11 - Cut corner packaging