PORTNAME=	mfmod_openmetrics
PORTVERSION=	1.2
CATEGORIES=	mail
MASTER_SITES=	http://download.gnu.org.ua/pub/release/${PORTNAME}/ \
		http://download.gnu.org.ua/pub/alpha/${PORTNAME}/

MAINTAINER=	zeus@gnu.org.ua
COMMENT=	OpenMetrics support loadable module for mailfromd
WWW=		https://puszcza.gnu.org.ua/projects/mfmod_openmetrics/

LICENSE=	GPLv3+

BUILD_DEPENDS=	${LOCALBASE}/include/mailfromd/mfmod.h:mail/mailfromd
LIB_DEPENDS=	libgdbm.so:databases/gdbm \
		libmicrohttpd.so:www/libmicrohttpd

USES=		libtool localbase
GNU_CONFIGURE=	yes
INSTALL_TARGET=	install-strip
TEST_TARGET=	check

INFO=		${PORTNAME}
PLIST_FILES=	lib/mailfromd/mfmod_openmetrics.so \
		share/mailfromd/openmetrics.mfl
PORTDOCS=	NEWS README

OPTIONS_DEFINE=	DOCS

post-patch:
	@${REINPLACE_CMD} -e '/sed -n/s,p},p;},' ${WRKSRC}/configure

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>
