rapidjson/rapidjson.spec

85 lines
2.3 KiB
RPMSpec
Raw Permalink Normal View History

Name: rapidjson
Version: 1.1.0
Release: 1mamba
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
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
# 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} \
-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
%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
* Mon Mar 15 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.0-1mamba
- package created using the webbuild interface