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 GPT (default for any UEFI based boot loader) and for reading EXT4 filesystem (/boot can be ext4).
7 _actualname="grub-legacy"
8 _pkgname="${_actualname}-efi-fedora"
13 pkgdesc="Fedora's grub-legacy fork - compiled for UEFI systems"
14 url="https://git.kernel.org/?p=boot/grub-fedora/grub-fedora.git"
15 arch=('i686' 'x86_64') ## CARCH = TARGET_UEFI_ARCH in this case
18 makedepends=('git' 'glibc' 'ncurses' 'diffutils' 'autoconf' 'automake' 'gnu-efi')
19 depends=('dosfstools' 'efibootmgr')
24 options=(strip !emptydirs zipman !libtool docs !buildflags !makeflags)
26 install="${pkgname}.install"
28 _gitroot="git://github.com/vathpela/grub-fedora.git"
30 _gitname="grub-legacy-fedora"
32 # _gitbranch="fedora-16"
38 msg "Connecting to GIT server...."
40 if [[ -d "${srcdir}/${_gitname}/" ]]; then
41 cd "${srcdir}/${_gitname}/"
45 git remote add origin "${_gitroot}"
48 git checkout "${_gitbranch}"
49 git merge "remotes/origin/${_gitbranch}"
50 msg "The local GIT repo has been updated."
52 git clone "${_gitroot}" "${_gitname}"
53 cd "${srcdir}/${_gitname}/"
54 git checkout "${_gitbranch}"
55 msg "GIT checkout done or server timeout"
66 rm -rf "${srcdir}/${_gitname}_build/" || true
67 cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}_build"
69 cd "${srcdir}/${_gitname}_build/"
71 sed "s|0\.97|0\.97-${pkgver}|" -i "${srcdir}/${_gitname}_build/configure.in" || true
72 # sed "s|0\.97|0\.97-${pkgver}|" -i "${srcdir}/${_gitname}_build/configure.ac" || true
84 _CFLAGS="-Os -g -fno-strict-aliasing -fno-stack-protector -Wall -Wno-error -Wno-shadow -Wno-unused -Wno-pointer-sign"
86 CFLAGS="${_CFLAGS}" ./configure \
87 --with-platform="efi" \
88 --disable-auto-linux-mem-opt \
93 CFLAGS="${_CFLAGS}" make
101 cd "${srcdir}/${_gitname}_build/"
103 install -D -m0644 "${srcdir}/${_gitname}_build/efi/grub.efi" "${pkgdir}/boot/efi/efi/grub-legacy/grub-legacy.efi"