aboutsummaryrefslogtreecommitdiffstats
path: root/mail/bmf/Makefile
blob: 3845fc8c820d12e07133526208ea6934ee97b48d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Created by: Sean Chittenden <seanc@FreeBSD.org>
# $FreeBSD$

PORTNAME=   bmf
PORTVERSION=    0.9.4
PORTREVISION=   1
CATEGORIES= mail
MASTER_SITES=   SF

MAINTAINER= ports@FreeBSD.org
COMMENT=    Fst Bayesian Mail Filter compatible with maildrop and procmail

OPTIONS_DEFINE=     BDB MYSQL DEBUG
OPTIONS_DEFAULT=    BDB
BDB_DESC=           Berkeley DB support (may specify w/ WITH_BDB_VER)
MYSQL_DESC=         Adds MySQL Support

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MBDB}
USE_BDB=    40+
CFLAGS+=    -I${BDB_INCLUDE_DIR}
LDFLAGS+=   -L${BDB_LIB_DIR}
CONFIGURE_ARGS+=--with-libdb=yes
CONFIGURE_ENV+= DB_LIBNAME=-l${BDB_LIB_NAME}
.else
CONFIGURE_ARGS+=--with-libdb=no
.endif
.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=  client
CONFIGURE_ARGS+=--with-mysql
.endif

HAS_CONFIGURE=  yes
CONFIGURE_ARGS+=    --without-package

.if ${PORT_OPTIONS:MDEBUG}
CONFIGURE_ARGS+=    --debug=yes
.endif

post-patch:
    ${REINPLACE_CMD} -e 's/@@CC/${CC}/;s/@@CXX/${CXX}/' ${WRKSRC}/configure
    ${REINPLACE_CMD} -e 's/: checkroot/: /g' ${WRKSRC}/Makefile.in

post-install:
    ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/bmf
    ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/bmfconv
    ${MKDIR} ${STAGEDIR}${PREFIX}/share/bmf
    ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${PREFIX}/share/bmf

.include <bsd.port.mk>