Name: nnfw Summary: nnfw Version: 0.3 Release: 1 Group: Development License: Apache-2.0 and MIT and BSD-2-Clause Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest Source1001: flatbuffers.tar.gz %ifarch arm armv7l aarch64 BuildRequires: cmake BuildRequires: python BuildRequires: python3 BuildRequires: boost-devel BuildRequires: gtest-devel BuildRequires: tensorflow-lite-devel BuildRequires: libarmcl-devel %endif Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig %description nnfw is a high-performance, on-device neural network framework for Tizen %{!?build_type: %define build_type Release} %package devel Summary: NNFW Devel Package Requires: nnfw %description devel NNFW devel package. %package test Summary: NNFW Test Requires: nnfw %description test NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime. %define test_install_prefix /opt/usr/nnfw-test %ifarch %{arm} %define target_arch armv7l %endif %ifarch x86_64 %define target_arch x86_64 %endif %ifarch aarch64 %define target_arch aarch64 %endif # Execute gbs with --define "test_build 1" in case that you need to test with environment variable %{!?test_build: %define test_build 0} %{!?coverage_build: %define coverage_build 0} %if %{coverage_build} == 1 %define build_options COVERAGE_BUILD=1 OBS_BUILD=1 BUILD_TYPE=Debug TARGET_ARCH=%{target_arch} TARGET_OS=tizen TFLITE_MAJOR_VER=1 TFLITE_MINOR_VER=13 OPTIONS=-DENVVAR_NEURUN_CONFIG=ON %else %if %{test_build} == 1 %define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen TFLITE_MAJOR_VER=1 TFLITE_MINOR_VER=13 OPTIONS=-DENVVAR_NEURUN_CONFIG=ON %else %define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen TFLITE_MAJOR_VER=1 TFLITE_MINOR_VER=13 %endif %endif %prep %setup -q cp %{SOURCE1} . mkdir ./externals cp %{SOURCE1001} ./externals/. cd ./externals tar -xf %{SOURCE1001} %build %ifarch arm armv7l aarch64 cp -v Makefile.template Makefile chmod +x ./nnfw chmod +x ./tests/nnapi/nnapi_test_generator/android-p/test_generator.py %{build_options} make %{?jobs:-j%jobs} all %endif %install %ifarch arm armv7l aarch64 %{build_options} make install # copy header's for devel mkdir -p %{buildroot}%{_includedir} cp -rf runtimes/include/* %{buildroot}%{_includedir} %ifarch aarch64 mv %{buildroot}%{_prefix}/lib %{buildroot}%{_libdir} %endif %if %{coverage_build} == 0 # nnfw-test rpm(like test-suite on cross build) ## install Product mkdir -p %{buildroot}%{test_install_prefix}/Product/out mv %{buildroot}%{_prefix}/unittest %{buildroot}%{test_install_prefix}/Product/out mv %{buildroot}%{_prefix}/bin %{buildroot}%{test_install_prefix}/Product/out cp -rf %{buildroot}%{_libdir} %{buildroot}%{test_install_prefix}/Product/out rm -rf %{buildroot}%{_libdir}/pureacl ## install tests mkdir -p %{buildroot}%{test_install_prefix}/tests cp -rf ./tests/framework %{buildroot}%{test_install_prefix}/tests ## install tools mkdir -p %{buildroot}%{test_install_prefix}/tools cp -rf ./tests/scripts %{buildroot}%{test_install_prefix}/tests ## install infra mkdir -p %{buildroot}%{test_install_prefix}/infra cp -rf ./infra/scripts/ %{buildroot}%{test_install_prefix}/infra %else %{build_options} make build_coverage_suite mkdir -p %{buildroot}%{test_install_prefix} cp -rf Product/out/coverage-suite.tar.gz %{buildroot}%{test_install_prefix}/. tar -zxf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz -C %{buildroot}%{test_install_prefix} rm -rf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz %endif %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %manifest %{name}.manifest %defattr(-,root,root,-) %ifarch arm armv7l aarch64 %{_libdir}/* %exclude %{_prefix}/bin/* %exclude %{_prefix}/unittest/* %exclude %{_libdir}/debug %endif %files devel %manifest %{name}.manifest %defattr(-,root,root,-) %ifarch arm armv7l aarch64 %{_includedir}/* %endif %files test %manifest %{name}.manifest %defattr(-,root,root,-) %ifarch arm armv7l aarch64 %{test_install_prefix}/* %exclude %{_libdir}/debug %endif %changelog * Thu Mar 15 2018 Chunseok Lee - Initial spec file for nnfw