%bcond cpp_tests 1 Name: flatbuffers Version: 23.5.26 Release: 1 Summary: Memory efficient serialization library License: Apache-2.0 URL: https://github.com/google/flatbuffers Source0: https://github.com/google/flatbuffers/archive/v%{version}/%{name}-%{version}.tar.gz Source1: flatc.1 BuildRequires: gcc-c++ cmake >= 2.8.9 BuildRequires: ninja-build BuildRequires: python3-devel BuildRequires: python3dist(numpy) BuildRequires: python3-pip python3-wheel Provides: bundled(grpc) = 1.49.0 %global common_description %{expand: FlatBuffers is a serialization library for games and other memory constrained apps. FlatBuffers allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility.} %description %{common_description} %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. %package compiler Summary: FlatBuffers compiler (flatc) Requires: %{name}%{?_isa} = %{version}-%{release} %description compiler %{common_description} This package contains flatc, the FlatBuffers compiler. %package doc Summary: Documentation and examples for FlatBuffers BuildArch: noarch %description doc %{common_description} %package -n python3-flatbuffers Summary: FlatBuffers serialization format for Python BuildArch: noarch Recommends: python3dist(numpy) Provides: flatbuffers-python3 = %{version}-%{release} Obsoletes: flatbuffers-python3 < 2.0.0-6 %description -n python3-flatbuffers %{common_description} %prep %autosetup -p1 rm -rvf android/ kotlin/ sed -r -i.upstream \ -e 's|[^[:blank:]]*(/flatc)|%{buildroot}%{_bindir}\1|' \ -e 's| python3 | %{python3} |' \ -e 's|run_tests [^/]|# &|' \ -e 's|PYTHONPATH=|&%{buildroot}%{python3_sitelib}:|' \ -e 's|which coverage|/bin/false|' \ tests/PythonTest.sh %build export VERSION='%{version}' %cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ %if %{with cpp_tests} -DFLATBUFFERS_BUILD_TESTS:BOOL=ON \ %else -DFLATBUFFERS_BUILD_TESTS:BOOL=OFF \ -DFLATBUFFERS_BUILD_GRPCTEST:BOOL=OFF \ %endif -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ -DFLATBUFFERS_BUILD_FLATLIB=OFF \ -DFLATBUFFERS_BUILD_FLATC=ON %ninja_build pushd python %pyproject_build popd %install %ninja_install pushd python %pyproject_install popd mkdir -p %{buildroot}%{_mandir}/man1 cp -p %SOURCE1 %{buildroot}%{_mandir}/man1/flatc.1 %check %if %{with cpp_tests} /usr/bin/ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license LICENSE %{_libdir}/libflatbuffers.so.* %files devel %{_includedir}/flatbuffers %{_libdir}/libflatbuffers.so %{_libdir}/pkgconfig/flatbuffers.pc %{_libdir}/cmake/flatbuffers/*.cmake %files compiler %{_bindir}/flatc %{_mandir}/man1/flatc.1* %files doc %license LICENSE %doc CHANGELOG.md %doc SECURITY.md %doc README.md %doc examples/ %doc samples/ %files -n python3-flatbuffers %license LICENSE %{python3_sitelib}/* %changelog * Wed Jul 26 2023 chenchen - 23.5.26-1 - Upgrade to version 23.5.26 * Thu Jul 20 2023 chenchen - 2.0.0-6 - fix build error due to gcc upgrade to 12 * Tue Nov 22 2022 Bin Hu - 2.0.0-5 - add python subpackage for tensorflow 2.10 build * Wed Nov 17 2021 yefeng - 2.0.0-4 - fix undefined behaviour * Mon Nov 15 2021 yefeng - 2.0.0-3 - output errors instead of stdout, Typo fixes in comments and Changes to support binary schema file * Wed Nov 11 2021 yefeng - 2.0.0-2 - Fix compiler warning * Tue Aug 17 2021 yaoxin - 2.0.0-1 - Upgrade 2.0.0 to fix CVE-2020-35864 * Mon Aug 2 2021 Haiwei Li - 1.10.0-2 - Fix complication failed due to gcc upgrade * Mon Jan 11 2021 yanan li - 1.10.0-1 - Package init