Disable building repository with ASan extra packs.
[platform/adaptation/rpi3/arm-trusted-firmware-rpi3.git] / packaging / arm-trusted-firmware.spec
1 %define buildplat rpi3
2 %if "%{build_type}" == "DEBUG"
3 %define buildtype debug
4 %define compile_flags BUILD_STRING="" LOG_LEVEL=40 DEBUG=1 V=0 CRASH_REPORTING=1 SPD=opteed
5 %else
6 %define buildtype release
7 %define compile_flags BUILD_STRING="" LOG_LEVEL=10 DEBUG=0 V=0 CRASH_REPORTING=1 SPD=opteed
8 %endif
9
10 Name: atf-rpi3
11 Summary: Trusted firmware for Embedded boards based on ARM processor
12 Version: 2017.05
13 Release: 0
14 Group: Security/test
15 License: BSD 3-Clause
16 ExclusiveArch: aarch64
17 URL: https://github.com/linaro-swg/arm-trusted-firmware.git
18 Source0: %{name}-%{version}.tar.bz2
19
20 BuildRequires: optee-os-rpi3
21 BuildRequires: u-boot-rpi3
22 BuildRequires: u-boot-tools
23
24 Provides: optee.bin
25
26 %description
27 Trusted firmware for Embedded boards based on ARM processor
28
29 %prep
30 %setup -q -n optee-os
31
32 %build
33
34 %{?asan:/usr/bin/gcc-unforce-options}
35 # Build image
36 export CFLAGS="-O0 -gdwarf-2"
37 make %{?_smp_mflags}  BL32=/boot/tee.bin %{compile_flags} PLAT=%{buildplat} BUILD_STRING="%{release}" all
38
39 dd if=/dev/zero of=scratch bs=1c count=131072
40 cat build/%{buildplat}/%{buildtype}/bl31.bin scratch > bl31.tmp
41 dd if=bl31.tmp of=bl31.head bs=1c count=131072
42 cat bl31.head /boot/tee-pager.bin > optee.bin
43
44 rm scratch bl31.tmp bl31.head
45
46 cp /boot/spl/bcm2837-rpi-3-b.dtb .
47 cp /boot/spl/fit_spl_atf.its .
48 cp /boot/spl/u-boot-nodtb.bin .
49 cp %{_bindir}/mkimage .
50
51 %install
52 mkimage -E -f  fit_spl_atf.its u-boot.img
53 mkdir -p %{buildroot}/boot/
54 install u-boot.img %{buildroot}/boot/
55 install optee.bin %{buildroot}/boot/
56
57 %clean
58
59 %files
60 %defattr(-,root,root,-)
61 /boot/u-boot.img
62 /boot/optee.bin