summaryrefslogtreecommitdiff
path: root/packaging/optee-os.spec
blob: 2e66bb58a930e7796070124eba913600c302f35f (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
Name:       optee-os
Summary:    OpTEE OS with userspace libraries and devkit for OpTEE OS.
Version:    2.4.0
Release:    1%{?dist}
Group:      Security/Testing
License:    BSD and zlib
URL:        https://github.com/OP-TEE/optee_os
Source0:    %{name}-%{version}.tar.gz
ExclusiveArch: armv6l armv7hl armv7l aarch64

Provides:   tee-pager.bin
Provides:   tee.bin
Provides:   optee-os-ta

BuildRequires: make
BuildRequires: python
BuildRequires: openssl1.1

%description
Trusted execution enviroment in Linux using the ARM® TrustZone® technology.

%package -n optee-os-rpi3
Summary:    OPTEE trusted operation system.
Group:      Security/Testing

%description -n optee-os-rpi3
Trusted execution enviroment in Linux using the ARM® TrustZone® technology.

%package ta
Summary:    OpTEE OS userspace libraries and devkit for OpTEE OS.
Group:      Security/Testing
Requires:   python
Requires:   openssl1.1

%description ta
Trusted execution enviroment in Linux using the ARM® TrustZone® technology.

%package -n optee-os-artik710
Summary:    OPTEE trusted operation system.
Group:      Security/Testing

%description -n optee-os-artik710
Trusted execution enviroment in Linux using the ARM® TrustZone® technology.

%if "%{build_type}" == "DEBUG"
%define log_env CFG_TEE_CORE_LOG_LEVEL=4 DEBUG=1
%else
%define log_env CFG_TEE_CORE_LOG_LEVEL=0 DEBUG=0
%endif

%if %{__isa_bits} == 64
%define compile_arch CFG_ARM64_core=y
%else
%define compile_arch CFG_WITH_VFP=n
%endif

%define compile_flags CROSS_COMPILE="" CROSS_COMPILE64=""  CFLAGS=-lgcc_eh CFG_LIBUTEE_TUI=n CFLAGS=-lgcc_eh CFG_LIBUTEE_TUI=n %{log_env} %{compile_arch}

%define export_dir export-ta_arm%{__isa_bits}
%define out_export_dir opt/optee/

%prep
%setup -q

%build
%{?asan:/usr/bin/gcc-unforce-options}
make %{compile_flags} PLATFORM=rpi3
make %{compile_flags} PLATFORM=s5p6818 out/arm-plat-s5p6818/core/tee.bin

%install
cp lib/libutils/isoc/arch/arm/softfloat/COPYING.txt LICENSE.BSD-3-Clause.mod

%define buildplat rpi3
%define plat_dir arm-plat-%{buildplat}
mkdir -p %{buildroot}/boot/
mkdir -p %{buildroot}/%{out_export_dir}

cp -p out/%{plat_dir}/core/tee-pager.bin %{buildroot}/boot/
cp -p out/%{plat_dir}/core/tee.bin %{buildroot}/boot/
cp -rf out/%{plat_dir}/%{export_dir} %{buildroot}/%{out_export_dir}/

%define buildplat s5p6818
%define plat_dir arm-plat-%{buildplat}

cp -p out/%{plat_dir}/core/tee.bin %{buildroot}/boot/tee-artik.bin

%clean

%files -n optee-os-rpi3
%license LICENSE
%license LICENSE.BSD-3-Clause
/boot/tee-pager.bin
/boot/tee.bin

%files ta
%license LICENSE
%license LICENSE.BSD-3-Clause
%license LICENSE.BSD-3-Clause.mod
/%{out_export_dir}/%{export_dir}

%files -n optee-os-artik710
%license LICENSE
%license LICENSE.BSD-3-Clause
/boot/tee-artik.bin