spdlog/spdlog.spec
Bernd Ritter c06c6f5c6d - Update spdlog to 1.13.0
- Removed patch 2823.patch because mismatch with new release
- Release notes 1.13.0:
  * Qt Sink: Allow for darker colors for light backgrounds (#2817). Thanks to @krawq.
  * Set CMAKE_BUILD_TYPE only for single-config generators (#2839). Thanks to @moritz-h.
  * Provide spdlog_header_only in build directory export (#2846). Thanks to @robertmaynard.
  * Add SPDLOG_TO_VERSION to compare spdlog version (#2853). Thanks to @kegechen.
  * Support async_overflow_policy::discard_new (#2876). Thanks to @walkerlala.
  * Make syslog_sink.h's syslog_prio_from_level protected (#2918). Thanks to @shannonbooth.
  * Fix OS availability check of pthread_threadid_np for iOS (#2897). Thanks to @lowdesertpunk.
  * Add .git-blame-ignore-revs to ignore clang-format related commits (#2899). Thanks to @lowdesertpunk.
  * Match SPDLOG_CONSTEXPR_FUNC to FMT_CONSTEXPR (#2901). Thanks to @kkraus14.
- Bugfixes:
  * Check fd_ is not nullptr in file_helper to prevent possible crash if disk is full (#2972).
  * Fix encoding issue in qt_sinks (#2862). Thanks to @neothenil and @tt4g .
  * Fix wrong thread_id (TID) in systemd_sink.h (#2919). Thanks to @M010.
  * Update example.cpp to fix the vector issue in bin_example (#2963). Thanks to @zhuzhzh.
  * Fix MSVC compile flag for no exceptions (#2974). Thanks to @Programicus.
  * Fix bug in circular_q::size() (#2820).
  * Fix link to fmt license file (#2967).
- Maintenance:
  * Added and updated various tests for circular_q.
  * Removed obsolete part from CMake configuration files (#2871). Thanks to @albert-github.
  * Removed policy_max from cmake_minimum_required(..).
  * Updated clang-format to google style and updated various formatting scripts.
  * Bumped to catch2 v3.5.0.

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/spdlog?expand=0&rev=94
2024-01-12 12:27:56 +00:00

120 lines
3.3 KiB
RPMSpec

#
# spec file for package spdlog
#
# 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/
#
Name: spdlog
%define lname libspdlog1_13
%define sover 1.13
Version: 1.13.0
Release: 0
Summary: C++ logging library
License: MIT
URL: https://github.com/gabime/spdlog
Source0: https://github.com/gabime/%{name}/archive/refs/tags/v%{version}.tar.gz
Source99: baselibs.conf
# PATCH-FIX-UPSTREAM 2827.patch -- Added missing square bracket to fix the level_to_string_view
#Patch0: https://patch-diff.githubusercontent.com/raw/gabime/spdlog/pull/2827.patch
BuildRequires: cmake >= 3.10
%if 0%{?suse_version} > 1500
BuildRequires: gcc-c++ >= 8
%else
BuildRequires: gcc8-c++
%endif
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: (pkgconfig(catch2) >= 3)
BuildRequires: pkgconfig(fmt) >= 8.0.0
BuildRequires: pkgconfig(libsystemd)
%description
A header-only/compiled, C++ logging library.
* Asynchronous mode (optional)
* Multi/Single threaded loggers.
* Various log targets (rotating/daily files, console, with colors,
syslog, custom target)
%package devel
Summary: Header files for spdlog
Requires: %{lname} = %{version}
Requires: libstdc++-devel
Requires: pkgconfig(fmt)
%description devel
The %{name}-devel package contains C++ header files for developing
applications that use %{name}.
%package -n %{lname}
Summary: C++ logging library
%description -n %{lname}
A header-only/compiled, C++ logging library.
* Asynchronous mode (optional)
* Multi/Single threaded loggers.
* Various log targets (rotating/daily files, console, with colors,
syslog, custom target)
%prep
%autosetup -p1
find . -name .gitignore -delete
sed -i -e "s,\r,," README.md LICENSE
%build
export CXX=g++
test -x "$(type -p g++-8)" && export CXX=g++-8
# spdlog embodies fmt ABI; add some symvers so both ld.so and rpm notice the change.
v=v$(rpm -q --qf="%%{VERSION}" --whatprovides "pkgconfig(fmt)" | sed -e 's/\..*//')
echo "FMT_$v { global: _ZN6spdlog*N3fmt${#v}${v}*; };" >spdlog.sym
v="$PWD/spdlog.sym"
%cmake -G Ninja \
-DSPDLOG_BUILD_TESTS=ON \
-DSPDLOG_BUILD_BENCH=OFF \
-DSPDLOG_FMT_EXTERNAL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSPDLOG_BUILD_EXAMPLES=OFF \
-DSPDLOG_BUILD_SHARED=ON \
-DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now -Wl,--version-script=$v" \
..
%ninja_build
%install
%ninja_install -C build
%check
export LD_LIBRARY_PATH="$PWD/build"
%ctest
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files devel
%license LICENSE
%doc README.md
%{_includedir}/spdlog/
%{_libdir}/libspdlog.so
%{_libdir}/cmake/spdlog/
%{_libdir}/pkgconfig/spdlog.pc
%files -n %{lname}
%{_libdir}/libspdlog.so.*
%changelog