summaryrefslogtreecommitdiff
path: root/packaging/nnfw.spec
blob: 1f31af01449f489f427d88974a00032b46a86873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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