diff --git a/README.md b/README.md index 9f30077..413a8d6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # jsoncpp +jsoncpp is an implementation of a JSON (http://json.org) reader and writer in C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. + diff --git a/jsoncpp-0.5.0-soname.patch b/jsoncpp-0.5.0-soname.patch new file mode 100644 index 0000000..f966b12 --- /dev/null +++ b/jsoncpp-0.5.0-soname.patch @@ -0,0 +1,24 @@ +diff -Nru jsoncpp-src-0.5.0.orig/SConstruct jsoncpp-src-0.5.0/SConstruct +--- jsoncpp-src-0.5.0.orig/SConstruct 2010-03-12 08:31:04.000000000 +0100 ++++ jsoncpp-src-0.5.0/SConstruct 2014-06-20 12:45:42.510887023 +0200 +@@ -179,8 +179,10 @@ + global lib_dir + env.Install( lib_dir, static_lib ) + if env['SHARED_LIB_ENABLED']: ++ shlink_flags = '-shared -Wl,-soname -Wl,lib' + target_name + 'cpp.so.0' + shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}', +- source=target_sources ) ++ source=target_sources, ++ SHLINKFLAGS=shlink_flags ) + env.Install( lib_dir, shared_lib ) + env['SRCDIST_ADD']( source=[target_sources] ) + +@@ -190,7 +192,7 @@ + global build_dir + target_build_dir = os.path.join( build_dir, target_directory ) + target = os.path.join( target_directory, 'sconscript' ) +- SConscript( target, build_dir=target_build_dir, duplicate=0 ) ++ SConscript( target, variant_dir=target_build_dir, duplicate=0 ) + env['SRCDIST_ADD']( source=[target] ) + + diff --git a/jsoncpp.spec b/jsoncpp.spec new file mode 100644 index 0000000..8f5ac80 --- /dev/null +++ b/jsoncpp.spec @@ -0,0 +1,78 @@ +%define pkgver %(echo %version | tr _ -) +Name: jsoncpp +Version: 0.5.0 +Release: 1mamba +Summary: An implementation of a JSON reader and writer in C++ +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +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 +License: MIT +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libgcc +BuildRequires: libstdc++6-devel +## AUTOBUILDREQ-END +BuildRequires: scons +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +jsoncpp is an implementation of a JSON (http://json.org) reader and writer in C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. + +%package -n lib%{name} +Summary: An implementation of a JSON reader and writer in C++ +Group: System/Libraries + +%description -n lib%{name} +This package contains shared libraries for %{name}. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-devel +This package contains libraries and header files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q -n %{name}-src-%{pkgver} +%patch0 -p1 + +%build +scons platform=linux-gcc + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +install -d -m0755 %{buildroot}{%{_includedir},%{_libdir}} +cp -a include/json %{buildroot}%{_includedir}/ + +cp libs/linux-gcc-*/libjson_linux-gcc-*_libmt.so %{buildroot}%{_libdir}/libjsoncpp.so.0 +ln -s libjsoncpp.so.0 %{buildroot}%{_libdir}/libjsoncpp.so + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libjsoncpp.so.* +%doc AUTHORS LICENSE + +%files -n lib%{name}-devel +%defattr(-,root,root) +%dir %{_includedir}/json +%{_includedir}/json/*.h +%{_libdir}/libjsoncpp.so +%doc README.txt + +%changelog +* Fri Jun 20 2014 Silvan Calarco 0.5.0-1mamba +- package created using the webbuild interface