rapidjson/rapidjson.spec

92 lines
2.5 KiB
RPMSpec
Raw Normal View History

Name: rapidjson
Version: 1.1.0
Release: 2mamba
Summary: A fast JSON parser/generator for C++ with both SAX/DOM style API
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/Tencent/rapidjson
Source: https://github.com/Tencent/rapidjson.git/v%{version}/rapidjson-%{version}.tar.bz2
Patch0: rapidjson-1.1.0-gcc-10.2.0.patch
Patch1: rapidjson-1.1.0-do_not_include_gtest_src_dir.patch
Patch2: rapidjson-1.1.0-gcc-14.patch
License: MIT
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildRequires: cmake
%description
A fast JSON parser/generator for C++ with both SAX/DOM style API.
%package -n lib%{name}-devel
Group: Development/Libraries
Summary: Development files for %{name}
%description -n lib%{name}-devel
This package contains header files for developing applications that use %{name}.
#% debug_package
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch 2 -p1 -b .gcc-14
# From Fedora
# Remove bundled code
rm -rf thirdparty
# Convert DOS line endings to unix
for file in "license.txt" $(find example -type f -name *.c*)
do
sed -e "s/\r$//g" < ${file} > ${file}.new && \
touch -r ${file} ${file}.new && \
mv -f ${file}.new ${file}
done
# Remove -march=native and -Werror from compile commands
find . -type f -name CMakeLists.txt -print0 | \
xargs -0r sed -i -e "s/-march=native/ /g" -e "s/-Werror//g"
%build
%cmake -d build \
-DDOC_INSTALL_DIR=%{_docdir}/%{name} \
-DRAPIDJSON_BUILD_CXX11:BOOL=OFF \
-DGTESTSRC_FOUND=TRUE \
-DGTEST_SOURCE_DIR=.
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C build
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/rapidjson
%{_includedir}/rapidjson/*.h
%{_includedir}/rapidjson/document.h.gcc-14
%dir %{_includedir}/rapidjson/error
%{_includedir}/rapidjson/error/*.h
%dir %{_includedir}/rapidjson/internal
%{_includedir}/rapidjson/internal/*.h
%dir %{_includedir}/rapidjson/msinttypes
%{_includedir}/rapidjson/msinttypes/*.h
%dir %{_libdir}/cmake/RapidJSON
%{_libdir}/cmake/RapidJSON/RapidJSON*.cmake
%{_libdir}/pkgconfig/RapidJSON.pc
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/*
%changelog
* Sun May 26 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.0-2mamba
- added patch for gcc 14
* Mon Mar 15 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.0-1mamba
- package created using the webbuild interface