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