summaryrefslogtreecommitdiff
path: root/packaging/nnfw.spec
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/nnfw.spec')
-rw-r--r--packaging/nnfw.spec50
1 files changed, 42 insertions, 8 deletions
diff --git a/packaging/nnfw.spec b/packaging/nnfw.spec
index 3649e8e20..475fb2e81 100644
--- a/packaging/nnfw.spec
+++ b/packaging/nnfw.spec
@@ -1,12 +1,13 @@
Name: nnfw
Summary: nnfw
-Version: 0.2
+Version: 0.3
Release: 1
Group: Development
-License: Apache-2.0 and MIT
+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
@@ -27,6 +28,13 @@ 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
@@ -46,26 +54,41 @@ NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime.
%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
+%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
-%define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen
+%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
-%{build_options} make %{?jobs:-j%jobs}
+cp -v Makefile.template Makefile
+%{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
@@ -79,12 +102,16 @@ 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
-cp -rf ./tests/framework %{buildroot}%{test_install_prefix}/framework
+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}/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
+%{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}
@@ -105,6 +132,13 @@ rm -rf %{buildroot}%{test_install_prefix}/coverage-suite.tar.gz
%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,-)