Bring xxhash-libs back

XXH_INLINE_ALL is not always reliable and we may still need the DSO to
link against, so don't aggressively drop the libs.

Resolves: RHEL-74131
This commit is contained in:
Siddhesh Poyarekar 2025-01-23 20:12:03 -05:00 committed by Siddhesh Poyarekar
parent b958d52363
commit dd81578a74

View File

@ -1,13 +1,6 @@
# Disable xxhash-libs in RHEL10 or later.
%if 0%{?fedora} > 0 || 0%{?rhel} < 10
%global build_xxhash_libs 1
%else
%global build_xxhash_libs 0
%endif
Name: xxhash Name: xxhash
Version: 0.8.2 Version: 0.8.2
Release: 10%{?dist} Release: 11%{?dist}
Summary: Extremely fast hash algorithm Summary: Extremely fast hash algorithm
# The source for the library (xxhash.c and xxhash.h) is BSD-2-Clause # The source for the library (xxhash.c and xxhash.h) is BSD-2-Clause
@ -27,8 +20,6 @@ evaluates collision, dispersion and randomness qualities of hash
functions. Code is highly portable, and hashes are identical on all functions. Code is highly portable, and hashes are identical on all
platforms (little / big endian). platforms (little / big endian).
%if %{build_xxhash_libs}
%package libs %package libs
Summary: Extremely fast hash algorithm - library Summary: Extremely fast hash algorithm - library
License: BSD-2-Clause License: BSD-2-Clause
@ -40,14 +31,10 @@ evaluates collision, dispersion and randomness qualities of hash
functions. Code is highly portable, and hashes are identical on all functions. Code is highly portable, and hashes are identical on all
platforms (little / big endian). platforms (little / big endian).
%endif
%package devel %package devel
Summary: Extremely fast hash algorithm - development files Summary: Extremely fast hash algorithm - development files
License: BSD-2-Clause License: BSD-2-Clause
%if %{build_xxhash_libs}
Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%endif
# By setting XXH_INLINE_ALL, xxhash may be used as a header-only library. # By setting XXH_INLINE_ALL, xxhash may be used as a header-only library.
# Dependent packages that use xxhash this way must BR this virtual Provide: # Dependent packages that use xxhash this way must BR this virtual Provide:
Provides: %{name}-static = %{version}-%{release} Provides: %{name}-static = %{version}-%{release}
@ -86,17 +73,12 @@ doxygen
%install %install
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
rm %{buildroot}/%{_libdir}/libxxhash.a rm %{buildroot}/%{_libdir}/libxxhash.a
%if %{build_xxhash_libs} == 0
rm %{buildroot}/%{_libdir}/libxxhash.so*
%endif
%check %check
make check make check
make test-xxhsum-c make test-xxhsum-c
%if %{build_xxhash_libs}
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%endif
%files %files
%{_bindir}/xxh*sum %{_bindir}/xxh*sum
@ -104,25 +86,24 @@ make test-xxhsum-c
%license cli/COPYING %license cli/COPYING
%doc cli/README.md %doc cli/README.md
%if %{build_xxhash_libs}
%files libs %files libs
%{_libdir}/libxxhash.so.* %{_libdir}/libxxhash.so.*
%license LICENSE %license LICENSE
%doc README.md %doc README.md
%endif
%files devel %files devel
%{_includedir}/xxhash.h %{_includedir}/xxhash.h
%{_includedir}/xxh3.h %{_includedir}/xxh3.h
%if %{build_xxhash_libs}
%{_libdir}/libxxhash.so %{_libdir}/libxxhash.so
%endif
%{_libdir}/pkgconfig/libxxhash.pc %{_libdir}/pkgconfig/libxxhash.pc
%files doc %files doc
%doc doxygen/html %doc doxygen/html
%changelog %changelog
* Thu Jan 23 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 0.8.2-11
- Bring xxhash-libs back (RHEL-74131).
* Mon Jan 13 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 0.8.2-10 * Mon Jan 13 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 0.8.2-10
- Rebuild to tag xxhash into buildroot (RHEL-71299). - Rebuild to tag xxhash into buildroot (RHEL-71299).