b50565
# vim:filetype=spec
b50565
# Modules always contain just 32-bit code
b50565
%global _libdir %{_exec_prefix}/lib
b50565
%global _binaries_in_noarch_packages_terminate_build 0
b50565
#%%undefine _missing_build_ids_terminate_build
b50565
%{expand:%%{!?buildsubdir:%%global buildsubdir grub-%{tarversion}}}
b50565
%{expand:%%{!?_licensedir:%%global license %%%%doc}}
b50565
3619a3
%global _configure ../configure
31ca14
b50565
%if %{?_with_ccache: 1}%{?!_with_ccache: 0}
b50565
%global cc_equals CC=/usr/%{_lib}/ccache/gcc
b50565
%else
b50565
%global cc_equals %{nil}
b50565
%endif
b50565
dcee99
%global cflags_sed						\\\
b50565
	sed							\\\
b50565
		-e 's/-O. //g'					\\\
b50565
		-e 's/-g /-g3 /g'				\\\
28076b
		-e 's/-fplugin=annobin //g'			\\\
28076b
		-e 's,-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ,,g' \\\
b50565
		-e 's/-fstack-protector[[:alpha:]-]\\+//g'	\\\
b50565
		-e 's/-Wp,-D_FORTIFY_SOURCE=[[:digit:]]\\+//g'	\\\
b50565
		-e 's/--param=ssp-buffer-size=4//g'		\\\
b50565
		-e 's/-mregparm=3/-mregparm=4/g'		\\\
b50565
		-e 's/-fexceptions//g'				\\\
b50565
		-e 's/-fasynchronous-unwind-tables//g'		\\\
dcee99
		-e 's/^/ -fno-strict-aliasing /'		\\\
dcee99
		%{nil}
dcee99
dcee99
%global efi_cflags						\\\
dcee99
	%{expand:%%(echo %{optflags} | %{cflags_sed})}
dcee99
dcee99
%global legacy_cflags						\\\
dcee99
	%{expand:%%(echo %{optflags} | 				\\\
dcee99
	%{cflags_sed}						\\\
b50565
		-e 's/-m64//g'					\\\
b50565
		-e 's/-mcpu=power[[:alnum:]]\\+/-mcpu=power6/g'	\\\
dcee99
	)}
b50565
b50565
%global with_efi_arch 0
b50565
%global with_alt_efi_arch 0
b50565
%global with_legacy_arch 0
b50565
%global grubefiarch %{nil}
b50565
%global grublegacyarch %{nil}
b50565
b50565
# sparc is always compiled 64 bit
b50565
%ifarch %{sparc}
b50565
%global target_cpu_name sparc64
b50565
%global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
b50565
%global legacy_target_cpu_name %{_arch}
b50565
%global legacy_package_arch ieee1275
b50565
%global platform ieee1275
b50565
%endif
b50565
# ppc is always compiled 64 bit
b50565
%ifarch ppc ppc64 ppc64le
b50565
%global target_cpu_name %{_arch}
b50565
%global legacy_target_cpu_name powerpc
b50565
%global legacy_package_arch %{_arch}
b50565
%global legacy_grub_dir powerpc-ieee1275
b50565
%global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
b50565
%global platform ieee1275
b50565
%endif
b50565
53a417
b50565
%global efi_only aarch64 %{arm}
a91fed
%global efi_arch x86_64 %{ix86} ia64 %{efi_only}
b50565
%ifarch %{efi_arch}
b50565
%global with_efi_arch 1
b50565
%else
b50565
%global with_efi_arch 0
b50565
%endif
b50565
%ifarch %{efi_only}
b50565
%global with_efi_only 1
b50565
%else
b50565
%global with_efi_only 0
b50565
%endif
b50565
%{!?with_efi_arch:%global without_efi_arch 0}
b50565
%{?with_efi_arch:%global without_efi_arch 1}
b50565
%{!?with_efi_only:%global without_efi_only 0}
b50565
%{?with_efi_only:%global without_efi_only 1}
b50565
b50565
### fixme
b50565
%ifarch aarch64 %{arm}
b50565
%global efi_modules " http linux "
b50565
%else
b50565
%global efi_modules " backtrace http linuxefi usb usbserial_common usbserial_pl2303 usbserial_ftdi usbserial_usbdebug "
b50565
%endif
b50565
e1f4c0
%ifarch aarch64
e1f4c0
%global legacy_provides -l
e1f4c0
%endif
e1f4c0
a91fed
%ifarch %{ix86}
a91fed
%global efiarch ia32
a91fed
%global target_cpu_name i386
a91fed
%global grub_target_name i386-efi
a91fed
%global package_arch efi-ia32
a91fed
a91fed
%global legacy_target_cpu_name i386
a91fed
%global legacy_package_arch pc
a91fed
%global platform pc
a91fed
%endif
a91fed
b50565
%ifarch x86_64
b50565
%global efiarch x64
b50565
%global target_cpu_name %{_arch}
b50565
%global grub_target_name %{_arch}-efi
b50565
%global package_arch efi-x64
b50565
b50565
%global legacy_target_cpu_name i386
b50565
%global legacy_package_arch pc
b50565
%global platform pc
b50565
b50565
%global alt_efi_arch ia32
b50565
%global alt_target_cpu_name i386
b50565
%global alt_grub_target_name i386-efi
b50565
%global alt_platform efi
b50565
%global alt_package_arch efi-ia32
dcee99
%global alt_efi_cflags						\\\
dcee99
	%{expand:%%(echo %{optflags} | 				\\\
dcee99
	%{cflags_sed}						\\\
dcee99
		-e 's/-m64//g'					\\\
dcee99
	)}
