packaging: u-boot*: Upgrade build required openssl version from 1.1 to 3
[platform/kernel/u-boot.git] / packaging / u-boot-visionfive2.spec
1 Name: u-boot-visionfive2
2 Version: 2022.10
3 Release: 0
4 Summary: Das U-Boot - Tizen bootloader
5 Group: System/Kernel
6 License: GPL-2.0+
7 ExclusiveArch: riscv64
8 URL: https://source.denx.de/u-boot/u-boot.git
9 Source0: u-boot-%{version}.tar.bz2
10 Source1001: u_boot_visionfive2.manifest
11
12 BuildRequires: gcc >= 6.0
13 BuildRequires: bc
14 BuildRequires: flex
15 BuildRequires: bison
16 BuildRequires: pkgconfig(openssl3)
17 BuildRequires: opensbi
18 BuildRequires: python3-devel
19 BuildRequires: swig
20 BuildRequires: python3-setuptools
21
22 %description
23 u-boot - Tizen bootloader for visionfive2 boards based
24
25 %package -n u-boot-tools
26 Summary: Companion tools for Das U-Boot bootloader
27 Group: System/Kernel
28
29 %description -n u-boot-tools
30 This package includes the mkimage program, which allows generation of U-Boot
31 images in various formats, and the fw_printenv and fw_setenv programs to read
32 and modify U-Boot's environment.
33
34 %prep
35 %setup -q -n u-boot-%{version}
36
37 %build
38 %{?asan:/usr/bin/gcc-unforce-options}
39 cp %{SOURCE1001} .
40
41 CONFIG=tizen_starfive_visionfive2_defconfig
42
43 make mrproper
44
45 # Set configuration
46 make $CONFIG
47
48 # Build tools
49 make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true tools
50
51 make HOSTCC="gcc $RPM_OPT_FLAGS" envtools
52
53 # Build Starfive SPL tool and Create SPL Image
54 cd tools/starfive/spl_tool
55 make
56 cd -
57
58 # Build u-boot
59 export PATH="$PATH:tools"
60 make OPENSBI=/platform/generic/firmware/fw_dynamic.bin %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'`
61
62 # Build SPL TOOL of StarFive
63 tools/starfive/spl_tool/spl_tool -c -f spl/u-boot-spl.bin
64
65 # Generate uboot.env
66 ./scripts/get_default_envs.sh > default_envs.txt
67 mkenvimage -s 16384 -o uboot.env default_envs.txt
68 rm default_envs.txt
69
70 # Build boot.scr
71 mkimage -A riscv -T script -C none -n "Tizen VisionFive2 Board Script" -d ./tizen/bootscript/tizen-boot-vf2.scr ./boot.scr.uimg
72
73 %install
74 rm -rf %{buildroot}
75
76 # Tools installation
77 mkdir -p %{buildroot}%{_bindir}
78 install -p -m 0755 tools/mkimage %{buildroot}%{_bindir}
79 install -p -m 0755 tools/env/fw_printenv %{buildroot}%{_bindir}
80 install -p -m 0755 scripts/dtc/dtc %{buildroot}%{_bindir}
81 ( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv )
82
83 # u-boot installation
84 mkdir -p %{buildroot}/boot
85 mkdir -p %{buildroot}/var/tmp
86 install -m 755 u-boot.itb %{buildroot}/var/tmp/
87 install -m 755 uboot.env %{buildroot}/boot/
88 install -m 755 tizen/bootscript/tizen-boot-vf2-uEnv.txt %{buildroot}/boot/uEnv.txt
89 install -m 755 boot.scr.uimg %{buildroot}/boot/
90 install -m 755 spl/u-boot-spl.bin.normal.out %{buildroot}/var/tmp/
91
92 %clean
93
94 %files
95 %manifest u_boot_visionfive2.manifest
96 %defattr(-,root,root,-)
97 /var/tmp/u-boot.itb
98 /var/tmp/u-boot-spl.bin.normal.out
99 /boot/uboot.env
100 /boot/boot.scr.uimg
101 /boot/uEnv.txt
102
103 %files -n u-boot-tools
104 %manifest u_boot_visionfive2.manifest
105 %defattr(-,root,root,-)
106 %{_bindir}/mkimage
107 %{_bindir}/fw_printenv
108 %{_bindir}/fw_setenv
109 %{_bindir}/dtc