From 6bd66ac93625a2bb639614d7549b15d111457b2e Mon Sep 17 00:00:00 2001 From: tigro Date: Mon, 16 Dec 2024 22:52:11 +0300 Subject: [PATCH] import rapidjson-1.1.0-30.el10 --- .rapidjson.metadata | 2 +- ...iling-assignment-operator.-Fixed-718.patch | 25 ++ ...tly-disable-copy-assignment-operator.patch | 25 ++ ...way-comparison-for-CLang-10-fix-1679.patch | 50 +++ ...recursive-operator-call-in-C-20-1846.patch | 32 ++ ...of-symmetric-equality-operators-on-i.patch | 29 ++ .../0006-do-not-define-operator-in-C-20.patch | 37 ++ ...> 0007-do-not-include-gtest_src_dir.patch} | 16 +- ...8-Make-valgrind-optional-for-riscv64.patch | 39 +++ SPECS/rapidjson.spec | 324 ++++++++++-------- 10 files changed, 430 insertions(+), 149 deletions(-) create mode 100644 SOURCES/0001-Removed-non-compiling-assignment-operator.-Fixed-718.patch create mode 100644 SOURCES/0002-Explicitly-disable-copy-assignment-operator.patch create mode 100644 SOURCES/0003-Three-way-comparison-for-CLang-10-fix-1679.patch create mode 100644 SOURCES/0004-Fix-recursive-operator-call-in-C-20-1846.patch create mode 100644 SOURCES/0005-gate-definition-of-symmetric-equality-operators-on-i.patch create mode 100644 SOURCES/0006-do-not-define-operator-in-C-20.patch rename SOURCES/{rapidjson-1.1.0-do_not_include_gtest_src_dir.patch => 0007-do-not-include-gtest_src_dir.patch} (57%) create mode 100644 SOURCES/0008-Make-valgrind-optional-for-riscv64.patch diff --git a/.rapidjson.metadata b/.rapidjson.metadata index edae96c..ddc0044 100644 --- a/.rapidjson.metadata +++ b/.rapidjson.metadata @@ -1 +1 @@ -a3e0d043ad3c2d7638ffefa3beb30a77c71c869f SOURCES/rapidjson-1.1.0.tar.gz +a3e0d043ad3c2d7638ffefa3beb30a77c71c869f SOURCES/rapidjson-1.1.0.tar.gz diff --git a/SOURCES/0001-Removed-non-compiling-assignment-operator.-Fixed-718.patch b/SOURCES/0001-Removed-non-compiling-assignment-operator.-Fixed-718.patch new file mode 100644 index 0000000..a31737f --- /dev/null +++ b/SOURCES/0001-Removed-non-compiling-assignment-operator.-Fixed-718.patch @@ -0,0 +1,25 @@ +From 1257fe9096b70cc278f9d6e4029776b50df5d5cf Mon Sep 17 00:00:00 2001 +From: Janusz Chorko +Date: Fri, 26 Aug 2016 21:17:38 +0200 +Subject: [PATCH 1/7] Removed non-compiling assignment operator. Fixed #718 + +--- + include/rapidjson/document.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index e3e20dfb..b0f1f70b 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -316,8 +316,6 @@ struct GenericStringRef { + + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + +- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } +- + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } + +-- +2.43.0 + diff --git a/SOURCES/0002-Explicitly-disable-copy-assignment-operator.patch b/SOURCES/0002-Explicitly-disable-copy-assignment-operator.patch new file mode 100644 index 0000000..54a514f --- /dev/null +++ b/SOURCES/0002-Explicitly-disable-copy-assignment-operator.patch @@ -0,0 +1,25 @@ +From f9d9e50caca4673f194115b059fe5daef77163fd Mon Sep 17 00:00:00 2001 +From: Janusz Chorko +Date: Fri, 26 Aug 2016 21:26:50 +0200 +Subject: [PATCH 2/7] Explicitly disable copy assignment operator + +--- + include/rapidjson/document.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index b0f1f70b..19f5a6a5 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -326,6 +326,8 @@ private: + //! Disallow construction from non-const array + template + GenericStringRef(CharType (&str)[N]) /* = delete */; ++ //! Copy assignment operator not permitted - immutable type ++ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; + }; + + //! Mark a character pointer as constant string +-- +2.43.0 + diff --git a/SOURCES/0003-Three-way-comparison-for-CLang-10-fix-1679.patch b/SOURCES/0003-Three-way-comparison-for-CLang-10-fix-1679.patch new file mode 100644 index 0000000..637463c --- /dev/null +++ b/SOURCES/0003-Three-way-comparison-for-CLang-10-fix-1679.patch @@ -0,0 +1,50 @@ +From 2cecf24712bfe0f3d821a6f3763156066c7c40ec Mon Sep 17 00:00:00 2001 +From: Nikolay <211292+kolya7k@users.noreply.github.com> +Date: Mon, 30 Mar 2020 07:20:35 +0500 +Subject: [PATCH 3/7] Three-way comparison for CLang 10 fix (#1679) + +C++20 features must enable additional functionality, not to change interface completely +--- + include/rapidjson/document.h | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index 19f5a6a5..8e13d1cc 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -24,6 +24,9 @@ + #include "encodedstream.h" + #include // placement new + #include ++#ifdef __cpp_lib_three_way_comparison ++#include ++#endif + + RAPIDJSON_DIAG_PUSH + #ifdef _MSC_VER +@@ -168,12 +171,16 @@ public: + + //! @name relations + //@{ +- bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; } +- bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; } +- bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; } +- bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; } +- bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; } +- bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; } ++ template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } ++ template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } ++ template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } ++ template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } ++ template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } ++ template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } ++ ++#ifdef __cpp_lib_three_way_comparison ++ template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } ++#endif + //@} + + //! @name dereference +-- +2.43.0 + diff --git a/SOURCES/0004-Fix-recursive-operator-call-in-C-20-1846.patch b/SOURCES/0004-Fix-recursive-operator-call-in-C-20-1846.patch new file mode 100644 index 0000000..2aca216 --- /dev/null +++ b/SOURCES/0004-Fix-recursive-operator-call-in-C-20-1846.patch @@ -0,0 +1,32 @@ +From 11a7270fabf0c39cca0771453ae8a5df42d58f42 Mon Sep 17 00:00:00 2001 +From: Laurent Stacul +Date: Mon, 22 Feb 2021 16:11:42 +0000 +Subject: [PATCH 4/7] Fix recursive operator== call in C++20 (#1846) + +--- + include/rapidjson/document.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index 8e13d1cc..3c354a79 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -926,6 +926,7 @@ public: + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } + ++#ifndef __cpp_lib_three_way_comparison + //! Equal-to operator with arbitrary types (symmetric version) + /*! \return (rhs == lhs) + */ +@@ -936,6 +937,7 @@ public: + */ + template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } + //@} ++#endif + + //!@name Type + //@{ +-- +2.43.0 + diff --git a/SOURCES/0005-gate-definition-of-symmetric-equality-operators-on-i.patch b/SOURCES/0005-gate-definition-of-symmetric-equality-operators-on-i.patch new file mode 100644 index 0000000..886a5dc --- /dev/null +++ b/SOURCES/0005-gate-definition-of-symmetric-equality-operators-on-i.patch @@ -0,0 +1,29 @@ +From 424d1b95c7d95ac82f49bba82fdd05c29f73a2c1 Mon Sep 17 00:00:00 2001 +From: Kent Ross +Date: Mon, 14 Mar 2022 12:25:26 -0700 +Subject: [PATCH 5/7] gate definition of symmetric equality operators on impl, + not lib + +These operators call themselves recursively if C++20 semantics are present in the compiler, regardless of standard library support for the operator; therefore the test should be on __cpp_impl_three_way_comparison, not __cpp_lib_[...]. + +This fixes the Value.EqualtoOperator test when the language standard is set to C++20 and the standard library does not yet define the library support macro. +--- + include/rapidjson/document.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index 3c354a79..46510f85 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -926,7 +926,7 @@ public: + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } + +-#ifndef __cpp_lib_three_way_comparison ++#ifndef __cpp_impl_three_way_comparison + //! Equal-to operator with arbitrary types (symmetric version) + /*! \return (rhs == lhs) + */ +-- +2.43.0 + diff --git a/SOURCES/0006-do-not-define-operator-in-C-20.patch b/SOURCES/0006-do-not-define-operator-in-C-20.patch new file mode 100644 index 0000000..383c33a --- /dev/null +++ b/SOURCES/0006-do-not-define-operator-in-C-20.patch @@ -0,0 +1,37 @@ +From 42ca72bf3a161cf8d5e43f5d4f68aeeec3f7e6b4 Mon Sep 17 00:00:00 2001 +From: Kent Ross +Date: Thu, 3 Nov 2022 20:17:41 -0700 +Subject: [PATCH 6/7] do not define operator!= in C++20 + +A change to the semantics of equality operator rewriting in C++20 (P2468R2: The Equality Operator You Are Looking For) means that operator== may not be rewritten with reversed operands if operator!= is also defined. Since operator!= can normally be synthesized from operator== regardless in this language standard, we can and should avoid defining those when the new language semantics are available. + +This fixes the compilation of tests (and probably consuming code) in C++20 onwards for compilers that implement this new semantic, including recent nightly builds of clang-16. + +Reference: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2468r2.html +--- + include/rapidjson/document.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h +index 46510f85..8b0446db 100644 +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -912,6 +912,7 @@ public: + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } + ++#ifndef __cpp_impl_three_way_comparison + //! Not-equal-to operator + /*! \return !(*this == rhs) + */ +@@ -926,7 +927,6 @@ public: + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } + +-#ifndef __cpp_impl_three_way_comparison + //! Equal-to operator with arbitrary types (symmetric version) + /*! \return (rhs == lhs) + */ +-- +2.43.0 + diff --git a/SOURCES/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch b/SOURCES/0007-do-not-include-gtest_src_dir.patch similarity index 57% rename from SOURCES/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch rename to SOURCES/0007-do-not-include-gtest_src_dir.patch index 18e8e80..0debf80 100644 --- a/SOURCES/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch +++ b/SOURCES/0007-do-not-include-gtest_src_dir.patch @@ -1,11 +1,14 @@ -commit e61866f098098422462e8bc220506443e76c3bb0 -Author: Björn Esser -Date: Sun Apr 3 11:21:47 2016 +0200 +From 486d1c6363e754bd30dfc24b345d9a9fe1737c92 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Sun, 3 Apr 2016 11:21:47 +0200 +Subject: [PATCH 7/7] do not include gtest_src_dir - do not include gtest_src_dir +--- + test/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 11c1b04..43377db 100644 +index 11c1b04c..43377dba 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,7 +8,7 @@ IF(GTESTSRC_FOUND) @@ -17,3 +20,6 @@ index 11c1b04..43377db 100644 include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) set(TEST_LIBRARIES gtest gtest_main) +-- +2.43.0 + diff --git a/SOURCES/0008-Make-valgrind-optional-for-riscv64.patch b/SOURCES/0008-Make-valgrind-optional-for-riscv64.patch new file mode 100644 index 0000000..98585dd --- /dev/null +++ b/SOURCES/0008-Make-valgrind-optional-for-riscv64.patch @@ -0,0 +1,39 @@ +From 148f0dda18e556b90299e4f5a3da2c899fb2cac3 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 14 Feb 2024 19:17:57 +0000 +Subject: [PATCH 8/8] Make valgrind optional for riscv64 + +--- + CMakeLists.txt | 2 ++ + test/unittest/CMakeLists.txt | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ceda71b1..9d6a49a4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,6 +49,8 @@ if(CCACHE_FOUND) + endif() + endif(CCACHE_FOUND) + ++find_program(VALGRIND_FOUND valgrind) ++ + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror") + if (RAPIDJSON_BUILD_CXX11) +diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt +index b3204d6c..aae901bc 100644 +--- a/test/unittest/CMakeLists.txt ++++ b/test/unittest/CMakeLists.txt +@@ -77,7 +77,7 @@ add_test(NAME unittest + COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) + +-if(NOT MSVC) ++if(NOT MSVC AND VALGRIND_FOUND) + # Not running SIMD.* unit test cases for Valgrind + add_test(NAME valgrind_unittest + COMMAND valgrind --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.* +-- +2.43.0 + diff --git a/SPECS/rapidjson.spec b/SPECS/rapidjson.spec index 2c62211..0ff726b 100644 --- a/SPECS/rapidjson.spec +++ b/SPECS/rapidjson.spec @@ -1,192 +1,230 @@ -# Conditional for release and snapshot builds. Uncomment for release-builds. -%global rel_build 1 - -# Settings used for build from snapshots. -%if 0%{?rel_build} -%global gittar %{name}-%{version}.tar.gz -%else # 0%%{?rel_build} -%global commit 67143c2ba002604a510ba436a8ed0d785a9f7de6 -%global commit_date 20140801 -%global shortcommit %(c=%{commit};echo ${c:0:7}) -%global gitver git%{commit_date}-%{shortcommit} -%global gitrel .git%{commit_date}.%{shortcommit} -%global gittar %{name}-%{version}-%{gitver}.tar.gz -%endif # 0%%{?rel_build} - -# This is a header-only lib. There is no debuginfo generated. -%global debug_package %{nil} - -# Set %%_pkgdocdir-helper-macro if not defined. -%if 0%{!?_pkgdocdir:1} -%global _pkgdocdir %{_docdir}/%{name}-%{version} -%endif # 0%%{!?_pkgdocdir:1} - -# CMake-builds go out-of-tree. Tests are not run in %%{buildroot}. -%global cmake_build_dir build-%{?__isa}%{?dist} - -# Set %%giturl for later use. -%global giturl https://github.com/miloyip/%{name}/archive - -%global common_desc \ -RapidJSON is a fast JSON parser and generator for C++. It was \ -inspired by RapidXml. \ - \ - RapidJSON is small but complete. It supports both SAX and DOM style \ - API. The SAX parser is only a half thousand lines of code. \ - \ - RapidJSON is fast. Its performance can be comparable to strlen(). \ - It also optionally supports SSE2/SSE4.1 for acceleration. \ - \ - RapidJSON is self-contained. It does not depend on external \ - libraries such as BOOST. It even does not depend on STL. \ - \ - RapidJSON is memory friendly. Each JSON value occupies exactly \ - 16/20 bytes for most 32/64-bit machines (excluding text string). By \ - default it uses a fast memory allocator, and the parser allocates \ - memory compactly during parsing. \ - \ - RapidJSON is Unicode friendly. It supports UTF-8, UTF-16, UTF-32 \ - (LE & BE), and their detection, validation and transcoding \ - internally. For example, you can read a UTF-8 file and let RapidJSON \ - transcode the JSON strings into UTF-16 in the DOM. It also supports \ - surrogates and "\u0000" (null character). \ - \ -JSON(JavaScript Object Notation) is a light-weight data exchange \ -format. RapidJSON should be in fully compliance with RFC4627/ECMA-404. +%global debug_package %{nil} Name: rapidjson Version: 1.1.0 -Release: 3%{?gitrel}%{?dist} +Release: 30%{?dist} Summary: Fast JSON parser and generator for C++ -License: MIT -URL: http://miloyip.github.io/%{name} -%if 0%{?rel_build} -# Sources for release-builds. -Source0: %{giturl}/v%{version}.tar.gz#/%{gittar} -%else # 0%%{?rel_build} -# Sources for snapshot-builds. -Source0: %{giturl}/%{commit}.tar.gz#/%{gittar} -%endif # 0%%{?rel_build} - -# Downstream-patch for gtest. -Patch0: rapidjson-1.1.0-do_not_include_gtest_src_dir.patch +# Most files are MIT, rapidjson/msinttypes/{stdint,inttypes}.h are BSD +License: MIT AND BSD-3-Clause +URL: http://rapidjson.org/ +Source0: https://github.com/Tencent/rapidjson/archive/v%{version}/%{name}-%{version}.tar.gz +# https://github.com/Tencent/rapidjson/pull/719 +Patch: 0001-Removed-non-compiling-assignment-operator.-Fixed-718.patch +# https://github.com/Tencent/rapidjson/pull/719 +Patch: 0002-Explicitly-disable-copy-assignment-operator.patch +# https://github.com/Tencent/rapidjson/pull/1137 +Patch: 0003-Three-way-comparison-for-CLang-10-fix-1679.patch +# https://github.com/Tencent/rapidjson/pull/1679 +Patch: 0004-Fix-recursive-operator-call-in-C-20-1846.patch +# https://github.com/Tencent/rapidjson/pull/1847 +Patch: 0005-gate-definition-of-symmetric-equality-operators-on-i.patch +# https://github.com/Tencent/rapidjson/pull/2091 +Patch: 0006-do-not-define-operator-in-C-20.patch +# Downstream-patch for gtest +Patch: 0007-do-not-include-gtest_src_dir.patch +# Make valgrind optional for riscv64 +# https://github.com/Tencent/rapidjson/pull/2263 +Patch: 0008-Make-valgrind-optional-for-riscv64.patch BuildRequires: cmake -#BuildRequires: gtest-devel -%ifnarch %{ix86} aarch64 s390 s390x +BuildRequires: make +BuildRequires: gcc-c++ +BuildRequires: gtest-devel +%ifarch %{valgrind_arches} BuildRequires: valgrind %endif +BuildRequires: doxygen %description -%{common_desc} +RapidJSON is a fast JSON parser and generator for C++. It was +inspired by RapidXml. + + RapidJSON is small but complete. It supports both SAX and DOM style + API. The SAX parser is only a half thousand lines of code. + + RapidJSON is fast. Its performance can be comparable to strlen(). + It also optionally supports SSE2/SSE4.1 for acceleration. + + RapidJSON is self-contained. It does not depend on external + libraries such as BOOST. It even does not depend on STL. + + RapidJSON is memory friendly. Each JSON value occupies exactly + 16/20 bytes for most 32/64-bit machines (excluding text string). By + default it uses a fast memory allocator, and the parser allocates + memory compactly during parsing. + + RapidJSON is Unicode friendly. It supports UTF-8, UTF-16, UTF-32 + (LE & BE), and their detection, validation and transcoding + internally. For example, you can read a UTF-8 file and let RapidJSON + transcode the JSON strings into UTF-16 in the DOM. It also supports + surrogates and "\u0000" (null character). + +JSON(JavaScript Object Notation) is a light-weight data exchange +format. RapidJSON should be in fully compliance with RFC4627/ECMA-404. %package devel -Summary: %{summary} -BuildArch: noarch - -Provides: %{name} == %{version}-%{release} -Provides: %{name}-static == %{version}-%{release} +Summary: %{summary} +Provides: %{name}%{?_isa} = %{version}-%{release} +Provides: %{name}-static = %{version}-%{release} %description devel -%{common_desc} - -%files devel -%license license.txt -%doc %dir %{_pkgdocdir} -%doc %{_pkgdocdir}/CHANGELOG.md -%doc %{_pkgdocdir}/readme*.md -%{_datadir}/cmake -%{_datadir}/pkgconfig/* -%{_includedir}/%{name} +%{description} %package doc Summary: Documentation-files for %{name} - -%if 0%{?fedora} || 0%{?rhel} >= 8 BuildArch: noarch -%endif # 0%%{?fedora} || 0%%{?rhel} >= 8 - -BuildRequires: %{_sbindir}/hardlink -BuildRequires: doxygen %description doc This package contains the documentation-files for %{name}. -%files doc -# Pickup license-files from main-pkg's license-dir. -# If there's no license-dir they are picked up by %%doc previously. -%{?_licensedir:%license %{_datadir}/licenses/%{name}*} -%doc %{_pkgdocdir} - %prep -%setup -q%{!?rel_build:n %{name}-%{commit}} -%patch0 -p1 -b .gtest -%{__mkdir} -p %{cmake_build_dir} +%autosetup -p 1 -n %{name}-%{version} + +# Remove bundled code +rm -rf thirdparty -# Fix 'W: wrong-file-end-of-line-encoding'. -for _file in "license.txt" $(%{_bindir}/find example -type f -name '*.c*') +# Convert DOS line endings to unix +for file in "license.txt" $(find example -type f -name *.c*) do - %{__sed} -e 's!\r$!!g' < ${_file} > ${_file}.new && \ - /bin/touch -r ${_file} ${_file}.new && \ - %{__mv} -f ${_file}.new ${_file} + sed -e "s/\r$//g" < ${file} > ${file}.new && \ + touch -r ${file} ${file}.new && \ + mv -f ${file}.new ${file} done -# Create an uncluttered backup of examples for inclusion in %%doc. -%{__cp} -a example examples - -# Disable -Werror. -%{_bindir}/find . -type f -name 'CMakeLists.txt' -print0 | \ - %{_bindir}/xargs -0 %{__sed} -i -e's![ \t]*-march=native!!g' -e's![ \t]*-Werror!!g' +# Remove -march=native and -Werror from compile commands +find . -type f -name CMakeLists.txt -print0 | \ + xargs -0r sed -i -e "s/-march=native/ /g" -e "s/-Werror//g" %build -pushd %{cmake_build_dir} -%cmake \ - -DDOC_INSTALL_DIR=%{_pkgdocdir} \ - -DGTESTSRC_FOUND=TRUE \ - -DGTEST_SOURCE_DIR=. \ - .. -%{__make} %{?_smp_mflags} -popd +%cmake \ + -DDOC_INSTALL_DIR:PATH=%{_pkgdocdir} \ + -DRAPIDJSON_BUILD_CXX11:BOOL=OFF \ + -DGTESTSRC_FOUND:BOOL=ON \ + -DGTEST_SOURCE_DIR:PATH=. +%cmake_build %install -pushd %{cmake_build_dir} -%{__make} install DESTDIR=%{buildroot} -popd +%cmake_install +install -pm 644 CHANGELOG.md readme*.md %{buildroot}%{_pkgdocdir}/ +find %{buildroot} -type f -name 'CMake*.txt' -delete -# Move pkgconfig und CMake-stuff to generic datadir. -%{__mv} -f %{buildroot}%{_libdir}/* %{buildroot}%{_datadir} -# Copy the documentation-files to final location. -%{__cp} -a CHANGELOG.md readme*.md examples %{buildroot}%{_pkgdocdir} +%check +%ctest -# Find and purge build-sys files. -%{_bindir}/find %{buildroot} -type f -name 'CMake*.txt' -print0 | \ - %{_bindir}/xargs -0 %{__rm} -fv -# Hardlink duplicated files to save space. -%{_sbindir}/hardlink -v %{buildroot}%{_includedir} -%{_sbindir}/hardlink -v %{buildroot}%{_pkgdocdir} +%files devel +%license license.txt +%dir %{_pkgdocdir} +%{_pkgdocdir}/CHANGELOG.md +%{_pkgdocdir}/readme*.md +%{_libdir}/cmake/RapidJSON/ +%{_libdir}/pkgconfig/*.pc +%{_includedir}/%{name}/ -%check -# Valgrind fails on %%ix86 and aarch64 and is not available on s390x -%ifarch %{ix86} aarch64 s390 s390x -CTEST_EXCLUDE=".*valgrind.*" -%endif # arch %%{ix86} -pushd %{cmake_build_dir} -%{_bindir}/ctest -E "${CTEST_EXCLUDE}" -V . -popd +%files doc +%license license.txt +%{_pkgdocdir}/ %changelog -* Tue Sep 18 2018 Honza Horak - 1.1.0-3 -- Do not use valgrind for tests on s390 and s390x +* Mon Dec 16 2024 Arkady L. Shane - 1.1.0-30 +- Rebuilt for MSVSphere 10 + +* Tue Oct 29 2024 Troy Dawson - 1.1.0-30 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Mon Jun 24 2024 Troy Dawson - 1.1.0-29 +- Bump release for June 2024 mass rebuild + +* Sun Feb 25 2024 Richard W.M. Jones - 1.1.0-28 +- Bump and rebuild package (for riscv64) + +* Fri Jan 26 2024 Fedora Release Engineering - 1.1.0-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 1.1.0-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 18 2024 Tom Hughes - 1.1.0-25 +- Add upstream patches for improved gcc 14 and C++20 support + +* Fri Jan 05 2024 Honza Horak - 1.1.0-24 +- SPDX migration +- Add BSD license that is used by stdint.h and inttypes.h + +* Fri Jul 21 2023 Fedora Release Engineering - 1.1.0-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jan 30 2023 Benjamin A. Beasley - 1.1.0-22 +- Do not force C++11: gtest 1.13.0 requires at least C++14 + +* Fri Jan 20 2023 Fedora Release Engineering - 1.1.0-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 1.1.0-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 1.1.0-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sun Jan 16 2022 Antonio Trande - 1.1.0-18 +- Build for EPEL9 + +* Fri Jul 23 2021 Fedora Release Engineering - 1.1.0-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 1.1.0-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Sep 1 2020 Tom Hughes - 1.1.0-15 +- Add patch for C++20 support + +* Wed Jul 29 2020 Fedora Release Engineering - 1.1.0-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 14 2020 Tom Hughes - 1.1.0-13 +- Install pkg-config and cmake files to arched location +- Build documentation as noarch + +* Thu Jan 30 2020 Fedora Release Engineering - 1.1.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.1.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jun 19 2019 Tom Hughes - 1.1.0-10 +- Fix FTBS due to hardlink location change +- Tidy up spec file + +* Sat Feb 02 2019 Fedora Release Engineering - 1.1.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.1.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Mar 7 2018 Tom Hughes - 1.1.0-7 +- Require gcc-c++ + +* Fri Feb 09 2018 Fedora Release Engineering - 1.1.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 9 2017 Tom Hughes - 1.1.0-5 +- Update valgrind exclusions + +* Thu Aug 03 2017 Fedora Release Engineering - 1.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri May 05 2017 Björn Esser - 1.1.0-2 - Doc-pkg must be build archful on RHEL <= 7