Blame python-google-crc32c.spec

6a66abb
%bcond tests 1
1f2b34b
a19a603
Name:           python-google-crc32c
7c2e014
Version:        1.5.0
2447d41
Release:        %autorelease
b8bc22d
Summary:        A python wrapper of the C library ‘Google CRC32C’
1f2b34b
630d494
License:        Apache-2.0
a19a603
URL:            https://github.com/googleapis/python-crc32c
f475778
Source:         %{url}/archive/v%{version}/python-crc32c-%{version}.tar.gz
1f2b34b
701b872
BuildRequires:  python3-devel
1f2b34b
BuildRequires:  gcc-c++
7c2e014
BuildRequires:  google-crc32c-devel >= 1.1.2
1f2b34b
1f2b34b
%global _description %{expand:
1f2b34b
This package wraps the google/crc32c hardware-based implementation of the
b8bc22d
CRC32C hashing algorithm.}
1f2b34b
1f2b34b
%description %{_description}
1f2b34b
1f2b34b
a19a603
%package -n python3-google-crc32c
1f2b34b
Summary:        %{summary}
6700309
4a87db3
# Remove after F40 reaches end-of-life:
4a87db3
Obsoletes:      python3-google-crc32c+testing < 1.1.2-25
6700309
a19a603
%description -n python3-google-crc32c %{_description}
1f2b34b
6700309
1f2b34b
%prep
a19a603
%autosetup -n python-crc32c-%{version}
18d4a87
# This is a git submodule, so the bundled library isn’t included in the GitHub
18d4a87
# source archive, but it doesn’t hurt to be very certain.
18d4a87
rm -rv google_crc32c/
1f2b34b
1f2b34b
1f2b34b
%generate_buildrequires
e996b22
%pyproject_buildrequires %{?with_tests:-x testing}
1f2b34b
1f2b34b
1f2b34b
%build
3f87dec
%pyproject_wheel
1f2b34b
1f2b34b
1f2b34b
%install
1f2b34b
%pyproject_install
c6ce24f
%pyproject_save_files -l google_crc32c
1f2b34b
1f2b34b
1f2b34b
%check
d60ca09
%pyproject_check_import
c47aff6
c47aff6
# See BUILDING.md.
c47aff6
pushd scripts >/dev/null
c47aff6
# Check the package, try and load the native library
39c4d52
%{py3_test_envvars} %{python3} -m check_crc32c_extension
c47aff6
popd >/dev/null
c47aff6
d60ca09
%if %{with tests}
e4f2855
%pytest
1f2b34b
%endif
1f2b34b
1f2b34b
a19a603
%files -n python3-google-crc32c -f %{pyproject_files}
6700309
%doc CHANGELOG.md
6700309
%doc README.md
39c4d52
%doc SECURITY.md
1f2b34b
1f2b34b
1f2b34b
%changelog
2447d41
%autochangelog