# Created by: fernan@iib.unsam.edu.ar
# $FreeBSD: tags/RELEASE_10_0_0/mail/nmzmail/Makefile 327742 2013-09-20 19:59:12Z bapt $

PORTNAME=	nmzmail
PORTVERSION=	0.1.3
PORTREVISION=	3
CATEGORIES=	mail
MASTER_SITES=	http://www.ecademix.com/JohannesHofmann/ CENKES

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Fast mail searching for mutt

RUN_DEPENDS=	namazu:${PORTSDIR}/databases/namazu2

GNU_CONFIGURE=	yes
USE_GMAKE=	yes

PLIST_FILES=	bin/nmzmail
PORTDOCS=	README	NEWS

NO_STAGE=	yes
pre-extract:
.if !defined(MAX_MAIL_DIRS)
	@ ${ECHO_MSG} "You can define MAX_MAIL_DIRS=n."
	@ ${ECHO_MSG} "nmzmail will only process this many mailboxes, the default is 32."
.endif

post-extract:
.if defined(MAX_MAIL_DIRS)
	@ ${SED} -i.bak -e 's/MAX_MAIL_DIRS 32/MAX_MAIL_DIRS ${MAX_MAIL_DIRS}/' \
	${WRKSRC}/src/nmzmail.c
.endif

post-install:
.if !defined(NOPORTDOCS)
	@${INSTALL} -d ${DOCSDIR}/
	@cd ${WRKSRC}/&&${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}/
.endif

.include <bsd.port.mk>
