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 static # build static binaries
16 %bcond_with grubemu # build grub-emu debugging utility
17 %bcond_without efiemu # build efiemu runtimes
19 %if "%{cc_version}" < "3.4"
20 # cc does not support:
21 # cc1: sorry, unimplemented: code model `large' not supported yet
26 # non-x86_64 arch doesn't support this
30 Summary: GRand Unified Bootloader
31 Summary(de.UTF-8): GRUB2 - ein Bootloader für x86 und ppc
32 Summary(hu.UTF-8): GRUB2 - rendszerbetöltő x86 és ppc gépekhez
33 Summary(pl.UTF-8): GRUB2 - bootloader dla x86 i ppc
34 Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
40 Source0: http://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
41 # Source0-md5: 27e360b951f006c464299d06bbd63442
43 Source2: update-grub.8
44 Source3: grub.sysconfig
45 Source4: grub-custom.cfg
46 URL: http://www.gnu.org/software/grub/
47 Patch0: pld-initrd.patch
48 Patch1: pld-sysconfdir.patch
49 Patch2: grub-garbage.patch
50 Patch3: grub-shelllib.patch
51 Patch4: grub-install.in.patch
52 Patch5: grub-lvmdevice.patch
53 Patch6: pld-mkconfigdir.patch
54 Patch7: grub-mkconfig-diagnostics.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
65 %ifarch %{ix86} %{x8664}
66 BuildRequires: lzo-devel >= 1.0.2
69 BuildRequires: /usr/lib/libc.so
70 %if "%{pld_release}" == "ac"
71 BuildRequires: libgcc32
73 BuildRequires: gcc-multilib
76 BuildRequires: ncurses-devel
77 BuildRequires: sed >= 4.0
79 BuildRequires: glibc-static
80 %ifarch %{ix86} %{x8664}
81 BuildRequires: lzo-static
83 BuildRequires: ncurses-static
85 BuildRequires: rpm >= 4.4.9-56
86 BuildRequires: rpmbuild(macros) >= 1.213
88 Suggests: cdrkit-mkisofs
92 ExclusiveArch: %{ix86} %{x8664} ppc sparc64
93 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
95 %define _sbindir /sbin
96 %define _bindir %{_sbindir}
98 %define _libexecdir %{_libdir}/grub
101 #%%define filterout_ld -Wl,--no-copy-dt-needed-entries
104 GRUB is a GPLed bootloader intended to unify bootloading across x86
105 operating systems. In addition to loading the Linux and *BSD kernels,
106 it implements the Multiboot standard, which allows for flexible
107 loading of multiple boot images (needed for modular kernels such as
110 GRUB 2 is derived from PUPA which was a research project to
111 investigate the next generation of GRUB. GRUB 2 has been rewritten
112 from scratch to clean up everything for modularity and portability.
114 GRUB 2 targets at the following goals:
115 - Scripting support, such as conditionals, loops, variables and
117 - Graphical interface.
118 - Dynamic loading of modules in order to extend itself at the run time
119 rather than at the build time.
120 - Portability for various architectures.
121 - Internationalization. This includes support for non-ASCII character
122 code, message catalogs like gettext, fonts, graphics console, and so
124 - Real memory management, to make GNU GRUB more extensible.
125 - Modular, hierarchical, object-oriented framework for file systems,
126 files, devices, drives, terminals, commands, partition tables and OS
128 - Cross-platform installation which allows for installing GRUB from a
129 different architecture.
130 - Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
131 - Fix design mistakes in GRUB Legacy, which could not be solved for
132 backward-compatibility, such as the way of numbering partitions.
134 %description -l de.UTF-8
135 GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
136 Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
137 läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
139 GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
140 und wird unter der GPL vertrieben. Aufgrund seiner höheren
141 Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
142 traditionellen Boot-Loader LILO.
144 %description -l hu.UTF-8
145 GRUB egy GPL liszenszű rendszerbetöltő. Linux és *BSD kernelek
146 betöltése mellett támogatja a Multiboot standard-ot, amely lehetővé
147 teszi boot képek betöltését (moduláris kerneleknek kell, mint pl. a
150 GRUB2 céljai a következők:
151 - szkriptelés támogatása, úgymint feltételek, ciklusok, változók,
154 - modulok dinamikus betöltése futási időben
155 - hordozhatóság több architektúrára
156 - többnyelvűség: nem-ASCII karakterek támogatása, üzenetkatalógusok,
157 mint gettext, betűtípusok, grafikus konzolon, és így tovább
158 - valós memória kezelés, amellyel még bővíthetőbbé tehetjük
159 - moduláris, hierarchikus, objektum-orientált keretrendszer
160 fájlrendszerekhez, fájlokhoz, eszközökhöz, meghajtókhoz,
161 terminálokhoz, parancsokhoz, partíciós táblákhoz és OS betöltőkhöz
163 %description -l es.UTF-8
164 Éste es GRUB - Grand Unified Boot Loader - un administrador de
165 inicialización capaz de entrar en la mayoría de los sistemas
166 operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
167 también en la mayoría de los sistemas operacionales comerciales para
170 El administrador GRUB puede ser una buena alternativa a LILO, para
171 usuarios conmás experiencia y que deseen obtener más recursos de su
172 cargador de inicialización (boot loader).
174 %description -l pl.UTF-8
175 GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
176 procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
177 Linuksa i *BSD: posiada również implementacje standardu Multiboot,
178 który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
179 (czego wymagają modułowe jądra, takie jak GNU Hurd).
181 %description -l pt_BR.UTF-8
182 Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
183 capaz de entrar na maioria dos sistemas operacionais livres - Linux,
184 FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
185 operacionais comerciais para PC.
187 O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
188 avançados e que querem mais recursos de seu boot loader.
191 %setup -q -n grub-%{version}
202 %if "%{cc_version}" < "3.4"
203 grep -rl -- -Wno-missing-field-initializers . | xargs sed -i -e 's,-Wno-missing-field-initializers,,'
204 sed -i -e '/video_mod_CFLAGS/s/$/ -Wno-error/' conf/common.rmk
208 cp -f /usr/share/automake/config.sub .
212 echo timestamp > stamp-h.in
214 export CFLAGS="-Os %{?debug:-g}"
216 # mawk stalls at ./genmoddep.awk, so force gawk
221 --enable-grub-emu-usb \
222 --enable-grub-emu-sdl \
223 --enable-grub-emu-pci \
225 --%{!?with_efiemu:dis}%{?with_efiemu:en}able-efiemu \
226 BUILD_CFLAGS="$CFLAGS"
228 BUILD_CFLAGS="$CFLAGS" \
230 %ifarch %{ix86} %{x8664}
231 grub_setup_LDFLAGS="-s -static" \
232 grub_mkimage_LDFLAGS="-s -static -llzo" \
234 grub_mkimage_LDFLAGS="-s -static" \
236 grub_emu_LDFLAGS="-s -static -lncurses -ltinfo" \
238 pkgdatadir=%{_libexecdir} \
239 pkglibdir=%{_libexecdir}
242 rm -rf $RPM_BUILD_ROOT
243 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{_sysconfdir}/grub.d}
246 pkgdatadir=%{_libexecdir} \
247 pkglibdir=%{_libexecdir} \
248 DESTDIR=$RPM_BUILD_ROOT
252 # this must be after 'make install'
253 install -d $RPM_BUILD_ROOT%{_libexecdir}/locale
255 cp -a docs/grub.cfg $RPM_BUILD_ROOT%{_libexecdir}
256 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
257 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
258 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
259 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/custom.cfg
260 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
262 # deprecated. we don't need it
263 rm $RPM_BUILD_ROOT/boot/grub/update-grub_lib
265 # core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
266 touch $RPM_BUILD_ROOT%{_libexecdir}/core.img
267 touch $RPM_BUILD_ROOT%{_libexecdir}/device.map
269 # needs to be exactly 1KiB
270 # but we're ghosting it. so whom are we kidding here? :P (maybe %config it in future?)
271 dd bs=1024 if=/dev/zero count=1 of=$RPM_BUILD_ROOT%{_libexecdir}/grubenv
274 rm -rf $RPM_BUILD_ROOT
276 %post -p %{_sbindir}/postshell
277 -/usr/sbin/fix-info-dir -c %{_infodir}
279 %postun -p %{_sbindir}/postshell
280 -/usr/sbin/fix-info-dir -c %{_infodir}
282 # Note this on version upgrade
283 %triggerpostun -- %{name} < %{version}-0
284 # don't do anything on --downgrade
285 if [ $1 -le 1 ]; then
288 echo "Grub was upgraded, trying to setup it to boot sector"
289 /sbin/grub-install '(hd0)' || :
292 %defattr(644,root,root,755)
293 %doc AUTHORS ChangeLog NEWS README THANKS TODO
294 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
295 %attr(755,root,root) %{_sbindir}/grub-bin2h
296 %attr(755,root,root) %{_sbindir}/grub-editenv
297 %attr(755,root,root) %{_sbindir}/grub-fstest
298 %attr(755,root,root) %{_sbindir}/grub-kbdcomp
299 %attr(755,root,root) %{_sbindir}/grub-install
300 %attr(755,root,root) %{_sbindir}/grub-menulst2cfg
301 %attr(755,root,root) %{_sbindir}/grub-mkconfig
302 %attr(755,root,root) %{_sbindir}/grub-mkfont
303 %attr(755,root,root) %{_sbindir}/grub-mklayout
304 %attr(755,root,root) %{_sbindir}/grub-mknetdir
305 %attr(755,root,root) %{_sbindir}/grub-mkpasswd-pbkdf2
306 %attr(755,root,root) %{_sbindir}/grub-mkrelpath
307 %attr(755,root,root) %{_sbindir}/grub-mkrescue
308 %attr(755,root,root) %{_sbindir}/grub-reboot
309 %attr(755,root,root) %{_sbindir}/grub-script-check
310 %attr(755,root,root) %{_sbindir}/grub-set-default
311 %attr(755,root,root) %{_sbindir}/update-grub
312 %ifarch %{ix86} %{x8664}
313 %attr(755,root,root) %{_sbindir}/grub-mkimage
314 %{_mandir}/man1/grub-mkimage.1*
316 %attr(755,root,root) %{_sbindir}/grub-probe
317 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
318 %{_mandir}/man8/grub-probe.8*
319 %{_mandir}/man8/grub-mkdevicemap.8*
321 %{_mandir}/man1/grub-bin2h.1*
322 %{_mandir}/man1/grub-editenv.1*
323 %{_mandir}/man1/grub-fstest.1*
324 %{_mandir}/man1/grub-menulst2cfg.1*
325 %{_mandir}/man1/grub-mkfont.1*
326 %{_mandir}/man1/grub-mklayout.1*
327 %{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
328 %{_mandir}/man1/grub-mkrelpath.1*
329 %{_mandir}/man1/grub-mkrescue.1*
330 %{_mandir}/man1/grub-script-check.1*
331 %{_mandir}/man8/grub-install.8*
332 %{_mandir}/man8/grub-mkconfig.8*
333 %{_mandir}/man8/grub-mknetdir.8*
334 %{_mandir}/man8/grub-reboot.8*
335 %{_mandir}/man8/grub-set-default.8*
336 %{_mandir}/man8/update-grub.8*
338 %attr(755,root,root) %{_sbindir}/grub-emu
339 %{_mandir}/man8/grub-emu.8*
341 /lib/grub-mkconfig_lib
344 # XXX: check this locale dir location and if it is neccesaary to exist on /boot
345 %dir %{_libexecdir}/locale
346 %config(noreplace) %verify(not md5 mtime size) %{_libexecdir}/grub.cfg
351 %{_libexecdir}/efiemu*.o
354 %{_libexecdir}/kernel.img
355 %ifarch %{ix86} %{x8664} sparc sparc64
356 %{_libexecdir}/boot.img
357 %{_libexecdir}/cdboot.img
358 %{_libexecdir}/diskboot.img
359 %{_libexecdir}/lnxboot.img
360 %{_libexecdir}/pxeboot.img
363 # generated by grub at runtime
364 %ghost %{_libexecdir}/device.map
365 %ghost %{_libexecdir}/core.img
366 %ghost %{_libexecdir}/grubenv
369 %doc /lib/grub.d/README
370 %attr(755,root,root) /lib/grub.d/00_header
371 %attr(755,root,root) /lib/grub.d/10_linux
372 %attr(755,root,root) /lib/grub.d/20_linux_xen
373 %attr(755,root,root) /lib/grub.d/30_os-prober
374 %attr(755,root,root) /lib/grub.d/40_custom
375 %attr(755,root,root) /lib/grub.d/41_custom
377 %dir %attr(750,root,root) %{_sysconfdir}/grub.d
378 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/grub.d/custom.cfg
380 %ifarch %{ix86} %{x8664}
381 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
382 %attr(755,root,root) %{_sbindir}/grub-probe
383 %attr(755,root,root) %{_sbindir}/grub-setup
384 %{_mandir}/man8/grub-mkdevicemap.8*
385 %{_mandir}/man8/grub-probe.8*
386 %{_mandir}/man8/grub-setup.8*
389 %{_infodir}/grub*.info*