mirror of
https://abf.rosa.ru/djam/jsoncpp.git
synced 2025-02-24 11:22:58 +00:00
92 lines
2.7 KiB
RPMSpec
92 lines
2.7 KiB
RPMSpec
%define major 24
|
|
%define libname %mklibname %{name} %{major}
|
|
%define devname %mklibname %{name} -d
|
|
|
|
# prevent circular dependencies with cmake
|
|
%global __requires_exclude ^cmake-filesystem.*$
|
|
|
|
Summary: C++ JSON Library
|
|
Name: jsoncpp
|
|
Version: 1.9.4
|
|
Release: 4
|
|
License: Public Domain
|
|
Group: System/Libraries
|
|
Url: http://jsoncpp.sourceforge.net/
|
|
Source0: https://github.com/open-source-parsers/jsoncpp/archive/%{version}.tar.gz
|
|
BuildRequires: ninja
|
|
BuildRequires: cmake
|
|
BuildRequires: python3-devel
|
|
|
|
%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}
|
|
%{_libdir}/lib%{name}.so.%{major}
|
|
%{_libdir}/lib%{name}.so.%{version}
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%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
|
|
%{_libdir}/pkgconfig/jsoncpp.pc
|
|
%{_libdir}/cmake/jsoncpp/*.cmake
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%build
|
|
%cmake \
|
|
-DBUILD_STATIC_LIBS:BOOL=OFF \
|
|
-DBUILD_OBJECT_LIBS:BOOL=OFF \
|
|
-DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON \
|
|
-DJSONCPP_WITH_EXAMPLE:BOOL=OFF \
|
|
-DJSONCPP_WITH_PKGCONFIG_SUPPORT:BOOL=ON \
|
|
-DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF \
|
|
-DJSONCPP_WITH_STRICT_ISO:BOOL=ON \
|
|
-DJSONCPP_WITH_TESTS:BOOL=OFF \
|
|
-DJSONCPP_WITH_WARNING_AS_ERROR:BOOL=OFF \
|
|
-DPYTHON_EXECUTABLE:STRING="%{__python3}" \
|
|
-G Ninja
|
|
%ninja_build
|
|
|
|
%install
|
|
%ninja_install -C build
|
|
|
|
#fix include path in .pc file
|
|
sed -i 's|/include|/include/json|' %{buildroot}%{_libdir}/pkgconfig/jsoncpp.pc
|
|
sed -i 's|Version: |Version: %{version}|' %{buildroot}%{_libdir}/pkgconfig/jsoncpp.pc
|
|
|