%define Werror_cflags %nil # Modules always contain just 32-bit code %define _libdir %{_exec_prefix}/lib # 64bit intel machines use 32bit boot loader # (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then) %ifarch x86_64 %define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu} %global efi_arch x86_64-efi %endif %ifarch %arm %global efi_arch arm-uboot %endif %ifarch %ix86 %global efi_arch i386-efi %endif %global tarversion 2.02~beta3 %global pc_arch i386-pc %define git 10463 %define rel 1 Name: grub2 Version: 2.02 Release: %mkrel -c git%{git} %{rel} Summary: Bootloader with support for Linux, Multiboot and more Group: System/Boot and Init License: GPLv3+ and GPLv2 # unicode font is GPLv2 URL: http://www.gnu.org/software/grub/ Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz #Source0: ftp://ftp.gnu.org/gnu/grub/grub-%%{tarversion}.tar.xz Source2: grub.default Source3: README.Mageia Source4: README.efi Source6: gitignore Source7: grub.patches # pf2 fonts may be regenerated in SOURCES using ./mkfonts Source8: mkfonts Source9: unicode.pf2 Source10: MageiaLogo-Bold-16.pf2 Source11: MageiaLogo-Bold-20.pf2 Source12: MageiaLogo-Bold-28.pf2 Source13: MageiaLogo-Regular-20.pf2 Source14: grub2-mageia-default.png Source15: MageiaLogoFonts-bdf.tar.xz Source20: theme.txt # # Fedora patches: # # generate with do-rebase # Include Fedora patches in Source7 %{expand:%(while read line; do echo $line; done < %{SOURCE7})} # And these are: # git checkout debuginfo # git format-patch fedora-23.. Patch10001: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch Patch10002: 10002-Make-it-possible-to-enabled-build-id-sha1.patch Patch10004: 10004-Add-grub_qdprintf-grub_dprintf-without-the-file-lin.patch Patch10005: 10005-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch # # Mga patches: # Patch20001: grub2-2.00-mga-add_failsafe-10_linux.in.patch Patch20002: grub2-2.00-mga-dont_write_sparse_file_error_to_screen.patch Patch20003: grub2-2.00-mga-dont_write_diskfilter_error_to_screen.patch Patch20004: grub2-2.00-mga-dont_check_uuid_in_installer.patch # # SuSE Patch: # # Fixes Mga#15846 - Grub2 doesn't install the bootloader on btrfs if we # have a dualboot with windows starting at sector 63 Patch30001: grub2-setup-try-fs-embed-if-mbr-gap-too-small.patch BuildRequires: autoconf BuildRequires: autogen BuildRequires: automake BuildRequires: binutils BuildRequires: bison BuildRequires: bzip2-devel BuildRequires: device-mapper-devel BuildRequires: flex BuildRequires: freetype2-devel BuildRequires: freetype-devel BuildRequires: freetype-devel BuildRequires: fuse-devel BuildRequires: gettext-devel BuildRequires: git BuildRequires: glibc-static-devel BuildRequires: help2man BuildRequires: liblzo-devel BuildRequires: libusb-devel BuildRequires: ncurses-devel BuildRequires: python BuildRequires: rpm-devel BuildRequires: ruby BuildRequires: texinfo Conflicts: %{name}-efi Provides: bootloader Provides: grub2bootloader = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} %description This is the second version of the GRUB (Grand Unified Boot-loader), a highly configurable and customizable boot-loader with modular architecture. It supports a wide range of kernel formats, file systems, computer architectures and hardware devices. Refer to the README.Mageia file that is part of this package's documentation for more information. %ifnarch %arm %package efi Summary: Boot-loader with support for EFI Group: System/Boot and Init Conflicts: %{name} Requires(post): efibootmgr Provides: bootloader Provides: grub2bootloader = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} %description efi This is the second version of the GRUB (Grand Unified Boot-loader), a highly configurable and customizable boot-loader with modular architecture. It supports a wide range of kernel formats, file systems, computer architectures and hardware devices. ************************** WARNING ************************ Do not attempt to install this package on a system which is not already using UEFI mode to boot. You cannot switch to UEFI mode by installing this package, the system must be installed in UEFI mode to use it, when it will be installed by default. %endif %ifarch %arm %package uboot Summary: Boot-loader with support for UBOOT Group: System/Boot and Init Provides: bootloader Provides: grub2bootloader = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} %description uboot configurable and customizable boot-loader with modular architecture. It supports a wide range of kernel formats, file systems, computer architectures and hardware devices. %endif %package common Summary: Provides files common to both grub2 and grub2-efi Group: System/Boot and Init Conflicts: memtest86+ < 5.01-7 Conflicts: %{name} < 2.02-0.git9752.19.mga5 Conflicts: %{name}-efi < 2.02-0.git9752.19.mga5 Recommends: os-prober >= 1.53 Recommends: xorriso Requires: grub2bootloader = %{version}-%{release} %description common Common files used by both grub2 and grub2-efi. %package mageia-theme Summary: Provides a graphical theme with a custom Mageia background for grub2 Group: System/Boot and Init Requires: grub2bootloader = %{version} Requires(post): sed Requires(post): coreutils Conflicts: grub2-mageia3-theme-dejavu Conflicts: grub2-mageia4-theme-dejavu Conflicts: grub2-mageia5-theme-dejavu Conflicts: grub2-mageia6-theme-dejavu Conflicts: grub2-mageia-theme-dejavu BuildArch: noarch %description mageia-theme This package provides a custom Mageia graphical theme. It is provided as a separate package so it may be easily excluded from minimal installations where a graphical theme is not required. %prep %setup -q -n grub-%{tarversion} cp %{SOURCE6} .gitignore git init echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore echo '!*.[[:digit:]]' > util/.gitignore git config user.email "%{name}-owner@fedoraproject.org" git config user.name "Fedora Ninjas" git config gc.auto 0 git add . git commit -a -q -m "%{tarversion} baseline." git apply %{patches} util/grub.d/.gitignore echo '!*.[[:digit:]]' > util/.gitignore git config user.email "%{name}-owner@fedoraproject.org" git config user.name "Fedora Ninjas" git config gc.auto 0 git add . git commit -a -q -m "%{tarversion} baseline." git apply %{patches} %{buildroot}/boot/%{name}/custom.cfg < %{buildroot}%{_bindir}/update-grub <> %{_sysconfdir}/default/grub # Add theme echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> %{_sysconfdir}/default/grub # If installing theme outside installer then update menu if [ "x${DURING_INSTALL}" != "x1" ]; then %{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave fi fi # Copy system default background at correct aspect ratio to grub2 default theme if [ -h %{_datadir}/mga/backgrounds/default.png ] && [ "$DURING_INSTALL" != "1" ]; then cp -f %{_datadir}/mga/backgrounds/default.png /boot/%{name}/themes/%{name}-mageia-default.png fi # If updating from below 2.02-0.git10101.4 then re-make grub.cfg once. # grub2 dropped ownership of grub.cfg to avoid rpmnew being created. # Remove rpmnew and after new grub.cfg is created remove rpmsave. Mga#17263 %triggerpostun common -- %{name} < 2.02-0.git10101.4, %{name}-efi < 2.02-0.git10101.4 rm -f /boot/%{name}/grub.cfg.rpmnew %{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave # Take this opportunity to remove some unwanted logs rm -f /var/log/%{name}_preun.log rm -f /var/log/%{name}_post.log rm -f /var/log/%{name}_theme_postun.log %preun # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{pc_arch} rm -rf /boot/%{name}/locale fi %ifnarch %arm %preun efi # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{efi_arch} rm -rf /boot/%{name}/locale fi %endif %postun mageia-theme # Only if uninstalling theme if [ $1 -eq 0 ]; then # Remove theme from config sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt/d' %{_sysconfdir}/default/grub fi %ifnarch %arm %files %dir %{_libdir}/grub %dir %{_libdir}/grub/i386-pc %{_libdir}/grub/i386-pc/* %endif %ifnarch %arm %files efi %doc README.efi %dir %{_libdir}/grub %dir %{_libdir}/grub/%{efi_arch} %{_libdir}/grub/%{efi_arch}/* %endif %ifarch %arm %files uboot %dir %{_libdir}/grub %dir %{_libdir}/grub/%{efi_arch} %{_libdir}/grub/%{efi_arch}/* %endif %files common -f grub.lang %doc COPYING NEWS README THANKS TODO README.Mageia %dir /boot/%{name} %dir /boot/%{name}/fonts %dir /boot/%{name}/themes %{_infodir}/* %{_bindir}/%{name}-* %{_bindir}/update-grub %{_bindir}/update-grub2 %{_sbindir}/%{name}-* %{_datarootdir}/bash-completion/completions/grub %{_sysconfdir}/grub.d/README %{_sysconfdir}/grub.d/00_header %{_sysconfdir}/grub.d/01_users %{_sysconfdir}/grub.d/10_linux %{_sysconfdir}/grub.d/20_linux_xen %{_sysconfdir}/grub.d/20_ppc_terminfo %{_sysconfdir}/grub.d/30_os-prober %config(noreplace) %{_sysconfdir}/grub.d/40_custom %config(noreplace) %{_sysconfdir}/grub.d/41_custom %config(noreplace) %{_sysconfdir}/default/grub %{_datadir}/grub %{_datadir}/grub/unicode.pf2 %config(noreplace) /boot/%{name}/custom.cfg %{_mandir}/man1/%{name}-*.1* %{_mandir}/man8/%{name}-*.8* %files mageia-theme /boot/%{name}/themes/*