File grub2.spec of Package grub2
Name: grub
Version: 1.96
Release: 15
Summary: GRUB - the Grand Unified Boot Loader.
Group: System Environment/Base
License: GPL
URL: http://www.gnu.org/software/%{name}/
Source0: ftp://alpha.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
ExclusiveArch: i386 i486 i586 i686 x86_64
BuildRequires: binutils >= 2.9.1.0.23, ncurses-devel, texinfo
BuildRequires: automake lzo-devel glibc-devel
PreReq: /sbin/install-info
Requires: mktemp
Requires: /usr/bin/cmp
Requires: system-logos
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
GRUB (Grand Unified Boot Loader) is an experimental boot loader
capable of booting into most free operating systems - Linux, FreeBSD,
NetBSD, GNU Mach, and others as well as most commercial operating
systems.
%prep
%setup -q
%build
autoreconf --install --force
GCCVERS=$(gcc --version | head -1 | cut -d\ -f3 | cut -d. -f1)
CFLAGS="-Os -g -fno-strict-aliasing -Wall -Wno-shadow -Wno-unused"
if [ "$GCCVERS" == "4" ]; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
%ifarch x86_64
#CFLAGS="$CFLAGS -static"
LDFLAGS="-L%{_libdir}"
export LDFLAGS
%endif
export CFLAGS
%configure --sbindir=/sbin --disable-auto-linux-mem-opt || cat config.log
make
%install
rm -fr $RPM_BUILD_ROOT
%makeinstall sbindir=${RPM_BUILD_ROOT}/sbin
mkdir -p ${RPM_BUILD_ROOT}/boot/grub
rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
%clean
rm -fr $RPM_BUILD_ROOT
%post
if [ "$1" = 1 ]; then
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/grub.info.gz
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/multiboot.info.gz
fi
%preun
if [ "$1" = 0 ] ;then
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/grub.info.gz
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/multiboot.info.gz
fi
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog NEWS README COPYING TODO
/boot/grub
%{_sysconfdir}/grub.d/*
/sbin/grub-mkdevicemap
/sbin/grub-probe
/sbin/grub-setup
/sbin/grub-install
/sbin/update-grub
%{_bindir}/grub-mkimage
%{_bindir}/grub-mkrescue
%{_datadir}/grub
%{_libdir}/grub/update-grub_lib
%{_libdir}/grub/*-pc/*
%changelog
* Wed Jul 16 2008 Carsten Schoene <cs@linux-administrator.com> - 1.96-15
- first try to build grub2 package