# New ports collection makefile for:	opencdk
# Date created:		15 Jan 2003
# Whom:			Sergei Kolobov <sergei@kolobov.com>
#
# $FreeBSD: ports/security/opencdk/Makefile,v 1.6 2003/02/27 20:32:12 naddy Exp $
#

PORTNAME=	opencdk
PORTVERSION=	0.4.5
CATEGORIES=	security
MASTER_SITES=	${MASTER_SITE_GNUPG} \
		http://www.mirrors.wiretapped.net/security/network-security/gnutls/opencdk/ \
		ftp://ftp.mirrors.wiretapped.net/security/network-security/gnutls/opencdk/ \
		ftp://ftp.gnutls.org/pub/gnutls/opencdk/
MASTER_SITE_SUBDIR=	alpha/gnutls/opencdk

MAINTAINER=	sergei@kolobov.com
COMMENT=	Open Crypto Development Kit

LIB_DEPENDS=	gcrypt.6:${PORTSDIR}/security/libgcrypt

USE_LIBTOOL=	yes
INSTALLS_SHLIB=	yes
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS=	--with-libgcrypt-prefix=${LOCALBASE}
USE_REINPLACE=	yes

DOCS=		AUTHORS NEWS README THANKS

post-patch:
.for file in encrypt.c main.c misc.c
	${REINPLACE_CMD} -e 's/<malloc.h>/<stdlib.h>/' ${WRKSRC}/src/${file}
.endfor

post-install:
	@${MKDIR} ${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/tests/*.c ${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/tests/*.gpg ${EXAMPLESDIR}
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
.for file in ${DOCS}
	${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
.endfor
	${INSTALL_DATA} ${WRKSRC}/doc/opencdk-api.html ${DOCSDIR}
.endif

.include <bsd.port.mk>
