1 # $Id: PKGBUILD 82656 2010-06-15 05:20:23Z allan $
2 # Maintainer: Ronald van Haren <ronald.archlinux.org>
3 # Contributor: Douglas Soares de Andrade <dsandrade@gmail.com>
4 # Contributor: judd <jvinet@zeroflux.org>
5 # Contributor: Mario A. Vazquez
6 # Contributor: Jerzy Goca <juras256@epf.pl>
7 # Contributor: Keshav P R
10 __pkgname="${_pkgname}-legacy"
12 # pkgname="${__pkgname}" ## grub-Legacy without graphics support
13 pkgname="${__pkgname}-gfx" ## grub-Legacy with graphics support
17 ## pkgrel follows grub-legacy package in the official repo
20 pkgdesc="GNU GRand Unified Bootloader Legacy version compiled for BIOS systems"
22 if [ "${pkgname}" == "${__pkgname}-gfx" ]
24 pkgdesc="GNU GRand Unified Bootloader Legacy version compiled for BIOS systems - with Graphics support"
28 arch=('i686' 'x86_64')
30 url="http://www.gnu.org/software/grub/grub-legacy.en.html"
32 makedepends=('ncurses')
33 depends=('bash' 'ncurses')
34 options=(strip docs !libtool !emptydirs zipman purge)
35 backup=('boot/grub/menu.lst')
36 install="${__pkgname}.install"
41 if [ "${pkgname}" == "${__pkgname}-gfx" ]
43 conflicts=('grub' 'grub-legacy')
45 provides=('grub' 'grub-legacy' 'grub-gfx')
48 source=("ftp://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.gz"
51 '040_all_grub-0.96-nxstack.patch'
52 '05-grub-0.97-initrdaddr.diff'
55 'grub-0.97-graphics.patch'
56 'grub-0.97-ldflags-objcopy-remove-build-id.patch'
57 'grub-inode-size.patch'
61 'special-devices.patch'
64 sha1sums=('2580626c4579bd99336d3af4482c346c95dac4fb'
65 '885c39d2819620c70bcd91cb9203d0c9e19b886f'
66 'e88a68204c9c9d4bd0b50fa11cab789df4ac55f8'
67 '157b81dbad3576536b08642242accfa1aeb093a9'
68 'adbb4685c98797ffb4dc83561ec75698991dddbd'
69 'a36f34e51efed540f1ddafd78e9c9f6d83e4c8d4'
70 '6057a076110d469fb63e56e57711d281221f9b42'
71 '0ca831c79c9248cddeeaf055b9276bee14e78be9'
72 '61c4b58d2eaa3c1561d8e9d8fc41341ce8882869'
73 '0436aa6fa0b6f768289172f983a3f4b69384629e'
74 'f2e0dff29a7c8a45e90aa07298a1b2a9a9d29afc'
75 '066d7ab1ae442f88e94c9e4f1867ac6682965d06'
76 '45fe668a3779664fb292591f426976b6c784d6c8'
77 'c5e2c94ed0e759590b9eb38c9d979f075d19d7c0'
78 'd1d05c66170fa7ed0dee28cc13de162741debd25')
80 if [ "${CARCH}" == 'x86_64' ]
82 makedepends=(${makedepends[@]} 'gcc-multilib' 'gcc-libs-multilib' 'lib32-glibc' 'binutils-multilib' 'libtool-multilib')
88 cd "${srcdir}/${_pkgname}-${pkgver}"
90 ## set destination architecture here
94 if [ "${pkgname}" == "${__pkgname}-gfx" ]
96 ## apply graphics patch
97 patch -Np1 -i "${srcdir}/grub-0.97-graphics.patch"
101 ## optimizations break the build -- disable them
102 ## adding special devices to grub, patches are from fedora
103 patch -Np1 -i "${srcdir}/special-devices.patch"
104 patch -Np1 -i "${srcdir}/i2o.patch"
105 patch -Np1 -i "${srcdir}/more-raid.patch"
106 patch -Np1 -i "${srcdir}/intelmac.patch"
108 ## Add support for bigger inode size to e2fs_stage1_5
109 patch -Np1 -i "${srcdir}/grub-inode-size.patch"
112 ## http://www.mail-archive.com/bug-grub@gnu.org/msg11458.html
113 patch -Np1 -i "${srcdir}/ext4.patch"
115 ## Objcopy and LDFLAGS remove build-id configure and Makefiles patch, taken from grub-fedora git repo
116 ## http://git.kernel.org/?p=boot/grub-fedora/grub-fedora.git;a=summary
117 patch -Np1 -i "${srcdir}/grub-0.97-ldflags-objcopy-remove-build-id.patch"
119 ## correcting problems for new wersion of autotools
120 sed -e'/^AC_PROG_CC/ a\AM_PROG_CC_C_O\ ' -i "${srcdir}/${_pkgname}-${pkgver}/configure.ac" || true
121 sed -e'/^AC_PROG_CC/ a\AM_PROG_AS\ ' -i "${srcdir}/${_pkgname}-${pkgver}/configure.ac" || true
123 ## recreate ./configure script with the required changes in LDFLAGS and objcopy
129 ## CFLAGS taken from grub-fedora
130 # _CFLAGS="-Os -g -fno-strict-aliasing -Wall -Wno-error -Wno-shadow -Wno-unused -Wno-pointer-sign -m32"
131 _CFLAGS="-Wall -Wno-error -Wno-unused -m32"
133 # if [ "${CARCH}" == 'x86_64' ]
135 # echo "This package has to be built on i686, won't compile on x86_64 without multilib."
139 if [ "${DESTARCH}" == 'x86_64' ]
141 _CFLAGS="${_CFLAGS} -static"
143 ## patch from gentoo for fixing a segfault
144 patch -Np1 -i "${srcdir}/040_all_grub-0.96-nxstack.patch"
146 ## patch from frugalware to make it boot when more than 2GB ram installed
147 patch -Np1 -i "${srcdir}/05-grub-0.97-initrdaddr.diff"
152 CFLAGS="${_CFLAGS}" ./configure --host=i386-pc-linux-gnu \
153 --disable-auto-linux-mem-opt \
154 --prefix=/usr --bindir=/bin --sbindir=/sbin \
155 --mandir=/usr/share/man --infodir=/usr/share/info \
164 cd "${srcdir}/${_pkgname}-${pkgver}"
166 make DESTDIR="${pkgdir}" install
168 install -D -m644 "${srcdir}/menu.lst" "${pkgdir}/boot/grub/menu.lst"
170 if [ "${pkgname}" == "${__pkgname}-gfx" ]
172 ## install the splash image file
173 install -D -m644 "${srcdir}/splash.xpm.gz" "${pkgdir}/boot/grub/splash.xpm.gz"
177 install -D -m755 "${srcdir}/install-grub" "${pkgdir}/sbin/install-grub"
179 if [ "${DESTARCH}" == 'x86_64' ]
181 ## fool makepkg into building a x86_64 package
182 export CARCH="x86_64"