%define major 1 %define libname %mklibname %{name} %{major} %define devname %mklibname %{name} -d Summary: C++ JSON Library Name: jsoncpp Version: 1.7.5 Release: 2 License: Public Domain Group: System/Libraries Url: http://jsoncpp.sourceforge.net/ Source0: https://github.com/open-source-parsers/jsoncpp/archive/%{name}-%{version}.tar.gz Patch0: jsoncpp-1.7.5-pkgconfig.patch Patch1: jsoncpp-1.7.5-stdint.patch BuildRequires: cmake %description JsonCpp is a simple API to manipulate JSON value, handle serialization and unserialization to string. It can also preserve existing comment in unserialization/serialization steps, making it a convenient format to store user input files. Unserialization parsing is user friendly and provides precise error reports. #---------------------------------------------------------------------------- %package -n %{libname} Summary: JsonCpp library Group: System/Libraries %description -n %{libname} JsonCpp is a simple API to manipulate JSON value, handle serialization and unserialization to string. It can also preserve existing comment in unserialization/serialization steps, making it a convenient format to store user input files. Unserialization parsing is user friendly and provides precise error reports. %files -n %{libname} %doc NEWS.txt README.md %{_libdir}/lib%{name}.so.%{major}* #---------------------------------------------------------------------------- %package -n %{devname} Summary: Development files for %{name} Group: System/Libraries Requires: %{libname} = %{EVRD} Provides: %{name}-devel = %{EVRD} %description -n %{devname} Files for building applications with %{name} support. %files -n %{devname} %{_libdir}/lib%{name}.so %dir %{_includedir}/json %{_includedir}/json/*.h %dir %{_libdir}/cmake/jsoncpp/ %{_libdir}/cmake/jsoncpp/* %{_libdir}/pkgconfig/jsoncpp.pc #---------------------------------------------------------------------------- %prep %setup -q %patch0 -p1 %patch1 -p1 %build %cmake \ -DJSONCPP_LIB_BUILD_SHARED:BOOL=ON \ -DJSONCPP_LIB_BUILD_STATIC:BOOL=OFF \ -DJSONCPP_WITH_TESTS:BOOL=OFF \ -DJSONCPP_WITH_POST_BUILD_UNITTES:BOOL=OFF \ -DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON %make %install %makeinstall_std -C build