Blame SOURCES/grub.macros

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