packaging: change the URL information
[platform/kernel/u-boot.git] / packaging / u-boot.spec
1 Name: u-boot
2 Version: 2017.03
3 Release: 0
4 Summary: Das U-Boot - Tizen bootloader
5 Group: System/Kernel
6 License: GPL-2.0+
7 ExclusiveArch: %{arm} aarch64
8 URL: http://git.denx.de/u-boot.git
9 Source0: %{name}-%{version}.tar.bz2
10 Source1001: u_boot.manifest
11
12 BuildRequires: gcc >= 4.8
13 BuildRequires: flex
14 BuildRequires: bison
15
16 %description
17 u-boot - Tizen bootloader for Embedded boards based on ARM processor
18
19 #TODO: Describe rpm package information depending on board
20 %package -n u-boot-pkg
21 Summary: A bootloader for Embedded system
22 Group: System/Kernel
23
24 %description -n u-boot-pkg
25 A boot loader for embedded systems.
26 Das U-Boot is a cross-platform bootloader for embedded systems,
27 used as the default boot loader by several board vendors.  It is
28 intended to be easy to port and to debug, and runs on many
29 supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS,
30 and Microblaze.
31
32 %package -n u-boot-tools
33 Summary: Companion tools for Das U-Boot bootloader
34 Group: System/Kernel
35 Provides: dtc
36
37 %description -n u-boot-tools
38 This package includes the mkimage program, which allows generation of U-Boot
39 images in various formats, and the fw_printenv and fw_setenv programs to read
40 and modify U-Boot's environment.
41
42 %ifarch %{arm}
43 %global use_mmc_storage 1
44 %endif
45
46 %ifarch aarch64
47 %define tool tools-only
48 %else
49 %define tool tools
50 %endif
51
52 %prep
53 %setup -q -n %{name}-%{version}
54
55 %build
56 cp %{SOURCE1001} .
57
58 CONFIG=tizen_defconfig
59
60 make mrproper
61
62 # Build dtc
63 make HOSTCC="gcc $RPM_OPT_FLAGS" -C tools/dtc
64
65 # Set configuration
66 make $CONFIG
67
68 # Build tools
69 make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true %{tool}
70
71 %if 1%{?use_mmc_storage}
72 make HOSTCC="gcc $RPM_OPT_FLAGS" CONFIG_ENV_IS_IN_MMC=y env
73 %else
74 make HOSTCC="gcc $RPM_OPT_FLAGS" env
75 %endif
76
77 %ifarch %{arm}
78 # Build u-boot
79 export PATH="$PATH:tools:tools/dtc/"
80 make %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'`
81
82 # Prepare proper dtb image: cat u-boot-nodtb.bin multi.dtb > u-boot-multi.bin
83 chmod 755 tools/mkimage_multidtb.sh
84 mkimage_multidtb.sh u-boot-nodtb.bin
85
86 # Sign u-boot-multi.bin - output is: u-boot-mmc.bin
87 chmod 755 tools/mkimage_signed.sh
88 mkimage_signed.sh u-boot-multi.bin $CONFIG
89
90 # Generate params.bin
91 cp `find . -name "env_common.o"` copy_env_common.o
92 objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
93 tr '\0' '\n' < copy_env_common.o > default_envs.txt
94 mkenvimage -s 16384 -o params.bin default_envs.txt
95 rm copy_env_common.o default_envs.txt
96 %endif
97
98 %install
99 rm -rf %{buildroot}
100
101 # Tools installation
102 mkdir -p %{buildroot}%{_bindir}
103 install -p -m 0755 tools/mkimage %{buildroot}%{_bindir}
104 install -p -m 0755 tools/env/fw_printenv %{buildroot}%{_bindir}
105 install -p -m 0755 tools/dtc/dtc %{buildroot}%{_bindir}
106 ( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv )
107
108 # u-boot installation
109 %ifarch %{arm}
110 mkdir -p %{buildroot}/var/tmp/u-boot
111 install -d %{buildroot}/var/tmp/u-boot
112 install -m 755 u-boot.bin %{buildroot}/var/tmp/u-boot
113 install -m 755 u-boot-mmc.bin %{buildroot}/var/tmp/u-boot
114 install -m 755 params.bin %{buildroot}/var/tmp/u-boot
115 %endif
116
117 %clean
118
119 %ifarch %{arm}
120 %files
121 %manifest u_boot.manifest
122 %defattr(-,root,root,-)
123 /var/tmp/u-boot
124 %endif
125
126 %files -n u-boot-tools
127 %manifest u_boot.manifest
128 %defattr(-,root,root,-)
129 %{_bindir}/mkimage
130 %{_bindir}/fw_printenv
131 %{_bindir}/fw_setenv
132 %{_bindir}/dtc