Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 00c7f3b98d0f686381db36d111461906 > files > 45

grub-0.97-48.mga7.src.rpm

%define _default_patch_fuzz 2

Summary:        GRand Unified Bootloader
Name:           grub
Version:        0.97
Release:        %mkrel 48
License:        GPLv2+
Group:          System/Boot and Init
URL:            http://www.gnu.org/software/grub/
Source0:        ftp://alpha.gnu.org/gnu/grub/%{name}-%{version}.tar.gz
Source2:        menu.lst.example

# Mandriva patches
Patch10000:     grub-0.5.96.1-ezd.patch
Patch10001:     grub-0.97-gcc4_warnings.patch
Patch10005:     grub-0.95-eltorito.patch
Patch10007:     grub-0.91-nice-magic.patch
Patch10009:     grub-0.95-mem_lower.patch
Patch10015:     grub-0.97-install_sh.patch
Patch10016:     grub-0.97-reiser4.patch
Patch10018:     grub-0.97-please-automake--add-AM_PROG_AS.patch

# gfxboot patch from SuSE
Patch10017:     grub-gfxmenu-v8.diff

# Debian patches
# handle the now default ext3 format (from debian which took it from fedora)
Patch1:         grub-ext3-256byte-inode.patch
# Fix objcopy build-id handling (closes: #837492):
Patch2:         no-pie.patch

# fedora patches
Patch22:        grub-0.94-addsyncs.patch
Patch23:        0002-Add-strspn-strcspn-and-strtok_r.patch
Patch24:        0003-Allow-passing-multiple-image-files-to-the-initrd-com.patch
Patch25:        grub-ext4-support.patch

# patches 100-199 are for features proposed but not accepted upstream
# add support for appending kernel arguments
#XXX patch below conflicts with our graphics patch
#Patch100: grub-0.90-append.patch
# add support for lilo -R-esque select a new os to boot into
Patch101:       grub-0.97-once.patch
Patch102:       grub-0.97-once-info-doc.patch

# patches 500+ are for miscellaneous little things
# support for non-std devs (eg cciss, etc)
Patch500:       grub-0.93-special-device-names.patch
# i2o device support
Patch501:       grub-0.94-i2o.patch
# detect cciss/ida/i2o
Patch502:       grub-0.95-moreraid.patch

# for some reason, using the initrd max part of the setup.S structure
# causes problems on x86_64 and with 4G/4G
Patch505:       grub-0.94-initrdmax.patch

# we need to use O_DIRECT to avoid hitting oddities with caching
Patch800:       grub-0.95-odirect.patch

# the 2.6 kernel no longer does geometry fixups.  so now I get to do it
# instead in userspace everywhere.
Patch1000:      grub-0.95-geometry-26kernel.patch

# Support for booting from a RAID1 device
Patch1100:      grub-0.95-md.patch
Patch1101:      grub-0.97-md-rework--mdv-adapted.patch

# Mark the simulation stack executable
# (otherwise grub segfaults on x86_64 which uses "noexec")
Patch1104:      grub-0.97-nxstack.patch
Patch1105:      grub-0.97-nx-multiinstall.patch

# always use a full path for mdadm.
Patch1110:      grub-0.97-mdadm-path.patch
# always install into the mbr if we're on a raid1 /boot.
Patch1111:      grub-0.95-md-mbr.patch

# gcc4 fixes.
#XXX patch below conflicts with our graphics patch
#Patch1115: grub-0.97-gcc4.patch

# Make non-MBR installs work again on non-raid1.
Patch1120:      grub-0.95-nonmbr.patch

# Make "grub-install --recheck" look like the menace it is.
Patch1130:      grub-0.95-recheck-bad.patch

# Fix missing prototypes, since grub nicely sets -Wmissing-prototypes and
# then tries to build conftests without them.
Patch1135:      grub-0.97-prototypes.patch

# install correctly on dmraid devices
Patch1145:      grub-0.97-dmraid.patch
Patch1146:      grub-0.97-dmraid-recheck-bad--mdv-adapted.patch
Patch1147:      grub-0.97-dmraid-partition-names.patch

# fix mactel keyboard bugs
Patch1148:      grub-0.97-mactel-kbd.patch

# fix error reporting
#XXX not very important, and would need adaptation, skipping
#Patch1149: grub-0.97-stderr.patch

# fix grub-install to notice mpath partitions
Patch1150:      grub-0.97-mpath.patch

# fix grub-install to notice virtio partitions (from fedora)
Patch1154:      grub-0.97-virtio-support.patch

# (from ubuntu) (nb: needed for grub-uuid.diff)
Patch1151:      grub-varargs.diff
# (from ubuntu) (nb: needed for grub-uuid.diff)
Patch1152:      grub-gpt.diff

