update to latest upstream-release (#1322941)

This commit is contained in:
Björn Esser 2016-04-03 12:01:40 +02:00
parent 75cbd14071
commit cc81212a92
4 changed files with 105 additions and 179 deletions

View File

@ -1,110 +0,0 @@
Index: include/rapidjson/genericreadstream.h
===================================================================
--- include/rapidjson/genericreadstream.h (revision 0)
+++ include/rapidjson/genericreadstream.h (working copy)
@@ -0,0 +1,44 @@
+#ifndef RAPIDJSON_GENERICREADSTREAM_H_
+#define RAPIDJSON_GENERICREADSTREAM_H_
+
+#include "rapidjson.h"
+#include <iostream>
+
+namespace rapidjson {
+
+//! Wrapper of std::istream for input.
+class GenericReadStream {
+public:
+ typedef char Ch; //!< Character type (byte).
+
+ //! Constructor.
+ /*!
+ \param is Input stream.
+ */
+ GenericReadStream(std::istream& is) : is_(is) {
+ }
+
+ Ch Peek() const {
+ return static_cast<char>(is_.peek());
+ }
+
+ Ch Take() {
+ return static_cast<char>(is_.get());
+ }
+
+ size_t Tell() const {
+ return (int)is_.tellg();
+ }
+
+ // Not implemented
+ void Put(Ch c) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+ std::istream& is_;
+};
+
+} // namespace rapidjson
+
+#endif // RAPIDJSON_GENERICREADSTREAM_H_
Index: include/rapidjson/genericwritestream.h
===================================================================
--- include/rapidjson/genericwritestream.h (revision 0)
+++ include/rapidjson/genericwritestream.h (working copy)
@@ -0,0 +1,56 @@
+#ifndef RAPIDJSON_GENERICWRITESTREAM_H_
+#define RAPIDJSON_GENERICWRITESTREAM_H_
+
+#include "rapidjson.h"
+#include <iostream>
+
+namespace rapidjson {
+
+//! Wrapper of std::ostream for output.
+class GenericWriteStream {
+public:
+ typedef char Ch; //!< Character type. Only support char.
+
+ //! Constructor
+ /*!
+ \param os Output stream.
+ */
+ GenericWriteStream(std::ostream& os) : os_(os) {
+ }
+
+ void Put(char c) {
+ os_.put(c);
+ }
+
+ void PutN(char c, size_t n) {
+ for (size_t i = 0; i < n; ++i) {
+ Put(c);
+ }
+ }
+
+ void Flush() {
+ os_.flush();
+ }
+
+ size_t Tell() const {
+ return (int)os_.tellp();
+ }
+
+ // Not implemented
+ char Peek() const { RAPIDJSON_ASSERT(false); }
+ char Take() { RAPIDJSON_ASSERT(false); }
+ char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ std::ostream& os_;
+};
+
+template<>
+inline void PutN(GenericWriteStream& stream, char c, size_t n) {
+ stream.PutN(c, n);
+}
+
+} // namespace rapidjson
+
+#endif // RAPIDJSON_GENERICWRITESTREAM_H_

View File

@ -0,0 +1,19 @@
commit bc0f878abe02fe85392c3aca3f8af7cc098548e1
Author: Björn Esser <me@besser82.io>
Date: Sun Apr 3 11:21:47 2016 +0200
do not include gtest_src_dir
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c698af4..5269eb7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -8,7 +8,7 @@ IF(GTESTSRC_FOUND)
set(gtest_force_shared_crt ON)
endif()
- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest)
+# add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest)
include_directories(${GTEST_INCLUDE_DIR})
set(TEST_LIBRARIES gtest gtest_main)

View File

