]> git.pld-linux.org Git - packages/jsoncpp.git/commitdiff
- new URLs, updated to 1.0.0 (note: new soname, headers must be used as <jsoncpp...
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 26 Dec 2014 11:34:39 +0000 (12:34 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 26 Dec 2014 11:34:39 +0000 (12:34 +0100)
- 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 [new file with mode: 0644]
jsoncpp-optflags.patch [deleted file]
jsoncpp-test.patch [new file with mode: 0644]
jsoncpp.pc [deleted file]
jsoncpp.spec

diff --git a/jsoncpp-libdir.patch b/jsoncpp-libdir.patch
new file mode 100644 (file)
index 0000000..d314c96
--- /dev/null
@@ -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 (file)
index ed5fae4..0000000
+++ /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 (file)
index 0000000..193916d
--- /dev/null
@@ -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 (file)
index c148f8c..0000000
+++ /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/
index 4a07dd29ae73073ecbc0634e65eef000a2c38e7d..0bc35184fa79526f8eb6e814bed8dad9443697ef 100644 (file)
@@ -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
This page took 0.184238 seconds and 4 git commands to generate.