From a7fad7baef9a2eb5f0ec9d07f9aa7b8e89c52e88 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Sep 17 2021 16:29:40 +0000 Subject: Initial package --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6719729 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/xxhash-2.0.2.tar.gz diff --git a/python-xxhash.spec b/python-xxhash.spec new file mode 100644 index 0000000..b849f51 --- /dev/null +++ b/python-xxhash.spec @@ -0,0 +1,67 @@ +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 +URL: https://github.com/ifduyue/python-xxhash +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} + + +%prep +%autosetup -n xxhash-%{version} +# Remove bundled xxhash library +rm -rvf deps + + +%generate_buildrequires +%pyproject_buildrequires -r + + +%build +%set_build_flags +# 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_wheel + + +%install +%pyproject_install +%pyproject_save_files xxhash + + +%check +cd tests +PYTHONPATH='%{buildroot}%{python3_sitearch}' \ + %{__python3} -m unittest discover + + +%files -n python3-xxhash -f %{pyproject_files} +%doc CHANGELOG.rst +%doc README.rst + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..86e5487 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (xxhash-2.0.2.tar.gz) = 8908e78207ff7b835259e359e2617f6b96555bd9dbc5bb079c850e9de22fd33c15396fbde0cd824cf8af2a195217f3ddc1aa8e62f1ed4071408b4a29bab31f2c