Browse Source

grub: update to grub-fedora.git master (fedora-15)

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@3970 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 13 years ago
parent
commit
4f06b2a9f9
1 changed files with 67 additions and 23 deletions
  1. 67 23
      g/grub/grub-vl.spec

+ 67 - 23
g/grub/grub-vl.spec

@@ -1,3 +1,5 @@
+%define efi_support 0
+
 %ifarch %{ix86}
 %define _host_cpu i386
 %else
@@ -10,7 +12,7 @@ Summary: grub - a Multiboot boot loader.
 Summary(ja): grub - マルチブートローダ
 Name: grub
 Version: 0.97
-Release: 3%{?_dist_release}
+Release: 4%{?_dist_release}
 License: GPL
 Group: System Environment/Base
 URL: http://www.gnu.org/software/grub/
@@ -18,11 +20,14 @@ URL: http://www.gnu.org/software/grub/
 Source0: ftp://alpha.gnu.org/gnu/grub/%{name}-%{version}.tar.gz
 Source1: %{defshell}
 
-Patch10: grub-0.97-prototypes.patch
-Patch100: ext3_256byte_inode.diff
-Patch110: grub-0.97-ext4-support.patch
-Patch120: grub-0.97-build-id=none.patch
-Patch130: grub-0.97-tinfo.patch
+# http://git.kernel.org/?p=boot/grub-fedora/grub-fedora.git;a=summary
+Patch1: grub-fedora-15.patch
+
+#Patch10: grub-0.97-prototypes.patch
+#Patch100: ext3_256byte_inode.diff
+#Patch110: grub-0.97-ext4-support.patch
+#Patch120: grub-0.97-build-id=none.patch
+#Patch130: grub-0.97-tinfo.patch
 
 ExclusiveArch: %{ix86} x86_64
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -61,32 +66,62 @@ GNU GRUB はマルチブートローダです。
 
 %prep
 %setup -q
-%patch10 -p1 -b .prototypes
-%patch100 -p1 -b .ext3_256byte_inode
-%patch110 -p1 -b .ext4
-%patch120 -p1 -b .build-id
-%patch130 -p1 -b .ncurses5
-aclocal
-autoconf
+%patch1 -p1 -b .fedora
+#%patch10 -p1 -b .prototypes
+#%patch100 -p1 -b .ext3_256byte_inode
+#%patch110 -p1 -b .ext4
+#%patch120 -p1 -b .build-id
+#%patch130 -p1 -b .ncurses5
+
+# Modify grub to show the full version number
+sed -i 's/0\.97/%{version}-%{release}/' configure.in
 
 %build
+autoreconf
+autoconf
 GCCVERS=$(gcc --version | head -1 | cut -d\  -f3 | cut -d. -f1)
-CFLAGS="-Os"
+CFLAGS="-Os -g -fno-strict-aliasing -Wall -Werror -Wno-shadow -Wno-unused"
 if [ "$GCCVERS" == "4" ]; then
   CFLAGS="$CFLAGS -Wno-pointer-sign"
 fi
-%ifarch x86_64
-CFLAGS="$CFLAGS -static" 
-%endif
 export CFLAGS
-%configure --disable-auto-linux-mem-opt
+
+%if %{efi_support}
+%configure --sbindir=/sbin \
+  --disable-auto-linux-mem-opt
+  --with-platform=efi
 %__make
+mv efi/grub.efi .
+make clean
+%endif
+
+CFLAGS="$CFLAGS -static" 
+%configure --sbindir=/sbin \
+  --disable-auto-linux-mem-opt
+%__make
+
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%makeinstall
-%{__install} -p -m 644 docs/menu.lst %{buildroot}%{_libdir}/grub/%{_host_cpu}-%{_target_vendor}
-%{__install} -p -m 744 %{SOURCE1} %{buildroot}%{_libdir}/grub/%{_host_cpu}-%{_target_vendor}
+%makeinstall sbindir=${RPM_BUILD_ROOT}/sbin
+mkdir -p ${RPM_BUILD_ROOT}/boot/grub
+%if %{efi_support}
+mkdir -m 0755 -p ${RPM_BUILD_ROOT}/boot/efi/EFI/vine/
+install -m 755 grub.efi ${RPM_BUILD_ROOT}/boot/efi/EFI/vine/grub.efi
+%endif
+%{__install} -p -m 644 docs/menu.lst %{buildroot}%{_datadir}/grub/%{_host_cpu}-%{_target_vendor}
+%{__install} -p -m 744 %{SOURCE1} %{buildroot}%{_datadir}/grub/%{_host_cpu}-%{_target_vendor}
+
+# create compat links
+mkdir -p ${RPM_BUILD_ROOT}/%{_sbindir}
+for i in grub grub-install grub-set-default grub-md5-crypt grub-terminfo ;do
+  ln -sf ../../sbin/$i ${RPM_BUILD_ROOT}/%{_sbindir}/$i
+done
+mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}
+mv ${RPM_BUILD_ROOT}/%{_datadir}/grub ${RPM_BUILD_ROOT}/%{_libdir}/grub
+ln -sf ../%{_lib}/grub ${RPM_BUILD_ROOT}/%{_datadir}/grub
+
+rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -94,7 +129,7 @@ rm -rf $RPM_BUILD_ROOT
 %post
 /sbin/install-info %{_infodir}/grub.info.gz %{_infodir}/dir
 /sbin/install-info %{_infodir}/multiboot.info.gz %{_infodir}/dir
-%{_libdir}/grub/%{_host_cpu}-%{_target_vendor}/%{defshell}
+%{_datadir}/grub/%{_host_cpu}-%{_target_vendor}/%{defshell}
 
 %preun
 if [ $1 = 0 ]; then
@@ -105,13 +140,22 @@ fi
 %files
 %defattr(-,root,root)
 %doc COPYING INSTALL README AUTHORS BUGS ChangeLog NEWS THANKS TODO MAINTENANCE
-%{_bindir}/*
+/boot/grub
+%if %{efi_support}
+%attr(0755,root,root) /boot/efiu/EFI/vine
+%endif
+%{_syssbindir}/*
 %{_sbindir}/*
+%{_bindir}/*
+%{_datadir}/grub
 %{_libdir}/grub
 %{_infodir}/*.info*
 %{_mandir}/man*/*
 
 %changelog
+* Fri May 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-4
+- switch to grub-fedora.git to support new features (ext4/efi/...)
+
 * Wed Mar 23 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.97-3
 - add Patch110 to support ext4 filesystem
 - add Patch120 to build with current binutils