%global debug_package %{nil}
%define distribution %(/usr/lib/rpm/redhat/dist.sh --distnum)

#-------------------------------------------------------------------------------
# Package definitions
#-------------------------------------------------------------------------------
Summary: redis client library for C++11
Name: qclient
Version: @VERSION_FULL@
Release: 1%{dist}
Prefix: /usr
License: none
Group: Applications/File

Source: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: python3
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: openssl-devel

%description
redis client library for C++11

%prep
%setup -n %{name}-%{version}

%build
mkdir -p build
cd build
%define cmake cmake

%if 0%{distribution} == 8
  echo "Install custom cmake 3.15.5"
  mkdir ./cmake_install/
  ../misc/cmake/cmake-3.15.5-Linux-x86_64.sh --prefix=./cmake_install/ --skip-license
  %define cmake ./cmake_install/bin/cmake
%endif

%{cmake} ../
%make_build

%install
cd build
%make_install

%ldconfig_scriptlets

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root, -)
%{_includedir}/*
%{_libdir}/libqclient.a
%{_libdir}/libqclient-no-folly.a
