]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - grub/grub.nm
0d9166d3084c6202e21ab16878b6d10e41bb4f2e
[people/ms/ipfire-3.x.git] / grub / grub.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = grub
7 version = 2.00
8 prerelease = beta5
9 release = 0.2.%{prerelease}
10 thisapp = %{name}-%{version}~%{prerelease}
11 sup_arches = x86_64 i686
12
13 groups = System/Boot
14 url = http://www.gnu.org/software/grub/
15 license = GPLv2+
16 summary = Grand Unified Boot Loader.
17
18 description
19 GRUB (Grand Unified Boot Loader) is an experimental boot loader
20 capable of booting into most free operating systems - Linux, FreeBSD,
21 NetBSD, GNU Mach, and others as well as most commercial operating
22 systems.
23 end
24
25 source_dl = http://ftp.gnu.org/gnu/grub/ ftp://alpha.gnu.org/gnu/grub/
26 sources = %{thisapp}.tar.xz
27
28 build
29 requires
30 autoconf
31 autogen
32 automake
33 bison
34 bzip2-devel
35 flex
36 freetype-devel
37 gettext
38 libdevmapper-devel
39 ncurses-devel
40 zlib-devel
41 end
42
43 prepare_cmds
44 # Create a copy of the source tree to build
45 # an EFI enabled version of grub.
46 cp -pR . %{DIR_SRC}/%{thisapp}-efi
47 end
48
49 # As the modules contain always 32 bit code, they
50 # should be living in /usr/lib.
51 libdir = %{prefix}/lib
52
53 configure_options += \
54 --target="i386" \
55 --datadir=%{libdir} \
56 --with-platform=pc \
57 --program-transform-name=s,grub,grub, \
58 --disable-werror \
59 CFLAGS="$(echo %{CFLAGS} | sed \
60 -e 's/-fstack-protector//g' \
61 -e 's/--param=ssp-buffer-size=4//g' \
62 -e 's/-mregparm=3/-mregparm=4/g' \
63 -e 's/-fexceptions//g' \
64 -e 's/-m64//g' \
65 -e 's/-fasynchronous-unwind-tables//g' )"
66
67 build_cmds
68 cd ../%{thisapp}-efi
69 ./configure \
70 %{configure_options} \
71 --with-platform=efi \
72 CFLAGS="$(echo %{CFLAGS} | sed \
73 -e 's/-O.//g' \
74 -e 's/-fstack-protector//g' \
75 -e 's/--param=ssp-buffer-size=4//g' \
76 -e 's/-mregparm=3/-mregparm=4/g' \
77 -e 's/-fexceptions//g' \
78 -e 's/-m64//g' \
79 -e 's/-fasynchronous-unwind-tables//g' )"
80
81 make %{PARALLELISMFLAGS}
82
83 ./grub-mkimage \
84 -O i386-efi \
85 -p /EFI/%{DISTRO_SNAME}/grub-efi \
86 -o grub.efi \
87 -d grub-core part_gpt hfsplus fat ext2 btrfs normal chain \
88 boot configfile linux appleldr minicmd loadbios reboot halt \
89 search font gfxterm echo video efi_gop efi_uga
90 end
91
92 install
93 cd ../%{thisapp}-efi
94 make install DESTDIR=%{BUILDROOT}
95
96 install -m 755 -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/
97 install -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi
98 touch %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
99 ln -svf ../boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg %{BUILDROOT}/etc/grub-efi.cfg
100 install -m 755 grub.efi %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.efi
101
102 cd -
103 make install DESTDIR=%{BUILDROOT}
104
105 # Install empty configuration file.
106 mkdir -pv %{BUILDROOT}/boot/grub
107 touch %{BUILDROOT}/boot/grub/grub.cfg
108 ln -svf ../boot/grub/grub.cfg %{BUILDROOT}%{sysconfdir}/grub2.cfg
109 end
110
111 debuginfo_strict_build_id = false
112 end
113
114 quality-agent
115 whitelist_nx
116 /usr/bin/*|/usr/sbin/*
117 end
118 end
119
120 packages
121 package %{name}
122 requires
123 gettext
124 os-prober
125 /usr/share/X11/fonts/misc/unifont.pcf.gz
126 system-logos
127 end
128
129 configfiles
130 /boot/grub/grub.cfg
131 /etc/default/grub
132 end
133
134 # Generate grub compatible font for graphical boot menu
135 # This only converts Latin-1, Latin Extended A+B, Arrows, Box and Block characters
136 script postin
137 /usr/bin/grub-mkfont --output /boot/grub/unifont.pf2 \
138 --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f \
139 /usr/share/X11/fonts/misc/unifont.pcf.gz
140 end
141 end
142
143 package %{name}-efi
144 description
145 EFI version of GRUB, the Grand Unified Boot Loader.
146 end
147 summary = %{description}
148
149 requires += grub = %{thisver}
150
151 configfiles
152 /boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
153 end
154
155 files
156 /boot/efi
157 /etc/grub-efi.cfg
158 end
159 end
160
161 package %{name}-debuginfo
162 template DEBUGINFO
163 end
164 end