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