ee1dd6e7c8dfbcaea55ae8deb3974839bd650e6a
[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
33 %description ta
34 Trusted execution enviroment in Linux using the ARM® TrustZone® technology.
35
36 %package -n optee-os-artik710
37 Summary:    OPTEE trusted operation system.
38 Group:      Security/Testing
39
40 %description -n optee-os-artik710
41 Trusted execution enviroment in Linux using the ARM® TrustZone® technology.
42
43 %if "%{build_type}" == "DEBUG"
44 %define log_env CFG_TEE_CORE_LOG_LEVEL=4 DEBUG=1
45 %else
46 %define log_env CFG_TEE_CORE_LOG_LEVEL=0 DEBUG=0
47 %endif
48
49 %if %{__isa_bits} == 64
50 %define compile_arch CFG_ARM64_core=y
51 %else
52 %define compile_arch CFG_WITH_VFP=n
53 %endif
54
55 %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}
56
57 %define export_dir export-ta_arm%{__isa_bits}
58 %define out_export_dir opt/optee/
59
60 %prep
61 %setup -q
62
63 %build
64 make %{compile_flags} PLATFORM=rpi3
65 make %{compile_flags} PLATFORM=s5p6818 out/arm-plat-s5p6818/core/tee.bin
66
67 %install
68 cp lib/libutils/isoc/arch/arm/softfloat/COPYING.txt LICENSE.BSD-3-Clause.mod
69
70 %define buildplat rpi3
71 %define plat_dir arm-plat-%{buildplat}
72 mkdir -p %{buildroot}/boot/
73 mkdir -p %{buildroot}/%{out_export_dir}
74
75 cp -p out/%{plat_dir}/core/tee-pager.bin %{buildroot}/boot/
76 cp -p out/%{plat_dir}/core/tee.bin %{buildroot}/boot/
77 cp -rf out/%{plat_dir}/%{export_dir} %{buildroot}/%{out_export_dir}/
78
79 %define buildplat s5p6818
80 %define plat_dir arm-plat-%{buildplat}
81
82 cp -p out/%{plat_dir}/core/tee.bin %{buildroot}/boot/tee-artik.bin
83
84 %clean
85
86 %files -n optee-os-rpi3
87 %license LICENSE
88 %license LICENSE.BSD-3-Clause
89 /boot/tee-pager.bin
90 /boot/tee.bin
91
92 %files ta
93 %license LICENSE
94 %license LICENSE.BSD-3-Clause
95 %license LICENSE.BSD-3-Clause.mod
96 /%{out_export_dir}/%{export_dir}
97
98 %files -n optee-os-artik710
99 %license LICENSE
100 %license LICENSE.BSD-3-Clause
101 /boot/tee-artik.bin