COMMENT =	a library implementing a thin layer on top of PKCS\#11 API

V =		0.4.13
DISTNAME =	libp11-${V}

CATEGORIES =	security

HOMEPAGE = 	https://github.com/OpenSC/libp11/wiki

# LGPL 2.1
PERMIT_PACKAGE =	Yes

SHARED_LIBS +=  p11                       1.0 # 0.4.13
SHARED_LIBS +=  pkcs11                    1.0 # 0.4.13

WANTLIB += 	pthread

SITES =		https://github.com/opensc/libp11/releases/download/${DISTNAME}/

BUILD_DEPENDS +=	devel/pkgconf \
			security/openssl/3.4

USE_LIBTOOL =	gnu

CONFIGURE_STYLE =	gnu
CONFIGURE_ARGS =	--with-enginesdir=${PREFIX}/lib/engines
CONFIGURE_ENV =	CFLAGS="-I${LOCALBASE}/include/eopenssl34" \
		LDFLAGS="-L${LOCALBASE}/lib/eopenssl34 -Wl,-rpath,${LOCALBASE}/lib/eopenssl34"

.include <bsd.port.mk>
