# Template file for 'airspyhf' 
pkgname=airspyhf
version=1.6.8
revision=1
build_style=cmake
hostmakedepends="pkg-config"
makedepends="libusb-devel"
short_desc="Usermode driver and tools for Airspy HF+"
maintainer="classabbyamp <void@placeviolette.net>"
license="BSD-3-Clause"
homepage="https://github.com/airspy/airspyhf"
distfiles="https://github.com/airspy/airspyhf/archive/refs/tags/${version}.tar.gz"
checksum=cd1e5ae89e09b813b096ae4a328e352c9432a582e03fd7da86760ba60efa77ab

post_install() {
	vlicense LICENSE
	vsed -e 's/GROUP="plugdev"/\0, TAG+="uaccess"/' -i tools/52-airspyhf.rules
}

libairspyhf_package() {
	short_desc+=" - library"
	pkg_install() {
		vmove usr/lib/*.so.*
		vinstall tools/52-airspyhf.rules 644 usr/lib/udev/rules.d/
	}
}

libairspyhf-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}