Browse Source

jsoncpp package update

Signed-off-by: basebuilder_pel7ppc64lebuilder0 <basebuilder@powerel.org>
master
basebuilder_pel7ppc64lebuilder0 2 years ago
parent
commit
049c69d129
  1. 19
      SOURCES/json-c-conflict.patch
  2. 16
      SOURCES/nowerror.patch
  3. 159
      SPECS/jsoncpp.spec

19
SOURCES/json-c-conflict.patch

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
diff -Nur jsoncpp-0.10.5/include/CMakeLists.txt jsoncpp-0.10.5.patched/include/CMakeLists.txt
--- jsoncpp-0.10.5/include/CMakeLists.txt 2015-07-23 07:32:47.000000000 +0200
+++ jsoncpp-0.10.5.patched/include/CMakeLists.txt 2016-04-24 00:08:51.153854035 +0200
@@ -1,2 +1,2 @@
FILE(GLOB INCLUDE_FILES "json/*.h")
-INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${INCLUDE_INSTALL_DIR}/json)
+INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${INCLUDE_INSTALL_DIR}/jsoncpp/json)
diff -Nur jsoncpp-0.10.5/pkg-config/jsoncpp.pc.in jsoncpp-0.10.5.patched/pkg-config/jsoncpp.pc.in
--- jsoncpp-0.10.5/pkg-config/jsoncpp.pc.in 2015-07-23 07:32:47.000000000 +0200
+++ jsoncpp-0.10.5.patched/pkg-config/jsoncpp.pc.in 2016-04-24 00:14:11.877668310 +0200
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=@LIBRARY_INSTALL_DIR@
-includedir=@INCLUDE_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@/jsoncpp
Name: jsoncpp
Description: A C++ library for interacting with JSON

16
SOURCES/nowerror.patch

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
diff -ru jsoncpp-0.10.5/CMakeLists.txt jsoncpp-0.10.5.patched/CMakeLists.txt
--- jsoncpp-0.10.5/CMakeLists.txt 2015-07-23 07:32:47.000000000 +0200
+++ jsoncpp-0.10.5.patched/CMakeLists.txt 2016-02-16 19:10:50.731887585 +0100
@@ -97,10 +97,10 @@
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -Wshadow -Wshorten-64-to-32")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wshadow -Wshorten-64-to-32")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wshadow -Wextra -pedantic -Wno-long-long")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow -Wextra -pedantic -Wno-long-long")
# not yet ready for -Wconversion
endif()

159
SPECS/jsoncpp.spec

@ -0,0 +1,159 @@ @@ -0,0 +1,159 @@
%global optflags %(echo '%{optflags} -Wno-error')
%global jsondir jsoncpp

Name: jsoncpp
Version: 0.10.5
Release: 2%{?dist}
Summary: JSON library implemented in C++

License: Public Domain or MIT
URL: https://github.com/open-source-parsers/jsoncpp
Source0: https://github.com/open-source-parsers/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

Patch0: nowerror.patch
Patch1: json-c-conflict.patch

BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: python

%description
%{name} is an implementation of a JSON (http://json.org) reader and writer in
C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format.
It is easy for humans to read and write. It is easy for machines to parse and
generate.


%package devel
Summary: Development headers and library for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains the development headers and library for %{name}.


%package doc
Summary: Documentation for %{name}
BuildArch: noarch

%description doc
This package contains the documentation for %{name}.


%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1


%build
%if 0%{?rhel} && 0%{?rhel} <= 6
export LD_LIBRARY_PATH="$(pwd)/src/lib_json:${LD_LIBRARY_PATH}"
%endif # 0%%{?rhel} && 0%%{?rhel} <= 6
%cmake -DBUILD_STATIC_LIBS=OFF \
-DJSONCPP_WITH_WARNING_AS_ERROR=OFF \
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=ON \
-DJSONCPP_WITH_CMAKE_PACKAGE=ON \
%if 0%{?rhel} && 0%{?rhel} <= 6
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
%endif # 0%%{?rhel} && 0%%{?rhel} <= 6
.
make %{?_smp_mflags}
# Build the doc
python doxybuild.py --with-dot --doxygen %{_bindir}/doxygen


%install
make install DESTDIR=%{buildroot}

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}/html
for f in NEWS.txt README.md ; do
install -p -m 0644 $f $RPM_BUILD_ROOT%{_docdir}/%{name}
done
install -p -m 0644 dist/doxygen/*/*.{html,png} $RPM_BUILD_ROOT%{_docdir}/%{name}/html


%check
# Tests are run automatically in the build section
# ctest -V %{?_smp_mflags}


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%files
%license AUTHORS LICENSE
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/README.md
%exclude %{_docdir}/%{name}/html
%{_libdir}/lib%{name}.so.*


%files devel
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/NEWS.txt
%{_libdir}/lib%{name}.so
%{_includedir}/%{jsondir}/
%{_libdir}/cmake
%{_libdir}/pkgconfig/jsoncpp.pc


%files doc
%{?_licensedir:%license %{_datadir}/licenses/%{name}*}
%doc %{_docdir}/%{name}/


%changelog
* Sat Apr 23 2016 Sébastien Willmann <sebastien.willmann@gmail.com> - 0.10.5-2
- Fix file conflict with json-c

* Fri Mar 25 2016 Björn Esser <fedora@besser82.io> - 0.10.5-1
- Update to version 0.10.5
- Use %%license and %%doc properly
- Add generated CMake-target
- Move %%check after %%install
- Remove Group-tag, needed for el <= 5, only
- Drop Patch0, not needed anymore
- Disabled Werror
- Add disttag
- Use cmake instead of scons

* Fri Mar 15 2013 Sébastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.9.rc2
- Changed Summary
- Added %%doc files to the doc package
- Added python as an explicit BuildRequires

* Fri Feb 15 2013 Sebastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.8.rc2
- Added documentation sub-package

* Sun Jan 20 2013 Sebastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.7.rc2
- Added graphviz as a BuildRequire

* Sat Jan 19 2013 Sebastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.6.rc2
- Install the corrected library

* Sat Dec 22 2012 Sebastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.5.rc2
- Added libjsoncpp.so.0
- Moved the shared lib build to the correct section

* Fri Dec 21 2012 Sebastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.4.rc2
- Removed doc subpackage
- Added .pc file
- Fixed shared lib

* Wed Dec 12 2012 Sebastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.3.rc2
- Removed static package
- Preserving timestamp on installed files
- Added guard grep to the sed expression
- Removed duplicated doc files
- Removed dependency on pkgconfig
- Changed base package group

* Sun Dec 02 2012 Sébastien Willmann <sebastien.willmann@gmail.com> - 0.6.0-0.2.rc2
- Changed license field to Public Domain or MIT

* Tue Nov 27 2012 Sébastien Willmann <sebastien.willmann@gmail.com> 0.6.0-0.1.rc2
- Creation of the spec file

Loading…
Cancel
Save