3 %bcond_without tests # build without tests
6 %define svndate 20120626
7 Summary: API for manipulating JSON
10 Release: 0.2.%{svndate}svn%{svnrev}
11 License: MIT or Public Domain
13 URL: http://jsoncpp.sourceforge.net/
15 # svn export https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp jsoncpp
16 # tar cfj jsoncpp-20120626svn249.tar.bz2 jsoncpp
17 Source0: %{name}-%{svndate}svn%{svnrev}.tar.bz2
18 # Source0-md5: cc7964a0787959111ef3d9965287dd3e
20 Patch0: %{name}-optflags.patch
22 BuildRequires: sed >= 4.0
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 JSONCPP provides a simple API to manipulate JSON values, and handle
27 serialization and unserialization to strings.
30 Summary: Headers and libraries for JSONCPP
31 Group: Development/Libraries
32 Requires: %{name} = %{version}-%{release}
35 Headers and libraries for JSONCPP.
41 s|g++|%{__cxx}| # FIXME: still does not work
42 s|@@OPTFLAGS@@|%{rpmcxxflags}|
49 # Now, lets make a proper shared lib. :P
50 %{__cxx} -o libjsoncpp.so.0.0.0 -shared -Wl,-soname,libjsoncpp.so.0 buildscons/linux-gcc-*/src/lib_json/*.os -lpthread %{rpmldflags}
53 scons platform=linux-gcc check
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/jsoncpp,%{_pkgconfigdir}}
59 install -p libjsoncpp.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
60 cp -a include/json $RPM_BUILD_ROOT%{_includedir}/jsoncpp
61 %{__sed} -e 's|@@LIBDIR@@|%{_libdir}|g' %{SOURCE1} > $RPM_BUILD_ROOT%{_pkgconfigdir}/jsoncpp.pc
63 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
64 ln -s $(basename $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libjsoncpp.so
67 rm -rf $RPM_BUILD_ROOT
69 %post -p /sbin/ldconfig
70 %postun -p /sbin/ldconfig
73 %defattr(644,root,root,755)
74 %doc AUTHORS NEWS.txt README.txt version
75 %attr(755,root,root) %{_libdir}/libjsoncpp.so.0.0.0
76 %ghost %{_libdir}/libjsoncpp.so.0
79 %defattr(644,root,root,755)
81 %{_includedir}/jsoncpp
82 %{_libdir}/libjsoncpp.so
83 %{_pkgconfigdir}/jsoncpp.pc