# Created by: Christopher Nehren <apeiron+ports@coitusmentis.info>
# $FreeBSD: tags/RELEASE_10_0_0/devel/nant/Makefile 330180 2013-10-12 19:25:53Z sunpoet $

PORTNAME=	nant
PORTVERSION=	0.92
CATEGORIES=	devel
MASTER_SITES=	SF
DISTNAME=	${PORTNAME}-${PORTVERSION}-src

MAINTAINER=	sunpoet@FreeBSD.org
COMMENT=	.NET build tool inspired by Ant

LICENSE=	GPLv2 GPLv3
LICENSE_COMB=	dual

BUILD_DEPENDS=	${LOCALBASE}/bin/mono:${PORTSDIR}/lang/mono
RUN_DEPENDS:=	${BUILD_DEPENDS}

OPTIONS_DEFINE=	DOCS EXAMPLES

INSTALL_TARGET=	install destdir=${STAGEDIR} prefix=${PREFIX}
MAKE_JOBS_UNSAFE=	yes
USES=		gmake pkgconfig
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}

DATADIR=	${PREFIX}/share/NAnt
DOCSDIR=	${PREFIX}/share/doc/NAnt

.include <bsd.port.options.mk>

post-patch:
	@${REINPLACE_CMD} -e 's|lib/pkgconfig|libdata/pkgconfig|' ${WRKSRC}/NAnt.build
.if !${PORT_OPTIONS:MDOCS}
	@${REINPLACE_CMD} -e '851,858 d' ${WRKSRC}/NAnt.build
.endif

post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
	cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}/
.endif

regression-test test: build
	cd ${WRKSRC}/ && ${SETENV} ${MAKE_ENV} ${MAKE} run-test

.include <bsd.port.mk>
