1 | # |
---|
2 | # GNU GRUB, the GRand Unified Bootloader |
---|
3 | # |
---|
4 | # This configuration file configure's, make's and install's GRUB2. |
---|
5 | # |
---|
6 | |
---|
7 | %define grub2_platform_supported = 1 |
---|
8 | |
---|
9 | %ifos darwin |
---|
10 | %undefine grub2_platform_supported |
---|
11 | %{echo "Darwin does not support Grub2 compilation by default."} |
---|
12 | %{echo "If you need Grub2 on Darwin, please install objconv"} |
---|
13 | %{echo "and enable it by removing '%undefine grub2_platform_supported' above"} |
---|
14 | %endif |
---|
15 | |
---|
16 | %if %{defined grub2_platform_supported} |
---|
17 | |
---|
18 | %if %{release} == %{nil} |
---|
19 | %define release 1 |
---|
20 | %endif |
---|
21 | |
---|
22 | Name: grub2-%{grub2_version}-%{_host}-%{release} |
---|
23 | Summary: GNU GRUB, the GRand Unified Bootloader v%{grub2_version} for target %{_target} on host %{_host} |
---|
24 | Version: %{grub2_version} |
---|
25 | Release: %{release} |
---|
26 | URL: https://www.gnu.org/software/grub/index.html |
---|
27 | |
---|
28 | # |
---|
29 | # Source |
---|
30 | # |
---|
31 | %source set grub2 https://ftp.gnu.org/gnu/grub/grub-%{grub2_version}.tar.xz |
---|
32 | |
---|
33 | # |
---|
34 | # Prepare the source code. |
---|
35 | # |
---|
36 | %prep |
---|
37 | build_top=$(pwd) |
---|
38 | |
---|
39 | %source setup grub2 -q -n grub-%{grub2_version} |
---|
40 | |
---|
41 | cd ${build_top} |
---|
42 | |
---|
43 | %build |
---|
44 | build_top=$(pwd) |
---|
45 | |
---|
46 | cd grub-%{grub2_version} |
---|
47 | |
---|
48 | %{host_build_flags} |
---|
49 | |
---|
50 | ./configure \ |
---|
51 | --build=%{_build} --host=%{_host} \ |
---|
52 | --verbose \ |
---|
53 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
54 | --exec-prefix=%{_exec_prefix} \ |
---|
55 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
56 | --mandir=%{_mandir} --infodir=%{_infodir} \ |
---|
57 | --with-platform=%{grub2_platform} \ |
---|
58 | --target=%{grub2_target} \ |
---|
59 | --disable-libzfs # broken on FreeBSD and not needed at all |
---|
60 | |
---|
61 | %{__make} %{?_smp_mflags} all |
---|
62 | |
---|
63 | cd ${build_top} |
---|
64 | |
---|
65 | %install |
---|
66 | build_top=$(pwd) |
---|
67 | |
---|
68 | rm -rf $SB_BUILD_ROOT |
---|
69 | |
---|
70 | cd grub-%{grub2_version} |
---|
71 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
72 | |
---|
73 | cd ${build_top} |
---|
74 | |
---|
75 | %endif |
---|