File influxdb-cxx.spec of Package influxdb-cxx

#
# spec file for package influxdb-cxx
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define soname InfluxDB
%define sover  0

Name:           influxdb-cxx
Version:        0.6.7
Release:        0
Summary:        InfluxDB C++ client library
License:        MIT
Group:          Development/Languages/C and C++ 
URL:            https://github.com/offa/influxdb-cxx
Source:         https://github.com/offa/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0:         0001-Add-trompeloeil-trompeloeil-target-if-not-available-.patch
Patch1:         0001-Allow-setting-CMAKE_INSTALL_LIBDIR-from-command-line.patch
Patch2:         0001-Add-soversion-for-InfluxDB.patch
Patch3:         0001-Missing-boost-libraries-added-100.patch
BuildRequires:  Catch2-devel
BuildRequires:  cmake >= 3.12
BuildRequires:  gcc-c++
BuildRequires:  libboost_system-devel >= 1.57
BuildRequires:  cmake(trompeloeil)
BuildRequires:  pkgconfig(libcurl)

%description
InfluxDB C++ client library.

%package -n lib%{soname}%{sover}
Summary:        InfluxDB C++ client library
Group:          System/Libraries

%description -n lib%{soname}%{sover}
InfluxDB C++ client library.

%package devel
Summary:        Headers for the InfluxDB C++ client library
Group:          Development/Languages/C and C++
Requires:       lib%{soname}%{sover} = %{version}-%{release}

%description devel
Headers for the InfluxDB C++ client library.

%prep
%autosetup -p1

%build
%cmake \
%if 0%{?suse_version} < 1550
	-DCMAKE_SKIP_RPATH:BOOL=OFF \
	-DCMAKE_SKIP_INSTALL_RPATHS:BOOL=ON \
%endif
	-DINFLUXCXX_SYSTEMTEST:BOOL=OFF
%cmake_build

%install
%cmake_install

%check
%ctest -- -E BoostSupportTest
# BoostSupportTest requires running DNS resolver

%post   -n lib%{soname}%{sover} -p /sbin/ldconfig
%postun -n lib%{soname}%{sover} -p /sbin/ldconfig

%files -n lib%{soname}%{sover}
%license LICENSE
%{_libdir}/lib%{soname}.so.%{sover}*

%files devel
%license LICENSE
%doc README.md CONTRIBUTING.md
%{_includedir}/InfluxDB.h
%{_includedir}/InfluxDBException.h
%{_includedir}/InfluxDBFactory.h
%{_includedir}/Point.h
%{_includedir}/Transport.h
%{_includedir}/influxdb_export.h
%{_libdir}/lib%{soname}.so
%dir %{_libdir}/cmake/InfluxDB
%{_libdir}/cmake/InfluxDB/InfluxDBConfig.cmake
%{_libdir}/cmake/InfluxDB/InfluxDBConfigVersion.cmake
%{_libdir}/cmake/InfluxDB/InfluxDBTargets-relwithdebinfo.cmake
%{_libdir}/cmake/InfluxDB/InfluxDBTargets.cmake

%changelog
openSUSE Build Service is sponsored by