# (from ubuntu)
# note that uuid support is partial (only in menu.lst), stage2 & menu.lst are
# still accessed through (hdX,Y)
#
# pros of using uuid in menu.lst:
# - menu.lst hd0/hd1 independance.
#   this is mostly useful when menu.lst is read through "configfile"
# missing feature:
# - partition renumbering will still break boot if install.sh is not modified
#  (since install.sh can't use uuid)
#
# anyway, this patch is useful to have even unused, since it allows
# "configfile" to handle ubuntu's menu.lst
Patch1153:      grub-uuid.diff

Patch1155:      grub-0.97-automake.patch

# (from ubuntu)
Patch1156:      objcopy-absolute.diff
Patch1200:      https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch

# Fix bugs pointed out by gcc warnings
Patch1157:	grub-0.97-fixes.path

ExclusiveArch:  %ix86 x86_64 amd64 ia32e

BuildRequires:  autoconf2.5
BuildRequires:  automake1.8
BuildRequires:  libgpm-devel
BuildRequires:  pkgconfig(ncurses)
BuildRequires:  tetex-dvips
BuildRequires:  tetex-latex
BuildRequires:  texinfo
BuildRequires:  texinfo-tex

Provides:       bootloader
Conflicts:      initscripts <= 6.40.2-15

%description
GRUB is a GPLed bootloader intended to unify bootloading across x86
operating systems.  In addition to loading the Linux and *BSD kernels,
it implements the Multiboot standard, which allows for flexible loading
of multiple boot images (needed for modular kernels such as the GNU
Hurd).

%package doc
Summary:        More documentation for grub
Group:          Documentation

%description doc
More documentation for grub.

%prep
%setup -q

%patch1 -p1 -b .256byte-inode
%patch2 -p1 -b .no-pie
%patch22 -p1 -b .addsync
%patch23 -p1 -b .string-functions
%patch24 -p1 -b .multiple-initrd
%patch25 -p1 -b .ext4

%patch101 -p1 -b .bootonce
%patch102 -p1 -b .bootonce-doc -z .pix

%patch500 -p1 -b .raid
%patch501 -p1 -b .i2o
%patch502 -p1 -b .moreraid

%patch505 -p1 -b .initrdmax

%patch800 -p1 -b .odirect

%patch1000 -p1 -b .26geom

%patch1100 -p1 -b .md
%patch1101 -p1 -b .md-rework

%patch1104 -p1 -b .nxstack
%patch1105 -p1 -b .nx-multiinstall

%patch1110 -p1 -b .mdadm-path
%patch1111 -p1 -b .md-mbr

%patch1120 -p1 -b .nonmbr

%patch1130 -p1 -b .recheck-bad

%patch1135 -p1 -b .prototypes

%patch1145 -p1 -b .dmraid
%patch1146 -p1 -b .dmraid-recheck-bad
%patch1147 -p1 -b .dmraid-partition-names

%patch1148 -p1 -b .mactel-kbd

%patch1150 -p1 -b .mpath
%patch1154 -p1 -b .virtio

%patch1151 -p1 -b .varargs
%patch1152 -p1 -b .gpt
%patch1153 -p1 -b .uuid

%patch1155 -p1 -b .automake
%patch1156 -p1 -b .objcopy
%patch1200 -p1 -b .stack

%patch1157 -p1 -b .fixes

%patch10000 -p1
%patch10001 -p1
%patch10005 -p1
%patch10007 -p1
%patch10009 -p1
%patch10015 -p1
#patch10016 -p1
%patch10018 -p1

%patch10017 -p0

%build
# force building grub.info from grub.texi (since patches do not edit both)
rm docs/grub.info

autoreconf -fi

CFLAGS="-Os -g -fno-strict-aliasing -fno-stack-protector -fno-reorder-functions" \
./configure --build=%{_target_platform} \
            --host=%{_host} \
            --target=%{_target} \
            --prefix=%{_prefix} \
            --exec-prefix=/ \
            --bindir=%{_bindir} \
            --mandir=%{_mandir} \
            --infodir=%{_infodir} \
            --disable-auto-linux-mem-opt

%make_build
# Stage2 reboots immediately when this file is built with -Os
sed -i 's/-Os/-O2/' stage2/Makefile
rm -f stage2/pre_stage2_exec-common.o
%make_build
%__make -C docs ps

%install
%make_install

rm -f %{buildroot}%{_infodir}/dir
install -d %{buildroot}/boot/grub
install -m 0644 %{_sourcedir}/menu.lst.example %{buildroot}/boot/grub

