# Maintainer: Integral <integral@member.fsf.org>
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: Dimitris Kiziridis <ragouel at outlook dot com>

pkgname=linux-wifi-hotspot-git
_pkgname=${pkgname%-git}
pkgver=4.7.2.r31.g8182f4a
pkgrel=1
pkgdesc="Feature-rich wifi hotspot creator"
arch=('x86_64' 'aarch64')
url="https://github.com/lakinduakash/${_pkgname}"
license=('BSD-2-Clause')
depends=('dnsmasq' 'gtk3' 'hostapd' 'iproute2' 'iw' 'procps-ng' 'qrencode')
makedepends=('git')
optdepends=('haveged: For random MAC generation'
	'wireless_tools: if iw cannot recognize your adapter'
	'bash-completion: for bash completions')
provides=('wihotspot' 'create_ap' "${_pkgname}")
conflicts=('wihotspot' 'create_ap' "${_pkgname}")
backup=('etc/create_ap.conf')
install="${_pkgname}.install"
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
	cd "${_pkgname}/"
	git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	make -C "${_pkgname}/"
}

package() {
	cd "${_pkgname}/"
	make DESTDIR="${pkgdir}" install

	install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${_pkgname}/"
	install -d "${pkgdir}/usr/share/doc/${pkgname}/"
	cp -r docs/* "${pkgdir}/usr/share/doc/${pkgname}/"
}
