File libjsonrpc-cpp.spec of Package libjsonrpc-cpp
#
# spec file for package libjsonrpc-cpp
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: libjsonrpc-cpp
Version: 1.4.1
Release: 0
Summary: JSON RPC C++ library
License: MIT
Group: System/Libraries
URL: https://github.com/cinemast/libjson-rpc-cpp
Source0: %{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: hiredis-devel
BuildRequires: jsoncpp-devel
BuildRequires: libargtable2-devel
BuildRequires: libcurl-devel
BuildRequires: libmicrohttpd-devel >= 0.9.44
BuildRequires: pkg-config
%define soname 1
%description
%package -n %{name}%{soname}
Summary: JSON RPC C++ library
Group: System/Libraries
%description -n %{name}%{soname}
This framework provides cross platform JSON-RPC (remote procedure call) support for C++. It is fully JSON-RPC 2.0 & 1.0 compatible.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{name}%{soname} = %{version}
%description devel
The %{name}-devel package contains libraries and header files for developing applications that use %{name}.
%prep
%setup -q
%build
%cmake -DBUILD_STATIC_LIBS=NO -DBUILD_SHARED_LIBS=YES -DCOMPILE_TESTS=NO -DCOMPILE_EXAMPLES=NO
%if 0%{?suse_version} && 0%{?suse_version} >= 1500
%make_build
%else
%{__make} %{?_smp_mflags}
%endif
%install
%cmake_install
%{__sed} -i 's#Libs: -L#Libs: -L%{_libdir}/#g' %{buildroot}%{_libdir}/pkgconfig/libjsonrpccpp-stub.pc
%{__sed} -i 's#Cflags: -I#Cflags: -I%{_includedir}/#g' %{buildroot}%{_libdir}/pkgconfig/libjsonrpccpp-stub.pc
%post -n %{name}%{soname}
/sbin/ldconfig
%postun -n %{name}%{soname}
/sbin/ldconfig
%files -n %{name}%{soname}
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_bindir}/jsonrpcstub
%{_includedir}/jsonrpccpp/
%{_libdir}/libjson-rpc-cpp/
%{_libdir}/pkgconfig/*
%{_libdir}/*.so
%{_mandir}/man1/jsonrpcstub.1%{?ext_man}
%doc AUTHORS.md CHANGELOG.md README.md
%changelog