File opentelemetry-cpp.spec of Package opentelemetry-cpp
#
# spec file for package opentelemetry-cpp
#
# Copyright (c) 2024 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 build_ldflags -pthread
Name: opentelemetry-cpp
Version: 1.16.1
Release: 0
Summary: The C++ OpenTelemetry client library
License: Apache-2.0
Group: System/Libraries
URL: https://github.com/open-telemetry/opentelemetry-cpp.git
Source: %{name}-%{version}.tar
%define MAJOR_VERSION %(echo %{version} | cut -d. -f1)
%define MINOR_VERSION %(echo %{version} | cut -d. -f2 | cut -d+ -f1)
%define RELEASE_VERSION %(echo %{version} | cut -d. -f3 | cut -d+ -f1)
%define _libname lib%{name}%{MAJOR_VERSION}_%{MINOR_VERSION}_%{RELEASE_VERSION}
BuildRequires: abseil-cpp-devel
BuildRequires: benchmark-devel
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gmock
BuildRequires: grpc-devel
BuildRequires: gtest
BuildRequires: libcurl-devel
BuildRequires: opentracing-cpp-devel
BuildRequires: pkg-config
BuildRequires: protobuf-devel
BuildRequires: cmake(Microsoft.GSL)
BuildRequires: cmake(nlohmann_json)
BuildRequires: cmake(prometheus-cpp)
%description
OpenTelemetry C++ is under active development.
The API and SDK packages are not yet generally available, and
releases are not guaranteed to conform to a specific version of the specification.
%package -n %{_libname}
Summary: The C++ OpenTelemetry client library
Group: System/Libraries
%description -n %{_libname}
OpenTelemetry C++ is under active development.
The API and SDK packages are not yet generally available, and
releases are not guaranteed to conform to a specific version of the specification.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{_libname} = %{version}
%description devel
Headers and libraries to program against %{name}.
%prep
%autosetup -p1
%build
#export CXXFLAGS="-Walloc-size-larger-than=18446744073709551615"
%cmake \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OPENTRACING=ON \
-DWITH_ABSEIL=ON \
-DWITH_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
%cmake_build
%install
%cmake_install
%post -n %{_libname} -p /sbin/ldconfig
%postun -n %{_libname} -p /sbin/ldconfig
%files -n %{_libname}
%defattr(-,root,root)
%doc LICENSE
%{_libdir}/*.so
%files devel
%defattr(-,root,root)
%{_includedir}/opentelemetry
%{_libdir}/cmake/*
%{_libdir}/pkgconfig/*
%changelog