summaryrefslogtreecommitdiff
path: root/packaging/nnfw.spec
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/nnfw.spec')
-rw-r--r--packaging/nnfw.spec105
1 files changed, 105 insertions, 0 deletions
diff --git a/packaging/nnfw.spec b/packaging/nnfw.spec
new file mode 100644
index 000000000..1f31af014
--- /dev/null
+++ b/packaging/nnfw.spec
@@ -0,0 +1,105 @@
+Name: nnfw
+Summary: nnfw
+Version: 0.1
+Release: 1
+Group: Development
+License: Apache-2.0 and MPL-2.0 and BSD-3-Clause
+
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+
+BuildRequires: cmake
+BuildRequires: boost-devel
+BuildRequires: gtest-devel
+BuildRequires: tensorflow-lite-devel
+
+%ifarch aarch64
+BuildRequires: libarmcl-devel-aarch64
+%endif
+%ifarch %{arm}
+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 test
+Summary: NNFW Test
+Requires: nnfw
+
+%description test
+NNFW test rpm. It does not depends on nnfw rpm since it contains nnfw runtime.
+
+%define install_prefix /usr
+%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
+
+%{!?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
+%else
+%define build_options OBS_BUILD=1 BUILD_TYPE=%{build_type} INSTALL_PATH=%{buildroot}%{install_prefix} TARGET_ARCH=%{target_arch} TARGET_OS=tizen
+%endif
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+
+%build
+%{build_options} make %{?jobs:-j%jobs}
+
+%install
+%{build_options} make install
+
+%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}%{install_prefix}/unittest %{buildroot}%{test_install_prefix}/Product/out
+mv %{buildroot}%{install_prefix}/bin %{buildroot}%{test_install_prefix}/Product/out
+mv %{buildroot}%{install_prefix}/lib %{buildroot}%{test_install_prefix}/Product/out
+## install tests
+cp -rf ./tests %{buildroot}%{test_install_prefix}/.
+## install tools
+mkdir -p %{buildroot}%{test_install_prefix}/tools
+cp -rf ./tools/test_driver %{buildroot}%{test_install_prefix}/tools
+%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
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{install_prefix}/lib/*
+%exclude %{install_prefix}/bin/*
+%exclude %{install_prefix}/unittest/*
+
+%files test
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{test_install_prefix}/*
+
+%changelog
+* Thu Mar 15 2018 Chunseok Lee <chunseok.lee@samsung.com>
+- Initial spec file for nnfw