diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-07 09:10:30 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-07 09:10:30 +0000 |
commit | 29128250bb671e0300b58eca228f29fb9aceac6d (patch) | |
tree | 0e288c15acb9df9ef7558a1c30f914baf0588ff3 | |
parent | f5b6b276910ab4a5d10497da008a7a15d892f75a (diff) |
automatic import of spdlog
-rw-r--r-- | spdlog-catchv3-compatibility.patch | 274 | ||||
-rw-r--r-- | spdlog.spec | 194 |
2 files changed, 23 insertions, 445 deletions
diff --git a/spdlog-catchv3-compatibility.patch b/spdlog-catchv3-compatibility.patch deleted file mode 100644 index 619871a..0000000 --- a/spdlog-catchv3-compatibility.patch +++ /dev/null @@ -1,274 +0,0 @@ -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 7fe4791e..c0af3fd7 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -13,6 +13,20 @@ if(PkgConfig_FOUND) - pkg_check_modules(systemd libsystemd) - endif() - -+find_package(Catch2 3 QUIET) -+if (Catch2_FOUND) -+ message(STATUS "Packaged version of Catch will be used.") -+else() -+ message(STATUS "Bundled version of Catch will be downloaded and used.") -+ include(FetchContent) -+ FetchContent_Declare( -+ Catch2 -+ GIT_REPOSITORY https://github.com/catchorg/Catch2.git -+ GIT_TAG v3.3.2 -+ ) -+ FetchContent_MakeAvailable(Catch2) -+endif() -+ - set(SPDLOG_UTESTS_SOURCES - test_file_helper.cpp - test_file_logging.cpp -@@ -52,6 +66,7 @@ function(spdlog_prepare_test test_target spdlog_lib) - if(systemd_FOUND) - target_link_libraries(${test_target} PRIVATE ${systemd_LIBRARIES}) - endif() -+ target_link_libraries(${test_target} PRIVATE Catch2::Catch2WithMain) - if(SPDLOG_SANITIZE_ADDRESS) - spdlog_enable_sanitizer(${test_target}) - endif() -diff --git a/tests/includes.h b/tests/includes.h -index 16394440..33e88bfb 100644 ---- a/tests/includes.h -+++ b/tests/includes.h -@@ -4,7 +4,7 @@ - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12 - #endif --#include "catch.hpp" -+#include <catch2/catch_all.hpp> - #if defined(__GNUC__) && __GNUC__ == 12 - # pragma GCC diagnostic pop - #endif -diff --git a/tests/main.cpp b/tests/main.cpp -index f8ed5192..c8dca193 100644 ---- a/tests/main.cpp -+++ b/tests/main.cpp -@@ -3,8 +3,7 @@ - # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12 - #endif - --#define CATCH_CONFIG_MAIN --#include "catch.hpp" -+#include <catch2/catch_all.hpp> - - #if defined(__GNUC__) && __GNUC__ == 12 - # pragma GCC diagnostic pop -diff --git a/tests/test_daily_logger.cpp b/tests/test_daily_logger.cpp -index c6e685de..82f28941 100644 ---- a/tests/test_daily_logger.cpp -+++ b/tests/test_daily_logger.cpp -@@ -87,19 +87,19 @@ TEST_CASE("daily_logger with custom calculator", "[daily_logger]") - * File name calculations - */ - --TEST_CASE("rotating_file_sink::calc_filename1", "[rotating_file_sink]]") -+TEST_CASE("rotating_file_sink::calc_filename1", "[rotating_file_sink]") - { - auto filename = spdlog::sinks::rotating_file_sink_st::calc_filename(SPDLOG_FILENAME_T("rotated.txt"), 3); - REQUIRE(filename == SPDLOG_FILENAME_T("rotated.3.txt")); - } - --TEST_CASE("rotating_file_sink::calc_filename2", "[rotating_file_sink]]") -+TEST_CASE("rotating_file_sink::calc_filename2", "[rotating_file_sink]") - { - auto filename = spdlog::sinks::rotating_file_sink_st::calc_filename(SPDLOG_FILENAME_T("rotated"), 3); - REQUIRE(filename == SPDLOG_FILENAME_T("rotated.3")); - } - --TEST_CASE("rotating_file_sink::calc_filename3", "[rotating_file_sink]]") -+TEST_CASE("rotating_file_sink::calc_filename3", "[rotating_file_sink]") - { - auto filename = spdlog::sinks::rotating_file_sink_st::calc_filename(SPDLOG_FILENAME_T("rotated.txt"), 0); - REQUIRE(filename == SPDLOG_FILENAME_T("rotated.txt")); -@@ -110,7 +110,7 @@ TEST_CASE("rotating_file_sink::calc_filename3", "[rotating_file_sink]]") - - # include <regex> - --TEST_CASE("daily_file_sink::daily_filename_calculator", "[daily_file_sink]]") -+TEST_CASE("daily_file_sink::daily_filename_calculator", "[daily_file_sink]") - { - // daily_YYYY-MM-DD_hh-mm.txt - auto filename = -@@ -123,7 +123,7 @@ TEST_CASE("daily_file_sink::daily_filename_calculator", "[daily_file_sink]]") - } - #endif - --TEST_CASE("daily_file_sink::daily_filename_format_calculator", "[daily_file_sink]]") -+TEST_CASE("daily_file_sink::daily_filename_format_calculator", "[daily_file_sink]") - { - std::tm tm = spdlog::details::os::localtime(); - // example-YYYY-MM-DD.log -diff --git a/tests/test_errors.cpp b/tests/test_errors.cpp -index 896e5b0a..939f1aeb 100644 ---- a/tests/test_errors.cpp -+++ b/tests/test_errors.cpp -@@ -22,7 +22,7 @@ protected: - } - }; - --TEST_CASE("default_error_handler", "[errors]]") -+TEST_CASE("default_error_handler", "[errors]") - { - prepare_logdir(); - spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG); -@@ -40,7 +40,7 @@ TEST_CASE("default_error_handler", "[errors]]") - - struct custom_ex - {}; --TEST_CASE("custom_error_handler", "[errors]]") -+TEST_CASE("custom_error_handler", "[errors]") - { - prepare_logdir(); - spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG); -@@ -54,7 +54,7 @@ TEST_CASE("custom_error_handler", "[errors]]") - require_message_count(SIMPLE_LOG, 2); - } - --TEST_CASE("default_error_handler2", "[errors]]") -+TEST_CASE("default_error_handler2", "[errors]") - { - spdlog::drop_all(); - auto logger = spdlog::create<failing_sink>("failed_logger"); -@@ -62,7 +62,7 @@ TEST_CASE("default_error_handler2", "[errors]]") - REQUIRE_THROWS_AS(logger->info("Some message"), custom_ex); - } - --TEST_CASE("flush_error_handler", "[errors]]") -+TEST_CASE("flush_error_handler", "[errors]") - { - spdlog::drop_all(); - auto logger = spdlog::create<failing_sink>("failed_logger"); -@@ -70,7 +70,7 @@ TEST_CASE("flush_error_handler", "[errors]]") - REQUIRE_THROWS_AS(logger->flush(), custom_ex); - } - --TEST_CASE("async_error_handler", "[errors]]") -+TEST_CASE("async_error_handler", "[errors]") - { - prepare_logdir(); - std::string err_msg("log failed with some msg"); -@@ -98,7 +98,7 @@ TEST_CASE("async_error_handler", "[errors]]") - } - - // Make sure async error handler is executed --TEST_CASE("async_error_handler2", "[errors]]") -+TEST_CASE("async_error_handler2", "[errors]") - { - prepare_logdir(); - std::string err_msg("This is async handler error message"); -diff --git a/tests/test_file_helper.cpp b/tests/test_file_helper.cpp -index 1d947078..dd3ca4f8 100644 ---- a/tests/test_file_helper.cpp -+++ b/tests/test_file_helper.cpp -@@ -15,7 +15,7 @@ static void write_with_helper(file_helper &helper, size_t howmany) - helper.flush(); - } - --TEST_CASE("file_helper_filename", "[file_helper::filename()]]") -+TEST_CASE("file_helper_filename", "[file_helper::filename()]") - { - prepare_logdir(); - -@@ -25,7 +25,7 @@ TEST_CASE("file_helper_filename", "[file_helper::filename()]]") - REQUIRE(helper.filename() == target_filename); - } - --TEST_CASE("file_helper_size", "[file_helper::size()]]") -+TEST_CASE("file_helper_size", "[file_helper::size()]") - { - prepare_logdir(); - spdlog::filename_t target_filename = SPDLOG_FILENAME_T(TEST_FILENAME); -@@ -39,7 +39,7 @@ TEST_CASE("file_helper_size", "[file_helper::size()]]") - REQUIRE(get_filesize(TEST_FILENAME) == expected_size); - } - --TEST_CASE("file_helper_reopen", "[file_helper::reopen()]]") -+TEST_CASE("file_helper_reopen", "[file_helper::reopen()]") - { - prepare_logdir(); - spdlog::filename_t target_filename = SPDLOG_FILENAME_T(TEST_FILENAME); -@@ -51,7 +51,7 @@ TEST_CASE("file_helper_reopen", "[file_helper::reopen()]]") - REQUIRE(helper.size() == 0); - } - --TEST_CASE("file_helper_reopen2", "[file_helper::reopen(false)]]") -+TEST_CASE("file_helper_reopen2", "[file_helper::reopen(false)]") - { - prepare_logdir(); - spdlog::filename_t target_filename = SPDLOG_FILENAME_T(TEST_FILENAME); -@@ -78,7 +78,7 @@ static void test_split_ext(const spdlog::filename_t::value_type *fname, const sp - REQUIRE(ext == expected_ext); - } - --TEST_CASE("file_helper_split_by_extension", "[file_helper::split_by_extension()]]") -+TEST_CASE("file_helper_split_by_extension", "[file_helper::split_by_extension()]") - { - test_split_ext(SPDLOG_FILENAME_T("mylog.txt"), SPDLOG_FILENAME_T("mylog"), SPDLOG_FILENAME_T(".txt")); - test_split_ext(SPDLOG_FILENAME_T(".mylog.txt"), SPDLOG_FILENAME_T(".mylog"), SPDLOG_FILENAME_T(".txt")); -diff --git a/tests/test_file_logging.cpp b/tests/test_file_logging.cpp -index 1c7a1853..7a7119ad 100644 ---- a/tests/test_file_logging.cpp -+++ b/tests/test_file_logging.cpp -@@ -6,7 +6,7 @@ - #define SIMPLE_LOG "test_logs/simple_log" - #define ROTATING_LOG "test_logs/rotating_log" - --TEST_CASE("simple_file_logger", "[simple_logger]]") -+TEST_CASE("simple_file_logger", "[simple_logger]") - { - prepare_logdir(); - spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG); -@@ -23,7 +23,7 @@ TEST_CASE("simple_file_logger", "[simple_logger]]") - REQUIRE(file_contents(SIMPLE_LOG) == spdlog::fmt_lib::format("Test message 1{}Test message 2{}", default_eol, default_eol)); - } - --TEST_CASE("flush_on", "[flush_on]]") -+TEST_CASE("flush_on", "[flush_on]") - { - prepare_logdir(); - spdlog::filename_t filename = SPDLOG_FILENAME_T(SIMPLE_LOG); -@@ -44,7 +44,7 @@ TEST_CASE("flush_on", "[flush_on]]") - spdlog::fmt_lib::format("Should not be flushed{}Test message 1{}Test message 2{}", default_eol, default_eol, default_eol)); - } - --TEST_CASE("rotating_file_logger1", "[rotating_logger]]") -+TEST_CASE("rotating_file_logger1", "[rotating_logger]") - { - prepare_logdir(); - size_t max_size = 1024 * 10; -@@ -60,7 +60,7 @@ TEST_CASE("rotating_file_logger1", "[rotating_logger]]") - require_message_count(ROTATING_LOG, 10); - } - --TEST_CASE("rotating_file_logger2", "[rotating_logger]]") -+TEST_CASE("rotating_file_logger2", "[rotating_logger]") - { - prepare_logdir(); - size_t max_size = 1024 * 10; -@@ -100,7 +100,7 @@ TEST_CASE("rotating_file_logger2", "[rotating_logger]]") - } - - // test that passing max_size=0 throws --TEST_CASE("rotating_file_logger3", "[rotating_logger]]") -+TEST_CASE("rotating_file_logger3", "[rotating_logger]") - { - prepare_logdir(); - size_t max_size = 0; -diff --git a/tests/test_macros.cpp b/tests/test_macros.cpp -index 2aeeecff..36537958 100644 ---- a/tests/test_macros.cpp -+++ b/tests/test_macros.cpp -@@ -10,7 +10,7 @@ - - #define TEST_FILENAME "test_logs/simple_log" - --TEST_CASE("debug and trace w/o format string", "[macros]]") -+TEST_CASE("debug and trace w/o format string", "[macros]") - { - - prepare_logdir(); diff --git a/spdlog.spec b/spdlog.spec index de46bb9..b7b128b 100644 --- a/spdlog.spec +++ b/spdlog.spec @@ -1,22 +1,17 @@ -Name: spdlog -Version: 1.11.0 -Release: 5%{?dist} +Name: spdlog +Version: 1.11.0 +Release: 1%{?dist} -License: MIT -Summary: Super fast C++ logging library -URL: https://github.com/gabime/%{name} -Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +License: MIT +Summary: Super fast C++ logging library. +Group: Development/Tools +Vendor: VMware, Inc. +URL: https://github.com/gabime/spdlog +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -# https://github.com/gabime/spdlog/pull/2661 -Patch100: spdlog-catchv3-compatibility.patch - -BuildRequires: catch-devel >= 3.0.0 BuildRequires: cmake -BuildRequires: fmt-devel >= 8.1.1 BuildRequires: gcc BuildRequires: gcc-c++ -BuildRequires: google-benchmark-devel -BuildRequires: ninja-build %description This is a packaged version of the gabime/spdlog C++ logging @@ -32,29 +27,27 @@ Requires: fmt-devel%{?_isa} The %{name}-devel package contains C++ header files for developing applications that use %{name}. +%global debug_package %{nil} + %prep -%autosetup -p1 -find . -name '.gitignore' -delete -sed -e "s,\r,," -i README.md -rm -f tests/catch.hpp +%setup -q %build -%cmake -G Ninja \ - -DCMAKE_INSTALL_LIBDIR=%{_lib} \ +mkdir -p build +cd build +cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ -DCMAKE_BUILD_TYPE=Release \ - -DSPDLOG_BUILD_SHARED=ON \ + -DBUILD_SHARED_LIBS=ON \ -DSPDLOG_BUILD_EXAMPLE=OFF \ -DSPDLOG_BUILD_BENCH=OFF \ - -DSPDLOG_BUILD_TESTS=ON \ + -DSPDLOG_BUILD_TESTS=OFF \ -DSPDLOG_INSTALL=ON \ - -DSPDLOG_FMT_EXTERNAL=ON -%cmake_build - -%check -%ctest + -DSPDLOG_FMT_EXTERNAL=ON .. +make %{?_smp_mflags} %install -%cmake_install +cd build +make DESTDIR=%{buildroot} install %files %license LICENSE @@ -69,146 +62,5 @@ rm -f tests/catch.hpp %{_libdir}/pkgconfig/%{name}.pc %changelog -* Wed Mar 01 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 1.11.0-5 -- Ported to catch v3. Fixed FTBFS in ELN. - -* Tue Feb 28 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 1.11.0-4 -- Fixed FTBFS in EPEL/ELN due to catch v3 update. - -* Tue Feb 28 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 1.11.0-3 -- Fixed FTBFS due to catch v3 update. - -* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Thu Nov 03 2022 Vitaly Zaitsev <vitaly@easycoding.org> - 1.11.0-1 -- Updated to version 1.11.0. - -* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sun Jul 10 2022 Vitaly Zaitsev <vitaly@easycoding.org> - 1.10.0-2 -- Rebuilt due to fmt library update. - -* Mon Apr 18 2022 Vitaly Zaitsev <vitaly@easycoding.org> - 1.10.0-1 -- Updated to version 1.10.0. - -* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Wed Sep 15 2021 Vitaly Zaitsev <vitaly@easycoding.org> - 1.9.2-2 -- Rebuilt due to google-benchmark 1.6.0 update. - -* Fri Aug 13 2021 Vitaly Zaitsev <vitaly@easycoding.org> - 1.9.2-1 -- Updated to version 1.9.2. - -* Tue Jul 27 2021 Vitaly Zaitsev <vitaly@easycoding.org> - 1.9.1-1 -- Updated to version 1.9.1. - -* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Jul 21 2021 Vitaly Zaitsev <vitaly@easycoding.org> - 1.9.0-1 -- Updated to version 1.9.0. - -* Sun Jul 04 2021 Vitaly Zaitsev <vitaly@easycoding.org> - 1.8.5-2 -- Rebuilt due to fmt library update. - -* Fri Apr 02 2021 Vitaly Zaitsev <vitaly@easycoding.org> - 1.8.5-1 -- Updated to version 1.8.5. - -* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Sat Dec 12 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1.8.2-1 -- Updated to version 1.8.2. - -* Tue Oct 13 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1.8.1-1 -- Updated to version 1.8.1. - -* Sat Sep 05 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1.8.0-1 -- Updated to version 1.8.0. - -* Tue Jul 21 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1.7.0-1 -- Updated to version 1.7.0. - -* Tue Jun 02 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1.6.1-1 -- Updated to version 1.6.1. - -* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Mon Jan 27 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1.5.0-1 -- Updated to version 1.5.0. - -* Wed Dec 18 2019 Vitaly Zaitsev <vitaly@easycoding.org> - 1.4.2-1 -- Updated to version 1.4.2. - -* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sun Jan 20 2019 Vitaly Zaitsev <vitaly@easycoding.org> - 1.3.1-1 -- Updated to version 1.3.1. - -* Mon Nov 05 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 1.2.1-1 -- Updated to version 1.2.1. - -* Sun Sep 02 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 1.1.0-1 -- Updated to version 1.1.0. - -* Thu Aug 09 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 1.0.0-1 -- Updated to version 1.0.0. - -* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Mon Jun 18 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.17.0-1 -- Updated to version 0.17.0. -- Added tests support. -- Added cmake and pkg-config support. - -* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Sun Sep 04 2016 Daniel Kopecek <dkopecek@redhat.com> - 0.10.0-1 -- Update to 0.10.0 - -* Fri Jul 08 2016 Daniel Kopecek <dkopecek@redhat.com> - 0-8.20160703git34bb86b -- update to rev 34bb86b - -* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-7.20151110gitcbc8ba7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Tue Nov 10 2015 Daniel Kopecek <dkopecek@redhat.com> - 0-6.20151110gitcbc8ba7 -- update to rev cbc8ba7 - -* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-5.20150410git211ce99 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Thu Apr 30 2015 Daniel Kopecek <dkopecek@redhat.com> - 0-4.20150410git211ce99 -- don't build the base package -- remove a dot from the release tag -- corrected -devel subpackage description - -* Mon Apr 20 2015 Daniel Kopecek <dkopecek@redhat.com> - 0-3.20150410git.211ce99 -- use the -p option when copying the header files - -* Tue Apr 14 2015 Daniel Kopecek <dkopecek@redhat.com> - 0-2.20150410git.211ce99 -- don't build the debuginfo subpackage -- require libstdc++-devel -- don't generate a distribution specific pkg-config file - -* Fri Apr 10 2015 Daniel Kopecek <dkopecek@redhat.com> - 0-1.20150410git.211ce99 -- Initial package +* Fri Apr 07 2023 kerneltravel <kjpioo2006@gmail.com> - 1.11.0 +- Initial package source version 1.11.0 from https://github.com/gabime/spdlog release. |