grub2/grub2.spec

275 lines
8.6 KiB
RPMSpec
Raw Normal View History

2008-08-27 08:07:28 +00:00
# Modules always contain just 32-bit code
%define _libdir %{_exec_prefix}/lib
2009-09-12 02:25:07 +00:00
# 64bit intel machines use 32bit boot loader
2008-08-27 08:07:28 +00:00
# (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then)
%ifarch x86_64
%define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu}
%endif
2009-09-12 02:25:07 +00:00
#sparc is always compile 64 bit
%ifarch %{sparc}
%define _target_platform sparc64-%{_vendor}-%{_target_os}%{?_gnu}
%endif
2008-08-27 08:07:28 +00:00
Name: grub2
2009-11-10 19:43:01 +00:00
Epoch: 1
Version: 1.97.1
2009-11-10 20:41:16 +00:00
Release: 2%{?dist}
2008-08-27 08:07:28 +00:00
Summary: Bootloader with support for Linux, Multiboot and more
Group: System Environment/Base
License: GPLv3+
URL: http://www.gnu.org/software/grub/
2009-11-10 19:43:01 +00:00
Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{version}.tar.gz
2008-08-27 08:07:28 +00:00
Source1: 90_persistent
Source2: grub.default
Source3: README.Fedora
2009-09-12 02:25:07 +00:00
Patch0: grub-1.95-grubdir.patch
Patch1: http://fedorapeople.org/~lkundrak/grub2/grub2-dlsym-v4.patch
2008-08-27 08:07:28 +00:00
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: flex bison ruby binutils
BuildRequires: ncurses-devel lzo-devel
2009-11-10 18:49:52 +00:00
BuildRequires: freetype-devel libusb-devel
2009-09-12 02:25:07 +00:00
%ifarch %{sparc}
BuildRequires: /usr/lib64/crt1.o glibc-static
%else
2009-03-01 13:15:33 +00:00
BuildRequires: /usr/lib/crt1.o glibc-static
2009-09-12 02:25:07 +00:00
%endif
BuildRequires: autoconf automake
2008-08-27 08:07:28 +00:00
# grubby
Requires(pre): mkinitrd
Requires(post): mkinitrd
# TODO: ppc and sparc
2009-09-12 02:25:07 +00:00
ExclusiveArch: %{ix86} x86_64 %{sparc}
2008-08-27 08:07:28 +00:00
%description
This is the second version of the GRUB (Grand Unified Bootloader),
a highly configurable and customizable bootloader with modular
architecture. It support rich scale of kernel formats, file systems,
computer architectures and hardware devices.
PLEASE NOTE: This is a development snapshot, and as such will not
replace grub if you install it, but will be merely added as another
kernel to your existing GRUB menu. Do not replace GRUB (grub package)
with it unless you know what are you doing. Refer to README.Fedora
file that is part of this package's documentation for more information.
2008-08-27 08:07:28 +00:00
%prep
2009-11-10 19:43:01 +00:00
%setup -q -n grub-%{version}
2008-08-27 08:07:28 +00:00
2009-09-12 02:25:07 +00:00
%patch0 -p1 -b .grubdir
%patch1 -p1 -b .dlsym
2008-08-27 08:07:28 +00:00
# README.Fedora
cp %{SOURCE3} .
2008-08-27 08:07:28 +00:00
%build
2009-09-12 02:25:07 +00:00
sh autogen.sh
2008-08-27 08:07:28 +00:00
# -static is needed so that autoconf script is able to link
# test that looks for _start symbol on 64 bit platforms
%configure TARGET_LDFLAGS=-static \
2009-09-12 02:25:07 +00:00
%ifarch %{sparc}
--with-platform=ieee1275 \
%else
2008-08-27 08:07:28 +00:00
--with-platform=pc \
2009-09-12 02:25:07 +00:00
%endif
2008-08-27 08:07:28 +00:00
--enable-grub-emu \
--program-transform-name=s,grub,%{name},
# TODO: Other platforms. Use alternatives system?
# --with-platform=ieee1275 \
# --with-platform=efi \
# --with-platform=i386-pc \
2009-09-12 02:25:07 +00:00
make %{?_smp_mflags}
2008-08-27 08:07:28 +00:00
#gcc -Inormal -I./normal -I. -Iinclude -I./include -Wall -W -DGRUB_LIBDIR=\"/usr/lib/`echo grub/i386-pc | sed 's&^&&;s,grub,grub2,'`\" -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DGRUB_UTIL=1 -MD -c -o grub_emu-normal_lexer.o normal/lexer.c
#In file included from normal/lexer.c:23:
#include/grub/script.h:26:29: error: grub_script.tab.h: No such file or directory
2009-09-12 02:25:07 +00:00
#make
2008-08-27 08:07:28 +00:00
%install
set -e
rm -fr $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
# Script that makes part of grub.cfg persist across updates
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/
# Ghost config file
install -d $RPM_BUILD_ROOT/boot/%{name}
touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg
ln -s ../boot/%{name}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.cfg
# Install ELF files modules and images were created from into
# the shadow root, where debuginfo generator will grab them from
find $RPM_BUILD_ROOT -name '*.mod' -o -name '*.img' |
while read MODULE
do
BASE=$(echo $MODULE |sed -r "s,.*/([^/]*)\.(mod|img),\1,")
# Symbols from .img files are in .exec files, while .mod
# modules store symbols in .elf. This is just because we
# have both boot.img and boot.mod ...
EXT=$(echo $MODULE |grep -q '.mod' && echo '.elf' || echo '.exec')
TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,")
2009-09-12 02:25:07 +00:00
# install -m 755 -D $BASE$EXT $TGT
2008-08-27 08:07:28 +00:00
done
# Defaults
install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
%clean
rm -rf $RPM_BUILD_ROOT
%post
exec >/dev/null 2>&1
# Create device.map or reuse one from GRUB Legacy
cp -u /boot/grub/device.map /boot/%{name}/device.map 2>/dev/null ||
%{name}-mkdevicemap
# Determine the partition with /boot
BOOT_PARTITION=$(df -h /boot |(read; awk '{print $1; exit}'))
# Generate core.img, but don't let it be installed in boot sector
%{name}-install --grub-setup=/bin/true $BOOT_PARTITION
# Remove stale menu.lst entries
/sbin/grubby --remove-kernel=/boot/%{name}/core.img
# Add core.img as multiboot kernel to GRUB Legacy menu
/sbin/grubby --add-kernel=/boot/%{name}/core.img --title="GNU GRUB 2, (%{version})"
%preun
exec >/dev/null
/sbin/grubby --remove-kernel=/boot/%{name}/core.img
# XXX Ugly
rm -f /boot/%{name}/*.mod
rm -f /boot/%{name}/*.img
rm -f /boot/%{name}/*.lst
rm -f /boot/%{name}/device.map
%triggerin -- kernel, kernel-PAE
exec >/dev/null 2>&1
# Generate grub.cfg
2009-09-12 02:25:07 +00:00
%{name}-mkconfig
2008-08-27 08:07:28 +00:00
%triggerun -- kernel, kernel-PAE
exec >/dev/null 2>&1
# Generate grub.cfg
2009-09-12 02:25:07 +00:00
%{name}-mkconfig
2008-08-27 08:07:28 +00:00
%files
%defattr(-,root,root,-)
%{_libdir}/%{name}
2009-09-12 02:25:07 +00:00
%{_libdir}/grub/
2008-08-27 08:07:28 +00:00
%{_sbindir}/%{name}-mkdevicemap
%{_sbindir}/%{name}-install
%{_sbindir}/%{name}-emu
%{_sbindir}/%{name}-probe
%{_sbindir}/%{name}-setup
2009-09-12 02:25:07 +00:00
%{_sbindir}/%{name}-mkconfig
2008-08-27 08:07:28 +00:00
%{_bindir}/%{name}-mkimage
%{_bindir}/%{name}-mkelfimage
2008-08-27 08:07:28 +00:00
%{_bindir}/%{name}-editenv
2009-11-10 20:41:16 +00:00
%{_bindir}/%{name}-fstest
%{_bindir}/%{name}-mkfont
%{_bindir}/%{name}-mkrescue
2008-08-27 08:07:28 +00:00
%dir %{_sysconfdir}/grub.d
%config %{_sysconfdir}/grub.d/??_*
%{_sysconfdir}/grub.d/README
%{_sysconfdir}/%{name}.cfg
%{_sysconfdir}/default/grub
%dir /boot/%{name}
# 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.Fedora
2008-08-27 08:07:28 +00:00
%exclude %{_mandir}
2009-09-12 02:25:07 +00:00
2008-08-27 08:07:28 +00:00
%changelog
2009-11-10 20:41:16 +00:00
* Tue Nov 10 2009 Dennis Gilmore <dennis@ausil.us> - 1:1.97.1-2
- update filelists
2009-11-10 19:43:01 +00:00
* Tue Nov 10 2009 Dennis Gilmore <dennis@ausil.us> - 1:1.97.1-1
- update to 1.97.1 release
- introduce epoch for upgrades
2009-11-10 18:49:52 +00:00
* Tue Nov 10 2009 Dennis Gilmore <dennis@ausil.us> - 1.98-0.7.20090911svn
- fix BR
* Fri Sep 11 2009 Dennis Gilmore <dennis@ausil.us> - 1.98-0.6.20090911svn
2009-09-12 02:25:07 +00:00
- update to new svn snapshot
- add sparc support
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.98-0.6.20080827svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
2009-03-01 13:15:33 +00:00
* Sun Mar 01 2009 Lubomir Rintel <lkundrak@v3.sk> - 1.98-0.4.20080827svn
- Add missing BR
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.98-0.4.20080827svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Aug 27 2008 Lubomir Rintel <lkundrak@v3.sk> - 1.98-0.3.20080827svn
- Updated SVN snapshot
- Added huge fat warnings
2008-08-27 08:07:28 +00:00
* Fri Aug 08 2008 Lubomir Rintel <lkundrak@v3.sk> - 1.98-0.2.20080807svn
- Correct scriptlet dependencies, trigger on kernel-PAE (thanks to Till Maas)
- Fix build on x86_64 (thanks to Marek Mahut)
* Thu Aug 07 2008 Lubomir Rintel <lkundrak@v3.sk> 1.98-0.1.20080807svn
- Another snapshot
- And much more!
* Mon May 12 2008 Lubomir Kundrak <lkundrak@redhat.com> 1.97-0.1.20080512cvs
- CVS snapshot
- buildid patch upstreamed
* Sat Apr 12 2008 Lubomir Kundrak <lkundrak@redhat.com> 1.96-2
- Pull in 32 bit glibc
- Fix builds on 64 bit
* Sun Mar 16 2008 Lubomir Kundrak <lkundrak@redhat.com> 1.96-1
- New upstream release
- More transformation fixes
- Generate -debuginfo from modules again. This time for real.
- grubby stub
- Make it possible to do configuration changes directly in grub.cfg
- grub.cfg symlink in /etc
* Thu Feb 14 2008 Lubomir Kundrak <lkundrak@redhat.com> 1.95.cvs20080214-3
- Update to latest trunk
- Manual pages
- Add pci.c to DISTLIST
* Mon Nov 26 2007 Lubomir Kundrak <lkundrak@redhat.com> 1.95.cvs20071119-2
- Fix program name transformation in utils
- Moved the modules to /lib
- Generate -debuginfo from modules again
* Sun Nov 18 2007 Lubomir Kundrak <lkundrak@redhat.com> 1.95.cvs20071119-1
- Synchronized with CVS, major specfile cleanup
* Mon Jan 30 2007 Lubomir Kundrak <lkundrak@skosi.org> 1.95-lkundrak1
- Removed redundant filelist entries
* Mon Jan 29 2007 Lubomir Kundrak <lkundrak@skosi.org> 1.95-lkundrak0
- Program name transformation
- Bump to 1.95
- grub-probefs -> grub-probe
- Add modules to -debuginfo
* Tue Sep 12 2006 Lubomir Kundrak <lkundrak@skosi.org> 1.94-lkundrak0
- built the package