%global python3_pkgversion 3.11 %global pypi_name zipp Name: python-%{pypi_name} Version: 3.18.1 Release: 2.ac16.py3.11%{?dist} Summary: Backport of pathlib-compatible object wrapper for zip files # SPDX License: MIT URL: https://github.com/jaraco/zipp Source0: %{pypi_source} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros # Not using test dependencies because the list # is full of linters and static code checkers BuildRequires: python%{python3_pkgversion}dist(pytest) BuildRequires: python%{python3_pkgversion}dist(jaraco-functools) %description A pathlib-compatible Zipfile object wrapper. A backport of the Path object. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} %description -n python%{python3_pkgversion}-%{pypi_name} A pathlib-compatible Zipfile object wrapper. A backport of the Path object. %prep %autosetup -n %{pypi_name}-%{version} # jaraco.itertools and func_timeout are not available in Fedora yet sed -i "/import jaraco.itertools/d" tests/test_path.py %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check # Skipped test needs jaraco.itertools %pytest -k "not test_joinpath_constant_time" 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}-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.rst %changelog * Mon May 20 2024 Ding-Yi Chen - 3.18.1-2.ac16.py3.11 - Cut corner packaging