Blob Blame History Raw
Name:           python-xxhash
Version:        2.0.2
Release:        %autorelease
Summary:        Python Binding for xxHash

# Note LICENSE mentions GPLv2 for “xxhsum command line interface”; that is not
# included in this package, so the license is BSD only.
License:        BSD
Source0:        %{pypi_source xxhash}

BuildRequires:  python3-devel

BuildRequires:  gcc
BuildRequires:  pkgconfig(libxxhash)

%global common_description %{expand:
xxhash is a Python binding for the xxHash library by Yann Collet.}

%description %{common_description}

%package -n python3-xxhash
Summary:        %{summary}

%description -n python3-xxhash %{common_description}

%autosetup -n xxhash-%{version}
# Remove bundled xxhash library
rm -rvf deps

%pyproject_buildrequires -r

# Normally, no extra flags are required to link the xxhash shared library, but
# we are prepared:
export CFLAGS="${CFLAGS} $(pkgconf --cflags libxxhash)"
export LDFLAGS="${LDFLAGS} $(pkgconf --libs-only-L libxxhash)"
export LDFLAGS="${LDFLAGS} $(pkgconf --libs-only-other libxxhash)"
export XXHASH_LINK_SO='Non-empty string'

%pyproject_save_files xxhash

cd tests
PYTHONPATH='%{buildroot}%{python3_sitearch}' %{python3} -m unittest discover

%files -n python3-xxhash -f %{pyproject_files}
%doc CHANGELOG.rst
%doc README.rst