@ -1,27 +1,31 @@
# Conditional for release and snapshot builds. Uncomment for release-builds.
#global rel_build 1
# Set %%test_config to release / debug for testsuite.
#global test_config debug
%global test_config release
%global rel_build 1
# Settings used for build from snapshots.
%{!?rel_build:%global commit 67143c2ba002604a510ba436a8ed0d785a9f7de6}
%{!?rel_build:%global commit_date 20140801}
%{!?rel_build:%global shortcommit %(c=%{commit};echo ${c:0:7})}
%{!?rel_build:%global gitver git%{commit_date}-%{shortcommit}}
%{!?rel_build:%global gitrel .git%{commit_date}.%{shortcommit}}
%{!?rel_build:%global gittar %{name}-%{version}-%{gitver}.tar.gz}
%{?rel_build: %global gittar %{name}-%{version}.tar.gz}
%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}
%global debug_package %{nil}
# Set %%_pkgdocdir-helper-macro if not defined.
%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
%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 giturl https://github.com/miloyip/%{name}/archive
%global common_desc \
RapidJSON is a fast JSON parser and generator for C++. It was \
@ -50,100 +54,115 @@ inspired by RapidXml. \
JSON(JavaScript Object Notation) is a light-weight data exchange \
format. RapidJSON should be in fully compliance with RFC4627/ECMA-404.
Name: rapidjson
Version: 0.12
Release: 0.4%{?gitrel}%{?dist}
Summary: Fast JSON parser and generator for C++
Name: rapidjson
Version: 1.0.2
Release: 1%{?gitrel}%{?dist}
Summary: Fast JSON parser and generator for C++
License: MIT
URL: http://miloyip.github.io/%{name}
License: MIT
URL: http://miloyip.github.io/%{name}
%if 0%{?rel_build}
# Sources for release-builds.
%{?rel_build:Source0: %{giturl}/v%{version}.tar.gz#/%{gittar}}
Source0: %{giturl}/v%{version}.tar.gz#/%{gittar}
%else # 0%%{?rel_build}
# Sources for snapshot-builds.
%{!?rel_build:Source0: %{giturl}/%{commit}.tar.gz#/%{gittar}}
Source0: %{giturl}/%{commit}.tar.gz#/%{gittar}
%endif # 0%%{?rel_build}
# Accepted upstream. See: https://code.google.com/p/rapidjson/issues/detail?id=20
Patch0: https://rapidjson.googlecode.com/issues/attachment?aid=200000000&name=generic_stream.patch&token=ABZ6GAepvWgj_soBAqcTKLtzL3jD3_hObg%3A1407342581907#/rapidjson-0.12_genericstream.patch
# Downstream-patch for gtest.
Patch0: rapidjson-1.0.2-do_not_include_gtest_src_dir.patch
BuildRequires: premake
BuildRequires: valgrind
BuildRequires: cmake
BuildRequires: gtest-devel
BuildRequires: valgrind
%description
%{common_desc}
%package devel
Summary: %{summary}
BuildArch: noarch
Summary: %{summary}
BuildArch: noarch
Provides: %{name} == %{version}-%{release}
Provides: %{name}-static == %{version}-%{release}
Provides: %{name} == %{version}-%{release}
Provides: %{name}-static == %{version}-%{release}
%description devel
%{common_desc}
%files devel
%license license.txt
%doc %dir %{_pkgdocdir}
%doc %{_pkgdocdir}/license.txt
%doc %{_pkgdocdir}/CHANGELOG.md
%doc %{_pkgdocdir}/readme*.md
%{_datadir}/cmake
%{_datadir}/pkgconfig/*
%{_includedir}/%{name}
%package doc
Summary: Documentation-files for %{name}
BuildArch: noarch
Summary: Documentation-files for %{name}
BuildArch: noarch
BuildRequires: %{_sbindir}/hardlink
BuildRequires: doxygen
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
%patch0 -p1 -b .gtest
%{__mkdir} -p %{cmake_build_dir}
# Fix 'W: wrong-file-end-of-line-encoding'.
for _file in "license.txt" $(find example -type f -name '*.c*')
for _file in "license.txt" $(%{_bindir}/find example -type f -name '*.c*')
do
%{__sed} -e 's!\r$!!g' < ${_file} > ${_file}.new && \
%{_bindir}/touch -r ${_file} ${_file}.new && \
/bin/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
# Create dummy-configure.
echo '#!%{_bindir}/bash' > configure && %{__chmod} +x configure
# Disable -Werror.
%{_bindir}/find . -type f -name 'CMakeLists.txt' -print0 | \
%{_bindir}/xargs -0 %{__sed} -i -e's![ \t]*-Werror!!g'
%build
# Testsuite is not buildable on %%arm currently…
%ifarch %{ix86} x86_64
%configure
pushd build
%{_bindir}/premake4 'gmake'
pushd %{cmake_build_dir}
%cmake \
-DDOC_INSTALL_DIR=%{_pkgdocdir} \
-DGTESTSRC_FOUND=TRUE \
-DGTEST_SOURCE_DIR=. \
..
%{__make} %{?_smp_mflags}
popd
%{__make} %{?_smp_mflags} -C build/gmake -f test.make \
config=%{?test_config}%{?__isa_bits} verbose=1
%{__make} %{?_smp_mflags} -C build/gmake -f example.make \
config=%{?test_config}%{?__isa_bits} verbose=1
%endif # arch %%{ix86} x86_64
%{_bindir}/doxygen build/Doxyfile
%install
# There is no install-target in Makefile.
%{__mkdir_p} %{buildroot}%{_includedir} %{buildroot}%{_pkgdocdir}
%{__cp} -a include/* %{buildroot}%{_includedir}
pushd %{cmake_build_dir}
%{__make} install DESTDIR=%{buildroot}
popd
# Move pkgconfig und CMake-stuff to generic datadir.
%{__mv} -f %{buildroot}%{_libdir}/* %{buildroot}%{_datadir}
# Copy the documentation-files to final location.
%{__cp} -a license.txt readme.md doc/*.md doc/html examples \
%{buildroot}%{_pkgdocdir}
%{__cp} -a CHANGELOG.md readme*.md examples %{buildroot}%{_pkgdocdir}
# 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}
@ -151,21 +170,19 @@ popd
%check
# Testsuite is not buildable on %%arm currently…
%ifarch %{ix86} x86_64
pushd bin
./perftest_%{?test_config}_x%{?__isa_bits}_gmake
./unittest_%{?test_config}_x%{?__isa_bits}_gmake || :
%{_bindir}/valgrind --verbose \
--leak-check=full \
--show-leak-kinds=all \
--error-exitcode=1 \
./unittest_%{?test_config}_x%{?__isa_bits}_gmake || :
# Valgrind fails on %%ix86.
%ifarch %{ix86}
CTEST_EXCLUDE=".*valgrind.*"
%endif # arch %%{ix86}
pushd %{cmake_build_dir}
%{_bindir}/ctest -E "${CTEST_EXCLUDE}" -V .
popd
%endif # arch %%{ix86} x86_64
%changelog
* Sun Apr 03 2016 Björn Esser <fedora@besser82.io> - 1.0.2-1
- update to latest upstream-release (#1322941)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-0.4.git20140801.67143c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

View File

@ -1 +1 @@
3a2cdf4da1a5b353e094f58d835434f5 rapidjson-0.12-git20140801-67143c2.tar.gz
97cc60d01282a968474c97f60714828c rapidjson-1.0.2.tar.gz