flatbuffers/flatbuffers.spec

166 lines
4.1 KiB
RPMSpec
Raw Normal View History

2023-07-26 14:38:59 +08:00
%bcond cpp_tests 1
2021-01-26 20:18:46 +08:00
Name: flatbuffers
2023-07-26 14:38:59 +08:00
Version: 23.5.26
Release: 1
2021-01-26 20:18:46 +08:00
Summary: Memory efficient serialization library
License: Apache-2.0
URL: https://github.com/google/flatbuffers
2023-07-26 14:38:59 +08:00
Source0: https://github.com/google/flatbuffers/archive/v%{version}/%{name}-%{version}.tar.gz
2021-01-26 20:18:46 +08:00
Source1: flatc.1
2021-01-26 20:18:46 +08:00
BuildRequires: gcc-c++ cmake >= 2.8.9
2023-07-26 14:38:59 +08:00
BuildRequires: ninja-build
BuildRequires: python3-devel
BuildRequires: python3dist(numpy)
BuildRequires: python3-pip python3-wheel
Provides: bundled(grpc) = 1.49.0
%global common_description %{expand:
2021-01-26 20:18:46 +08:00
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
2023-07-26 14:38:59 +08:00
compatibility.}
%description %{common_description}
2021-01-26 20:18:46 +08:00
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
%{summary}.
2023-07-26 14:38:59 +08:00
%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}
2021-01-26 20:18:46 +08:00
%prep
%autosetup -p1
2023-07-26 14:38:59 +08:00
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
2021-01-26 20:18:46 +08:00
%build
2023-07-26 14:38:59 +08:00
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
2021-01-26 20:18:46 +08:00
pushd python
2023-07-26 14:38:59 +08:00
%pyproject_build
popd
2021-01-26 20:18:46 +08:00
%install
2023-07-26 14:38:59 +08:00
%ninja_install
pushd python
2023-07-26 14:38:59 +08:00
%pyproject_install
popd
2023-07-26 14:38:59 +08:00
mkdir -p %{buildroot}%{_mandir}/man1
cp -p %SOURCE1 %{buildroot}%{_mandir}/man1/flatc.1
2021-01-26 20:18:46 +08:00
%check
2023-07-26 14:38:59 +08:00
%if %{with cpp_tests}
/usr/bin/ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags}
2021-01-26 20:18:46 +08:00
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
2023-07-26 14:38:59 +08:00
%license LICENSE
2021-01-26 20:18:46 +08:00
%{_libdir}/libflatbuffers.so.*
%files devel
%{_includedir}/flatbuffers
%{_libdir}/libflatbuffers.so
2021-08-17 10:37:00 +08:00
%{_libdir}/pkgconfig/flatbuffers.pc
2021-01-26 20:18:46 +08:00
%{_libdir}/cmake/flatbuffers/*.cmake
2023-07-26 14:38:59 +08:00
%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
2023-07-26 14:38:59 +08:00
%license LICENSE
%{python3_sitelib}/*
2021-01-26 20:18:46 +08:00
%changelog
2023-07-26 14:38:59 +08:00
* Wed Jul 26 2023 chenchen <chen_aka_jan@163.com> - 23.5.26-1
- Upgrade to version 23.5.26
* Thu Jul 20 2023 chenchen <chen_aka_jan@163.com> - 2.0.0-6
- fix build error due to gcc upgrade to 12
* Tue Nov 22 2022 Bin Hu <hubin73@huawei.com> - 2.0.0-5
- add python subpackage for tensorflow 2.10 build
* Wed Nov 17 2021 yefeng <yefeng24@huawei.com> - 2.0.0-4
- fix undefined behaviour
* Mon Nov 15 2021 yefeng <yefeng24@huawei.com> - 2.0.0-3
2021-11-15 19:06:38 +08:00
- output errors instead of stdout, Typo fixes in comments and Changes to support binary schema file
* Wed Nov 11 2021 yefeng <yefeng24@huawei.com> - 2.0.0-2
- Fix compiler warning
2021-08-17 10:37:00 +08:00
* Tue Aug 17 2021 yaoxin <yaoxin30@huawei.com> - 2.0.0-1
- Upgrade 2.0.0 to fix CVE-2020-35864
* Mon Aug 2 2021 Haiwei Li <lihaiwei8@huawei.com> - 1.10.0-2
- Fix complication failed due to gcc upgrade
2021-01-26 20:18:46 +08:00
* Mon Jan 11 2021 yanan li <liyanan32@huawei.com> - 1.10.0-1
- Package init