# Template file for 'xpadneo'
pkgname=xpadneo
version=0.10.2
revision=1
depends="dkms bluez"
short_desc="Bluetooth driver for Xbox One Wireless Controller"
maintainer="Joshua Krämer <joshua@kraemer.link>"
license="GPL-2.0-only AND GPL-3.0-or-later"
homepage="https://github.com/atar-axis/xpadneo"
distfiles="https://github.com/atar-axis/xpadneo/archive/v${version}.tar.gz"
checksum=8b1ef554b76062ad25ef69c6a5cf946c4aafb727aaf9a4682b9a642d5721fee9
dkms_modules="hid-xpadneo ${version}"

do_install() {
	cd hid-xpadneo
	sed -e "
		s/@DO_NOT_CHANGE@/${version}/
		/REMAKE_INITRD=/d
		/POST_INSTALL=/d
		/POST_REMOVE=/d
		" dkms.conf.in >dkms.conf
	vmkdir usr/src/hid-xpadneo-${version}
	vcopy src usr/src/hid-xpadneo-${version}
	vinstall dkms.conf 644 usr/src/hid-xpadneo-${version}
	vinstall etc-modprobe.d/xpadneo.conf 644 usr/lib/modprobe.d
	vinstall etc-udev-rules.d/60-xpadneo.rules 644 usr/lib/udev/rules.d
}