b50565
%endif
b50565
b50565
%ifarch aarch64
b50565
%global efiarch aa64
b50565
%global target_cpu_name aarch64
b50565
%global grub_target_name arm64-efi
b50565
%global package_arch efi-aa64
b50565
%endif
b50565
b50565
%ifarch %{arm}
b50565
%global efiarch arm
b50565
%global target_cpu_name arm
b50565
%global grub_target_name arm-efi
b50565
%global package_arch efi-arm
b50565
%endif
b50565
b50565
%global _target_platform %{target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
b50565
%global _alt_target_platform %{alt_target_cpu_name}-%{_vendor}-%{_target_os}%{?_gnu}
b50565
b50565
%ifarch %{efi_arch}
b50565
%global with_efi_arch 1
b50565
%global grubefiname grub%{efiarch}.efi
b50565
%global grubeficdname gcd%{efiarch}.efi
b50565
%global grubefiarch %{target_cpu_name}-efi
a91fed
%ifarch %{ix86}
a91fed
%global with_efi_modules 0
a91fed
%global without_efi_modules 1
a91fed
%else
a91fed
%global with_efi_modules 1
a91fed
%global without_efi_modules 0
a91fed
%endif
b50565
%endif
b50565
b50565
%if 0%{?alt_efi_arch:1}
b50565
%global with_alt_efi_arch 1
b50565
%global grubaltefiname grub%{alt_efi_arch}.efi
b50565
%global grubalteficdname gcd%{alt_efi_arch}.efi
b50565
%global grubaltefiarch %{alt_target_cpu_name}-efi
b50565
%endif
b50565
b50565
# Figure out the right file path to use
b50565
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
b50565
b50565
%ifnarch %{efi_only}
b50565
%global with_legacy_arch 1
b50565
%global grublegacyarch %{legacy_target_cpu_name}-%{platform}
b50565
%global moduledir %{legacy_target_cpu_name}-%{platform}
b50565
%endif
b50565
b50565
%global evr %{epoch}:%{version}-%{release}
b50565
53a417
%ifarch x86_64
b50565
%global with_efi_common 1
53a417
%global with_legacy_modules 0
b50565
%global with_legacy_common 0
53a417
%else
53a417
%global with_efi_common 0
53a417
%global with_legacy_common 1
53a417
%global with_legacy_modules 1
b50565
%endif
b50565
b50565
%define define_legacy_variant()						\
b50565
%{expand:%%package %%{1}}						\
b50565
Summary:	Bootloader with support for Linux, Multiboot, and more	\
b50565
Group:		System Environment/Base					\
152cdc
Provides:	%{name} = %{evr}					\
b52a72
Obsoletes:	%{name} < %{evr}					\
b50565
Requires:	%{name}-common = %{evr}					\
b50565
Requires:	%{name}-tools-minimal = %{evr}				\
b50565
Requires:	%{name}-%{1}-modules = %{evr}				\
b50565
Requires:	gettext which file					\
b50565
Requires:	%{name}-tools-extra = %{evr}				\
b50565
Requires:	%{name}-tools = %{evr}					\
b50565
Requires(pre):	dracut							\
b50565
Requires(post): dracut							\
b50565
%{expand:%%description %%{1}}						\
b50565
%{desc}									\
b50565
This subpackage provides support for %%{1} systems.			\
b50565
									\
b50565
%{expand:%%{?!buildsubdir:%%define buildsubdir grub-%%{1}-%{tarversion}}}\
53a417
%{expand:%%if 0%%{with_legacy_modules}					\
53a417
%%package %%{1}-modules							\
b50565
Summary:	Modules used to build custom grub images		\
b50565
Group:		System Environment/Base					\
b50565
BuildArch:	noarch							\
53a417
Requires:	%%{name}-common = %%{evr}				\
53a417
%%description %%{1}-modules						\
53a417
%%{desc}								\
b50565
This subpackage provides support for rebuilding your own grub.efi.	\
53a417
%%endif									\
53a417
}									\
b50565
									\
b50565
%{expand:%%{?!buildsubdir:%%define buildsubdir grub-%%{1}-%{tarversion}}}\
b50565
%{expand:%%package %%{1}-tools}						\
b50565
Summary:	Support tools for GRUB.					\
b50565
Group:		System Environment/Base					\
b50565
Requires:	gettext os-prober which file system-logos		\
b50565
Requires:	%{name}-common = %{evr}					\
b50565
Requires:	%{name}-tools-minimal = %{evr}				\
b50565
Requires:	os-prober >= 1.58-11					\
b50565
Requires:	gettext which file					\
b50565
									\
b50565
%{expand:%%description %%{1}-tools}					\
b50565
%{desc}									\
b50565
This subpackage provides tools for support of %%{1} platforms.		\
b50565
%{nil}
b50565
152cdc
%define define_efi_variant(o)						\
b50565
%{expand:%%package %{1}}						\
b50565
Summary:	GRUB for EFI systems.					\
b50565
Group:		System Environment/Base					\
b50565
Requires:	%{name}-common = %{evr}					\
b50565
Requires:	%{name}-tools-minimal >= %{evr}				\
b50565
Requires:	%{name}-tools-extra = %{evr}				\
b50565
Requires:	%{name}-tools = %{evr}					\
152cdc
Provides:	%{name}-efi = %{evr}					\
e1f4c0
%{?legacy_provides:Provides:	%{name} = %{evr}}			\
152cdc
%{-o:Obsoletes:	%{name}-efi < %{evr}}					\
b50565
									\
b50565
%{expand:%%description %{1}}						\
b50565
%{desc}									\
b50565
This subpackage provides support for %{1} systems.			\
b50565
									\
b50565
%{expand:%%{?!buildsubdir:%%define buildsubdir grub-%{1}-%{tarversion}}}\
a91fed
%{expand:%if 0%{?with_efi_modules}					\
b50565
%{expand:%%package %{1}-modules}					\
b50565
Summary:	Modules used to build custom grub.efi images		\
b50565
Group:		System Environment/Base					\
b50565
BuildArch:	noarch							\
b50565
Requires:	%{name}-common = %{evr}					\
a91fed
Provides:	%{name}-efi-modules = %{evr}				\
a91fed
Obsoletes:	%{name}-efi-modules < %{evr}				\
b50565
%{expand:%%description %{1}-modules}					\
b50565
%{desc}									\
b50565
This subpackage provides support for rebuilding your own grub.efi.	\
a91fed
%endif}									\
b50565
									\
b50565
%{expand:%%package %{1}-cdboot}						\
b50565
Summary:	Files used to boot removeable media with EFI		\
b50565
Group:		System Environment/Base					\
b50565
Requires:	%{name}-common = %{evr}					\
152cdc
Provides:	%{name}-efi-cdboot = %{evr}				\
b50565
%{expand:%%description %{1}-cdboot}					\
b50565
%{desc}									\
b50565
This subpackage provides optional components of grub used with removeable media on %{1} systems.\
b50565
%{nil}
b50565
b50565
%global do_common_setup()					\
b50565
%setup -q -n grub-%{tarversion}					\
b50565
rm -fv docs/*.info						\
b50565
cp %{SOURCE6} .gitignore					\
b50565
cp %{SOURCE8} ./grub-core/tests/strtoull_test.c			\
b50565
git init							\
b50565
echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore	\
b50565
echo '!*.[[:digit:]]' > util/.gitignore				\
b50565
echo '!config.h' > include/grub/emu/.gitignore			\
b50565
./autogen.sh							\
b50565
git config user.email "%{name}-owner@fedoraproject.org"		\
b50565
git config user.name "Fedora Ninjas"				\
b50565
git config gc.auto 0						\
b50565
git add .							\
b50565
git commit -a -q -m "%{tarversion} baseline."			\
b50565
git am %%{patches} 
b50565
git config --unset user.email					\
b50565
git config --unset user.name					\
b50565
%{nil}
b50565
b50565
%define do_efi_configure()					\
b50565
%configure							\\\
b50565
	%{cc_equals}						\\\
dcee99
	CFLAGS="%{2} -I$(pwd)"					\\\
41c167
	CPPFLAGS="${CPPFLAGS} -I$(pwd)"				\\\
b50565
	TARGET_LDFLAGS=-static					\\\
b50565
        --with-platform=efi					\\\
b50565
	--target=%{1}						\\\
b50565
	--with-grubdir=%{name}					\\\
b50565
        --program-transform-name=s,grub,%{name},		\\\
b50565
	--disable-grub-mount					\\\
b50565
	--disable-werror					\
b50565
%{nil}
b50565
b50565
%define do_efi_build_modules()					\
b50565
make %{?_smp_mflags} ascii.h widthspec.h			\
b50565
make %{?_smp_mflags} -C grub-core				\
b50565
%{nil}
b50565
b50565
%define do_efi_build_all()					\
b50565
make %{?_smp_mflags}						\
b50565
%{nil}
b50565
b50565
%define do_efi_link_utils()					\
b50565
for x in grub-mkimage ; do					\\\
b50565
	ln ../grub-%{1}-%{tarversion}/${x} ./ ;			\\\
b50565
done								\
b50565
%{nil}
b50565
b50565
%ifarch x86_64 aarch64
b50565
%define mkimage()						\
b50565
%{4}./grub-mkimage -O %{1} -o %{2}.orig				\\\
b50565
	-p /EFI/%{efidir} -d grub-core ${GRUB_MODULES}		\
b50565
%{4}./grub-mkimage -O %{1} -o %{3}.orig				\\\
b50565
	-p /EFI/BOOT -d grub-core ${GRUB_MODULES}		\
b50565
%{expand:%%{pesign -s -i %%{2}.orig -o %%{2} -a %%{5} -c %%{6} -n %%{7}}}	\
b50565
%{expand:%%{pesign -s -i %%{3}.orig -o %%{3} -a %%{5} -c %%{6} -n %%{7}}}	\
b50565
%{nil}
b50565
%else
b50565
%define mkimage()						\
b50565
%{4}./grub-mkimage -O %{1} -o %{2}				\\\
b50565
	-p /EFI/%{efidir} -d grub-core ${GRUB_MODULES}		\
b50565
%{4}./grub-mkimage -O %{1} -o %{3}				\\\
b50565
	-p /EFI/BOOT -d grub-core ${GRUB_MODULES}		\
b50565
%{nil}
b50565
%endif
b50565
b50565
%define do_efi_build_images()					\
06b68a
GRUB_MODULES="	all_video boot blscfg btrfs			\\\
06b68a
		cat chain configfile echo			\\\
b50565
		efifwsetup efinet ext2 fat font gfxmenu gfxterm \\\
b50565
		gzio halt hfsplus iso9660 jpeg loadenv loopback \\\
b50565
		lvm lsefi mdraid09 mdraid1x minicmd		\\\
b50565
		normal part_apple part_msdos part_gpt		\\\
b50565
		password_pbkdf2 png reboot			\\\
b50565
		search search_fs_uuid search_fs_file		\\\
b50565
		search_label serial sleep syslinuxcfg test tftp \\\
b50565
		video xfs"					\
b50565
GRUB_MODULES+=%{efi_modules}					\
b50565
%{expand:%%{mkimage %{1} %{2} %{3} %{4}}}			\
b50565
%{nil}
b50565
b50565
%define do_primary_efi_build()					\
b50565
cd grub-%{1}-%{tarversion}					\
b50565
%{expand:%%do_efi_configure %%{4} %%{5}}			\
b50565
%do_efi_build_all						\
b50565
%{expand:%%do_efi_build_images %{grub_target_name} %{2} %{3} ./ } \
b50565
cd ..								\
b50565
%{nil}
b50565
b50565
%define do_alt_efi_build()					\
b50565
cd grub-%{1}-%{tarversion}					\
b50565
%{expand:%%do_efi_configure %%{4} %%{5}}			\
b50565
%do_efi_build_modules						\
b50565
%{expand:%%do_efi_link_utils %{grubefiarch}}			\
b50565
%{expand:%%do_efi_build_images %{alt_grub_target_name} %{2} %{3} ../grub-%{grubefiarch}-%{tarversion}/ } \
b50565
cd ..								\
b50565
%{nil}
b50565
b50565
%define do_legacy_build()					\
b50565
cd grub-%{1}-%{tarversion}					\
b50565
%configure							\\\
b50565
	%{cc_equals}						\\\
dcee99
	CFLAGS="%{legacy_cflags} -I$(pwd)"			\\\
b50565
	TARGET_LDFLAGS=-static					\\\
b50565
        --with-platform=%{platform}				\\\
b50565
	--target=%{_target_platform}				\\\
b50565
	--with-grubdir=%{name}					\\\
b50565
        --program-transform-name=s,grub,%{name},		\\\
b50565
	--disable-grub-mount					\\\
b50565
	--disable-werror					\
b50565
make %{?_smp_mflags}						\
b50565
cd ..								\
b50565
%{nil}
b50565
b50565
%define do_alt_efi_install()					\
b50565
cd grub-%{1}-%{tarversion}					\
78e1a1
install -d -m 700 $RPM_BUILD_ROOT/usr/lib/grub/%{grubaltefiarch}/ \
b50565
find . '(' -iname gdb_grub					\\\
b50565
	-o -iname kernel.exec					\\\
b50565
	-o -iname kernel.img					\\\
b50565
	-o -iname config.h					\\\
b50565
	-o -iname gmodule.pl					\\\
b50565
	-o -iname modinfo.sh					\\\
b50565
	-o -iname '*.lst'					\\\
b50565
	-o -iname '*.mod'					\\\
b50565
	')'							\\\
b50565
	-exec cp {} $RPM_BUILD_ROOT/usr/lib/grub/%{grubaltefiarch}/ \\\; \
Petr Ĺ abata 50a9c3
find $RPM_BUILD_ROOT -type f -iname "*.mod*" -exec chmod a-x {} '\;'	\
78e1a1
install -m 700 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2}	\
78e1a1
install -m 700 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \
b50565
cd ..								\
b50565
%{nil}
b50565
b50565
%define do_efi_install()					\
b50565
cd grub-%{1}-%{tarversion}					\
78e1a1
install -m 700 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/	\
78e1a1
install -m 700 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/loader/entries \
78e1a1
install -m 700 -d $RPM_BUILD_ROOT/boot/grub2/			\
b50565
make DESTDIR=$RPM_BUILD_ROOT install				\
b50565
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub.info ]; then		\
b50565
	rm -f $RPM_BUILD_ROOT%{_infodir}/grub.info		\
b50565
fi								\
b50565
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info ]; then	\
b50565
	rm -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info		\
b50565
fi								\
b50565
find $RPM_BUILD_ROOT -iname "*.module" -exec chmod a-x {} '\;'	\
b50565
touch $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/grub.cfg		\
b50565
ln -sf ../boot/efi/EFI/%{efidir}/grub.cfg			\\\
b50565
	$RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg		\
78e1a1
install -m 700 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2}	\
78e1a1
install -m 700 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \
b50565
install -D -m 644 unicode.pf2					\\\
b50565
	$RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/fonts/unicode.pf2\
b50565
cd ..								\
b50565
%{nil}
b50565
b50565
%define do_legacy_install()					\
b50565
cd grub-%{1}-%{tarversion}					\
b50565
make DESTDIR=$RPM_BUILD_ROOT install				\
b50565
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub.info ]; then		\
b50565
	rm -f $RPM_BUILD_ROOT%{_infodir}/grub.info		\
b50565
fi								\
b50565
if [ -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info ]; then	\
b50565
	rm -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info		\
b50565
fi								\
b50565
ln -s ../boot/%{name}/grub.cfg					\\\
b50565
	${RPM_BUILD_ROOT}%{_sysconfdir}/grub2.cfg		\
b50565
if [ -f $RPM_BUILD_ROOT/%{_libdir}/grub/%{1}/grub2.chrp ]; then \
b50565
	mv $RPM_BUILD_ROOT/%{_libdir}/grub/%{1}/grub2.chrp	\\\
b50565
	   $RPM_BUILD_ROOT/%{_libdir}/grub/%{1}/grub.chrp	\
b50565
fi								\
dcee99
cd ..								\
78e1a1
install -d -m 0755 ${RPM_BUILD_ROOT}/boot/loader/entries	\
b50565
%{nil}
b50565
b50565
%define do_common_install()					\
b50565
install -d -m 0755 						\\\
b50565
	$RPM_BUILD_ROOT%{_datarootdir}/locale/en\@quot		\\\
b50565
	$RPM_BUILD_ROOT%{_datarootdir}/locale/en		\\\
b50565
	$RPM_BUILD_ROOT%{_infodir}/				\
b50565
cp -a $RPM_BUILD_ROOT%{_datarootdir}/locale/en\@quot		\\\
b50565
	$RPM_BUILD_ROOT%{_datarootdir}/locale/en		\
b50565
cp docs/grub.info $RPM_BUILD_ROOT%{_infodir}/%{name}.info	\
b50565
cp docs/grub-dev.info						\\\
b50565
	$RPM_BUILD_ROOT%{_infodir}/%{name}-dev.info		\
b50565
# Ghost config file						\
78e1a1
install -d -m 0700 ${RPM_BUILD_ROOT}/boot/efi/EFI/%{efidir}/	\
b50565
install -d -m 0755 ${RPM_BUILD_ROOT}/boot/grub2/		\
b50565
install -d -m 0755 ${RPM_BUILD_ROOT}/boot/%{name}/themes/system	\
b50565
install -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/default	\
b50565
install -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig	\
b50565
touch ${RPM_BUILD_ROOT}%{_sysconfdir}/default/grub		\
b50565
ln -sf ../default/grub						\\\
b50565
	${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub		\
345233
ln -sf ../efi/EFI/%{efidir}/grubenv				\\\
345233
	$RPM_BUILD_ROOT/boot/grub2/grubenv			\
b50565
touch ${RPM_BUILD_ROOT}/boot/%{name}/grub.cfg			\
b50565
%{nil}
b50565
b50565
%define define_legacy_variant_files()				\
b50565
%{expand:%%files %{1}}						\
b50565
%defattr(-,root,root,-)						\
b50565
%config(noreplace) %{_sysconfdir}/%{name}.cfg			\
b50565
%ghost %config(noreplace) /boot/%{name}/grub.cfg		\
78e1a1
%dir %attr(0700,root,root)/boot/loader/entries			\
b50565
								\
53a417
%{expand:%if 0%{?with_legacy_modules}				\
b50565
%{expand:%%files %{1}-modules}					\
b50565
%defattr(-,root,root)						\
b50565
%dir %{_libdir}/grub/%{2}/					\
b50565
%{_libdir}/grub/%{2}/*						\
b50565
%exclude %{_libdir}/grub/%{2}/*.module				\
31ea67
%exclude %{_libdir}/grub/%{2}/{boot,boot_hybrid,cdboot,diskboot,lzma_decompress,pxeboot}.image \
b50565
%exclude %{_libdir}/grub/%{2}/*.o				\
53a417
%else								\
53a417
%%exclude %%{_libdir}/grub/%%{grublegacyarch}/*			\
53a417
%endif}								\
b50565
%{nil}
b50565
b50565
%define define_efi_variant_files()				\
b50565
%{expand:%%files %{1}}						\
b50565
%defattr(-,root,root,-)						\
b50565
%config(noreplace) %{_sysconfdir}/%{name}-efi.cfg		\
8cceee
%dir %attr(0700,root,root)/boot/efi/EFI/%{efidir}		\
8cceee
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{2}		\
78e1a1
%dir %attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts		\
78e1a1
%dir %attr(0700,root,root)/boot/efi/EFI/%{efidir}/loader/entries \
8cceee
%ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grub.cfg	\
b50565
/boot/grub2/grubenv						\
b50565
%ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grubenv \
a91fed
%{expand:%if 0%{?without_efi_modules}				\
a91fed
%exclude %{_libdir}/grub/%{6}					\
a91fed
%exclude %{_libdir}/grub/%{6}/*					\
a91fed
%endif}								\
b50565
								\
a91fed
%{expand:%if 0%{?with_efi_modules}				\
b50565
%{expand:%%files %{1}-modules}					\
b50565
%defattr(-,root,root,-)						\
b50565
%dir %{_libdir}/grub/%{6}/					\
b50565
%{_libdir}/grub/%{6}/*						\
b50565
%exclude %{_libdir}/grub/%{6}/*.module				\
a91fed
%endif}								\
b50565
								\
b50565
%{expand:%%files %{1}-cdboot}					\
b50565
%defattr(-,root,root,-)						\
8cceee
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{3}		\
8cceee
%attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts		\
b50565
%{nil}