%global python3_pkgversion 3.11 %bcond tests 0 Name: python-google-crc32c Version: 1.5.0 Release: 2.ac16.py3.11%{?dist} Summary: A python wrapper of the C library ‘Google CRC32C’ License: Apache-2.0 URL: https://github.com/googleapis/python-crc32c Source: %{url}/archive/v%{version}/python-crc32c-%{version}.tar.gz BuildRequires: python%{python3_pkgversion}-devel BuildRequires: gcc-c++ BuildRequires: google-crc32c-devel >= 1.1.2 %global _description %{expand: This package wraps the google/crc32c hardware-based implementation of the CRC32C hashing algorithm.} %description %{_description} %package -n python%{python3_pkgversion}-google-crc32c Summary: %{summary} # Remove after F40 reaches end-of-life: Obsoletes: python3-google-crc32c+testing < 1.1.2-25 %description -n python%{python3_pkgversion}-google-crc32c %{_description} %prep %autosetup -n python-crc32c-%{version} # This is a git submodule, so the bundled library isn’t included in the GitHub # source archive, but it doesn’t hurt to be very certain. rm -rv google_crc32c/ %generate_buildrequires %pyproject_buildrequires %{?with_tests:-x testing} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files google_crc32c %check %pyproject_check_import # See BUILDING.md. pushd scripts >/dev/null # Check the package, try and load the native library %{py3_test_envvars} %{python3} -m check_crc32c_extension popd >/dev/null %if %{with tests} %pytest %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-crc32c -f %{pyproject_files} %doc CHANGELOG.md %doc README.md %doc SECURITY.md %changelog * Wed May 22 2024 Ding-Yi Chen - 1.5.0-2.ac16.py3.11 - Cut corner packaging