From 9ca4f035ea0ccd40b9d96f4cf4759e29249103b2 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 00:21:22 +0100 Subject: [PATCH] provide pkg-config file move headers to %{_includedir}/jsoncpp [release 0.6.0_rc2-2mamba;Wed Sep 17 2014] --- jsoncpp-0.6.0_rc2-buildfix-fPIC.patch | 11 ++++++++ jsoncpp.spec | 38 +++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 jsoncpp-0.6.0_rc2-buildfix-fPIC.patch diff --git a/jsoncpp-0.6.0_rc2-buildfix-fPIC.patch b/jsoncpp-0.6.0_rc2-buildfix-fPIC.patch new file mode 100644 index 0000000..455ea3a --- /dev/null +++ b/jsoncpp-0.6.0_rc2-buildfix-fPIC.patch @@ -0,0 +1,11 @@ +--- jsoncpp-src-0.6.0-rc2/SConstruct.orig 2014-09-17 14:13:14.742927982 +0200 ++++ jsoncpp-src-0.6.0-rc2/SConstruct 2014-09-17 14:11:04.782932297 +0200 +@@ -119,7 +119,7 @@ + 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 -fPIC" ) + env['SHARED_LIB_ENABLED'] = True + else: + print "UNSUPPORTED PLATFORM." diff --git a/jsoncpp.spec b/jsoncpp.spec index da738d8..a170440 100644 --- a/jsoncpp.spec +++ b/jsoncpp.spec @@ -1,7 +1,7 @@ %define pkgver %(echo %version | tr _ -) Name: jsoncpp Version: 0.6.0_rc2 -Release: 1mamba +Release: 2mamba Summary: An implementation of a JSON reader and writer in C++ Group: System/Libraries Vendor: openmamba @@ -10,6 +10,7 @@ Packager: Silvan Calarco URL: http://jsoncpp.sourceforge.net/ Source: http://downloads.sourceforge.net/project/jsoncpp/jsoncpp/%{pkgver}/jsoncpp-src-%{pkgver}.tar.gz Patch0: jsoncpp-0.5.0-soname.patch +Patch1: jsoncpp-0.6.0_rc2-buildfix-fPIC.patch License: MIT ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -42,19 +43,40 @@ This package contains libraries and header files for developing applications tha %prep %setup -q -n %{name}-src-%{pkgver} %patch0 -p1 +%patch1 -p1 %build +export CFLAGS="%{optflags}" +export CXXFLAGS="%{optflags}" scons platform=linux-gcc %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" -install -d -m0755 %{buildroot}{%{_includedir},%{_libdir}} -cp -a include/json %{buildroot}%{_includedir}/ +install -d -m0755 %{buildroot}{%{_includedir}/jsoncpp,%{_libdir}} +cp -a include/json %{buildroot}%{_includedir}/jsoncpp cp libs/linux-gcc-*/libjson_linux-gcc-*_libmt.so %{buildroot}%{_libdir}/libjsoncpp.so.0 ln -s libjsoncpp.so.0 %{buildroot}%{_libdir}/libjsoncpp.so +install -d -m0755 %{buildroot}%{_libdir}/pkgconfig +cat > %{buildroot}%{_libdir}/pkgconfig/jsoncpp.pc << _EOF +prefix=%{_prefix} +libdir=%{_libdir} +includedir=%{_includedir}/jsoncpp + +version = %{version} + +name = jsoncpp +pkgname = libjsoncpp + +Name: \${name} +Version: 0.6.0_rc2 +Description: Jsoncpp library version %{version} +Cflags: -I\${includedir} +Libs: -L\${libdir} -ljsoncpp +_EOF + %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" @@ -68,12 +90,18 @@ ln -s libjsoncpp.so.0 %{buildroot}%{_libdir}/libjsoncpp.so %files -n lib%{name}-devel %defattr(-,root,root) -%dir %{_includedir}/json -%{_includedir}/json/*.h +%dir %{_includedir}/jsoncpp +%dir %{_includedir}/jsoncpp/json +%{_includedir}/jsoncpp/json/*.h %{_libdir}/libjsoncpp.so +%{_libdir}/pkgconfig/jsoncpp.pc %doc README.txt %changelog +* Wed Sep 17 2014 Silvan Calarco 0.6.0_rc2-2mamba +- provide pkg-config file +- move headers to %{_includedir}/jsoncpp + * Mon Jul 07 2014 Silvan Calarco 0.6.0_rc2-1mamba - update to 0.6.0_rc2