[packages/jsoncpp] - new URLs, updated to 1.0.0 (note: new soname, headers must be used as <jsoncpp/*> now) - switch fr
qboosh
qboosh at pld-linux.org
Fri Dec 26 12:33:34 CET 2014
commit 1fe9b66cc18e8dac6d53b8e73dfa7607c446c0a6
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Dec 26 12:34:39 2014 +0100
- new URLs, updated to 1.0.0 (note: new soname, headers must be used as <jsoncpp/*> now)
- switch from scons to cmake build system, which is less broken
- removed obsolete optflags patch and .pc file
- added test patch (don't try to compare floats exactly)
- added libdir patch
jsoncpp-libdir.patch | 10 ++++++++
jsoncpp-optflags.patch | 12 ---------
jsoncpp-test.patch | 11 ++++++++
jsoncpp.pc | 11 --------
jsoncpp.spec | 68 ++++++++++++++++++++++----------------------------
5 files changed, 51 insertions(+), 61 deletions(-)
---
diff --git a/jsoncpp.spec b/jsoncpp.spec
index 4a07dd2..0bc3518 100644
--- a/jsoncpp.spec
+++ b/jsoncpp.spec
@@ -1,29 +1,23 @@
#
# Conditional build:
%bcond_without apidocs # doxygen apidocs build
-%bcond_without tests # "scons check" run
+%bcond_without tests # tests during build
-%define svnrev 275
-%define svndate 20131207
Summary: API for manipulating JSON
Summary(pl.UTF-8): API do operacji na strukturach JSON
Name: jsoncpp
-Version: 0.6.0
-Release: 0.%{svndate}svn%{svnrev}.1
+Version: 1.0.0
+Release: 1
License: MIT or Public Domain
Group: Libraries
-# Need to use svn.
-# svn export https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp jsoncpp
-# tar cfj jsoncpp-20120626svn249.tar.bz2 jsoncpp
-Source0: %{name}-%{svndate}svn%{svnrev}.tar.bz2
-# Source0-md5: 82a3375d3aa03474c2aad13dc8d48648
-Source1: %{name}.pc
-Patch0: %{name}-optflags.patch
-URL: http://jsoncpp.sourceforge.net/
+Source0: https://github.com/open-source-parsers/jsoncpp/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 4c886ac3bfccc867a79f3a5280ce1152
+Patch0: %{name}-test.patch
+Patch1: %{name}-libdir.patch
+URL: https://github.com/open-source-parsers/jsoncpp/
+BuildRequires: cmake >= 2.8.5
BuildRequires: libstdc++-devel
BuildRequires: python >= 2
-BuildRequires: scons
-BuildRequires: sed >= 4.0
%if %{with apidocs}
BuildRequires: doxygen
BuildRequires: graphviz
@@ -62,23 +56,21 @@ API documentation for JSONCPP library.
Dokumentacja API biblioteki JSONCPP.
%prep
-%setup -q -n %{name}
+%setup -q
%patch0 -p1
-%{__sed} -i -e '
- s|g++|%{__cxx}| # FIXME: still does not work
- s|@@OPTFLAGS@@|%{rpmcxxflags} -fno-inline-small-functions|
-' SConstruct
+%patch1 -p1
%build
-%scons \
- platform=linux-gcc
-
-# Now, lets make a proper shared lib. :P
-%{__cxx} -o libjsoncpp.so.0.0.0 -shared -Wl,-soname,libjsoncpp.so.0 buildscons/linux-gcc-*/src/lib_json/*.os -lpthread %{rpmldflags}
-
-%if %{with tests}
-scons platform=linux-gcc check
-%endif
+install -d build
+cd build
+%cmake .. \
+ -DARCHIVE_INSTALL_DIR:PATH=%{_lib} \
+ -DLIBRARY_INSTALL_DIR:PATH=%{_lib} \
+ -DPACKAGE_INSTALL_DIR:PATH=%{_lib}/cmake \
+ -DJSONCPP_LIB_BUILD_SHARED=ON \
+ -DJSONCPP_WITH_CMAKE_PACKAGE=ON \
+ %{!?with_tests:-DJSONCPP_WITH_TESTS=OFF}
+cd ..
%if %{with apidocs}
%{__python} doxybuild.py \
@@ -88,13 +80,12 @@ scons platform=linux-gcc check
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/jsoncpp,%{_pkgconfigdir}}
-install -p libjsoncpp.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
-cp -a include/json $RPM_BUILD_ROOT%{_includedir}/jsoncpp
-%{__sed} -e 's|@@LIBDIR@@|%{_libdir}|g' %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/jsoncpp.pc
-/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
-ln -s $(basename $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+# <json/*> is too common, use <jsoncpp/*>
+%{__mv} $RPM_BUILD_ROOT%{_includedir}/{json,jsoncpp}
%clean
rm -rf $RPM_BUILD_ROOT
@@ -104,15 +95,16 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc AUTHORS LICENSE NEWS.txt README.txt
-%attr(755,root,root) %{_libdir}/libjsoncpp.so.0.0.0
-%attr(755,root,root) %ghost %{_libdir}/libjsoncpp.so.0
+%doc AUTHORS LICENSE NEWS.txt README.md
+%attr(755,root,root) %{_libdir}/libjsoncpp.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libjsoncpp.so.1
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libjsoncpp.so
%{_includedir}/jsoncpp
%{_pkgconfigdir}/jsoncpp.pc
+%{_libdir}/cmake/jsoncpp
%if %{with apidocs}
%files apidocs
diff --git a/jsoncpp-libdir.patch b/jsoncpp-libdir.patch
new file mode 100644
index 0000000..d314c96
--- /dev/null
+++ b/jsoncpp-libdir.patch
@@ -0,0 +1,10 @@
+--- jsoncpp-1.0.0/pkg-config/jsoncpp.pc.in.orig 2014-11-20 15:45:58.000000000 +0100
++++ jsoncpp-1.0.0/pkg-config/jsoncpp.pc.in 2014-12-25 22:42:34.036718112 +0100
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@LIBRARY_INSTALL_DIR@
+ includedir=${prefix}/@INCLUDE_INSTALL_DIR@
+
+ Name: jsoncpp
diff --git a/jsoncpp-optflags.patch b/jsoncpp-optflags.patch
deleted file mode 100644
index ed5fae4..0000000
--- a/jsoncpp-optflags.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up jsoncpp/SConstruct.optflags jsoncpp/SConstruct
---- jsoncpp/SConstruct.optflags 2010-03-13 05:59:50.000000000 -0500
-+++ jsoncpp/SConstruct 2012-06-26 13:27:15.551157402 -0400
-@@ -119,7 +119,7 @@ elif platform == 'mingw':
- env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] )
- elif platform.startswith('linux-gcc'):
- env.Tool( 'default' )
-- env.Append( LIBS = ['pthread'], CCFLAGS = "-Wall" )
-+ env.Append( LIBS = ['pthread'], CCFLAGS = "-Wall @@OPTFLAGS@@" )
- env['SHARED_LIB_ENABLED'] = True
- else:
- print "UNSUPPORTED PLATFORM."
diff --git a/jsoncpp-test.patch b/jsoncpp-test.patch
new file mode 100644
index 0000000..193916d
--- /dev/null
+++ b/jsoncpp-test.patch
@@ -0,0 +1,11 @@
+--- jsoncpp-1.0.0/src/test_lib_json/main.cpp.orig 2014-11-20 15:45:58.000000000 +0100
++++ jsoncpp-1.0.0/src/test_lib_json/main.cpp 2014-12-25 22:06:20.003476014 +0100
+@@ -661,7 +661,7 @@
+ JSONTEST_ASSERT_EQUAL(kint32max, val.asUInt());
+ JSONTEST_ASSERT_EQUAL(kint32max, val.asLargestUInt());
+ JSONTEST_ASSERT_EQUAL(kint32max, val.asDouble());
+- JSONTEST_ASSERT_EQUAL(kfint32max, val.asFloat());
++ JSONTEST_ASSERT_EQUAL(kint32max, (int)val.asFloat());
+ JSONTEST_ASSERT_EQUAL(true, val.asBool());
+ JSONTEST_ASSERT_STRING_EQUAL("2147483647", val.asString());
+
diff --git a/jsoncpp.pc b/jsoncpp.pc
deleted file mode 100644
index c148f8c..0000000
--- a/jsoncpp.pc
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=/usr
-exec_prefix=${prefix}
-libdir=@@LIBDIR@@
-includedir=${prefix}/include
-
-Name: jsoncpp
-Description: API for manipulating JSON
-Version: 0.6.0
-URL: http://jsoncpp.sourceforge.net/
-Libs: -L${libdir} -ljsoncpp
-Cflags: -I${includedir} -I${includedir}/jsoncpp/
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/jsoncpp.git/commitdiff/1fe9b66cc18e8dac6d53b8e73dfa7607c446c0a6
More information about the pld-cvs-commit
mailing list