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
56 BuildRequires: autoconf >= 2.53
57 BuildRequires: automake >= 1:1.11.1-1
59 BuildRequires: freetype-devel
61 BuildRequires: gettext-devel
62 BuildRequires: help2man
63 BuildRequires: libtool
64 BuildRequires: texinfo
66 BuildRequires: /usr/lib/libc.so
68 %if "%{pld_release}" == "ac"
69 BuildRequires: libgcc32
71 BuildRequires: gcc-multilib
73 BuildRequires: ncurses-devel
74 BuildRequires: sed >= 4.0
75 BuildRequires: glibc-static
76 BuildRequires: rpm >= 4.4.9-56
77 BuildRequires: rpmbuild(macros) >= 1.213
79 Suggests: cdrkit-mkisofs
83 ExclusiveArch: %{ix86} %{x8664} ppc sparc64
84 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86 %define _sbindir /sbin
87 %define _bindir %{_sbindir}
89 %define _libexecdir %{_libdir}/grub
92 #%%define filterout_ld -Wl,--no-copy-dt-needed-entries
95 GRUB is a GPLed bootloader intended to unify bootloading across x86
96 operating systems. In addition to loading the Linux and *BSD kernels,
97 it implements the Multiboot standard, which allows for flexible
98 loading of multiple boot images (needed for modular kernels such as
101 GRUB 2 is derived from PUPA which was a research project to
102 investigate the next generation of GRUB. GRUB 2 has been rewritten
103 from scratch to clean up everything for modularity and portability.
105 GRUB 2 targets at the following goals:
106 - Scripting support, such as conditionals, loops, variables and
108 - Graphical interface.
109 - Dynamic loading of modules in order to extend itself at the run time
110 rather than at the build time.
111 - Portability for various architectures.
112 - Internationalization. This includes support for non-ASCII character
113 code, message catalogs like gettext, fonts, graphics console, and so
115 - Real memory management, to make GNU GRUB more extensible.
116 - Modular, hierarchical, object-oriented framework for file systems,
117 files, devices, drives, terminals, commands, partition tables and OS
119 - Cross-platform installation which allows for installing GRUB from a
120 different architecture.
121 - Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
122 - Fix design mistakes in GRUB Legacy, which could not be solved for
123 backward-compatibility, such as the way of numbering partitions.
125 %description -l de.UTF-8
126 GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
127 Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
128 läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
130 GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
131 und wird unter der GPL vertrieben. Aufgrund seiner höheren
132 Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
133 traditionellen Boot-Loader LILO.
135 %description -l hu.UTF-8
136 GRUB egy GPL liszenszű rendszerbetöltő. Linux és *BSD kernelek
137 betöltése mellett támogatja a Multiboot standard-ot, amely lehetővé
138 teszi boot képek betöltését (moduláris kerneleknek kell, mint pl. a
141 GRUB2 céljai a következők:
142 - szkriptelés támogatása, úgymint feltételek, ciklusok, változók,
145 - modulok dinamikus betöltése futási időben
146 - hordozhatóság több architektúrára
147 - többnyelvűség: nem-ASCII karakterek támogatása, üzenetkatalógusok,
148 mint gettext, betűtípusok, grafikus konzolon, és így tovább
149 - valós memória kezelés, amellyel még bővíthetőbbé tehetjük
150 - moduláris, hierarchikus, objektum-orientált keretrendszer
151 fájlrendszerekhez, fájlokhoz, eszközökhöz, meghajtókhoz,
152 terminálokhoz, parancsokhoz, partíciós táblákhoz és OS betöltőkhöz
154 %description -l es.UTF-8
155 Éste es GRUB - Grand Unified Boot Loader - un administrador de
156 inicialización capaz de entrar en la mayoría de los sistemas
157 operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
158 también en la mayoría de los sistemas operacionales comerciales para
161 El administrador GRUB puede ser una buena alternativa a LILO, para
162 usuarios conmás experiencia y que deseen obtener más recursos de su
163 cargador de inicialización (boot loader).
165 %description -l pl.UTF-8
166 GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
167 procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
168 Linuksa i *BSD: posiada również implementacje standardu Multiboot,
169 który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
170 (czego wymagają modułowe jądra, takie jak GNU Hurd).
172 %description -l pt_BR.UTF-8
173 Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
174 capaz de entrar na maioria dos sistemas operacionais livres - Linux,
175 FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
176 operacionais comerciais para PC.
178 O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
179 avançados e que querem mais recursos de seu boot loader.
182 %setup -q -n grub-%{version}
194 %if "%{cc_version}" < "3.4"
195 grep -rl -- -Wno-missing-field-initializers . | xargs sed -i -e 's,-Wno-missing-field-initializers,,'
196 sed -i -e '/video_mod_CFLAGS/s/$/ -Wno-error/' conf/common.rmk
200 cp -f /usr/share/automake/config.sub .
204 echo timestamp > stamp-h.in
206 export CFLAGS="%{rpmcflags} -Os %{?debug:-g}"
208 # mawk stalls at ./genmoddep.awk, so force gawk
213 --enable-grub-emu-usb \
214 --enable-grub-emu-sdl \
215 --enable-grub-emu-pci \
217 --%{!?with_efiemu:dis}%{?with_efiemu:en}able-efiemu \
218 TARGET_LDFLAGS=-static
223 rm -rf $RPM_BUILD_ROOT
224 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{_sysconfdir}/grub.d}
227 pkgdatadir=%{_libexecdir} \
228 pkglibdir=%{_libexecdir} \
229 DESTDIR=$RPM_BUILD_ROOT
233 # this must be after 'make install'
234 install -d $RPM_BUILD_ROOT%{_libexecdir}/locale
236 cp -a docs/grub.cfg $RPM_BUILD_ROOT%{_libexecdir}
237 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
238 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
239 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
240 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/custom.cfg
241 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
243 # deprecated. we don't need it
244 rm $RPM_BUILD_ROOT/boot/grub/update-grub_lib
246 # core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
247 touch $RPM_BUILD_ROOT%{_libexecdir}/core.img
248 touch $RPM_BUILD_ROOT%{_libexecdir}/device.map
250 # needs to be exactly 1KiB
251 # but we're ghosting it. so whom are we kidding here? :P (maybe %config it in future?)
252 dd bs=1024 if=/dev/zero count=1 of=$RPM_BUILD_ROOT%{_libexecdir}/grubenv
255 rm -rf $RPM_BUILD_ROOT
257 %post -p %{_sbindir}/postshell
258 -/usr/sbin/fix-info-dir -c %{_infodir}
260 %postun -p %{_sbindir}/postshell
261 -/usr/sbin/fix-info-dir -c %{_infodir}
263 # Note this on version upgrade
264 %triggerpostun -- %{name} < %{version}-0
265 # don't do anything on --downgrade
266 if [ $1 -le 1 ]; then
269 echo "Grub was upgraded, trying to setup it to boot sector"
270 /sbin/grub-install '(hd0)' || :
273 %defattr(644,root,root,755)
274 %doc AUTHORS ChangeLog NEWS README THANKS TODO
275 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
276 %attr(755,root,root) %{_sbindir}/grub-bin2h
277 %attr(755,root,root) %{_sbindir}/grub-editenv
278 %attr(755,root,root) %{_sbindir}/grub-fstest
279 %attr(755,root,root) %{_sbindir}/grub-kbdcomp
280 %attr(755,root,root) %{_sbindir}/grub-install
281 %attr(755,root,root) %{_sbindir}/grub-menulst2cfg
282 %attr(755,root,root) %{_sbindir}/grub-mkconfig
283 %attr(755,root,root) %{_sbindir}/grub-mkfont
284 %attr(755,root,root) %{_sbindir}/grub-mklayout
285 %attr(755,root,root) %{_sbindir}/grub-mknetdir
286 %attr(755,root,root) %{_sbindir}/grub-mkpasswd-pbkdf2
287 %attr(755,root,root) %{_sbindir}/grub-mkrelpath
288 %attr(755,root,root) %{_sbindir}/grub-mkrescue
289 %attr(755,root,root) %{_sbindir}/grub-reboot
290 %attr(755,root,root) %{_sbindir}/grub-script-check
291 %attr(755,root,root) %{_sbindir}/grub-set-default
292 %attr(755,root,root) %{_sbindir}/update-grub
293 %ifarch %{ix86} %{x8664}
294 %attr(755,root,root) %{_sbindir}/grub-mkimage
295 %{_mandir}/man1/grub-mkimage.1*
297 %attr(755,root,root) %{_sbindir}/grub-probe
298 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
299 %{_mandir}/man8/grub-probe.8*
300 %{_mandir}/man8/grub-mkdevicemap.8*
302 %{_mandir}/man1/grub-bin2h.1*
303 %{_mandir}/man1/grub-editenv.1*
304 %{_mandir}/man1/grub-fstest.1*
305 %{_mandir}/man1/grub-menulst2cfg.1*
306 %{_mandir}/man1/grub-mkfont.1*
307 %{_mandir}/man1/grub-mklayout.1*
308 %{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
309 %{_mandir}/man1/grub-mkrelpath.1*
310 %{_mandir}/man1/grub-mkrescue.1*
311 %{_mandir}/man1/grub-script-check.1*
312 %{_mandir}/man8/grub-install.8*
313 %{_mandir}/man8/grub-mkconfig.8*
314 %{_mandir}/man8/grub-mknetdir.8*
315 %{_mandir}/man8/grub-reboot.8*
316 %{_mandir}/man8/grub-set-default.8*
317 %{_mandir}/man8/update-grub.8*
319 %attr(755,root,root) %{_sbindir}/grub-emu
320 %{_mandir}/man8/grub-emu.8*
322 /lib/grub-mkconfig_lib
325 # XXX: check this locale dir location and if it is neccesaary to exist on /boot
326 %dir %{_libexecdir}/locale
327 %config(noreplace) %verify(not md5 mtime size) %{_libexecdir}/grub.cfg
332 %{_libexecdir}/efiemu*.o
335 %{_libexecdir}/kernel.img
336 %ifarch %{ix86} %{x8664} sparc sparc64
337 %{_libexecdir}/boot.img
338 %{_libexecdir}/cdboot.img
339 %{_libexecdir}/diskboot.img
340 %{_libexecdir}/lnxboot.img
341 %{_libexecdir}/pxeboot.img
344 # generated by grub at runtime
345 %ghost %{_libexecdir}/device.map
346 %ghost %{_libexecdir}/core.img
347 %ghost %{_libexecdir}/grubenv
350 %doc /lib/grub.d/README
351 %attr(755,root,root) /lib/grub.d/00_header
352 %attr(755,root,root) /lib/grub.d/10_linux
353 %attr(755,root,root) /lib/grub.d/20_linux_xen
354 %attr(755,root,root) /lib/grub.d/30_os-prober
355 %attr(755,root,root) /lib/grub.d/40_custom
356 %attr(755,root,root) /lib/grub.d/41_custom
358 %dir %attr(750,root,root) %{_sysconfdir}/grub.d
359 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/grub.d/custom.cfg
361 %ifarch %{ix86} %{x8664}
362 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
363 %attr(755,root,root) %{_sbindir}/grub-probe
364 %attr(755,root,root) %{_sbindir}/grub-setup
365 %{_mandir}/man8/grub-mkdevicemap.8*
366 %{_mandir}/man8/grub-probe.8*
367 %{_mandir}/man8/grub-setup.8*
370 %{_infodir}/grub*.info*