commit 0887fcb75e1bba338de41d73381d2cfcaee542d540984e76f0261c36e665321f Author: Jan Engelhardt Date: Thu Sep 23 15:56:45 2021 +0000 Accepting request 918457 from home:matwey:branches:devel:libraries:c_c++ Initial version of influxdb-cxx library OBS-URL: https://build.opensuse.org/request/show/918457 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/influxdb-cxx?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Add-soversion-for-InfluxDB.patch b/0001-Add-soversion-for-InfluxDB.patch new file mode 100644 index 0000000..be78907 --- /dev/null +++ b/0001-Add-soversion-for-InfluxDB.patch @@ -0,0 +1,39 @@ +From 9a2ad88a7569cb7f4fe095d907fa001218ba07ff Mon Sep 17 00:00:00 2001 +From: "Matwey V. Kornilov" +Date: Fri, 10 Sep 2021 18:05:09 +0000 +Subject: [PATCH] Add soversion for InfluxDB + +--- + src/CMakeLists.txt | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 106a33c..e393479 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -37,6 +37,22 @@ add_library(InfluxDB + ) + add_library(InfluxData::InfluxDB ALIAS InfluxDB) + ++# ++# Here are a set of rules to help you update your library version information: ++# ++# If the library source code has changed at all since the last update, ++# then increment revision (‘c:r:a’ becomes ‘c:r+1:a’). ++# If any interfaces have been added, removed, or changed since the last update, ++# increment current, and set revision to 0. ++# If any interfaces have been added since the last public release, ++# then increment age. ++# If any interfaces have been removed or changed since the last public release, ++# then set age to 0. ++# ++# set_target_properties(InfluxDB PROPERTIES VERSION c.r.a SOVERSION c) ++# ++set_target_properties(InfluxDB PROPERTIES VERSION 0.0.0 SOVERSION 0) ++ + generate_export_header(InfluxDB) + + target_include_directories(InfluxDB +-- +2.31.1 + diff --git a/0001-Add-trompeloeil-trompeloeil-target-if-not-available-.patch b/0001-Add-trompeloeil-trompeloeil-target-if-not-available-.patch new file mode 100644 index 0000000..80f245d --- /dev/null +++ b/0001-Add-trompeloeil-trompeloeil-target-if-not-available-.patch @@ -0,0 +1,28 @@ +From 5b37509bb79ff164983cfd3991f49828136d613a Mon Sep 17 00:00:00 2001 +From: offa +Date: Thu, 5 Aug 2021 17:56:06 +0200 +Subject: [PATCH] Add trompeloeil::trompeloeil target if not available (#94). + +--- + test/CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index e9a3780..a9bdb13 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -2,6 +2,11 @@ + find_package(Catch2 REQUIRED) + find_package(trompeloeil REQUIRED) + ++if( NOT TARGET trompeloeil::trompeloeil ) ++ add_library(trompeloeil::trompeloeil INTERFACE IMPORTED) ++ target_link_libraries(trompeloeil::trompeloeil INTERFACE trompeloeil) ++endif() ++ + + add_library(TestMain STATIC TestMain.cxx) + target_link_libraries(TestMain PUBLIC Catch2::Catch2 trompeloeil::trompeloeil) +-- +2.31.1 + diff --git a/0001-Allow-setting-CMAKE_INSTALL_LIBDIR-from-command-line.patch b/0001-Allow-setting-CMAKE_INSTALL_LIBDIR-from-command-line.patch new file mode 100644 index 0000000..d1ead79 --- /dev/null +++ b/0001-Allow-setting-CMAKE_INSTALL_LIBDIR-from-command-line.patch @@ -0,0 +1,28 @@ +From 7bed4d74a534049bc249b3df62627adbb593f8dc Mon Sep 17 00:00:00 2001 +From: "Matwey V. Kornilov" +Date: Fri, 10 Sep 2021 17:29:09 +0000 +Subject: [PATCH] Allow setting CMAKE_INSTALL_LIBDIR from command line + +Some distros really need lib64 at 64bit architectures. Make it possible to +override the variable through cmake command line. +--- + CMakeLists.txt | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 393973d..58e5100 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,9 +55,6 @@ include(GenerateExportHeader) + # Set fPIC for all targets + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +-# Set CMAKE_INSTALL_LIBDIR explicitly to lib (to avoid lib64 on CC7) +-set(CMAKE_INSTALL_LIBDIR lib) +- + # Set the default build type to "RelWithDebInfo" + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" +-- +2.31.1 + diff --git a/influxdb-cxx-0.6.7.tar.gz b/influxdb-cxx-0.6.7.tar.gz new file mode 100644 index 0000000..c4d40d4 --- /dev/null +++ b/influxdb-cxx-0.6.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fbd880b15e375a57b0009932d961d1e6608ecd9eaa98c2801ec4db5366dd093 +size 58254 diff --git a/influxdb-cxx.changes b/influxdb-cxx.changes new file mode 100644 index 0000000..391036b --- /dev/null +++ b/influxdb-cxx.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu Sep 9 20:04:34 UTC 2021 - Matwey Kornilov + +- Initial version diff --git a/influxdb-cxx.spec b/influxdb-cxx.spec new file mode 100644 index 0000000..526bb93 --- /dev/null +++ b/influxdb-cxx.spec @@ -0,0 +1,103 @@ +# +# 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 +BuildRequires: Catch2-devel +BuildRequires: cmake >= 3.12 +BuildRequires: gcc-c++ +BuildRequires: libboost_system-devel >= 1.57 +BuildRequires: cmake(trompeloeil) +BuildRequires: pkgconfig(libcurl) +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +InfluxDB C++ client library. + +%package -n lib%{soname}%{sover} +Summary: InfluxDB C++ client library +Group: Development/Languages/C and C++ + +%description -n lib%{soname}%{sover} +InfluxDB C++ client library. + +%package devel +Summary: InfluxDB C++ client library +Group: Development/Languages/C and C++ +Requires: lib%{soname}%{sover} = %{version}-%{release} + +%description devel +InfluxDB C++ client library. + +This package contains development files. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +%cmake -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} +%defattr(-,root,root) +%license LICENSE +%{_libdir}/lib%{soname}.so.%{sover}* + +%files devel +%defattr(-,root,root) +%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