]> TLD Linux GIT Repositories - packages/grub2.git/blob - grub2.spec
bb2ae3179b92e60feef0f3db901b1babeaec754b
[packages/grub2.git] / grub2.spec
1 # TODO
2 # - reap out which in probe scripts and drop R: which
3 # - subpackages? e.g. modules and utils
4 # - check where is that locale path: /boot/grub/locale and fix it or change it
5 # - grubemu notes
6 #   --enable-grub-emu-usb conflicts with --enable-grub-emu-pci, emu-pci seems experimental
7 #   - to build and install the `grub-emu' debugging utility we need to re-run build with --target=emu
8 #   - put grub-emu to subpackage if it is fixed
9 #
10 # Conditional build:
11 %bcond_with     grubemu         # grub-emu debugging utility
12 %bcond_without  efiemu          # efiemu runtimes (64-bit efiemu on 32-bit boot platform)
13 %bcond_with     unifont         # unifont based fonts
14 %bcond_without  arc             # MIPS ARC platform support
15 %bcond_without  coreboot        # coreboot/linuxbios platform support (x86/arm specific)
16 %bcond_without  efi             # EFI platform support
17 %bcond_without  ieee1275        # ieee1275 platform support (x86/ppc/sparc specific)
18 %bcond_without  loongson        # MIPS loongson platform support (mipsel specific)
19 %bcond_without  multiboot       # multiboot platform support (x86/arm specific)
20 %bcond_without  pc              # PC BIOS platform support (x86 specific)
21 %bcond_without  qemu            # qemu platform support (x86/mips specific)
22 %bcond_without  uboot           # ARM uBoot platform support
23 %bcond_without  xen             # Xen platform support (x86 specific)
24 %bcond_without  xen_pvh         # Xen PVH platform support (x86 specific)
25
26 %ifnarch mips mipsel mips64 mips64el
27 %undefine       with_arc
28 %endif
29 %ifnarch %{ix86} %{x8664} x32 %{arm}
30 %undefine       with_coreboot
31 %endif
32 %ifnarch %{ix86} %{x8664} x32 %{arm} aarch64 ia64
33 %undefine       with_efi
34 %endif
35 %ifnarch %{ix86} %{x8664} x32 ppc ppc64 sparc64
36 %undefine       with_ieee1275
37 %endif
38 %ifnarch mipsel mips64el
39 %undefine       with_loongson
40 %endif
41 %ifnarch %{ix86} %{x8664} x32
42 %undefine       with_multiboot
43 %undefine       with_pc
44 %undefine       with_xen
45 %undefine       with_xen_pvh
46 %endif
47 %ifnarch %{ix86} mips mipsel mips64 mips64el
48 %undefine       with_qemu
49 %endif
50 %ifnarch %{arm}
51 %undefine       with_uboot
52 %endif
53
54 # FIXME: x86_64-xen build is broken (as of 2.06)
55 %ifarch %{x8664} x32
56 %undefine       with_xen
57 %endif
58
59 # these require unifont
60 %if %{without unifont}
61 %undefine       with_coreboot
62 %undefine       with_loongson
63 %undefine       with_qemu
64 %endif
65
66 %ifnarch %{x8664} x32
67 # non-x86_64 arch doesn't support this
68 %undefine       with_efiemu
69 %endif
70
71 # the 'most natural' platform should go last
72 %ifarch %{ix86} %{x8664} x32
73 %define         platforms %{?with_coreboot:coreboot} %{?with_ieee1275:ieee1275} %{?with_multiboot:multiboot} %{?with_qemu:qemu} %{?with_xen:xen} %{?with_xen_pvh:xen_pvh} %{?with_efi:efi} %{?with_pc:pc}
74 %endif
75 %ifarch %{arm}
76 %define         platforms %{?with_efi:efi} %{?with_uboot:uboot}
77 %endif
78 %ifarch aarch64 ia64 riscv32 riscv64
79 %define         platforms efi
80 %endif
81 %ifarch mips mips64
82 %define         platforms arc
83 %endif
84 %ifarch mipsel mips64el
85 %define         platforms %{?with_arc:arc} %{?with_loongson:loongson}
86 %endif
87 %ifarch ppc ppc64 sparc64
88 %define         platforms ieee1275
89 %endif
90
91 %ifarch %{ix86}
92 %define coreboot_arch   i386
93 %define efi_arch        i386
94 %define ieee1275_arch   i386
95 %define qemu_arch       i386
96 %define qemu_plat       qemu
97 %define xen_arch        i386
98 %endif
99 %ifarch %{x8664} x32
100 %define coreboot_arch   i386
101 %define efi_arch        x86_64
102 %define ieee1275_arch   i386
103 %define qemu_arch       i386
104 %define qemu_plat       qemu
105 %define xen_arch        x86_64
106 %endif
107 %ifarch %{arm}
108 %define coreboot_arch   arm
109 %define efi_arch        arm
110 %endif
111 %ifarch aarch64
112 %define efi_arch        arm64
113 %endif
114 %ifarch ia64
115 %define efi_arch        ia64
116 %endif
117 %ifarch mips mips64
118 %define arc_arch        mips
119 %define qemu_arch       mips
120 %define qemu_plat       qemu_mips
121 %endif
122 %ifarch mipsel mips64el
123 %define arc_arch        mipsel
124 %define qemu_arch       mipsel
125 %define qemu_plat       qemu_mips
126 %endif
127 %ifarch ppc ppc64
128 %define ieee1275_arch   powerpc
129 %endif
130 %ifarch riscv32
131 %define efi_arch        riscv32
132 %endif
133 %ifarch riscv64
134 %define efi_arch        riscv64
135 %endif
136 %ifarch sparc64
137 %define ieee1275_arch   sparc64
138 %endif
139
140 Summary:        GRand Unified Bootloader
141 Summary(de.UTF-8):      GRUB2 - ein Bootloader für x86 und ppc
142 Summary(hu.UTF-8):      GRUB2 - rendszerbetöltő x86 és ppc gépekhez
143 Summary(pl.UTF-8):      GRUB2 - bootloader dla x86 i ppc
144 Summary(pt_BR.UTF-8):   Gerenciador de inicialização GRUB2
145 Name:           grub2
146 Version:        2.06
147 Release:        4
148 License:        GPL v2
149 Group:          Base
150 Source0:        https://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
151 # Source0-md5:  cf0fd928b1e5479c8108ee52cb114363
152 Source1:        update-grub
153 Source2:        update-grub.8
154 Source3:        grub.sysconfig
155 Source4:        grub-custom.cfg
156 Patch1:         tld-sysconfdir.patch
157 Patch2:         grub-garbage.patch
158 Patch3:         grub-lvmdevice.patch
159 Patch4:         tld-mkconfigdir.patch
160 Patch5:         grub-mkconfig-diagnostics.patch
161 Patch6:         posix.patch
162 Patch7:         %{name}-fonts_path.patch
163 Patch9:         just-say-linux.patch
164 Patch10:        ignore-kernel-symlinks.patch
165 Patch11:        initrd-search.patch
166 Patch12:        %{name}-cfg.patch
167 Patch13:        efi-net-fix.patch
168 Patch14:        blscfg.patch
169 Patch15:        restricted.patch
170 Patch16:        0193-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch
171 Patch17:        0268-grub_fs_probe-dprint-errors-from-filesystems.patch
172 Patch18:        ignore-ext4-metadata_csum_seed.patch
173 URL:            http://www.gnu.org/software/grub/
174 BuildRequires:  autoconf >= 2.63
175 BuildRequires:  automake >= 1:1.11.1-1
176 BuildRequires:  bison >= 2.3
177 BuildRequires:  device-mapper-devel >= 1.02.34
178 BuildRequires:  flex >= 2.5.35
179 BuildRequires:  fonts-TTF-DejaVu
180 %if %{with unifont}
181 BuildRequires:  fonts-misc-unifont
182 %endif
183 BuildRequires:  freetype-devel >= 2.1.5
184 BuildRequires:  gawk
185 BuildRequires:  gcc >= 6:5.1
186 %ifarch %{x8664} x32
187 %if %{with efiemu} || %{with coreboot} || %{with ieee1275} || %{with multiboot} || %{with pc} || %{with xen_pvh}
188 BuildRequires:  gcc-multilib-32 >= 6:5.1
189 %endif
190 %endif
191 %ifarch x32
192 %if %{with efiemu} || %{with efi}
193 BuildRequires:  gcc-multilib-64 >= 6:5.1
194 %endif
195 %endif
196 BuildRequires:  gettext-tools >= 0.18.3
197 BuildRequires:  glibc-localedb-all
198 BuildRequires:  glibc-static
199 BuildRequires:  help2man
200 BuildRequires:  libfuse-devel
201 BuildRequires:  libtool
202 BuildRequires:  ncurses-devel
203 BuildRequires:  pkgconfig
204 BuildRequires:  python3
205 BuildRequires:  python3-modules
206 BuildRequires:  rpm >= 4.4.9-56
207 BuildRequires:  rpmbuild(macros) >= 1.213
208 BuildRequires:  sed >= 4.0
209 BuildRequires:  tar >= 1:1.22
210 BuildRequires:  texinfo
211 BuildRequires:  xz
212 BuildRequires:  xz-devel
213 Requires:       %{name}-platform = %{version}-%{release}
214 Requires:       issue
215 Requires:       which
216 %ifarch %{ix86} %{x8664} x32
217 Suggests:       %{name}-platform-pc
218 %endif
219 Suggests:       cdrkit-mkisofs
220 Suggests:       os-prober
221 Provides:       bootloader
222 Conflicts:      grub
223 ExclusiveArch:  %{ix86} %{x8664} x32 %{arm} aarch64 ia64 mips mipsel mips64 mips64el ppc ppc64 riscv32 riscv64 sparc64
224 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
225
226 %define         _sbindir        /sbin
227 %define         _bindir         %{_sbindir}
228 %define         _libdir         /lib
229 %define         _datadir        %{_libdir}
230 %define         _libexecdir     %{_libdir}/grub
231 %define         _grubdir        /boot/grub
232 %define         _localedir      /usr/share/locale
233
234 # part of grub code is not relocable (these are not Linux libs)
235 # stack protector also breaks non-Linux binaries
236 # any kind of forced optimizations makes grub2 unreliable (random
237 # reboots and hangs on boot menu screen)
238 %define         filterout_c     -fPIC -O.
239 %undefine       _ssp_cflags
240 %undefine       _fortify_cflags
241
242 %description
243 GRUB is a GPLed bootloader intended to unify bootloading across x86
244 operating systems. In addition to loading the Linux and *BSD kernels,
245 it implements the Multiboot standard, which allows for flexible
246 loading of multiple boot images (needed for modular kernels such as
247 the GNU Hurd).
248
249 GRUB 2 is derived from PUPA which was a research project to
250 investigate the next generation of GRUB. GRUB 2 has been rewritten
251 from scratch to clean up everything for modularity and portability.
252
253 GRUB 2 targets at the following goals:
254 - Scripting support, such as conditionals, loops, variables and
255   functions.
256 - Graphical interface.
257 - Dynamic loading of modules in order to extend itself at the run time
258   rather than at the build time.
259 - Portability for various architectures.
260 - Internationalization. This includes support for non-ASCII character
261   code, message catalogs like gettext, fonts, graphics console, and so
262   on.
263 - Real memory management, to make GNU GRUB more extensible.
264 - Modular, hierarchical, object-oriented framework for file systems,
265   files, devices, drives, terminals, commands, partition tables and OS
266   loaders.
267 - Cross-platform installation which allows for installing GRUB from a
268   different architecture.
269 - Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
270 - Fix design mistakes in GRUB Legacy, which could not be solved for
271   backward-compatibility, such as the way of numbering partitions.
272
273 %description -l de.UTF-8
274 GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
275 Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
276 läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
277
278 GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
279 und wird unter der GPL vertrieben. Aufgrund seiner höheren
280 Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
281 traditionellen Boot-Loader LILO.
282
283 %description -l hu.UTF-8
284 GRUB egy GPL liszenszű rendszerbetöltő. Linux és *BSD kernelek
285 betöltése mellett támogatja a Multiboot standard-ot, amely lehetővé
286 teszi boot képek betöltését (moduláris kerneleknek kell, mint pl. a
287 GNU Hurd).
288
289 GRUB2 céljai a következők:
290 - szkriptelés támogatása, úgymint feltételek, ciklusok, változók,
291   függvények.
292 - grafikus felület
293 - modulok dinamikus betöltése futási időben
294 - hordozhatóság több architektúrára
295 - többnyelvűség: nem-ASCII karakterek támogatása, üzenetkatalógusok,
296   mint gettext, betűtípusok, grafikus konzolon, és így tovább
297 - valós memória kezelés, amellyel még bővíthetőbbé tehetjük
298 - moduláris, hierarchikus, objektum-orientált keretrendszer
299   fájlrendszerekhez, fájlokhoz, eszközökhöz, meghajtókhoz,
300   terminálokhoz, parancsokhoz, partíciós táblákhoz és OS betöltőkhöz
301
302 %description -l es.UTF-8
303 Éste es GRUB - Grand Unified Boot Loader - un administrador de
304 inicialización capaz de entrar en la mayoría de los sistemas
305 operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
306 también en la mayoría de los sistemas operacionales comerciales para
307 PC.
308
309 El administrador GRUB puede ser una buena alternativa a LILO, para
310 usuarios conmás experiencia y que deseen obtener más recursos de su
311 cargador de inicialización (boot loader).
312
313 %description -l pl.UTF-8
314 GRUB jest bootloaderem na licencji GNU GPL, mającym na celu unifikację
315 procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
316 Linuksa i *BSD: posiada również implementację standardu Multiboot,
317 który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
318 (czego wymagają modułowe jądra, takie jak GNU Hurd).
319
320 %description -l pt_BR.UTF-8
321 Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
322 capaz de entrar na maioria dos sistemas operacionais livres - Linux,
323 FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
324 operacionais comerciais para PC.
325
326 O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
327 avançados e que querem mais recursos de seu boot loader.
328
329 %package -n bash-completion-%{name}
330 Summary:        bash-completion for GRUB
331 Summary(pl.UTF-8):      Bashowe uzupełnianie nazw dla GRUB-a
332 Group:          Applications/Shells
333 Requires:       %{name} = %{version}-%{release}
334 Requires:       bash-completion
335 BuildArch:      noarch
336
337 %description -n bash-completion-%{name}
338 This package provides bash-completion for GRUB.
339
340 %description -n bash-completion-%{name} -l pl.UTF-8
341 Pakiet ten dostarcza bashowe uzupełnianie nazw dla GRUB-a.
342
343 %package fonts
344 Summary:        Fonts for GRUB
345 Summary(pl.UTF-8):      Fonty dla GRUB-a
346 Group:          Base
347 Requires:       %{name} = %{version}-%{release}
348
349 %description fonts
350 Fonts for GRUB.
351
352 %description fonts -l pl.UTF-8
353 Fonty dla GRUB-a.
354
355 %package platform-arc
356 Summary:        MIPS ARC platform support for GRUB
357 Summary(pl.UTF-8):      Obsługa platformy MIPS ARC dla GRUB-a
358 Group:          Base
359 Requires:       %{name} = %{version}-%{release}
360 Provides:       %{name}-platform = %{version}-%{release}
361
362 %description platform-arc
363 MIPS ARC platform support for GRUB.
364
365 %description platform-arc -l pl.UTF-8
366 Obsługa platformy MIPS ARC dla GRUB-a.
367
368 %package platform-coreboot
369 Summary:        Coreboot (LinuxBIOS) platform support for GRUB
370 Summary(pl.UTF-8):      Obsługa platformy Coreboot (LinuxBIOS) dla GRUB-a
371 Group:          Base
372 Requires:       %{name} = %{version}-%{release}
373 Requires:       %{name}-fonts = %{version}-%{release}
374 Provides:       %{name}-platform = %{version}-%{release}
375
376 %description platform-coreboot
377 Coreboot (LinuxBIOS) platform support for GRUB.
378
379 %description platform-coreboot -l pl.UTF-8
380 Obsługa platformy Coreboot (LinuxBIOS) dla GRUB-a.
381
382 %package platform-efi
383 Summary:        (U)EFI platform support for GRUB
384 Summary(pl.UTF-8):      Obsługa platformy (U)EFI dla GRUB-a
385 Group:          Base
386 Requires:       %{name} = %{version}-%{release}
387 Suggests:       efibootmgr
388 Provides:       %{name}-platform = %{version}-%{release}
389
390 %description platform-efi
391 (U)EFI platform support for GRUB.
392
393 %description platform-efi -l pl.UTF-8
394 Obsługa platformy (U)EFI dla GRUB-a.
395
396 %package platform-ieee1275
397 Summary:        IEEE 1275 (OpenFirmware) platform support for GRUB
398 Summary(pl.UTF-8):      Obsługa platformy IEEE 1275 (OpenFirmware) dla GRUB-a
399 Group:          Base
400 Requires:       %{name} = %{version}-%{release}
401 Provides:       %{name}-platform = %{version}-%{release}
402
403 %description platform-ieee1275
404 IEEE 1275 (OpenFirmware) platform support for GRUB.
405
406 %description platform-ieee1275 -l pl.UTF-8
407 Obsługa platformy IEEE 1275 (OpenFirmware) dla GRUB-a.
408
409 %package platform-loongson
410 Summary:        MIPS Loongson platform support for GRUB
411 Summary(pl.UTF-8):      Obsługa platformy MIPS Loongson dla GRUB-a
412 Group:          Base
413 Requires:       %{name} = %{version}-%{release}
414 Requires:       %{name}-fonts = %{version}-%{release}
415 Provides:       %{name}-platform = %{version}-%{release}
416
417 %description platform-loongson
418 MIPS Loongson (yeelong, fuloong) platform support for GRUB.
419
420 %description platform-loongson -l pl.UTF-8
421 Obsługa platformy MIPS Loongson (yeelong, fuloong) dla GRUB-a.
422
423 %package platform-multiboot
424 Summary:        Multiboot platform support for GRUB
425 Summary(pl.UTF-8):      Obsługa platformy Multiboot dla GRUB-a
426 Group:          Base
427 Requires:       %{name} = %{version}-%{release}
428 Provides:       %{name}-platform = %{version}-%{release}
429
430 %description platform-multiboot
431 Multiboot platform support for GRUB.
432
433 %description platform-multiboot -l pl.UTF-8
434 Obsługa platformy Multiboot dla GRUB-a.
435
436 %package platform-pc
437 Summary:        PC BIOS platform support for GRUB
438 Summary(pl.UTF-8):      Obsługa platformy PC BIOS dla GRUB-a
439 Group:          Base
440 Requires:       %{name} = %{version}-%{release}
441 Provides:       %{name}-platform = %{version}-%{release}
442
443 %description platform-pc
444 PC BIOS platform support for GRUB.
445
446 %description platform-pc -l pl.UTF-8
447 Obsługa platformy PC BIOS dla GRUB-a.
448
449 %package platform-qemu
450 Summary:        Qemu platform support for GRUB
451 Summary(pl.UTF-8):      Obsługa platformy Qemu dla GRUB-a
452 Group:          Base
453 Requires:       %{name} = %{version}-%{release}
454 Requires:       %{name}-fonts = %{version}-%{release}
455 Provides:       %{name}-platform = %{version}-%{release}
456
457 %description platform-qemu
458 Qemu platform support for GRUB.
459
460 %description platform-qemu -l pl.UTF-8
461 Obsługa platformy Qemu dla GRUB-a.
462
463 %package platform-uboot
464 Summary:        ARM uBoot platform support for GRUB
465 Summary(pl.UTF-8):      Obsługa platformy ARM uBoot dla GRUB-a
466 Group:          Base
467 Requires:       %{name} = %{version}-%{release}
468 Provides:       %{name}-platform = %{version}-%{release}
469
470 %description platform-uboot
471 ARM uBoot platform support for GRUB.
472
473 %description platform-uboot -l pl.UTF-8
474 Obsługa platformy ARM uBoot dla GRUB-a.
475
476 %package platform-xen
477 Summary:        Xen platform support for GRUB
478 Summary(pl.UTF-8):      Obsługa platformy Xen dla GRUB-a
479 Group:          Base
480 Requires:       %{name} = %{version}-%{release}
481 Provides:       %{name}-platform = %{version}-%{release}
482
483 %description platform-xen
484 Xen platform support for GRUB.
485
486 %description platform-xen -l pl.UTF-8
487 Obsługa platformy Xen dla GRUB-a.
488
489 %package platform-xen_pvh
490 Summary:        Xen PVH platform support for GRUB
491 Summary(pl.UTF-8):      Obsługa platformy Xen PVH dla GRUB-a
492 Group:          Base
493 Requires:       %{name} = %{version}-%{release}
494 Provides:       %{name}-platform = %{version}-%{release}
495
496 %description platform-xen_pvh
497 Xen PVH platform support for GRUB.
498
499 %description platform-xen_pvh -l pl.UTF-8
500 Obsługa platformy Xen PVH dla GRUB-a.
501
502 %package mkfont
503 Summary:        GRUB font files converter
504 Summary(pl.UTF-8):      Konwerter plików fontów GRUB-a
505 Group:          Base
506
507 %description mkfont
508 Converts common font file formats into PF2.
509
510 %description mkfont -l pl.UTF-8
511 Program do konwersji popularnych formatów plików fontów do PF2.
512
513 %package theme-starfield
514 Summary:        starfield theme for GRUB
515 Summary(pl.UTF-8):      Motyw starfield dla GRUB-a
516 Requires:       %{name} = %{version}-%{release}
517 Group:          Base
518
519 %description theme-starfield
520 starfield theme for GRUB.
521
522 %description theme-starfield -l pl.UTF-8
523 Motyw starfield dla GRUB-a.
524
525 %prep
526 %setup -q -n grub-%{version}
527 %patch1 -p1
528 %patch2 -p1
529 %patch3 -p1
530 %patch4 -p1
531 %patch5 -p1
532 %patch6 -p1
533 %patch7 -p1
534 %patch9 -p1
535 %patch10 -p1
536 %patch11 -p1
537 %patch12 -p0
538 %patch13 -p1
539 %patch14 -p1
540 %patch15 -p1
541 %patch16 -p1
542 %patch17 -p1
543 %patch18 -p1
544
545 # we don't have C.utf-8 and need an UTF-8 locale for build
546 sed -i -e 's/LC_ALL=C.UTF-8/LC_ALL=en_US.utf-8/g' po/Makefile* po/Rules*
547
548 %build
549 # if gold is used then grub doesn't even boot
550 # https://savannah.gnu.org/bugs/?34539
551 # http://sourceware.org/bugzilla/show_bug.cgi?id=14196
552 install -d our-ld
553 ln -f -s /usr/bin/ld.bfd our-ld/ld
554 export PATH=$(pwd)/our-ld:$PATH
555
556 ## not only the typical autotools stuff
557 #./autogen.sh
558
559 #{__gettextize}
560 %{__aclocal} -I m4
561 %{__autoconf}
562 %{__autoheader}
563 %{__automake}
564
565 for platform in %{platforms} ; do
566         install -d build-${platform}
567         cd build-${platform}
568
569         platform_opts=""
570         case platform in
571           coreboot|ieee1275|multiboot|pc|qemu|xen_pvh)
572                 platform_opts="--enable-efiemu%{!?with_efiemu:=no}"
573                 ;;
574         esac
575
576         ln -f -s ../configure .
577         # mawk stalls at ./genmoddep.awk, so force gawk
578         AWK=gawk \
579         %configure \
580                 --with-platform=${platform} \
581                 --disable-werror \
582                 --enable-grub-themes \
583         %if %{with grubemu}
584                 --enable-grub-emu-usb \
585                 --enable-grub-emu-sdl \
586                 --enable-grub-emu-pci \
587         %endif
588                 $platform_opts \
589                 TARGET_LDFLAGS=-static
590
591         %{__make} -j1 -C po update-gmo
592         %{__make}
593         cd ..
594 done
595
596 %install
597 rm -rf $RPM_BUILD_ROOT
598
599 for platform in %{platforms} ; do
600         cd build-${platform}
601         %{__make} install \
602                 pkgdatadir=%{_libexecdir} \
603                 pkglibdir=%{_libexecdir} \
604                 DESTDIR=$RPM_BUILD_ROOT
605         cd ..
606 done
607
608 # not in Th (?)
609 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/de@hebrew
610 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/en@{arabic,cyrillic,greek,hebrew,piglatin}
611
612 %find_lang grub
613
614 # this must be after 'make install'
615 install -d $RPM_BUILD_ROOT%{_libexecdir}/locale
616
617 install -d $RPM_BUILD_ROOT%{_grubdir}
618 cp -p docs/grub.cfg $RPM_BUILD_ROOT%{_grubdir}
619
620 # grub.d/41_custom
621 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_grubdir}/custom.cfg
622 %{__rm} $RPM_BUILD_ROOT/lib/grub.d/40_custom
623
624 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
625 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
626
627 install -d $RPM_BUILD_ROOT/etc/sysconfig
628 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
629
630 # rm -f, because it sometimes exists, sometimes not, depending which texlive you have installed
631 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
632
633 # platform specific, unnecessarily always installed
634 %ifnarch %{ix86} %{x8664} x32
635 %{__rm} $RPM_BUILD_ROOT{%{_sbindir}/grub-bios-setup,%{_mandir}/man8/grub-bios-setup.8}
636 %endif
637 %ifnarch sparc64
638 %{__rm} $RPM_BUILD_ROOT{%{_sbindir}/grub-sparc64-setup,%{_mandir}/man8/grub-sparc64-setup.8}
639 %endif
640
641 # core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
642 touch $RPM_BUILD_ROOT%{_grubdir}/core.img
643 touch $RPM_BUILD_ROOT%{_grubdir}/device.map
644
645 # needs to be exactly 1KiB
646 # but we're ghosting it. so whom are we kidding here? :P (maybe %config it in future?)
647 dd bs=1024 if=/dev/zero count=1 of=$RPM_BUILD_ROOT%{_grubdir}/grubenv
648
649 %clean
650 rm -rf $RPM_BUILD_ROOT
651
652 %post -p %{_sbindir}/postshell
653 -/usr/sbin/fix-info-dir -c %{_infodir}
654
655 %postun -p %{_sbindir}/postshell
656 -/usr/sbin/fix-info-dir -c %{_infodir}
657
658 %triggerpostun -- %{name} < 2.00-2
659 # Note this trigger on version upgrade needed only for upgrade from
660 # old grub2 packages which contained modules in /boot/grub
661 # or were built with optimizations enabled.
662 # Don't do anything on --downgrade.
663 if [ $1 -le 1 ]; then
664         exit 0
665 fi
666 echo "Grub was upgraded, trying to setup it to boot sector"
667 /sbin/grub-install '(hd0)' || :
668
669 %triggerpostun -- %{name} < 1.99-7.3
670 # migrate /etc/grub.d/custom.cfg.rpmsave  -> /boot/grub/custom.cfg
671 if [ -f %{_sysconfdir}/grub.d/custom.cfg.rpmsave ]; then
672         cp -f %{_grubdir}/custom.cfg{,.rpmnew}
673         mv -f  %{_sysconfdir}/grub.d/custom.cfg.rpmsave %{_grubdir}/custom.cfg
674 fi
675
676 %files -f grub.lang
677 %defattr(644,root,root,755)
678 %doc AUTHORS ChangeLog NEWS README THANKS TODO
679 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
680 %attr(755,root,root) %{_sbindir}/grub-editenv
681 %attr(755,root,root) %{_sbindir}/grub-fstest
682 %attr(755,root,root) %{_sbindir}/grub-file
683 %attr(755,root,root) %{_sbindir}/grub-glue-efi
684 %attr(755,root,root) %{_sbindir}/grub-kbdcomp
685 %attr(755,root,root) %{_sbindir}/grub-install
686 %attr(755,root,root) %{_sbindir}/grub-macbless
687 %attr(755,root,root) %{_sbindir}/grub-menulst2cfg
688 %attr(755,root,root) %{_sbindir}/grub-mkconfig
689 %attr(755,root,root) %{_sbindir}/grub-mklayout
690 %attr(755,root,root) %{_sbindir}/grub-mknetdir
691 %attr(755,root,root) %{_sbindir}/grub-mkpasswd-pbkdf2
692 %attr(755,root,root) %{_sbindir}/grub-mkrelpath
693 %attr(755,root,root) %{_sbindir}/grub-mkrescue
694 %attr(755,root,root) %{_sbindir}/grub-mkstandalone
695 %attr(755,root,root) %{_sbindir}/grub-mount
696 %attr(755,root,root) %{_sbindir}/grub-ofpathname
697 %attr(755,root,root) %{_sbindir}/grub-reboot
698 %attr(755,root,root) %{_sbindir}/grub-render-label
699 %attr(755,root,root) %{_sbindir}/grub-script-check
700 %attr(755,root,root) %{_sbindir}/grub-set-default
701 %attr(755,root,root) %{_sbindir}/grub-syslinux2cfg
702 %attr(755,root,root) %{_sbindir}/update-grub
703 %ifarch %{ix86} %{x8664} x32
704 %attr(755,root,root) %{_sbindir}/grub-bios-setup
705 %{_mandir}/man8/grub-bios-setup.8*
706 %endif
707 %ifarch %{ix86} %{x8664} x32
708 %attr(755,root,root) %{_sbindir}/grub-mkimage
709 %{_mandir}/man1/grub-mkimage.1*
710 %else
711 %attr(755,root,root) %{_sbindir}/grub-probe
712 %{_mandir}/man8/grub-probe.8*
713 %endif
714 %ifarch sparc64
715 %attr(755,root,root) %{_sbindir}/grub-sparc64-setup
716 %{_mandir}/man8/grub-sparc64-setup.8*
717 %endif
718 %{_mandir}/man1/grub-editenv.1*
719 %{_mandir}/man1/grub-file.1*
720 %{_mandir}/man1/grub-fstest.1*
721 %{_mandir}/man1/grub-glue-efi.1*
722 %{_mandir}/man1/grub-kbdcomp.1*
723 %{_mandir}/man1/grub-menulst2cfg.1*
724 %{_mandir}/man1/grub-mklayout.1*
725 %{_mandir}/man1/grub-mknetdir.1*
726 %{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
727 %{_mandir}/man1/grub-mkrelpath.1*
728 %{_mandir}/man1/grub-mkrescue.1*
729 %{_mandir}/man1/grub-mkstandalone.1*
730 %{_mandir}/man1/grub-mount.1*
731 %{_mandir}/man1/grub-render-label.1*
732 %{_mandir}/man1/grub-script-check.1*
733 %{_mandir}/man1/grub-syslinux2cfg.1*
734 %{_mandir}/man8/grub-install.8*
735 %{_mandir}/man8/grub-macbless.8*
736 %{_mandir}/man8/grub-mkconfig.8*
737 %{_mandir}/man8/grub-ofpathname.8*
738 %{_mandir}/man8/grub-reboot.8*
739 %{_mandir}/man8/grub-set-default.8*
740 %{_mandir}/man8/update-grub.8*
741 %if %{with grubemu}
742 %attr(755,root,root) %{_sbindir}/grub-emu
743 %{_mandir}/man8/grub-emu.8*
744 %endif
745 %{_libexecdir}/grub-mkconfig_lib
746
747 %dir %{_grubdir}
748 %dir %{_libexecdir}
749 # XXX: check this locale dir location and if it is neccesaary to exist on /boot
750
751 %dir %{_libexecdir}/locale
752 %config(noreplace) %verify(not md5 mtime size) %{_grubdir}/grub.cfg
753 %config(noreplace) %verify(not md5 mtime size) %{_grubdir}/custom.cfg
754
755 # generated by grub at runtime
756 %ghost %{_grubdir}/device.map
757 %ghost %{_grubdir}/core.img
758 %ghost %{_grubdir}/grubenv
759
760 %dir /lib/grub.d
761 %doc /lib/grub.d/README
762 %attr(755,root,root) /lib/grub.d/00_header
763 %attr(755,root,root) /lib/grub.d/10_linux
764 %attr(755,root,root) /lib/grub.d/20_linux_xen
765 %attr(755,root,root) /lib/grub.d/30_os-prober
766 %attr(755,root,root) /lib/grub.d/41_custom
767
768 %ifarch %{ix86} %{x8664} x32
769 %attr(755,root,root) %{_sbindir}/grub-probe
770 %{_mandir}/man8/grub-probe.8*
771 %endif
772
773 %{_infodir}/grub*.info*
774
775 %dir %{_datadir}/grub/themes
776
777 %files -n bash-completion-%{name}
778 %defattr(644,root,root,755)
779 /etc/bash_completion.d/grub
780
781 %if %{with unifont}
782 %files fonts
783 %defattr(644,root,root,755)
784 %{_libexecdir}/ascii.h
785 %{_libexecdir}/ascii.pf2
786 %{_libexecdir}/euro.pf2
787 %{_libexecdir}/unicode.pf2
788 %{_libexecdir}/widthspec.h
789 %endif
790
791 %if %{with arc}
792 %files platform-arc
793 %defattr(644,root,root,755)
794 %dir %{_libexecdir}/%{arc_arch}-arc
795 %{_libexecdir}/%{arc_arch}-arc/modinfo.sh
796 %{_libexecdir}/%{arc_arch}-arc/*.lst
797 %{_libexecdir}/%{arc_arch}-arc/*.mod
798 %{_libexecdir}/%{arc_arch}-arc/*.module
799 %{_libexecdir}/%{arc_arch}-arc/config.h
800 %{_libexecdir}/%{arc_arch}-arc/gdb_grub
801 %{_libexecdir}/%{arc_arch}-arc/gmodule.pl
802 %{_libexecdir}/%{arc_arch}-arc/kernel.exec
803 %{_libexecdir}/%{arc_arch}-arc/kernel.img
804 %endif
805
806 %if %{with coreboot}
807 %files platform-coreboot
808 %defattr(644,root,root,755)
809 %dir %{_libexecdir}/%{coreboot_arch}-coreboot
810 %{_libexecdir}/%{coreboot_arch}-coreboot/modinfo.sh
811 %{_libexecdir}/%{coreboot_arch}-coreboot/*.lst
812 %{_libexecdir}/%{coreboot_arch}-coreboot/*.mod
813 %{_libexecdir}/%{coreboot_arch}-coreboot/*.module
814 %{_libexecdir}/%{coreboot_arch}-coreboot/config.h
815 %{_libexecdir}/%{coreboot_arch}-coreboot/gdb_grub
816 %{_libexecdir}/%{coreboot_arch}-coreboot/gmodule.pl
817 %{_libexecdir}/%{coreboot_arch}-coreboot/kernel.exec
818 %{_libexecdir}/%{coreboot_arch}-coreboot/kernel.img
819 %if %{with efiemu}
820 %{_libexecdir}/%{coreboot_arch}-coreboot/efiemu*.o
821 %endif
822 %endif
823
824 %if %{with efi}
825 %files platform-efi
826 %defattr(644,root,root,755)
827 %attr(755,root,root) /lib/grub.d/30_uefi-firmware
828 %dir %{_libexecdir}/%{efi_arch}-efi
829 %{_libexecdir}/%{efi_arch}-efi/modinfo.sh
830 %{_libexecdir}/%{efi_arch}-efi/*.lst
831 %{_libexecdir}/%{efi_arch}-efi/*.mod
832 %{_libexecdir}/%{efi_arch}-efi/*.module
833 %{_libexecdir}/%{efi_arch}-efi/config.h
834 %{_libexecdir}/%{efi_arch}-efi/gdb_grub
835 %{_libexecdir}/%{efi_arch}-efi/gmodule.pl
836 %{_libexecdir}/%{efi_arch}-efi/kernel.exec
837 %{_libexecdir}/%{efi_arch}-efi/kernel.img
838 %endif
839
840 %if %{with ieee1275}
841 %files platform-ieee1275
842 %defattr(644,root,root,755)
843 %dir %{_libexecdir}/%{ieee1275_arch}-ieee1275
844 %{_libexecdir}/%{ieee1275_arch}-ieee1275/modinfo.sh
845 %{_libexecdir}/%{ieee1275_arch}-ieee1275/*.lst
846 %{_libexecdir}/%{ieee1275_arch}-ieee1275/*.mod
847 %{_libexecdir}/%{ieee1275_arch}-ieee1275/*.module
848 %{_libexecdir}/%{ieee1275_arch}-ieee1275/config.h
849 %{_libexecdir}/%{ieee1275_arch}-ieee1275/gdb_grub
850 %{_libexecdir}/%{ieee1275_arch}-ieee1275/gmodule.pl
851 %{_libexecdir}/%{ieee1275_arch}-ieee1275/kernel.exec
852 %{_libexecdir}/%{ieee1275_arch}-ieee1275/kernel.img
853 %if %{with efiemu}
854 %{_libexecdir}/%{ieee1275_arch}-ieee1275/efiemu*.o
855 %endif
856 %endif
857
858 %if %{with multiboot}
859 %files platform-multiboot
860 %defattr(644,root,root,755)
861 %dir %{_libexecdir}/i386-multiboot
862 %{_libexecdir}/i386-multiboot/modinfo.sh
863 %{_libexecdir}/i386-multiboot/*.lst
864 %{_libexecdir}/i386-multiboot/*.mod
865 %{_libexecdir}/i386-multiboot/*.module
866 %{_libexecdir}/i386-multiboot/config.h
867 %{_libexecdir}/i386-multiboot/gdb_grub
868 %{_libexecdir}/i386-multiboot/gmodule.pl
869 %{_libexecdir}/i386-multiboot/kernel.exec
870 %{_libexecdir}/i386-multiboot/kernel.img
871 %if %{with efiemu}
872 %{_libexecdir}/i386-multiboot/efiemu*.o
873 %endif
874 %endif
875
876 %if %{with pc}
877 %files platform-pc
878 %defattr(644,root,root,755)
879 %dir %{_libexecdir}/i386-pc
880 %{_libexecdir}/i386-pc/modinfo.sh
881 %{_libexecdir}/i386-pc/*.lst
882 %{_libexecdir}/i386-pc/*.mod
883 %{_libexecdir}/i386-pc/*.module
884 %{_libexecdir}/i386-pc/config.h
885 %{_libexecdir}/i386-pc/gdb_grub
886 %{_libexecdir}/i386-pc/gmodule.pl
887 %{_libexecdir}/i386-pc/boot.image
888 %{_libexecdir}/i386-pc/boot.img
889 %{_libexecdir}/i386-pc/boot_hybrid.image
890 %{_libexecdir}/i386-pc/boot_hybrid.img
891 %{_libexecdir}/i386-pc/cdboot.image
892 %{_libexecdir}/i386-pc/cdboot.img
893 %{_libexecdir}/i386-pc/diskboot.image
894 %{_libexecdir}/i386-pc/diskboot.img
895 %{_libexecdir}/i386-pc/kernel.exec
896 %{_libexecdir}/i386-pc/kernel.img
897 %{_libexecdir}/i386-pc/lnxboot.image
898 %{_libexecdir}/i386-pc/lnxboot.img
899 %{_libexecdir}/i386-pc/lzma_decompress.image
900 %{_libexecdir}/i386-pc/lzma_decompress.img
901 %{_libexecdir}/i386-pc/pxeboot.image
902 %{_libexecdir}/i386-pc/pxeboot.img
903 %if %{with efiemu}
904 %{_libexecdir}/i386-pc/efiemu*.o
905 %endif
906 %endif
907
908 %if %{with qemu}
909 %files platform-qemu
910 %defattr(644,root,root,755)
911 %dir %{_libexecdir}/%{qemu_arch}-%{qemu_plat}
912 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/modinfo.sh
913 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/*.lst
914 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/*.mod
915 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/*.module
916 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/config.h
917 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/gdb_grub
918 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/gmodule.pl
919 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/boot.image
920 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/boot.img
921 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/kernel.exec
922 %{_libexecdir}/%{qemu_arch}-%{qemu_plat}/kernel.img
923 %endif
924
925 %if %{with uboot}
926 %files platform-uboot
927 %defattr(644,root,root,755)
928 %dir %{_libexecdir}/arm-uboot
929 %{_libexecdir}/arm-uboot/modinfo.sh
930 %{_libexecdir}/arm-uboot/*.lst
931 %{_libexecdir}/arm-uboot/*.mod
932 %{_libexecdir}/arm-uboot/*.module
933 %{_libexecdir}/arm-uboot/config.h
934 %{_libexecdir}/arm-uboot/gdb_grub
935 %{_libexecdir}/arm-uboot/gmodule.pl
936 %{_libexecdir}/arm-uboot/kernel.exec
937 %{_libexecdir}/arm-uboot/kernel.img
938 %endif
939
940 %if %{with xen}
941 %files platform-xen
942 %defattr(644,root,root,755)
943 %dir %{_libexecdir}/%{xen_arch}-xen
944 %{_libexecdir}/%{xen_arch}-xen/modinfo.sh
945 %{_libexecdir}/%{xen_arch}-xen/*.lst
946 %{_libexecdir}/%{xen_arch}-xen/*.mod
947 %{_libexecdir}/%{xen_arch}-xen/*.module
948 %{_libexecdir}/%{xen_arch}-xen/config.h
949 %{_libexecdir}/%{xen_arch}-xen/gdb_grub
950 %{_libexecdir}/%{xen_arch}-xen/gmodule.pl
951 %{_libexecdir}/%{xen_arch}-xen/kernel.exec
952 %{_libexecdir}/%{xen_arch}-xen/kernel.img
953 %endif
954
955 %if %{with xen_pvh}
956 %files platform-xen_pvh
957 %defattr(644,root,root,755)
958 %dir %{_libexecdir}/i386-xen_pvh
959 %{_libexecdir}/i386-xen_pvh/modinfo.sh
960 %{_libexecdir}/i386-xen_pvh/*.lst
961 %{_libexecdir}/i386-xen_pvh/*.mod
962 %{_libexecdir}/i386-xen_pvh/*.module
963 %{_libexecdir}/i386-xen_pvh/config.h
964 %{_libexecdir}/i386-xen_pvh/gdb_grub
965 %{_libexecdir}/i386-xen_pvh/gmodule.pl
966 %{_libexecdir}/i386-xen_pvh/kernel.exec
967 %{_libexecdir}/i386-xen_pvh/kernel.img
968 %if %{with efiemu}
969 %{_libexecdir}/i386-xen_pvh/efiemu*.o
970 %endif
971 %endif
972
973 %files mkfont
974 %defattr(644,root,root,755)
975 %attr(755,root,root) %{_sbindir}/grub-mkfont
976 %{_mandir}/man1/grub-mkfont.1*
977
978 %files theme-starfield
979 %defattr(644,root,root,755)
980 %{_datadir}/grub/themes/starfield