diff options
author | Yongjoo Ahn <yongjoo1.ahn@samsung.com> | 2024-01-03 15:10:06 +0900 |
---|---|---|
committer | Yongjoo Ahn <yongjoo1.ahn@samsung.com> | 2024-01-04 14:22:47 +0900 |
commit | 398217dbff33ed6846e1668067739258d5ead2ff (patch) | |
tree | dca2d4e3a208c730c639652913d19f981b256977 | |
parent | 0100f6a5779831fa7a651e4b67ef389a8752bd9b (diff) | |
download | flatbuffers-accepted/tizen_unified.tar.gz flatbuffers-accepted/tizen_unified.tar.bz2 flatbuffers-accepted/tizen_unified.zip |
[packaging] Add rpm spec and other files to support Tizen packagingtizen_9.0_m2_releaseaccepted/tizen/unified/riscv/20240106.074919accepted/tizen/unified/dev/20240620.010701accepted/tizen/unified/20240105.105457accepted/tizen/9.0/unified/20241031.000358tizen_9.0tizensandbox/anyj0527/v23.5.26accepted/tizen_unified_riscvaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
- Let the flatbuffers and flatbuffers-devel packages built by tizen GBS
Change-Id: Ib27a78816d99278c4167f33e532adaa03015cc2c
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
-rw-r--r-- | packaging/flatbuffers.manifest | 5 | ||||
-rw-r--r-- | packaging/flatbuffers.pc.in | 5 | ||||
-rw-r--r-- | packaging/flatbuffers.spec | 108 |
3 files changed, 118 insertions, 0 deletions
diff --git a/packaging/flatbuffers.manifest b/packaging/flatbuffers.manifest new file mode 100644 index 00000000..017d22d3 --- /dev/null +++ b/packaging/flatbuffers.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/packaging/flatbuffers.pc.in b/packaging/flatbuffers.pc.in new file mode 100644 index 00000000..50db13fd --- /dev/null +++ b/packaging/flatbuffers.pc.in @@ -0,0 +1,5 @@ +Name: flatbuffers +Description: memory efficient serialization library +Version: @version@ +Libs: -L@libdir@ -lflatbuffers +Cflags: -I@includedir@ diff --git a/packaging/flatbuffers.spec b/packaging/flatbuffers.spec new file mode 100644 index 00000000..92b9223e --- /dev/null +++ b/packaging/flatbuffers.spec @@ -0,0 +1,108 @@ +Name: flatbuffers +Summary: cross platform serialization library +Version: 23.5.26 +Release: 1%{?dist} +Group: Development/Libraries +Packager: Yongjoo Ahn <yongjoo1.ahn@samsung.com> +License: Apache-2.0 +Source0: %{name}-%{version}.tar.gz +Source1: %{name}.manifest + +BuildRequires: cmake +BuildRequires: sed +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description +FlatBuffers is a cross platform serialization library architected for maximum +memory efficiency. It allows you to directly access serialized data without +parsing/unpacking it first, while still having great forwards/backwards +compatibility. + +%package devel +Summary: Development package to use flatbuffers +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +%description devel +This package provides headers and other miscellaneous files required to use flatbuffers. + +%package python +Summary: Python subpackage to use flatbuffers +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: python3-devel +%description python +This package provides flatbuffers python API. + +%prep +%setup -q +cp %{SOURCE1} . + +%build +export CFLAGS+=" -fno-lto" +export CXXFLAGS+=" -fno-lto" +pushd python +export VERSION="23.5.26" +%{_bindir}/python3 setup.py build +popd + +# flatbuffers build occasionally fails when using -j${BUILD_THREADS} with an error similar to: +# /mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:17: error: 'MyGame' has not been declared +# /mnt/source/flatbuffers/flatbuffers-1.6.0/samples/sample_binary.cpp:19:25: error: 'Sample' is not a namespace-name +# ... +# Disabling build tests gets rid of this flakiness and makes the compilation faster. +%{cmake} \ + -DFLATBUFFERS_INSTALL=ON \ + -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DFLATBUFFERS_BUILD_TESTS=OFF \ + -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \ + -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ + -DCMAKE_INSTALL_BINDIR=%{_bindir} \ + -DFB_CMAKE_DIR=%{_libdir}/cmake \ + -DCMAKE_BUILD_TYPE=Release . +%{__make} %{?_smp_mflags} + +%install +%{__make} DESTDIR=%{?buildroot:%{buildroot}} install +install -D -m 644 packaging/%{name}.pc.in %{buildroot}%{_libdir}/pkgconfig/%{name}.pc +sed -i 's#@version@#%{version}#g' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc +sed -i 's#@libdir@#%{_libdir}#g' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc +sed -i 's#@includedir@#%{_includedir}#g' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc +mkdir -p %{buildroot}/%{python3_sitelib}/flatbuffers +pushd python +export VERSION="23.5.26" +%{_bindir}/python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} +rm -r %{buildroot}/%{python3_sitelib}/*.egg-info +rm -r %{buildroot}/%{python3_sitelib}/flatbuffers/__pycache__ +popd + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%manifest %{name}.manifest +%license LICENSE +%{_libdir}/libflatbuffers.so.* + +%files devel +%defattr(-,root,root,-) +%{_bindir}/flatc +%{_includedir}/flatbuffers +%{_libdir}/libflatbuffers.a +%{_libdir}/cmake/flatbuffers/* +%{_libdir}/libflatbuffers.so +%{_libdir}/pkgconfig/flatbuffers.pc + +%files python +%defattr(-,root,root,-) +%manifest %{name}.manifest +%license LICENSE +%{python3_sitelib}/flatbuffers/ + +%changelog +* Wed Jan 01 2024 Yongjoo Ahn <yongjoo1.ahn@samsung.com> +- Release of 23.5.26 + |