COMMENT =		Low level NFC SDK and Programmers API

VERSION =		1.8.0
DISTNAME =		libnfc-${VERSION}

SHARED_LIBS +=  	nfc      6.0 # 6.0

CATEGORIES =		devel

HOMEPAGE =		http://nfc-tools.org/index.php?title=Libnfc

MAINTAINER=		Denis Bodor <dbodor@lefinnois.net>

# LGPL 3.0
PERMIT_PACKAGE =	Yes

SITES =			https://github.com/nfc-tools/libnfc/releases/download/libnfc-${VERSION}/
EXTRACT_SUFX =		.tar.bz2

FLAVORS=		withpcsc
FLAVOR?=

LIBNFC_DRV_BASE= 	acr122s,arygon,pn532_uart,acr122_usb,pn53x_usb
WANTLIB +=		c curses pthread readline usb usb-1.0
LIB_DEPENDS +=		devel/libusb-compat

.if ${FLAVOR:Mwithpcsc}
LIB_DEPENDS +=		security/pcsc-lite
WANTLIB +=		pcsclite
LIBNFC_DRV_PCSC =	acr122_pcsc,pcsc
.endif

CONFIGURE_STYLE =	gnu
CONFIGURE_ARGS +=	--with-drivers=${LIBNFC_DRV_BASE}${LIBNFC_DRV_PCSC}
SEPARATE_BUILD =	Yes
NO_TEST =		Yes

post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/${DISTNAME}
	${INSTALL_DATA} ${WRKSRC}/libnfc.conf.sample \
		${PREFIX}/share/examples/${DISTNAME}

.include <bsd.port.mk>
