updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / efilinux-x86_64-git / PKGBUILD
blob52ca9cf3c7dd8753b5a320a792abd5f058f73b28
1 # Maintainer : Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
3 _UEFI_ARCH='x86_64'
4 _GNU_EFI_LIB_DIR='/usr/lib'
6 _actualname="efilinux"
7 _pkgname="${_actualname}-${_UEFI_ARCH}"
8 pkgname="${_pkgname}-git"
10 pkgver=20120102
11 pkgrel=1
12 pkgdesc="Reference Implementation of a Linux Bootloader for ${_UEFI_ARCH} UEFI Firmwares"
13 arch=('any')
14 url="https://github.com/mfleming/efilinux"
15 license=('GPL')
16 makedepends=('git' 'gnu-efi')
17 depends=('dosfstools' 'efibootmgr')
18 provides=("${_actualname}" "${_pkgname}")
19 conflicts=("${_actualname}" "${_pkgname}")
20 options=(!strip docs zipman purge !libtool emptydirs)
21 install="${_actualname}.install"
22 backup=()
24 # _gitroot="git://git.kernel.org/pub/scm/boot/${_actualname}/${_actualname}.git"
25 _gitroot="git://github.com/mfleming/efilinux.git"
26 _gitname="${_actualname}"
27 _gitbranch="master"
29 _update_git() {
30         
31         cd "${srcdir}/"
32         
33         msg "Connecting to GIT server...."
34         
35         if [ -d "${srcdir}/${_gitname}/" ]
36         then
37                 cd "${srcdir}/${_gitname}/"
38                 git reset --hard
39                 git fetch
40                 git checkout "${_gitbranch}"
41                 git merge "remotes/origin/${_gitbranch}"
42                 msg "The local GIT repo has been updated."
43         else
44                 git clone "${_gitroot}" "${_gitname}"
45                 cd "${srcdir}/${_gitname}/"
46                 git checkout "${_gitbranch}"
47                 msg "GIT checkout done or server timeout"
48         fi
49         
50         echo
51         
54 build() {
55         
56         if [ "${CARCH}" == 'x86_64' ]
57         then
58                 _update_git
59                 echo
60         elif [ "${_UEFI_ARCH}" == 'x86_64' ]
61         then
62                 echo "This package can be built only in a x86_64 system."
63                 exit 1
64         fi
65         
66         rm -rf "${srcdir}/${_gitname}_build/" || true
67         cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}_build"
68         
69         cd "${srcdir}/${_gitname}_build"
70         
71         ## Change LIBDIR from /usr/lib64/ to /usr/lib/ in Makefile
72         sed 's|/usr/lib64|/usr/lib|g' -i "${srcdir}/${_gitname}_build/Makefile"
73         
74         CFLAGS="" make ARCH="${_UEFI_ARCH}" CRT0="${_GNU_EFI_LIB_DIR}/crt0-efi-${_UEFI_ARCH}.o" LDSCRIPT="${_GNU_EFI_LIB_DIR}/elf_${_UEFI_ARCH}_efi.lds"
75         echo
76         
79 package() {
80         
81         cd "${srcdir}/${_gitname}_build"
82         
83         install -D -m644 "${srcdir}/${_gitname}_build/${_actualname}.efi" "${pkgdir}/boot/efi/efi/${_actualname}/${_actualname}.efi"
84