forked from pool/grub2
Accepting request 79800 from devel:openSUSE:Factory
Build an efi subpackage [bnc#713595]. OBS-URL: https://build.opensuse.org/request/show/79800 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=20
This commit is contained in:
parent
0d1923d06e
commit
a584e29ccc
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 25 14:46:04 UTC 2011 - aj@suse.de
|
||||
|
||||
- Fix directory ownership.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 23 12:46:43 UTC 2011 - aj@suse.de
|
||||
|
||||
- Build an efi subpackage [bnc#713595].
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 2 12:10:39 UTC 2011 - dvaleev@novell.com
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
addFilter("zero-length /boot/grub2/grub.cfg")
|
||||
addFilter("zero-length /boot/grub2-efi/grub.cfg")
|
||||
addFilter("non-etc-or-var-file-marked-as-conffile /boot/grub2/grub.cfg")
|
||||
addFilter("non-etc-or-var-file-marked-as-conffile /boot/grub2-efi/grub.cfg")
|
||||
addFilter("non-conffile-in-etc /etc/bash_completion.d/grub")
|
||||
addFilter("non-conffile-in-etc /etc/grub.d/README")
|
||||
addFilter("statically-linked-binary .*/grub2/i386-pc/kernel.img")
|
||||
# We need to supply unstripped files for grub
|
||||
addFilter("unstripped-binary-or-object .*/grub2/i386-pc/.*.mod")
|
||||
addFilter("unstripped-binary-or-object .*/grub2-efi/.*/.*.mod")
|
||||
|
149
grub2.spec
149
grub2.spec
@ -40,6 +40,11 @@ BuildRequires: bison device-mapper-devel flex lzma ruby xz
|
||||
%else
|
||||
%define platform pc
|
||||
%endif
|
||||
# build efi bootloader on some platforms only:
|
||||
%if ! 0%{?efi}
|
||||
%global efi %{ix86} x86_64 ia64
|
||||
%endif
|
||||
|
||||
Version: 1.99
|
||||
Release: 4
|
||||
Summary: Bootloader with support for Linux, Multiboot and more
|
||||
@ -65,7 +70,6 @@ Requires(preun):/sbin/install-info
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
# TODO: ppc
|
||||
ExclusiveArch: %{ix86} x86_64 ppc ppc64
|
||||
|
||||
%description
|
||||
@ -80,21 +84,66 @@ kernel to your existing GRUB menu. Do not replace GRUB (grub package)
|
||||
with it unless you know what are you doing. Refer to README.openSUSE
|
||||
file that is part of this package's documentation for more information.
|
||||
|
||||
%ifarch %{efi}
|
||||
|
||||
%package efi
|
||||
Summary: GRUB2 for EFI systems
|
||||
Group: System/Boot
|
||||
|
||||
%description efi
|
||||
The GRand Unified Bootloader (GRUB) is a highly configurable and customizable
|
||||
bootloader with modular architecture. It support rich variety of kernel formats,
|
||||
file systems, computer architectures and hardware devices. This subpackage
|
||||
provides support for EFI systems.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n grub-%{version} -a 5
|
||||
(cd po && ls *.po | cut -d. -f1 | xargs) >po/LINGUAS
|
||||
sed 's,@setfilename grub.info,@setfilename grub2.info,' docs/grub.texi >docs/grub2.texi
|
||||
sed -i 's,grub.texi,grub2.texi,' docs/Makefile.am
|
||||
# We create (if we build for efi) two copies of the sources
|
||||
# in the Builddir
|
||||
%setup -T -c -n grub-%{version}
|
||||
%setup -D -T -q -n grub-%{version} -a 0
|
||||
(cd grub-%{version};tar xaf %{SOURCE5})
|
||||
(cd grub-%{version}/po && ls *.po | cut -d. -f1 | xargs) >grub-%{version}/po/LINGUAS
|
||||
sed 's,@setfilename grub.info,@setfilename grub2.info,' grub-%{version}/docs/grub.texi >grub-%{version}/docs/grub2.texi
|
||||
sed -i 's,grub.texi,grub2.texi,' grub-%{version}/docs/Makefile.am
|
||||
cd grub-%{version}
|
||||
%patch0 -p1
|
||||
%patch2 -p0
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
cd ..
|
||||
|
||||
# README.openSUSE
|
||||
cp %{SOURCE3} .
|
||||
cp %{SOURCE3} grub-%{version}/
|
||||
%ifarch %{efi}
|
||||
cp -a grub-%{version} grub-efi-%{version}
|
||||
%endif
|
||||
|
||||
%build
|
||||
%ifarch %{efi}
|
||||
cd grub-efi-%{version}
|
||||
# we don't want to let rpm to override *FLAGS by bogus ones
|
||||
CFLAGS=" "
|
||||
CXXFLAGS=" "
|
||||
FFLAGS=" "
|
||||
export CFLAGS CXXFLAGS FFLAGS
|
||||
%configure \
|
||||
TARGET_LDFLAGS=-static \
|
||||
--with-platform=efi \
|
||||
--program-transform-name=s,grub,%{name}-efi,
|
||||
make %{?_smp_mflags}
|
||||
%ifarch %{ix86}
|
||||
%define grubefiarch i386-efi
|
||||
%else
|
||||
%define grubefiarch %{_arch}-efi
|
||||
%endif
|
||||
./grub-mkimage -O %{grubefiarch} -o grub.efi -d grub-core part_gpt hfsplus fat \
|
||||
ext2 btrfs normal chain boot configfile linux appleldr minicmd \
|
||||
loadbios reboot halt search font gfxterm
|
||||
cd ..
|
||||
%endif
|
||||
cd grub-%{version}
|
||||
#./autogen.sh
|
||||
|
||||
# we don't want to let rpm to override *FLAGS by bogus ones
|
||||
@ -113,6 +162,24 @@ export CFLAGS CXXFLAGS FFLAGS
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%ifarch %{efi}
|
||||
cd grub-efi-%{version}
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
# Ghost config file
|
||||
install -d $RPM_BUILD_ROOT/boot/%{name}-efi
|
||||
touch $RPM_BUILD_ROOT/boot/%{name}-efi/grub.cfg
|
||||
ln -s ../boot/%{name}-efi/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg
|
||||
|
||||
install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/opensuse/
|
||||
install -m 755 grub.efi $RPM_BUILD_ROOT/boot/efi/EFI/opensuse/grub.efi
|
||||
# Remove devel files
|
||||
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}-efi/*/*.h
|
||||
|
||||
cd ..
|
||||
%endif
|
||||
|
||||
cd grub-%{version}
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
# Script that makes part of grub.cfg persist across updates
|
||||
@ -153,6 +220,10 @@ if [ -e /boot/%{name}/device.map ]; then
|
||||
/sbin/update-bootloader --refresh || true
|
||||
fi
|
||||
|
||||
%post efi
|
||||
/sbin/install-info %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
||||
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
||||
@ -169,7 +240,13 @@ if [ $1 = 0 ]; then
|
||||
rm -f /boot/%{name}/device.map
|
||||
fi
|
||||
|
||||
%files -f grub.lang
|
||||
%preun efi
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
||||
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
fi
|
||||
|
||||
%files -f grub-%{version}/grub.lang
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/%{name}
|
||||
%{_libdir}/grub/
|
||||
@ -185,8 +262,64 @@ fi
|
||||
# Actually, this is replaced by update-grub from scriptlets,
|
||||
# but it takes care of modified persistent part
|
||||
%config(noreplace) /boot/%{name}/grub.cfg
|
||||
%doc COPYING INSTALL NEWS README THANKS TODO ChangeLog README.openSUSE
|
||||
%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS
|
||||
%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO
|
||||
%doc grub-%{version}/ChangeLog grub-%{version}/README.openSUSE
|
||||
%{_infodir}/grub-dev.info*
|
||||
%{_infodir}/%{name}.info*
|
||||
|
||||
%ifarch %{efi}
|
||||
|
||||
%files efi -f grub-%{version}/grub.lang
|
||||
%defattr(-,root,root,-)
|
||||
%dir /boot
|
||||
%dir /boot/efi
|
||||
%dir /boot/efi/EFI
|
||||
%attr(0755,root,root)/boot/efi/EFI/opensuse
|
||||
/etc/bash_completion.d/grub
|
||||
%{_libdir}/grub2-efi
|
||||
%{_libdir}/grub/
|
||||
%{_sbindir}/grub2-efi-mkconfig
|
||||
%{_sbindir}/grub2-efi-mkdevicemap
|
||||
%{_sbindir}/grub2-efi-mknetdir
|
||||
%{_sbindir}/grub2-efi-install
|
||||
%{_sbindir}/grub2-efi-probe
|
||||
%{_sbindir}/grub2-efi-reboot
|
||||
%{_sbindir}/grub2-efi-set-default
|
||||
#%{_sbindir}/grub2-efi-setup
|
||||
%{_bindir}/grub2-efi-bin2h
|
||||
%{_bindir}/grub2-efi-editenv
|
||||
%{_bindir}/grub2-efi-fstest
|
||||
%{_bindir}/grub2-efi-kbdcomp
|
||||
%{_bindir}/grub2-efi-menulst2cfg
|
||||
# %{_bindir}/grub2-efi-mkelfimage
|
||||
%{_bindir}/grub2-efi-mkfont
|
||||
%{_bindir}/grub2-efi-mklayout
|
||||
%{_bindir}/grub2-efi-mkimage
|
||||
# %{_bindir}/grub2-efi-mkisofs
|
||||
%{_bindir}/grub2-efi-mkpasswd-pbkdf2
|
||||
%{_bindir}/grub2-efi-mkrelpath
|
||||
%ifnarch %{sparc} ppc ppc64
|
||||
%{_bindir}/grub2-efi-mkrescue
|
||||
%endif
|
||||
%ifarch %{sparc} ppc ppc64
|
||||
%{_sbindir}/grub2-efi-ofpathname
|
||||
%endif
|
||||
%{_bindir}/grub2-efi-script-check
|
||||
%dir %{_sysconfdir}/grub.d
|
||||
%config %{_sysconfdir}/grub.d/??_*
|
||||
%{_sysconfdir}/grub.d/README
|
||||
%{_sysconfdir}/grub2-efi.cfg
|
||||
%{_sysconfdir}/default/grub
|
||||
%dir /boot/grub2-efi
|
||||
# Actually, this is replaced by update-grub from scriptlets,
|
||||
# but it takes care of modified persistent part
|
||||
%config(noreplace) /boot/grub2-efi/grub.cfg
|
||||
%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS
|
||||
%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO
|
||||
%doc grub-%{version}/ChangeLog grub-%{version}/README.openSUSE
|
||||
%exclude %{_mandir}
|
||||
%{_infodir}/grub2*
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user