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