%post
if [ -f /boot/grub/install.sh ]; then
	if [ -x /usr/sbin/detectloader ]; then
		LOADER=$(/usr/sbin/detectloader)
		if [ "$LOADER" = "GRUB" ]; then
			for file in /lib/grub/%{_arch}-%{_real_vendor}/*stage*; do
				cp -f $file /boot/grub/ || :
			done
			sh /boot/grub/install.sh > /dev/null
		fi
	fi
fi

%triggerun -- grub <= 0.97-1
# What a hack hell... we need this things because of upgrading from
# previous grub versions. The problem is that previous grub packages
# remove the stage files from /boot/grub in some cases, making the
# system unbootable.
mkdir -p /boot/grub/backup_stagefiles
mv /boot/grub/*stage* /boot/grub/backup_stagefiles/ >/dev/null 2>&1 || :

# Replicate post script code here, because the trigger scripts are
# executed only after post script of this new package, and old
# install.sh was used then. So we need to execute again to use the new
# generated install.sh script.
if [ -f /boot/grub/install.sh ]; then
	if [ -x /usr/sbin/detectloader ]; then
		LOADER=$(/usr/sbin/detectloader)
		if [ "$LOADER" = "GRUB" ]; then
			for file in /lib/grub/%{_arch}-%{_real_vendor}/*stage*; do
				cp -f $file /boot/grub/ || :
			done
			sh /boot/grub/install.sh > /dev/null
		fi
	fi
fi

%triggerpostun -- grub <= 0.97-1
if [ -d /boot/grub/backup_stagefiles ]; then
	for file in /boot/grub/backup_stagefiles/*stage*; do
		if [ ! -f "/boot/grub/`basename $file`" ]; then
			mv $file /boot/grub/ || :
		else
			rm -f $file;
		fi
	done
	rmdir /boot/grub/backup_stagefiles > /dev/null || :
fi

%files
/boot/grub
%{_infodir}/*
%{_mandir}/*/*
/lib/grub
%{_bindir}/mbchk
/sbin/grub*

%files doc
%doc AUTHORS BUGS ChangeLog docs/grub.ps docs/multiboot.ps NEWS README
%doc THANKS TODO


%changelog
* Mon Sep 03 2018 tv <tv> 0.97-48.mga7
  (not released yet)
+ Revision: 1256406
- add 2 patches from Debian/Gentoo:
  o Disable PIE for stage1 and stage2
    This is no use for freestanding binaries and causes an explosion in binary size
  o Add %%esp to list of clobbered registers
- make sure comment ends in %%triggerun instead of %%post
- rely on filetriggers for info system (mga#23482)

* Sun Dec 17 2017 pterjan <pterjan> 0.97-47.mga7
+ Revision: 1183038
- Only build stage2/common.c with -O2, the rest work fine with -Os

* Sat Dec 16 2017 pterjan <pterjan> 0.97-46.mga7
+ Revision: 1182913
- Switch to -O2 to allow users to boot and fix a bug while I am there
- Fix a bug in grub-varargs.diff

* Tue Oct 17 2017 daviddavid <daviddavid> 0.97-45.mga7
+ Revision: 1172413
- drop defattr to fix doc dir execute permission (mga#21870)

* Tue Jan 17 2017 tv <tv> 0.97-44.mga6
+ Revision: 1082143
- do no try to reinvent /boot/grub/install.sh
  (which is generated since at least 2000)
  this was added in order in 0.97-13mdk on Sep 12 2005 in order to upgrade
  Connectiva to Mandriva (which we don't care anymore)

* Fri Feb 19 2016 umeabot <umeabot> 0.97-43.mga6
+ Revision: 969321
- Mageia 6 Mass Rebuild

* Fri Aug 21 2015 tmb <tmb> 0.97-42.mga6
+ Revision: 867457
- rebuild for new gcc

* Wed Oct 15 2014 umeabot <umeabot> 0.97-41.mga5
+ Revision: 745092
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 0.97-40.mga5
+ Revision: 679952
- Mageia 5 Mass Rebuild

* Fri Oct 18 2013 umeabot <umeabot> 0.97-39.mga4
+ Revision: 521325
- Mageia 4 Mass Rebuild

* Sun Jan 20 2013 barjac <barjac> 0.97-38.mga3
+ Revision: 390293
- update group

* Sun Jan 13 2013 sander85 <sander85> 0.97-37.mga3
+ Revision: 377467
- Fix build
+ umeabot <umeabot>
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Tue Nov 27 2012 rtp <rtp> 0.97-36.mga3
+ Revision: 322356
- Build with -fno-reorder-functions to make stage2 work again

* Tue Nov 27 2012 pterjan <pterjan> 0.97-35.mga3
+ Revision: 322205
- Add a patch from me and one from ubuntu to fix build
- Add missing buildrequires
- Fix license
+ ennael <ennael>
- Documentation group
+ blino <blino>
- rebuild to get info pages as xz instead of lzma
+ misc <misc>
- remove Mandriva branding ( https://bugs.mageia.org/show_bug.cgi?id=370 )

* Mon Jan 10 2011 tmb <tmb> 0.97-32.mga1
+ Revision: 4995
- imported package grub