# 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=0.8.0
pkgrel=1
arch=('x86_64' 'i686')
url="https://github.com/vathpela/efibootmgr"
license=('GPL2')
makedepends=('git')
depends=('pciutils' 'efivar' 'zlib')
options=('strip' 'zipman' 'docs' '!emptydirs')

source=("efibootmgr::git+https://github.com/vathpela/efibootmgr.git#tag=efibootmgr-${pkgver}")
#source=("efibootmgr::git+https://github.com/vathpela/efibootmgr.git#commit=099e1107489a24e019e8900f1c44da646945c343")
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"
	echo
	
}

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