]> git.ipfire.org Git - ipfire-3.x.git/blob - grub/grub.nm
Merge remote-tracking branch 'stevee/plymouth'
[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 release = 2
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/ ftp://alpha.gnu.org/gnu/grub/
24 sources = %{thisapp}.tar.xz
25
26 # Unifont
27 unifont = /usr/share/X11/fonts/misc/unifont.pcf.gz
28
29 build
30 requires
31 autoconf
32 autogen
33 automake
34 bison
35 bzip2-devel
36 dejavu-fonts-sans-fonts
37 flex
38 freetype-devel
39 gettext
40 libdevmapper-devel
41 ncurses-devel
42 zlib-devel
43 %{unifont}
44 end
45
46 prepare_cmds
47 cp -vf %{unifont} unifont.pcf.gz
48 ./autogen.sh
49
50 # Create a copy of the source tree to build
51 # an EFI enabled version of grub.
52 cp -pR . %{DIR_SRC}/%{thisapp}-efi
53 end
54
55 # As the modules contain always 32 bit code, they
56 # should be living in /usr/lib.
57 libdir = %{prefix}/lib
58
59 configure_options += \
60 --target="i386" \
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 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 all_video
95 end
96
97 install
98 cd ../%{thisapp}-efi
99 make install DESTDIR=%{BUILDROOT}
100
101 install -m 755 -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/
102 install -d %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi
103 touch %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
104 ln -svf ../boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg %{BUILDROOT}/etc/grub-efi.cfg
105 install -m 755 grub.efi %{BUILDROOT}/boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.efi
106
107 cd -
108 make install DESTDIR=%{BUILDROOT}
109
110 # Install empty configuration file.
111 mkdir -pv %{BUILDROOT}/boot/grub
112 touch %{BUILDROOT}/boot/grub/grub.cfg
113 ln -svf ../boot/grub/grub.cfg %{BUILDROOT}%{sysconfdir}/grub2.cfg
114
115 # Don't ship the default theme, replace it by our own one.
116 rm -rfv %{BUILDROOT}/boot/grub/themes/starfield \
117 %{datadir}/grub/themes
118 mkdir -pv %{BUILDROOT}/boot/grub/themes/system
119 cp -rfv %{DIR_SOURCE}/theme/* \
120 %{BUILDROOT}/boot/grub/themes/system/
121
122 # Prepare the fonts.
123 mkdir -pv %{BUILDROOT}/boot/grub/themes/system
124 pushd %{BUILDROOT}/boot/grub/themes/system/
125 %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-10.pf2 -s 10 \
126 %{datadir}/fonts/dejavu/DejaVuSans.ttf
127 %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-12.pf2 -s 12 \
128 %{datadir}/fonts/dejavu/DejaVuSans.ttf
129 %{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-Bold-14.pf2 \
130 -s 14 %{datadir}/fonts/dejavu/DejaVuSans-Bold.ttf
131 popd
132 end
133
134 debuginfo_strict_build_id = false
135 end
136
137 quality-agent
138 whitelist_nx
139 /usr/bin/*|/usr/sbin/*
140 end
141 end
142
143 packages
144 package %{name}
145 requires
146 gettext
147 os-prober
148 system-logos >= 2
149 end
150
151 configfiles
152 /boot/grub/grub.cfg
153 /etc/default/grub
154 end
155 end
156
157 package %{name}-efi
158 description
159 EFI version of GRUB, the Grand Unified Boot Loader.
160 end
161 summary = %{description}
162
163 requires += grub = %{thisver}
164
165 configfiles
166 /boot/efi/EFI/%{DISTRO_SNAME}/grub-efi/grub.cfg
167 end
168
169 files
170 /boot/efi
171 /etc/grub-efi.cfg
172 /usr/lib/grub/i386-efi
173 end
174 end
175
176 package %{name}-debuginfo
177 template DEBUGINFO
178 end
179 end