summaryrefslogtreecommitdiff
path: root/packaging/optee-os-ta-devel-rpi3.spec
blob: 50ed2305a1474c2a560419cb9d95214de6b97efc (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
%define buildplat rpi3
%define compile_flags CROSS_COMPILE="" CROSS_COMPILE64="" PLATFORM=%{buildplat} CFLAGS=-lgcc_eh CFG_LIBUTEE_TUI=n CFG_TEE_CORE_LOG_LEVEL=3 DEBUG=0
%if %{__isa_bits} == 64
%define compile_arch %{compile_flags} CFG_ARM64_core=y
%else
%define compile_arch %{compile_flags} CFG_WITH_VFP=n
%endif
%define out_dir out/arm-plat-%{buildplat}
%define out_lib_dir %{out_dir}/ta_arm%{__isa_bits}-lib
%define export_dir export-ta_arm%{__isa_bits}
%define out_export_dir opt/optee/%{export_dir}

Name:       optee-os-ta
Summary:    Userspace libraries and devkit for OpTEE OS.
Version:    2.4.0
Release:    1%{?dist}
Group:      Security/Testing
License:    BSD-2-Clause
URL:        https://github.com/OP-TEE/optee_os
Source0:    %{name}-%{version}.tar.gz
ExclusiveArch: armv6l armv7hl armv7l aarch64

Provides:   %{name}

BuildRequires: make
BuildRequires: python
BuildRequires: openssl

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

%prep
%setup -q

%build
mkdir -p %{out_dir}/%{export_dir}/mk
make %{compile_arch} %{out_lib_dir}/libutee/libutee.a %{out_lib_dir}/libmpa/libmpa.a %{out_lib_dir}/libpng/libpng.a %{out_lib_dir}/libzlib/libzlib.a %{out_lib_dir}/libutils/libutils.a %{out_dir}/%{export_dir}/mk/conf.mk 

%install
mkdir -p %{buildroot}/%{out_export_dir}/mk
mkdir -p %{buildroot}/%{out_export_dir}/lib
mkdir -p %{buildroot}/%{out_export_dir}/src
mkdir -p %{buildroot}/%{out_export_dir}/scripts
mkdir -p %{buildroot}/%{out_export_dir}/keys
mkdir -p %{buildroot}/%{out_export_dir}/host_include
mkdir -p %{buildroot}/%{out_export_dir}/include

find %{_builddir}/%{name}-%{version}/%{out_lib_dir}/ -name lib*.a | xargs cp -t %{buildroot}/%{out_export_dir}/lib

cp %{_builddir}/%{name}-%{version}/%{out_dir}/%{export_dir}/mk/conf.mk %{buildroot}/%{out_export_dir}/mk/
cp %{_builddir}/%{name}-%{version}/mk/compile.mk %{buildroot}/%{out_export_dir}/mk/
cp %{_builddir}/%{name}-%{version}/mk/subdir.mk %{buildroot}/%{out_export_dir}/mk/
cp %{_builddir}/%{name}-%{version}/mk/gcc.mk %{buildroot}/%{out_export_dir}/mk/
cp %{_builddir}/%{name}-%{version}/mk/cleandirs.mk %{buildroot}/%{out_export_dir}/mk/
cp %{_builddir}/%{name}-%{version}/ta/arch/arm/link.mk %{buildroot}/%{out_export_dir}/mk/
cp %{_builddir}/%{name}-%{version}/ta/mk/ta_dev_kit.mk %{buildroot}/%{out_export_dir}/mk/

cp %{_builddir}/%{name}-%{version}/ta/arch/arm/*.S %{buildroot}/%{out_export_dir}/src/
cp %{_builddir}/%{name}-%{version}/ta/arch/arm/user_ta_header.c %{buildroot}/%{out_export_dir}/src/

cp %{_builddir}/%{name}-%{version}/scripts/sign.py %{buildroot}/%{out_export_dir}/scripts/

cp %{_builddir}/%{name}-%{version}/keys/default_ta.pem %{buildroot}/%{out_export_dir}/keys/

cp -rf %{_builddir}/%{name}-%{version}/lib/libutee/include/*  %{buildroot}/%{out_export_dir}/host_include/
cp -rf %{_builddir}/%{name}-%{version}/lib/libmpa/include/*  %{buildroot}/%{out_export_dir}/host_include/
cp -rf %{_builddir}/%{name}-%{version}/lib/libpng/include/*  %{buildroot}/%{out_export_dir}/host_include/
cp -rf %{_builddir}/%{name}-%{version}/lib/libzlib/include/*  %{buildroot}/%{out_export_dir}/host_include/

cp -rf %{buildroot}/%{out_export_dir}/host_include/*  %{buildroot}/%{out_export_dir}/include/
cp -rf %{_builddir}/%{name}-%{version}/lib/libutils/ext/include/*  %{buildroot}/%{out_export_dir}/include/
cp -rf %{_builddir}/%{name}-%{version}/lib/libutils/isoc/include/*  %{buildroot}/%{out_export_dir}/include/

%clean

%files
/%{out_export_dir}