dcavalca / rpms / grub2

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