%global gittag0 v%{version} %global name0 xxHash Name: xxhsum Version: 0.6.2 Release: 1%{?dist} Summary: Extremely fast hash algorithm License: BSD and GPLv2+ URL: https://github.com/Cyan4973/%{name0} Source0: %{url}/archive/%{gittag0}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: cmake Requires: libxxhash%{?_isa} = %{version}-%{release} %package -n libxxhash License: BSD Summary: %{name} Shared Libraries %package -n libxxhash-devel License: BSD Summary: Development files for libxxhash Requires: libxxhash%{?_isa} = %{version}-%{release} %description xxHash is an Extremely fast Hash algorithm, running at RAM speed limits. It successfully completes the SMHasher test suite which evaluates collision, dispersion and randomness qualities of hash functions. %description -n libxxhash This package contains %{name} Shared Libraries %description -n libxxhash-devel The libxxhash-devel package contains libraries and header files for developing applications that use libxxhash %prep %autosetup -n %{name0}-%{version} ## libxxhash # Use ${LIB_INSTALL_DIR} instead of hardcoded lib in cmake file sed -i 's|DESTINATION lib|DESTINATION ${LIB_INSTALL_DIR}|' cmake_unofficial/CMakeLists.txt sed -i 's|xxhsum: xxhash.c xxhsum.c|xxhsum: xxhsum.c|' Makefile sed -i 's|-o| -Lcmake_unofficial/ -lxxhash -o|' Makefile %build ## libxxhash CFLAGS="${CFLAGS:-%optflags}" #CPPFLAGS="CPPFLAGS" export CFLAGS ( cd cmake_unofficial %{__cmake} -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} make xxhash ) make %{name} %{?_smp_mflags} CFLAGS="%{optflags}" %install mkdir -p %{buildroot}%{_bindir}/ cp -p %{name} %{buildroot}%{_bindir}/ ## libxxhash make install DESTDIR=%{buildroot} -C cmake_unofficial find %{buildroot} -name '*.a' -delete find %{buildroot} -name '*.la' -delete %files %doc README.md %license LICENSE %{_bindir}/* %files -n libxxhash %{_libdir}/libxxhash.so.* %license LICENSE %files -n libxxhash-devel %{_includedir}/xxhash.h %{_libdir}/libxxhash.so %post -n libxxhash -p /sbin/ldconfig %postun -n libxxhash -p /sbin/ldconfig %changelog * Sat Dec 31 2016 Francesco Frassinelli - 0.6.2-1 - version bump * Mon Jan 18 2016 Francesco Frassinelli - 42-5 - xxhsum requires subpackage libxxhash; compilation fixed * Sat Dec 05 2015 Francesco Frassinelli - 42-4 - libxxhash added using ldconfig * Sat Dec 05 2015 Francesco Frassinelli - 42-3 - libxxhash and libxxhash-devel produced; license fixed * Sat Dec 05 2015 Francesco Frassinelli - 42-2 - libxxhash build added * Sat Nov 14 2015 Francesco Frassinelli - 42-1 - Initial build