[packages/jsoncpp] new, version 0.6.0-svn

glen glen at pld-linux.org
Sun Nov 11 10:57:17 CET 2012


commit 0cc95b9ee6eb48aab3f1ce933aff649840d6c995
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Nov 11 11:51:49 2012 +0200

    new, version 0.6.0-svn
    
    based on Tom Callaway's src.rpm:
    http://repos.fedorapeople.org/repos/spot/chromium/fedora-18/SRPMS/jsoncpp-0.6.0-0.1.20120626svn249.fc18.src.rpm

 jsoncpp-optflags.patch | 12 ++++++++
 jsoncpp.pc             | 11 +++++++
 jsoncpp.spec           | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+)
---
diff --git a/jsoncpp.spec b/jsoncpp.spec
new file mode 100644
index 0000000..b336e8c
--- /dev/null
+++ b/jsoncpp.spec
@@ -0,0 +1,82 @@
+#
+# Conditional build:
+%bcond_without	tests		# build without tests
+
+%define	svnrev  249
+%define	svndate 20120626
+Summary:	API for manipulating JSON
+Name:		jsoncpp
+Version:	0.6.0
+Release:	0.1.%{svndate}svn%{svnrev}
+License:	MIT or Public Domain
+Group:		Libraries
+URL:		http://jsoncpp.sourceforge.net/
+# 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:	e42665aba92a48b1fa998e534d03b5d8
+Source1:	%{name}.pc
+Patch0:		%{name}-optflags.patch
+BuildRequires:	scons
+BuildRequires:	sed >= 4.0
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+JSONCPP provides a simple API to manipulate JSON values, and handle
+serialization and unserialization to strings.
+
+%package devel
+Summary:	Headers	and libraries for JSONCPP
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Headers and libraries for JSONCPP.
+
+%prep
+%setup -q -n %{name}
+%patch0 -p1
+%{__sed} -i -e '
+	s|g++|%{__cxx}| # FIXME: still does not work
+	s|@@OPTFLAGS@@|%{rpmcxxflags}|
+' SConstruct
+
+%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
+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
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS NEWS.txt README.txt version
+%attr(755,root,root) %{_libdir}/libjsoncpp.so.0.0.0
+%ghost %{_libdir}/libjsoncpp.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%doc doc/*
+%{_includedir}/jsoncpp
+%{_libdir}/libjsoncpp.so
+%{_pkgconfigdir}/jsoncpp.pc
diff --git a/jsoncpp-optflags.patch b/jsoncpp-optflags.patch
new file mode 100644
index 0000000..ed5fae4
--- /dev/null
+++ b/jsoncpp-optflags.patch
@@ -0,0 +1,12 @@
+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.pc b/jsoncpp.pc
new file mode 100644
index 0000000..c148f8c
--- /dev/null
+++ b/jsoncpp.pc
@@ -0,0 +1,11 @@
+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/0cc95b9ee6eb48aab3f1ce933aff649840d6c995



More information about the pld-cvs-commit mailing list