Fix optee-os-ta dependency to openssl and python
[platform/core/security/tef-optee_os.git] / packaging / optee-os.spec
1 Name:       optee-os
2 Summary:    OpTEE OS with userspace libraries and devkit for OpTEE OS.
3 Version:    2.4.0
4 Release:    1%{?dist}
5 Group:      Security/Testing
6 License:    BSD and zlib
7 URL:        https://github.com/OP-TEE/optee_os
8 Source0:    %{name}-%{version}.tar.gz
9 ExclusiveArch: armv6l armv7hl armv7l aarch64
10
11 Provides:   tee-pager.bin
12 Provides:   tee.bin
13 Provides:   optee-os-ta
14
15 BuildRequires: make
16 BuildRequires: python
17 BuildRequires: openssl
18
19 %description
20 Trusted execution enviroment in Linux using the ARM® TrustZone® technology.
21
22 %package -n optee-os-rpi3
23 Summary:    OPTEE trusted operation system.
24 Group:      Security/Testing
25
26 %description -n optee-os-rpi3
27 Trusted execution enviroment in Linux using the ARM® TrustZone® technology.
28
29 %package ta
30 Summary:    OpTEE OS userspace libraries and devkit for OpTEE OS.
31 Group:      Security/Testing
32 Requires: python
33 Requires: openssl
34
35 %description ta
36 Trusted execution enviroment in Linux using the ARM® TrustZone® technology.
37
38 %package -n optee-os-artik710
39 Summary:    OPTEE trusted operation system.
40 Group:      Security/Testing
41
42 %description -n optee-os-artik710
43 Trusted execution enviroment in Linux using the ARM® TrustZone® technology.
44
45 %if "%{build_type}" == "DEBUG"
46 %define log_env CFG_TEE_CORE_LOG_LEVEL=4 DEBUG=1
47 %else
48 %define log_env CFG_TEE_CORE_LOG_LEVEL=0 DEBUG=0
49 %endif
50
51 %if %{__isa_bits} == 64
52 %define compile_arch CFG_ARM64_core=y
53 %else
54 %define compile_arch CFG_WITH_VFP=n
55 %endif
56
57 %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}
58
59 %define export_dir export-ta_arm%{__isa_bits}
60 %define out_export_dir opt/optee/
61
62 %prep
63 %setup -q
64
65 %build
66 %{?asan:/usr/bin/gcc-unforce-options}
67 make %{compile_flags} PLATFORM=rpi3
68 make %{compile_flags} PLATFORM=s5p6818 out/arm-plat-s5p6818/core/tee.bin
69
70 %install
71 cp lib/libutils/isoc/arch/arm/softfloat/COPYING.txt LICENSE.BSD-3-Clause.mod
72
73 %define buildplat rpi3
74 %define plat_dir arm-plat-%{buildplat}
75 mkdir -p %{buildroot}/boot/
76 mkdir -p %{buildroot}/%{out_export_dir}
77
78 cp -p out/%{plat_dir}/core/tee-pager.bin %{buildroot}/boot/
79 cp -p out/%{plat_dir}/core/tee.bin %{buildroot}/boot/
80 cp -rf out/%{plat_dir}/%{export_dir} %{buildroot}/%{out_export_dir}/
81
82 %define buildplat s5p6818
83 %define plat_dir arm-plat-%{buildplat}
84
85 cp -p out/%{plat_dir}/core/tee.bin %{buildroot}/boot/tee-artik.bin
86
87 %clean
88
89 %files -n optee-os-rpi3
90 %license LICENSE
91 %license LICENSE.BSD-3-Clause
92 /boot/tee-pager.bin
93 /boot/tee.bin
94
95 %files ta
96 %license LICENSE
97 %license LICENSE.BSD-3-Clause
98 %license LICENSE.BSD-3-Clause.mod
99 /%{out_export_dir}/%{export_dir}
100
101 %files -n optee-os-artik710
102 %license LICENSE
103 %license LICENSE.BSD-3-Clause
104 /boot/tee-artik.bin