PORTNAME=	tclodbc
DISTVERSION=	2.5.1
CATEGORIES=	databases tcl
PKGNAMEPREFIX=	${TCL_PKGNAMEPREFIX}

MAINTAINER=	you@example.org
COMMENT=	ODBC extension for Tcl
#WWW=		https://github.com/jtwile2/tclodbc

LICENSE=	BSD3CLAUSE
# TODO: verify against the license file shipped in the sources
# LICENSE_FILE=	${WRKSRC}/license.terms

LIB_DEPENDS=	libodbc.so:databases/unixODBC libodbcinst.so:databases/unixODBC

USES=		tcl:86+,tea compiler:c++11-lang autoreconf
USE_GITHUB=	yes
GH_ACCOUNT=	jtwile2
GH_PROJECT=	tclodbc
# TODO: set to the real tag or commit hash (e.g. v2.5.1)
GH_TAGNAME=	a5136a8f9e75043a6c8a74a19cd9896776f6ad92

GNU_CONFIGURE=	yes
USE_LDCONFIG=	yes
GNU_CONFIGURE=	yes
CONFIGURE_ARGS+=--with-tcl=${TCL_LIBDIR}

PLIST_SUB=      DISTVERSION=${DISTVERSION}

TCL_PKG=	tclodbc${DISTVERSION}

CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

PORTDOCS=	*
OPTIONS_DEFINE=	DOCS

post-install:
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${TCL_PKG}/lib${PORTNAME}${DISTVERSION}.so
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/*.htm ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>
