1 # Maintainer : Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
3 # This PKGBUILD is based on grub.spec at https://pkgs.fedoraproject.org/gitweb/?p=grub.git;a=blob_plain;f=grub.spec;hb=HEAD .
5 # This grub-legacy package includes support for booting from GPT and for reading EXT4 filesystem (/boot can be ext4).
7 _actualname="grub-legacy"
8 _pkgname="${_actualname}-fedora"
9 pkgname="${_pkgname}-git"
13 pkgdesc="Fedora's grub-legacy fork - compiled for BIOS systems"
14 url="https://git.kernel.org/?p=boot/grub-fedora/grub-fedora.git"
15 arch=('i686' 'x86_64')
17 makedepends=('git' 'ncurses')
19 optdepends=('python2: For /sbin/grub-crypt python2 script')
20 backup=('boot/grub/grub.conf')
21 conflicts=('grub' "${_actualname}")
22 provides=('grub' "${_actualname}")
23 options=(strip !emptydirs zipman !libtool docs !buildflags !makeflags)
26 sha256sums=('f2d7bea7b2f3e54ca96e1637ae88f73a0f409a04563038d36d25190169339898')
28 install="${pkgname}.install"
30 ## TODO: Need to check whether multilib is really needed for x86_64.
31 if [[ "${CARCH}" == 'x86_64' ]]; then
32 makedepends+=('gcc-multilib' 'gcc-libs-multilib' 'lib32-glibc' 'binutils-multilib' 'libtool-multilib')
36 _gitroot="git://github.com/vathpela/grub-fedora.git"
38 _gitname="grub-legacy-fedora"
40 # _gitbranch="fedora-16"
46 msg "Connecting to GIT server...."
48 if [[ -d "${srcdir}/${_gitname}/" ]]; then
49 cd "${srcdir}/${_gitname}/"
53 git remote add origin "${_gitroot}"
56 git checkout "${_gitbranch}"
57 git merge "remotes/origin/${_gitbranch}"
58 msg "The local GIT repo has been updated."
60 git clone "${_gitroot}" "${_gitname}"
61 cd "${srcdir}/${_gitname}/"
62 git checkout "${_gitbranch}"
63 msg "GIT checkout done or server timeout"
74 rm -rf "${srcdir}/${_gitname}_build/" || true
75 cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}_build"
77 cd "${srcdir}/${_gitname}_build/"
79 sed "s|0\.97|0\.97-${pkgver}|" -i "${srcdir}/${_gitname}_build/configure.in" || true
80 # sed "s|0\.97|0\.97-${pkgver}|" -i "${srcdir}/${_gitname}_build/configure.ac" || true
91 __CFLAGS="-Os -g -fno-strict-aliasing -fno-stack-protector -Wall -Wno-error -Wno-shadow -Wno-unused -Wno-pointer-sign -m32"
93 if [[ "${CARCH}" == 'x86_64' ]]; then
94 _CFLAGS="${__CFLAGS} -static"
99 CFLAGS="${_CFLAGS}" ./configure \
100 --with-platform="pc" \
101 --host=i386-pc-linux-gnu \
102 --disable-auto-linux-mem-opt \
107 --mandir="/usr/share/man" \
108 --infodir="/usr/share/info" \
109 --libdir="/usr/lib" \
110 --datarootdir="/usr/lib"
113 CFLAGS="${_CFLAGS}" make
121 cd "${srcdir}/${_gitname}_build/"
123 make DESTDIR="${pkgdir}" install
125 install -D -m0644 "${srcdir}/grub.conf" "${pkgdir}/boot/grub/grub.conf"
127 sed 's|#! /usr/bin/python|#!/usr/bin/env python2|g' -i "${pkgdir}/sbin/grub-crypt"