6bb98d
Name:		xxhash
6bb98d
Version:	0.8.1
6bb98d
Release:	3%{?dist}
6bb98d
Summary:	Extremely fast hash algorithm
6bb98d
6bb98d
#		The source for the library (xxhash.c and xxhash.h) is BSD
6bb98d
#		The source for the command line tool (xxhsum.c) is GPLv2+
6bb98d
License:	BSD and GPLv2+
6bb98d
URL:		http://www.xxhash.com/
6bb98d
Source0:	https://github.com/Cyan4973/xxHash/archive/v%{version}/%{name}-%{version}.tar.gz
6bb98d
6bb98d
BuildRequires:	make
6bb98d
BuildRequires:	gcc
6bb98d
BuildRequires:	doxygen
6bb98d
6bb98d
Patch0:		1-fix-man-page-installation.patch
6bb98d
6bb98d
%description
6bb98d
xxHash is an Extremely fast Hash algorithm, running at RAM speed
6bb98d
limits. It successfully completes the SMHasher test suite which
6bb98d
evaluates collision, dispersion and randomness qualities of hash
6bb98d
functions. Code is highly portable, and hashes are identical on all
6bb98d
platforms (little / big endian).
6bb98d
6bb98d
%package libs
6bb98d
Summary:	Extremely fast hash algorithm - library
6bb98d
License:	BSD
6bb98d
6bb98d
%description libs
6bb98d
xxHash is an Extremely fast Hash algorithm, running at RAM speed
6bb98d
limits. It successfully completes the SMHasher test suite which
6bb98d
evaluates collision, dispersion and randomness qualities of hash
6bb98d
functions. Code is highly portable, and hashes are identical on all
6bb98d
platforms (little / big endian).
6bb98d
6bb98d
%package devel
6bb98d
Summary:	Extremely fast hash algorithm - development files
6bb98d
License:	BSD
6bb98d
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
6bb98d
# By setting XXH_INLINE_ALL, xxhash may be used as a header-only library.
6bb98d
# Dependent packages that use xxhash this way must BR this virtual Provide:
6bb98d
Provides:	%{name}-static = %{version}-%{release}
6bb98d
6bb98d
%description devel
6bb98d
Development files for the xxhash library
6bb98d
6bb98d
%package doc
6bb98d
Summary:	Extremely fast hash algorithm - documentation files
6bb98d
License:	BSD
6bb98d
BuildArch:	noarch
6bb98d
6bb98d
%description doc
6bb98d
Documentation files for the xxhash library
6bb98d
6bb98d
%prep
6bb98d
%setup -q -n xxHash-%{version}
6bb98d
%patch0 -p1
6bb98d
6bb98d
%build
6bb98d
# Enable runtime detection of sse2/avx2/avx512 on intel architectures
6bb98d
%ifarch %{ix86} x86_64
6bb98d
%global dispatch 1
6bb98d
%else
6bb98d
%global dispatch 0
6bb98d
%endif
6bb98d
6bb98d
%make_build MOREFLAGS="%{__global_cflags} %{?__global_ldflags}" \
6bb98d
	    DISPATCH=%{dispatch}
6bb98d
doxygen
6bb98d
6bb98d
%install
6bb98d
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
6bb98d
rm %{buildroot}/%{_libdir}/libxxhash.a
6bb98d
6bb98d
%check
6bb98d
make check
6bb98d
make test-xxhsum-c
6bb98d
6bb98d
%ldconfig_scriptlets libs
6bb98d
6bb98d
%files
6bb98d
%{_bindir}/xxh*sum
6bb98d
%{_mandir}/man1/xxh*sum.1*
6bb98d
%license cli/COPYING
6bb98d
%doc cli/README.md
6bb98d
6bb98d
%files libs
6bb98d
%{_libdir}/libxxhash.so.*
6bb98d
%license LICENSE
6bb98d
%doc README.md
6bb98d
6bb98d
%files devel
6bb98d
%{_includedir}/xxhash.h
6bb98d
%{_includedir}/xxh3.h
6bb98d
%{_libdir}/libxxhash.so
6bb98d
%{_libdir}/pkgconfig/libxxhash.pc
6bb98d
6bb98d
%files doc
6bb98d
%doc doxygen/html
6bb98d
6bb98d
%changelog
6bb98d
* Mon Jul 18 2022 Vladis Dronov <vdronov@redhat.com> - 0.8.1-3
6bb98d
- Fix broken manpages (upstream commit 836f4e735cf3)
6bb98d
- Add OSCI testing harness
6bb98d
6bb98d
* Fri Jun 17 2022 Vladis Dronov <vdronov@redhat.com> - 0.8.1-1
6bb98d
- Packaging of xxhash v0.8.1 for CS and RHEL copied from Fedora 36