# vim:filetype=spec # Modules always contain just 32-bit code %global _libdir %{_exec_prefix}/lib %global _binaries_in_noarch_packages_terminate_build 0 #%%undefine _missing_build_ids_terminate_build %{expand:%%{!?buildsubdir:%%global buildsubdir grub-%{tarversion}}} %{expand:%%{!?_licensedir:%%global license %%%%doc}} %global _configure ../configure %if %{?_with_ccache: 1}%{?!_with_ccache: 0} %global cc_equals CC=/usr/%{_lib}/ccache/gcc %else %global cc_equals %{nil} %endif %global cflags_sed \\\ sed \\\ -e 's/-O. //g' \\\ -e 's/-g /-g3 /g' \\\ -e 's/-fplugin=annobin //g' \\\ -e 's,-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ,,g' \\\ -e 's/-fstack-protector[[:alpha:]-]\\+//g' \\\ -e 's/-Wp,-D_FORTIFY_SOURCE=[[:digit:]]\\+//g' \\\ -e 's/--param=ssp-buffer-size=4//g' \\\ -e 's/-mregparm=3/-mregparm=4/g' \\\ -e 's/-fexceptions//g' \\\ -e 's/-fasynchronous-unwind-tables//g' \\\ -e 's/^/ -fno-strict-aliasing /' \\\ %{nil} %global host_cflags %{expand:%%(echo %{optflags} | %{cflags_sed})} %global target_cflags %{expand:%%(echo %{optflags} | %{cflags_sed})} %global legacy_target_cflags \\\ %{expand:%%(echo %{target_cflags} | \\\ %{cflags_sed} \\\ -e 's/-m64//g' \\\ -e 's/-mcpu=power[[:alnum:]]\\+/-mcpu=power6/g' \\\ )} %global legacy_host_cflags \\\ %{expand:%%(echo %{host_cflags} | \\\ %{cflags_sed} \\\ -e 's/-m64//g' \\\ -e 's/-mcpu=power[[:alnum:]]\\+/-mcpu=power6/g' \\\ )} %global efi_host_cflags %{expand:%%(echo %{host_cflags})} %global efi_target_cflags %{expand:%%(echo %{target_cflags})} %global with_efi_arch 0 %global with_alt_efi_arch 0 %global with_legacy_arch 0 %global grubefiarch %{nil} %global grublegacyarch %{nil} # sparc is always compiled 64 bit %ifarch %{sparc} %global target_cpu_name sparc64 %global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu} %global legacy_target_cpu_name %{_arch} %global legacy_package_arch ieee1275 %global platform ieee1275 %endif # ppc is always compiled 64 bit %ifarch ppc ppc64 ppc64le %global target_cpu_name %{_arch} %global legacy_target_cpu_name powerpc %global legacy_package_arch %{_arch} %global legacy_grub_dir powerpc-ieee1275 %global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu} %global platform ieee1275 %endif %global efi_only aarch64 %{arm} %global efi_arch x86_64 ia64 %{efi_only} %ifarch %{efi_arch} %global with_efi_arch 1 %else %global with_efi_arch 0 %endif %ifarch %{efi_only} %global with_efi_only 1 %else %global with_efi_only 0 %endif %{!?with_efi_arch:%global without_efi_arch 0} %{?with_efi_arch:%global without_efi_arch 1} %{!?with_efi_only:%global without_efi_only 0} %{?with_efi_only:%global without_efi_only 1} ### fixme %ifarch aarch64 %{arm} %global efi_modules " " %else %global efi_modules " backtrace chain usb usbserial_common usbserial_pl2303 usbserial_ftdi usbserial_usbdebug " %endif %ifarch aarch64 %{arm} %global legacy_provides -l %endif %ifarch %{ix86} %global efiarch ia32 %global target_cpu_name i386 %global grub_target_name i386-efi %global package_arch efi-ia32 %global legacy_target_cpu_name i386 %global legacy_package_arch pc %global platform pc %endif %ifarch x86_64 %global efiarch x64 %global target_cpu_name %{_arch} %global grub_target_name %{_arch}-efi %global package_arch efi-x64 %global legacy_target_cpu_name i386 %global legacy_package_arch pc %global platform pc %global alt_efi_arch ia32 %global alt_target_cpu_name i386 %global alt_grub_target_name i386-efi %global alt_platform efi %global alt_package_arch efi-ia32 %global alt_efi_host_cflags %{expand:%%(echo %{efi_host_cflags})} %global alt_efi_target_cflags \\\ %{expand:%%(echo %{target_cflags} | \\\ %{cflags_sed} \\\ -e 's/-m64//g' \\\ )} %endif %ifarch aarch64 %global efiarch aa64 %global target_cpu_name aarch64 %global grub_target_name arm64-efi %global package_arch efi-aa64 %endif %ifarch %{arm} %global efiarch arm %global target_cpu_name arm %global grub_target_name arm-efi %global package_arch efi-arm %global efi_target_cflags \\\ %{expand:%%(echo %{optflags} | \\\ %{cflags_sed} \\\ -e 's/-march=armv7-a[[:alnum:]+-]*/&+nofp/g' \\\ -e 's/-mfpu=[[:alnum:]-]\\+//g' \\\ -e 's/-mfloat-abi=[[:alpha:]]\\+/-mfloat-abi=soft/g' \\\ )} %endif %global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu} %global _alt_target_platform %{alt_target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu} %ifarch %{efi_arch} %global with_efi_arch 1 %global grubefiname grub%{efiarch}.efi %global grubeficdname gcd%{efiarch}.efi %global grubefiarch %{target_cpu_name}-efi %ifarch %{ix86} %global with_efi_modules 0 %global without_efi_modules 1 %else %global with_efi_modules 1 %global without_efi_modules 0 %endif %endif %if 0%{?alt_efi_arch:1} %global with_alt_efi_arch 1 %global grubaltefiname grub%{alt_efi_arch}.efi %global grubalteficdname gcd%{alt_efi_arch}.efi %global grubaltefiarch %{alt_target_cpu_name}-efi %endif %ifnarch %{efi_only} %global with_legacy_arch 1 %global grublegacyarch %{legacy_target_cpu_name}-%{platform} %global moduledir %{legacy_target_cpu_name}-%{platform} %endif %global evr %{epoch}:%{version}-%{release} %ifarch x86_64 %global with_efi_common 1 %global with_legacy_modules 0 %global with_legacy_common 0 %else %global with_efi_common 0 %global with_legacy_common 1 %global with_legacy_modules 1 %endif %define define_legacy_variant() \ %{expand:%%package %%{1}} \ Summary: Bootloader with support for Linux, Multiboot, and more \ Group: System Environment/Base \ Provides: %{name} = %{evr} \ Obsoletes: %{name} < %{evr} \ Requires: %{name}-common = %{evr} \ Requires: %{name}-tools-minimal = %{evr} \ Requires: %{name}-%{1}-modules = %{evr} \ Requires: gettext which file \ Requires: %{name}-tools-extra = %{evr} \ Requires: %{name}-tools = %{evr} \ Requires(pre): dracut \ Requires(post): dracut \ %{expand:%%description %%{1}} \ %{desc} \ This subpackage provides support for %{1} systems. \ \ %{expand:%%{?!buildsubdir:%%define buildsubdir grub-%%{1}-%{tarversion}}}\ %{expand:%%if 0%%{with_legacy_modules} \ %%package %%{1}-modules \ Summary: Modules used to build custom grub images \ Group: System Environment/Base \ BuildArch: noarch \ Requires: %%{name}-common = %%{evr} \ %%description %%{1}-modules \ %%{desc} \ This subpackage provides support for rebuilding your own grub.efi. \ %%endif \ } \ \ %{expand:%%{?!buildsubdir:%%define buildsubdir grub-%%{1}-%{tarversion}}}\ %{expand:%%package %%{1}-tools} \ Summary: Support tools for GRUB. \ Group: System Environment/Base \ Requires: gettext os-prober which file system-logos \ Requires: %{name}-common = %{evr} \ Requires: %{name}-tools-minimal = %{evr} \ Requires: os-prober >= 1.58-11 \ Requires: gettext which file \ \ %{expand:%%description %%{1}-tools} \ %{desc} \ This subpackage provides tools for support of %%{1} platforms. \ %{nil} %define define_efi_variant(o) \ %{expand:%%package %{1}} \ Summary: GRUB for EFI systems. \ Group: System Environment/Base \ Requires: efi-filesystem \ Requires: %{name}-common = %{evr} \ Requires: %{name}-tools-minimal >= %{evr} \ Requires: %{name}-tools-extra = %{evr} \ Requires: %{name}-tools = %{evr} \ Provides: %{name}-efi = %{evr} \ %{?legacy_provides:Provides: %{name} = %{evr}} \ %{-o:Obsoletes: %{name}-efi < %{evr}} \ \ %{expand:%%description %{1}} \ %{desc} \ This subpackage provides support for %{1} systems. \ \ %{expand:%%{?!buildsubdir:%%define buildsubdir grub-%{1}-%{tarversion}}}\ %{expand:%if 0%{?with_efi_modules} \ %{expand:%%package %{1}-modules} \ Summary: Modules used to build custom grub.efi images \ Group: System Environment/Base \ BuildArch: noarch \ Requires: %{name}-common = %{evr} \ Provides: %{name}-efi-modules = %{evr} \ Obsoletes: %{name}-efi-modules < %{evr} \ %{expand:%%description %{1}-modules} \ %{desc} \ This subpackage provides support for rebuilding your own grub.efi. \ %endif} \ \ %{expand:%%package %{1}-cdboot} \ Summary: Files used to boot removeable media with EFI \ Group: System Environment/Base \ Requires: %{name}-common = %{evr} \ Provides: %{name}-efi-cdboot = %{evr} \ %{expand:%%description %{1}-cdboot} \ %{desc} \ This subpackage provides optional components of grub used with removeable media on %{1} systems.\ %{nil} %global do_common_setup() \ %setup -q -n grub-%{tarversion} \ rm -fv docs/*.info \ cp %{SOURCE6} .gitignore \ cp %{SOURCE8} ./grub-core/tests/strtoull_test.c \ git init \ echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore \ echo '!*.[[:digit:]]' > util/.gitignore \ echo '!config.h' > include/grub/emu/.gitignore \ git config user.email "%{name}-owner@fedoraproject.org" \ git config user.name "Fedora Ninjas" \ git config gc.auto 0 \ rm -f configure \ git add . \ git commit -a -q -m "%{tarversion} baseline." \ git apply --index --whitespace=nowarn %{SOURCE3} \ git commit -a -q -m "%{tarversion} master." \ git am --whitespace=nowarn %%{patches}