%global srcname jsonrpccpp Name: libjson-rpc-cpp Version: 0.7.0 Release: 1%{?dist} Summary: C++ framework for json-rpc (json remote procedure call) License: MIT URL: https://github.com/cinemast/libjson-rpc-cpp Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Fix finding catch in Fedora installation. We ship catch library in # many files, not in one. Those are located under /usr/include/catch Patch0: catch-path_suffix-cmake.patch BuildRequires: cmake BuildRequires: make BuildRequires: gcc-c++ BuildRequires: jsoncpp-devel BuildRequires: argtable-devel BuildRequires: libcurl-devel BuildRequires: libmicrohttpd-devel BuildRequires: catch-devel # Documentation BuildRequires: doxygen Requires: %{name}-common%{?_isa} = %{version}-%{release} Requires: %{name}-client%{?_isa} = %{version}-%{release} Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: %{name}-stub%{?_isa} = %{version}-%{release} %description %{summary}. This package is meta-package which requires: * %{name}-common * %{name}-client * %{name}-server * %{name}-stub %package devel Summary: Development files for JSON-RPC C++ framework Requires: %{name}-common%{?_isa} = %{version}-%{release} Requires: %{name}-client%{?_isa} = %{version}-%{release} Requires: %{name}-server%{?_isa} = %{version}-%{release} Requires: %{name}-stub%{?_isa} = %{version}-%{release} Requires: jsoncpp-devel%{?_isa} Requires: libmicrohttpd-devel%{?_isa} %description devel This package provides all required developer resources like header-files of the %{name} framework. Features of this framework include: * Type checking * Malformed request handling * Handling batch procedure calls * JSON-RPC Method invocation * JSON-RPC Notification invocation * Simple Interface for implementing additional Server-Connectors beside HTTP * Positional and named parameters %package common Summary: Common functionality for %{name}-server and %{name}-client Recommends: %{name}-client%{?_isa} = %{version}-%{release} Recommends: %{name}-server%{?_isa} = %{version}-%{release} Recommends: %{name}-tools%{?_isa} = %{version}-%{release} %description common This library provides common classes for the libjson-rpc-cpp framework like: * Exceptions * Error-Codes * Specification Parsers and Writers * Procedure parameter validation This package usually only makes sense with %{name}-client and/or %{name}-server. %package client Summary: Library implementing json-rpc C++ clients Requires: %{name}-common%{?_isa} = %{version}-%{release} Recommends: %{name}-tools%{?_isa} = %{version}-%{release} %description client This library provides classes to easily implement JSON-RPC C++ clients. It comes with a built in HTTP-Client connector (based on libcurl) for easy data exchange. It is fully JSON-RPC 2.0 and JSON-RPC 1.0 compatible, including: * Type checking * Error response handling * Batch procedure calls * JSON-RPC Method invocation * JSON-RPC Notification invocation * Interface for additional Client-Connectors beside HTTP * Positional and named parameters %package server Summary: Library implementing json-rpc C++ clients Requires: %{name}-common%{?_isa} = %{version}-%{release} Recommends: %{name}-tools%{?_isa} = %{version}-%{release} %description server This library provides classes to easily implement JSON-RPC C++ Server applications. It comes with a built in HTTP-Server connector (based on libmicrohttpd) for easy data exchange. It is fully JSON-RPC 2.0 and JSON-RPC 1.0 compatible, including: * Type checking * Malformed request handling * Handling batch procedure calls * JSON-RPC Method invocation * JSON-RPC Notification invocation * Simple Interface for implementing additional Server-Connectors beside HTTP * Positional and named parameters %package stub Summary: Library for stub generation of %{name} based applications Requires: %{name}-common%{?_isa} = %{version}-%{release} Recommends: %{name}-tools%{?_isa} = %{version}-%{release} %description stub This package provides the stub generator library for the %{name} framework. It can automatically generate full functioning C++ and JavaScript JSON-RPC Client classes, which are ready to use. For JSON-RPC Server applications, this library can generate an abstract C++ class which just has to be sub classed and implement all pure virtual methods. To make this possible, a interface description file (in the JSON format) is required, which lists all available methods with corresponding parameters and types. %package tools Summary: Stub generator for %{name} based applications Requires: %{name}-common%{?_isa} = %{version}-%{release} %description tools This package provides the stub generator for the libjson-rpc-cpp framework. It can automatically generate full functioning C++ and JavaScript JSON-RPC Client classes, which are ready to use. For JSON-RPC Server applications, this tool can generate an abstract C++ class which just has to be sub classed and implement all pure virtual methods. To make this possible, a simple interface description file (in the JSON format) is required, which lists all available methods with corresponding parameters and types. %prep %autosetup -p1 # Removing CMake file which will try to download catch rm -rf src/catch # Fix libdirs find -name 'CMakeLists.txt' -exec sed -i 's,lib/${CMAKE_LIBRARY_PATH},%{_lib},g' {} ';' # https://github.com/cinemast/libjson-rpc-cpp/issues/184 find -type f -name '*.cpp' -or -name '*.h' -executable -exec chmod -x {} ';' %build mkdir %{_target_platform} pushd %{_target_platform} %cmake .. %make_build popd %install %make_install -C %{_target_platform} %check pushd %{_target_platform} ctest -VV popd %files devel %{_includedir}/%{srcname}/ %{_libdir}/lib%{srcname}-common.so %{_libdir}/pkgconfig/lib%{srcname}-common.pc %{_libdir}/lib%{srcname}-client.so %{_libdir}/pkgconfig/lib%{srcname}-client.pc %{_libdir}/lib%{srcname}-server.so %{_libdir}/pkgconfig/lib%{srcname}-server.pc %{_libdir}/lib%{srcname}-stub.so %{_libdir}/pkgconfig/lib%{srcname}-stub.pc %post common -p /sbin/ldconfig %postun common -p /sbin/ldconfig %files common %license LICENSE.txt %doc CHANGELOG.md README.md %{_libdir}/lib%{srcname}-common.so.* %post client -p /sbin/ldconfig %postun client -p /sbin/ldconfig %files client %{_libdir}/lib%{srcname}-client.so.* %post server -p /sbin/ldconfig %postun server -p /sbin/ldconfig %files server %{_libdir}/lib%{srcname}-server.so.* %post stub -p /sbin/ldconfig %postun stub -p /sbin/ldconfig %files stub %{_libdir}/lib%{srcname}-stub.so.* %files tools %{_bindir}/jsonrpcstub %{_mandir}/man1/jsonrpcstub.1* %changelog * Sat Jan 07 2017 Igor Gnatenko - 0.7.0-1 - Update to 0.7.0 * Sat Apr 02 2016 Igor Gnatenko - 0.6.0-2 - Fix requirements for -devel - Use packaged fedora's catch * Thu Mar 24 2016 Igor Gnatenko - 0.6.0-1 - Initial package