2 # - reap out which in probe scripts and drop R: which
3 # - subpackages? e.g. modules and utils
4 # - subpackage for /sbin/grub-mkfont (pulls freetype lib dep)
5 # - check where is that locale path: /boot/grub/locale and fix it or change it
7 # --enable-grub-emu-usb conflicts with --enable-grub-emu-pci, emu-pci seems experimental
8 # - to build and install the `grub-emu' debugging utility we need to re-run build with --target=emu
9 # - put grub-emu to subpackage if it is fixed
10 # - warning: Installed (but unpackaged) file(s) found:
12 # /etc/bash_completion.d/grub
15 %bcond_with grubemu # build grub-emu debugging utility
16 %bcond_without efiemu # build efiemu runtimes
18 %if "%{cc_version}" < "3.4"
19 # cc does not support:
20 # cc1: sorry, unimplemented: code model `large' not supported yet
25 # non-x86_64 arch doesn't support this
29 Summary: GRand Unified Bootloader
30 Summary(de.UTF-8): GRUB2 - ein Bootloader für x86 und ppc
31 Summary(hu.UTF-8): GRUB2 - rendszerbetöltő x86 és ppc gépekhez
32 Summary(pl.UTF-8): GRUB2 - bootloader dla x86 i ppc
33 Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
39 Source0: http://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
40 # Source0-md5: 27e360b951f006c464299d06bbd63442
42 Source2: update-grub.8
43 Source3: grub.sysconfig
44 Source4: grub-custom.cfg
45 URL: http://www.gnu.org/software/grub/
46 Patch0: pld-initrd.patch
47 Patch1: pld-sysconfdir.patch
48 Patch2: grub-garbage.patch
49 Patch3: grub-shelllib.patch
50 Patch4: grub-install.in.patch
51 Patch5: grub-lvmdevice.patch
52 Patch6: pld-mkconfigdir.patch
53 Patch7: grub-mkconfig-diagnostics.patch
55 Patch9: %{name}-awk.patch
57 BuildRequires: autoconf >= 2.53
58 BuildRequires: automake >= 1:1.11.1-1
60 BuildRequires: freetype-devel
62 BuildRequires: gettext-devel
63 BuildRequires: help2man
64 BuildRequires: libtool
65 BuildRequires: texinfo
67 BuildRequires: /usr/lib/libc.so
68 %if "%{pld_release}" == "ac"
69 BuildRequires: libgcc32
71 BuildRequires: gcc-multilib
74 BuildRequires: ncurses-devel
75 BuildRequires: sed >= 4.0
76 BuildRequires: glibc-static
77 BuildRequires: rpm >= 4.4.9-56
78 BuildRequires: rpmbuild(macros) >= 1.213
80 Suggests: cdrkit-mkisofs
84 ExclusiveArch: %{ix86} %{x8664} ppc sparc64
85 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87 %define _sbindir /sbin
88 %define _bindir %{_sbindir}
90 %define _libexecdir %{_libdir}/grub
93 GRUB is a GPLed bootloader intended to unify bootloading across x86
94 operating systems. In addition to loading the Linux and *BSD kernels,
95 it implements the Multiboot standard, which allows for flexible
96 loading of multiple boot images (needed for modular kernels such as
99 GRUB 2 is derived from PUPA which was a research project to
100 investigate the next generation of GRUB. GRUB 2 has been rewritten
101 from scratch to clean up everything for modularity and portability.
103 GRUB 2 targets at the following goals:
104 - Scripting support, such as conditionals, loops, variables and
106 - Graphical interface.
107 - Dynamic loading of modules in order to extend itself at the run time
108 rather than at the build time.
109 - Portability for various architectures.
110 - Internationalization. This includes support for non-ASCII character
111 code, message catalogs like gettext, fonts, graphics console, and so
113 - Real memory management, to make GNU GRUB more extensible.
114 - Modular, hierarchical, object-oriented framework for file systems,
115 files, devices, drives, terminals, commands, partition tables and OS
117 - Cross-platform installation which allows for installing GRUB from a
118 different architecture.
119 - Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
120 - Fix design mistakes in GRUB Legacy, which could not be solved for
121 backward-compatibility, such as the way of numbering partitions.
123 %description -l de.UTF-8
124 GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
125 Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
126 läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
128 GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
129 und wird unter der GPL vertrieben. Aufgrund seiner höheren
130 Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
131 traditionellen Boot-Loader LILO.
133 %description -l hu.UTF-8
134 GRUB egy GPL liszenszű rendszerbetöltő. Linux és *BSD kernelek
135 betöltése mellett támogatja a Multiboot standard-ot, amely lehetővé
136 teszi boot képek betöltését (moduláris kerneleknek kell, mint pl. a
139 GRUB2 céljai a következők:
140 - szkriptelés támogatása, úgymint feltételek, ciklusok, változók,
143 - modulok dinamikus betöltése futási időben
144 - hordozhatóság több architektúrára
145 - többnyelvűség: nem-ASCII karakterek támogatása, üzenetkatalógusok,
146 mint gettext, betűtípusok, grafikus konzolon, és így tovább
147 - valós memória kezelés, amellyel még bővíthetőbbé tehetjük
148 - moduláris, hierarchikus, objektum-orientált keretrendszer
149 fájlrendszerekhez, fájlokhoz, eszközökhöz, meghajtókhoz,
150 terminálokhoz, parancsokhoz, partíciós táblákhoz és OS betöltőkhöz
152 %description -l es.UTF-8
153 Éste es GRUB - Grand Unified Boot Loader - un administrador de
154 inicialización capaz de entrar en la mayoría de los sistemas
155 operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
156 también en la mayoría de los sistemas operacionales comerciales para
159 El administrador GRUB puede ser una buena alternativa a LILO, para
160 usuarios conmás experiencia y que deseen obtener más recursos de su
161 cargador de inicialización (boot loader).
163 %description -l pl.UTF-8
164 GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
165 procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
166 Linuksa i *BSD: posiada również implementacje standardu Multiboot,
167 który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
168 (czego wymagają modułowe jądra, takie jak GNU Hurd).
170 %description -l pt_BR.UTF-8
171 Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
172 capaz de entrar na maioria dos sistemas operacionais livres - Linux,
173 FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
174 operacionais comerciais para PC.
176 O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
177 avançados e que querem mais recursos de seu boot loader.
180 %setup -q -n grub-%{version}
193 %if "%{cc_version}" < "3.4"
194 grep -rl -- -Wno-missing-field-initializers . | xargs sed -i -e 's,-Wno-missing-field-initializers,,'
195 sed -i -e '/video_mod_CFLAGS/s/$/ -Wno-error/' conf/common.rmk
199 # if gold is used then grub doesn't even boot
201 ln -s /usr/bin/ld.bfd our-ld/ld
202 export PATH=$(pwd)/our-ld:$PATH
204 cp -f /usr/share/automake/config.sub .
208 echo timestamp > stamp-h.in
210 export CFLAGS="%{rpmcflags} -Os %{?debug:-g}"
212 # mawk stalls at ./genmoddep.awk, so force gawk
217 --enable-grub-emu-usb \
218 --enable-grub-emu-sdl \
219 --enable-grub-emu-pci \
221 --%{!?with_efiemu:dis}%{?with_efiemu:en}able-efiemu \
222 TARGET_LDFLAGS=-static
227 rm -rf $RPM_BUILD_ROOT
228 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{_sysconfdir}/grub.d}
231 pkgdatadir=%{_libexecdir} \
232 pkglibdir=%{_libexecdir} \
233 DESTDIR=$RPM_BUILD_ROOT
237 # this must be after 'make install'
238 install -d $RPM_BUILD_ROOT%{_libexecdir}/locale
240 cp -a docs/grub.cfg $RPM_BUILD_ROOT%{_libexecdir}
241 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
242 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
243 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
244 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/custom.cfg
245 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
247 # deprecated. we don't need it
248 rm $RPM_BUILD_ROOT/boot/grub/update-grub_lib
250 # core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
251 touch $RPM_BUILD_ROOT%{_libexecdir}/core.img
252 touch $RPM_BUILD_ROOT%{_libexecdir}/device.map
254 # needs to be exactly 1KiB
255 # but we're ghosting it. so whom are we kidding here? :P (maybe %config it in future?)
256 dd bs=1024 if=/dev/zero count=1 of=$RPM_BUILD_ROOT%{_libexecdir}/grubenv
259 rm -rf $RPM_BUILD_ROOT
261 %post -p %{_sbindir}/postshell
262 -/usr/sbin/fix-info-dir -c %{_infodir}
264 %postun -p %{_sbindir}/postshell
265 -/usr/sbin/fix-info-dir -c %{_infodir}
267 # Note this on version upgrade
268 %triggerpostun -- %{name} < %{version}-0
269 # don't do anything on --downgrade
270 if [ $1 -le 1 ]; then
273 echo "Grub was upgraded, trying to setup it to boot sector"
274 /sbin/grub-install '(hd0)' || :
277 %defattr(644,root,root,755)
278 %doc AUTHORS ChangeLog NEWS README THANKS TODO
279 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
280 %attr(755,root,root) %{_sbindir}/grub-bin2h
281 %attr(755,root,root) %{_sbindir}/grub-editenv
282 %attr(755,root,root) %{_sbindir}/grub-fstest
283 %attr(755,root,root) %{_sbindir}/grub-kbdcomp
284 %attr(755,root,root) %{_sbindir}/grub-install
285 %attr(755,root,root) %{_sbindir}/grub-menulst2cfg
286 %attr(755,root,root) %{_sbindir}/grub-mkconfig
287 %attr(755,root,root) %{_sbindir}/grub-mkfont
288 %attr(755,root,root) %{_sbindir}/grub-mklayout
289 %attr(755,root,root) %{_sbindir}/grub-mknetdir
290 %attr(755,root,root) %{_sbindir}/grub-mkpasswd-pbkdf2
291 %attr(755,root,root) %{_sbindir}/grub-mkrelpath
292 %attr(755,root,root) %{_sbindir}/grub-mkrescue
293 %attr(755,root,root) %{_sbindir}/grub-reboot
294 %attr(755,root,root) %{_sbindir}/grub-script-check
295 %attr(755,root,root) %{_sbindir}/grub-set-default
296 %attr(755,root,root) %{_sbindir}/update-grub
297 %ifarch %{ix86} %{x8664}
298 %attr(755,root,root) %{_sbindir}/grub-mkimage
299 %{_mandir}/man1/grub-mkimage.1*
301 %attr(755,root,root) %{_sbindir}/grub-probe
302 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
303 %{_mandir}/man8/grub-probe.8*
304 %{_mandir}/man8/grub-mkdevicemap.8*
306 %{_mandir}/man1/grub-bin2h.1*
307 %{_mandir}/man1/grub-editenv.1*
308 %{_mandir}/man1/grub-fstest.1*
309 %{_mandir}/man1/grub-menulst2cfg.1*
310 %{_mandir}/man1/grub-mkfont.1*
311 %{_mandir}/man1/grub-mklayout.1*
312 %{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
313 %{_mandir}/man1/grub-mkrelpath.1*
314 %{_mandir}/man1/grub-mkrescue.1*
315 %{_mandir}/man1/grub-script-check.1*
316 %{_mandir}/man8/grub-install.8*
317 %{_mandir}/man8/grub-mkconfig.8*
318 %{_mandir}/man8/grub-mknetdir.8*
319 %{_mandir}/man8/grub-reboot.8*
320 %{_mandir}/man8/grub-set-default.8*
321 %{_mandir}/man8/update-grub.8*
323 %attr(755,root,root) %{_sbindir}/grub-emu
324 %{_mandir}/man8/grub-emu.8*
326 /lib/grub-mkconfig_lib
329 # XXX: check this locale dir location and if it is neccesaary to exist on /boot
330 %dir %{_libexecdir}/locale
331 %config(noreplace) %verify(not md5 mtime size) %{_libexecdir}/grub.cfg
336 %{_libexecdir}/efiemu*.o
339 %{_libexecdir}/kernel.img
340 %ifarch %{ix86} %{x8664} sparc sparc64
341 %{_libexecdir}/boot.img
342 %{_libexecdir}/cdboot.img
343 %{_libexecdir}/diskboot.img
344 %{_libexecdir}/lnxboot.img
345 %{_libexecdir}/pxeboot.img
348 # generated by grub at runtime
349 %ghost %{_libexecdir}/device.map
350 %ghost %{_libexecdir}/core.img
351 %ghost %{_libexecdir}/grubenv
354 %doc /lib/grub.d/README
355 %attr(755,root,root) /lib/grub.d/00_header
356 %attr(755,root,root) /lib/grub.d/10_linux
357 %attr(755,root,root) /lib/grub.d/20_linux_xen
358 %attr(755,root,root) /lib/grub.d/30_os-prober
359 %attr(755,root,root) /lib/grub.d/40_custom
360 %attr(755,root,root) /lib/grub.d/41_custom
362 %dir %attr(750,root,root) %{_sysconfdir}/grub.d
363 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/grub.d/custom.cfg
365 %ifarch %{ix86} %{x8664}
366 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
367 %attr(755,root,root) %{_sbindir}/grub-probe
368 %attr(755,root,root) %{_sbindir}/grub-setup
369 %{_mandir}/man8/grub-mkdevicemap.8*
370 %{_mandir}/man8/grub-probe.8*
371 %{_mandir}/man8/grub-setup.8*
374 %{_infodir}/grub*.info*