# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Murtuza Akhtari <inxsible at gmail dot com>
# Contributor: Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>

pkgname="efibootmgr"
pkgdesc="Tool to modify UEFI Firmware Boot Manager Variables"
pkgver=16
pkgrel=1
arch=('x86_64')
url="https://github.com/rhinstaller/efibootmgr"
license=('GPL2')
makedepends=('git')
depends=('pciutils' 'efivar' 'zlib')
options=('strip' 'zipman' 'docs' '!emptydirs')

source=("efibootmgr::git+https://github.com/rhinstaller/efibootmgr.git#tag=${pkgver}")
#source=("efibootmgr::git+https://github.com/rhinstaller/efibootmgr.git#commit=5e9700c2252eed45f4568f3a7c08c866c2c83c0b")
sha1sums=('SKIP')

pkgver() {
	cd "${srcdir}/efibootmgr/"
	echo "$(git describe --tags)" | sed -e 's|efibootmgr-||g' -e 's|-|\.|g'
}

prepare() {
	
	cd "${srcdir}/efibootmgr/"
	
	git clean -x -d -f
	echo
	
}

build() {
	
	cd "${srcdir}/efibootmgr/"
	
	make EXTRA_CFLAGS="-Os" EFIDIR="/boot/EFI"
	echo
	
}

package() {
	
	cd "${srcdir}/efibootmgr/"
	
	install -d "${pkgdir}/usr/bin/"
	install -D -m0755 "${srcdir}/efibootmgr/src/efibootmgr" "${pkgdir}/usr/bin/efibootmgr"
	
	install -d "${pkgdir}/usr/share/man/man8/"
	install -D -m0644 "${srcdir}/efibootmgr/src/efibootmgr.8" "${pkgdir}/usr/share/man/man8/efibootmgr.8"
	
}
