# Template file for 'libnfc'
pkgname=libnfc
version=1.8.0
revision=1
build_style=cmake
short_desc="Low level NFC SDK and Programmers API"
hostmakedepends="pkg-config"
makedepends="libusb-devel libusb-compat-devel"
maintainer="Andrea Brancaleoni <abc@pompel.me>"
license="GPL-3"
homepage="http://nfc-tools.org/"
distfiles="https://github.com/nfc-tools/libnfc/archive/libnfc-${version}.tar.gz"
checksum=0ab7d9b41442e7edc2af7c54630396edc73ce51128aa28a5c6e4135dc5595495
CFLAGS="-D_GNU_SOURCE"

pre_configure() {
	sed -i "s|MODE=\"0664\", GROUP=\"plugdev\"|TAG+=\"uaccess\"|g" contrib/udev/93-pn53x.rules
}
post_install() {
	vinstall contrib/udev/93-pn53x.rules         644 usr/lib/udev/rules.d/
	vinstall contrib/linux/blacklist-libnfc.conf 644 usr/lib/modprobe.d/
}
libnfc-devel_package() {
	depends="${makedepends} libnfc>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
