%global python3_pkgversion 3.11 %bcond tests 0 Version: 2.7.0 Name: python-google-resumable-media Release: 2.ac16.py3.11%{?dist} Summary: Utilities for Google media downloads and resumable uploads License: Apache-2.0 URL: https://github.com/googleapis/google-resumable-media-python Source: %{url}/archive/v%{version}/google-resumable-media-python-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %if %{with tests} BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist brotli} %endif %global _description %{expand: %{summary}.} %description %{_description} %package -n python%{python3_pkgversion}-google-resumable-media Summary: %{summary} %description -n python%{python3_pkgversion}-google-resumable-media %{_description} # We don’t build a metapackage for the aiohttp extra because it currently # requires google-auth 1.x, and Fedora has version 2.x. # # Please consider supporting google-auth 2.x # https://github.com/googleapis/google-resumable-media-python/issues/417 %pyproject_extras_subpkg -n python3-google-resumable-media requests %prep %autosetup -n google-resumable-media-python-%{version} %generate_buildrequires %pyproject_buildrequires -x requests %build %pyproject_wheel %install %pyproject_install %pyproject_save_files google %check %pyproject_check_import %if %{with tests} # Work around an usual pytest/PEP 420 issue where pytest can't import the # installed module. Thanks to mhroncok for the help! mv google{,_} %pytest tests/unit mv google{_,} %endif 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}-google-resumable-media -f %{pyproject_files} %doc CHANGELOG.md %doc README.rst %changelog * Wed May 22 2024 Ding-Yi Chen - 2.7.0-2.ac16.py3.11 - Cut corner packaging