]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - grub/grub.nm
Merge remote-tracking branch 'arne_f/automake'
[people/stevee/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 = 5
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 --sbindir=/sbin \
60 --datadir=%{libdir} \
61 --with-platform=pc \
62 --program-transform-name=s,grub,grub, \
63 --disable-werror \
64 CFLAGS="$(echo %{CFLAGS} | sed \
65 -e 's/-fstack-protector//g' \
66 -e 's/--param=ssp-buffer-size=4//g' \
67 -e 's/-mregparm=3/-mregparm=4/g' \
68 -e 's/-fexceptions//g' \
69 -e 's/-m64//g' \
70 -e 's/-fasynchronous-unwind-tables//g' )"
71
72 build_cmds
73 cd ../%{thisapp}-efi
74 ./configure \
75 %{configure_options} \
76 --with-platform=efi \
77 --program-transform-name=s,grub,grub-efi, \
78 CFLAGS="$(echo %{CFLAGS} | sed \
79 -e 's/-O.//g' \
80 -e 's/-fstack-protector//g' \
81 -e 's/--param=ssp-buffer-size=4//g' \
82 -e 's/-mregparm=3/-mregparm=4/g' \
83 -e 's/-fexceptions//g' \
84 -e 's/-m64//g' \
85 -e 's/-fasynchronous-unwind-tables//g' )"
86
87 make %{PARALLELISMFLAGS}
88
89 ./grub-mkimage \
90 -O i386-efi \
91 -p /EFI/%{DISTRO_SNAME}/grub-efi \
92 -o grub.efi \
93 -d grub-core part_gpt hfsplus fat ext2 btrfs normal chain \
94 boot configfile linux appleldr minicmd loadbios reboot halt \
95 search font gfxterm echo video efi_gop efi_uga
96 end
97
98 install
99 cd ../%{thisapp}-efi
100 make install DESTDIR=%{BUILDROOT}
101
102 mv -v %{BUILDROOT}/etc/bash_completion.d/grub{,-efi}
103 sed -e "s,grub/grub-mkconfig_lib,grub-efi/grub-mkconfig_lib," \
104 -i %{BUILDROOT}/sbin/grub-efi-mkconfig
105
106 install -m 755 -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/
107 install -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi
108 touch %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
109 ln -svf ../boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg %{BUILDROOT}/etc/grub-efi.cfg
110 install -m 755 grub.efi %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.efi
111
112 cd -
113 make install DESTDIR=%{BUILDROOT}
114
115 # Install theme file
116 install -m 0744 %{DIR_SOURCE}/05_theme %{BUILDROOT}/etc/grub.d/
117
118 # Install splash background
119 mkdir -pv %{BUILDROOT}/boot/grub
120 install %{DIR_SOURCE}/splash.png %{BUILDROOT}/boot/grub
121
122 # Install empty configuration file.
123 touch %{BUILDROOT}/boot/grub/grub.cfg
124 end
125 end
126
127 quality-agent
128 whitelist_nx
129 /sbin/*|/usr/bin/*
130 end
131 end
132
133 packages
134 package %{name}
135 requires
136 gettext
137 os-prober
138 /usr/share/X11/fonts/misc/unifont.pcf.gz
139 end
140
141 configfiles
142 /boot/grub/grub.cfg
143 /etc/default/grub
144 end
145
146 # Generate grub compatible font for graphical boot menu
147 # This only converts Latin-1, Latin Extended A+B, Arrows, Box and Block characters
148 script postin
149 /usr/bin/grub-mkfont --output /boot/grub/unifont.pf2 \
150 --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f \
151 /usr/share/X11/fonts/misc/unifont.pcf.gz
152 end
153 end
154
155 package %{name}-efi
156 description
157 EFI version of GRUB, the Grand Unified Boot Loader.
158 end
159 summary = %{description}
160
161 requires += grub = %{thisver}
162
163 configfiles
164 /boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
165 end
166
167 files
168 /boot/efi
169 /etc/bash_completion.d/grub-efi
170 /etc/grub-efi.cfg
171 /sbin/grub-efi-*
172 /usr/bin/grub-efi-*
173 /usr/lib/grub-efi
174 end
175 end
176
177 package %{name}-debuginfo
178 template DEBUGINFO
179 end
180 end