# Maintainer: Kimiblock

pkgname=firefox-extension-location-guard
pkgver=2.5.0
pkgrel=2
arch=('any')
url='https://github.com/chatziko/location-guard'
license=('LicenseRef-unknown')
optdepends=('firefox')
pkgdesc='Hide your geographic location from websites.'
makedepends=('nodejs' 'npm' 'unzip' 'zip' 'git')
source=("source::git+${url}.git#tag=v${pkgver}")
b2sums=('4ef762fd709a32b22b5dbc0376680db33dc646ece8168a686fc72f02ab9d39fa1cfe3d26fa803abdbaae98b4b9162c1d156571b9fc96b821adbfd83cfe3e753d')

prepare() {
	cd source
	git reset --hard
	git clean -fdx
	npm ci
}

build() {
	cd source
	make build-firefox
}

package() {
	cd source
	make package-firefox
	install -Dm644 \
		"${srcdir}/source/build/location-guard-firefox-${pkgver}.xpi" \
		"${pkgdir}/usr/lib/firefox/browser/extensions/jid1-HdwPLukcGQeOSh@jetpack.xpi"
}
