From 1027e892c005b389e99137facc6b9ce79586b857d30f5e476aacb3e5b21517c5 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 11 Oct 2016 06:28:45 +0000 Subject: [PATCH] Accepting request 434124 from home:adamm:branches:devel:libraries:c_c++ - Added BuildRoot so we can actually build for SLE11 - New upstream version 1.1.0 * Added JSON Pointer * Added JSON Schema * Added relaxed JSON syntax (comment, trailing comma, NaN/Infinity) * Iterating array/object with C++11 Range-based for loop * Reduce memory overhead of each Value from 24 bytes to 16 bytes in x86-64 architecture. * full changeset at https://github.com/miloyip/rapidjson/releases/tag/v1.1.0 - remove_arch_specific_flags.patch: remove architecture specific compiler flags. - merge doc into devel package, it only adds about 20kB OBS-URL: https://build.opensuse.org/request/show/434124 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/rapidjson?expand=0&rev=2 --- fix_compilation_sle11sp4.patch | 20 ++++++++++++++ fix_install_paths.patch | 30 +++++++++++++++++++++ rapidjson-1.0.2.tar.gz | 3 --- rapidjson.changes | 22 +++++++++++++++ rapidjson.spec | 46 +++++++++++++++----------------- remove_arch_specific_flags.patch | 26 ++++++++++++++++++ v1.1.0.tar.gz | 3 +++ 7 files changed, 123 insertions(+), 27 deletions(-) create mode 100644 fix_compilation_sle11sp4.patch create mode 100644 fix_install_paths.patch delete mode 100644 rapidjson-1.0.2.tar.gz create mode 100644 remove_arch_specific_flags.patch create mode 100644 v1.1.0.tar.gz diff --git a/fix_compilation_sle11sp4.patch b/fix_compilation_sle11sp4.patch new file mode 100644 index 0000000..52655f9 --- /dev/null +++ b/fix_compilation_sle11sp4.patch @@ -0,0 +1,20 @@ +Author: Adam Majer +Summary: Fix compilation with older GCC compiler +PR: https://github.com/miloyip/rapidjson/pull/755 + +include/rapidjson/reader.h:578: error: suggest a space before ';' or explicit braces around empty body in 'while' statement +: warnings being treated as errors + +Index: rapidjson-1.1.0/include/rapidjson/reader.h +=================================================================== +--- rapidjson-1.1.0.orig/include/rapidjson/reader.h ++++ rapidjson-1.1.0/include/rapidjson/reader.h +@@ -575,7 +575,7 @@ private: + } + } + else if (RAPIDJSON_LIKELY(Consume(is, '/'))) +- while (is.Peek() != '\0' && is.Take() != '\n'); ++ while (is.Peek() != '\0' && is.Take() != '\n') {} + else + RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + diff --git a/fix_install_paths.patch b/fix_install_paths.patch new file mode 100644 index 0000000..5f20b4e --- /dev/null +++ b/fix_install_paths.patch @@ -0,0 +1,30 @@ +Author: Adam Majer +Summary: Install data under data directory, not library prefix + +Index: rapidjson-1.1.0/CMakeLists.txt +=================================================================== +--- rapidjson-1.1.0.orig/CMakeLists.txt ++++ rapidjson-1.1.0/CMakeLists.txt +@@ -94,11 +94,11 @@ endif() + + #add extra search paths for libraries and includes + SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in") +-SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "Directory where lib will install") ++SET(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Directory where shared data will install") + SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation") + + IF(UNIX OR CYGWIN) +- SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}") ++ SET(_CMAKE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/cmake/${PROJECT_NAME}") + ELSEIF(WIN32) + SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake") + ENDIF() +@@ -133,7 +133,7 @@ IF (UNIX OR CYGWIN) + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + @ONLY) + INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc +- DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" ++ DESTINATION "${SHARE_INSTALL_PREFIX}/pkgconfig" + COMPONENT pkgconfig) + ENDIF() + diff --git a/rapidjson-1.0.2.tar.gz b/rapidjson-1.0.2.tar.gz deleted file mode 100644 index 3f8dd98..0000000 --- a/rapidjson-1.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c3711ed2b3c76a5565ee9f0128bb4ec6753dbcc23450b713842df8f236d08666 -size 725981 diff --git a/rapidjson.changes b/rapidjson.changes index e5b4c9d..b2e4061 100644 --- a/rapidjson.changes +++ b/rapidjson.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Mon Oct 10 14:11:09 UTC 2016 - adam.majer@suse.de + +- Added BuildRoot so we can actually build for SLE11 + +------------------------------------------------------------------- +Fri Sep 30 12:49:18 UTC 2016 - adam.majer@suse.de + +- New upstream version 1.1.0 + * Added JSON Pointer + * Added JSON Schema + * Added relaxed JSON syntax (comment, trailing comma, + NaN/Infinity) + * Iterating array/object with C++11 Range-based for loop + * Reduce memory overhead of each Value from 24 bytes to 16 bytes + in x86-64 architecture. + * full changeset at + https://github.com/miloyip/rapidjson/releases/tag/v1.1.0 +- remove_arch_specific_flags.patch: remove architecture specific + compiler flags. +- merge doc into devel package, it only adds about 20kB + ------------------------------------------------------------------- Wed Apr 20 12:56:56 UTC 2016 - tbechtold@suse.com diff --git a/rapidjson.spec b/rapidjson.spec index ce09c11..31da169 100644 --- a/rapidjson.spec +++ b/rapidjson.spec @@ -16,15 +16,20 @@ # -%global debug_package %{nil} Name: rapidjson -Version: 1.0.2 +Version: 1.1.0 Release: 0 Summary: Fast JSON parser and generator for C++ License: MIT Group: Development/Libraries/C and C++ -Url: http://miloyip.github.io/%{name} -Source0: https://github.com/miloyip/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Url: http://rapidjson.org/ +Source0: https://github.com/miloyip/rapidjson/archive/v%{version}.tar.gz +Patch: remove_arch_specific_flags.patch +Patch1: fix_compilation_sle11sp4.patch +Patch10: fix_install_paths.patch +%if 0%{?suse_version} < 1200 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%endif BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkg-config @@ -49,42 +54,35 @@ RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml. Summary: Fast JSON parser and generator for C++ Group: Development/Libraries/C and C++ Provides: %{name} == %{version} +%if 0%{?suse_version} > 1200 BuildArch: noarch +%endif %description devel -RapidJSON is a JSON parser and generator for C++. - -%package doc -Summary: Fast JSON parser and generator for C++ -Group: Documentation/Other -BuildArch: noarch - -%description doc -RapidJSON is a JSON parser and generator for C++. -This package contains the documentation. +RapidJSON is a header-only JSON parser and generator for C++. +This package contains development headers and examples. %prep %setup -q +%patch -p1 +%patch1 -p1 +%patch10 -p1 %build -%cmake \ - -DDOC_INSTALL_DIR=%{_docdir}/%{name} +%cmake -DDOC_INSTALL_DIR=%{_docdir}/%{name} +make %{?_smp_mflags} %install %cmake_install -# Move pkgconfig und CMake-stuff to generic datadir. -mv -f %{buildroot}%{_libdir}/* %{buildroot}%{_datadir} - %files devel %defattr(-,root,root) %doc license.txt -%{_datadir}/cmake -%{_datadir}/pkgconfig/* +%dir %{_datadir}/cmake/RapidJSON +%{_datadir}/cmake/RapidJSON/RapidJSONConfig.cmake +%{_datadir}/cmake/RapidJSON/RapidJSONConfigVersion.cmake +%{_datadir}/pkgconfig/RapidJSON.pc %{_includedir}/%{name} - -%files doc -%defattr(-,root,root) %dir %{_docdir}/%{name} %{_docdir}/%{name}/* diff --git a/remove_arch_specific_flags.patch b/remove_arch_specific_flags.patch new file mode 100644 index 0000000..c008cab --- /dev/null +++ b/remove_arch_specific_flags.patch @@ -0,0 +1,26 @@ +Author: Adam Majer +Summary: Remove architecture specific compiler flags +PR: https://github.com/miloyip/rapidjson/pull/756 + +Index: rapidjson-1.1.0/CMakeLists.txt +=================================================================== +--- rapidjson-1.1.0.orig/CMakeLists.txt ++++ rapidjson-1.1.0/CMakeLists.txt +@@ -50,7 +50,7 @@ if(CCACHE_FOUND) + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") + if (RAPIDJSON_BUILD_CXX11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -73,7 +73,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL + endif() + endif() + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") + if (RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() diff --git a/v1.1.0.tar.gz b/v1.1.0.tar.gz new file mode 100644 index 0000000..ab39102 --- /dev/null +++ b/v1.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e +size 1019402