]> git.ipfire.org Git - ipfire-3.x.git/blame - grub/grub.nm
grub: Fix build on x86_64.
[ipfire-3.x.git] / grub / grub.nm
CommitLineData
c36e4789 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
c36e4789
MT
4###############################################################################
5
802ea3af 6name = grub
47bdaf55 7version = 1.99
5218f081 8release = 5
dc22ea77 9sup_arches = x86_64 i686
c36e4789 10
6cec16f1 11groups = System/Boot
802ea3af
MT
12url = http://www.gnu.org/software/grub/
13license = GPLv2+
14summary = Grand Unified Boot Loader.
c36e4789 15
802ea3af 16description
dc22ea77
MT
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
c36e4789 20 systems.
802ea3af
MT
21end
22
47bdaf55 23source_dl = http://ftp.gnu.org/gnu/grub/
802ea3af
MT
24
25build
26 requires
27 autoconf
dc22ea77 28 autogen
802ea3af
MT
29 automake
30 bison
31 flex
32 freetype-devel
33 gettext
dc22ea77 34 libdevmapper-devel
802ea3af 35 ncurses-devel
802ea3af
MT
36 zlib-devel
37 end
38
dc22ea77
MT
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" \
5218f081 43 Makefile* */Makefile* \
dc22ea77
MT
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
5218f081
MT
53 # As the modules contain always 32 bit code, they
54 # should be living in /usr/lib.
55 libdir = %{prefix}/lib
56
802ea3af 57 configure_options += \
5218f081 58 --target="i386" \
47bdaf55 59 --sbindir=/sbin \
5218f081
MT
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' )"
802ea3af 71
dc22ea77
MT
72 build_cmds
73 cd ../%{thisapp}-efi
5218f081
MT
74 ./configure \
75 %{configure_options} \
dc22ea77 76 --with-platform=efi \
5218f081
MT
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
dc22ea77
MT
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
5218f081 98 install
dc22ea77 99 cd ../%{thisapp}-efi
802ea3af
MT
100 make install DESTDIR=%{BUILDROOT}
101
dc22ea77 102 mv -v %{BUILDROOT}/etc/bash_completion.d/grub{,-efi}
dc22ea77
MT
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
5218f081
MT
112 cd -
113 make install DESTDIR=%{BUILDROOT}
114
802ea3af
MT
115 # Install theme file
116 install -m 0744 %{DIR_SOURCE}/05_theme %{BUILDROOT}/etc/grub.d/
117
118 # Install splash background
47bdaf55 119 mkdir -pv %{BUILDROOT}/boot/grub
802ea3af 120 install %{DIR_SOURCE}/splash.png %{BUILDROOT}/boot/grub
2af18b56
MT
121
122 # Install empty configuration file.
123 touch %{BUILDROOT}/boot/grub/grub.cfg
802ea3af
MT
124 end
125end
126
127quality-agent
128 whitelist_nx
47bdaf55 129 /sbin/*|/usr/bin/*
802ea3af
MT
130 end
131end
132
133packages
134 package %{name}
135 requires
136 gettext
137 os-prober
47bdaf55
MT
138 /usr/share/X11/fonts/misc/unifont.pcf.gz
139 end
140
2af18b56
MT
141 configfiles
142 /boot/grub/grub.cfg
143 /etc/default/grub
144 end
145
47bdaf55
MT
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 \
dc22ea77
MT
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
802ea3af
MT
174 end
175 end
1f9bc2f0
MT
176
177 package %{name}-debuginfo
178 template DEBUGINFO
179 end
802ea3af 180end