aboutsummaryrefslogtreecommitdiffstats
path: root/mail/dovecot2/Makefile
blob: c23f13b0b4d0465354592f3ca90d004d5a87e713 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# New ports collection makefile for:    dovecot2
# Date created:     2010/09/21
# Whom:         Nagy, Attila <bra@fsn.hu>
#
# $FreeBSD$
#

PORTNAME=   dovecot
PORTVERSION=    2.1.8
CATEGORIES= mail ipv6
MASTER_SITES=   http://www.dovecot.org/releases/${PORTVERSION:R}/

MAINTAINER= bra@fsn.hu
COMMENT=    Secure and compact IMAP and POP3 servers

LATEST_LINK=    dovecot2
CONFLICTS=  dovecot-1.[0-9]*

######################################################################
# Anytime PORTVERSION changes please bump PORTREVISION of            #
# mail/dovecot2-pigeonhole and also mail/dovecot2-antispam-plugin.   #
# Please see ports/135311 and ports/146029 for an explanation.       #
#                                                                    #
# Please be careful when updating this port as changes to this port  #
# can break mail/dovecot2-pigeonhole. In order to ensure the least   #
# amount of breakage possible please consult the maintainer of that  #
# port before updating this one.                                     #
######################################################################

USE_ICONV=  yes
USE_RC_SUBR=    dovecot.sh
MAKE_JOBS_SAFE= yes

GNU_CONFIGURE=  yes
CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --localstatedir=/var \
        --with-statedir=/var/db/dovecot \
        --without-shadow
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
USE_LDCONFIG=   ${PREFIX}/lib/dovecot

USERS=      ${PORTNAME} dovenull
GROUPS=     ${USERS}

PROTOCOLS=  imap pop3

# Default requirement for dovecot rc script
_REQUIRE=   LOGIN

OPTIONS_DEFINE= KQUEUE SSL GSSAPI VPOPMAIL LDAP PGSQL MYSQL SQLITE SOLR DOCS EXAMPLES
OPTIONS_DEFAULT=    KQUEUE SSL

KQUEUE_DESC=    kqueue(2) support
VPOPMAIL_DESC=  vpopmail support
SOLR_DESC=  Solr FTS support

.include <bsd.port.pre.mk>

# sed script for dovecot.conf
REINPLACE=  s!%%PROTOCOLS%%!${PROTOCOLS}!g;\
        s!/usr/!${PREFIX}/!g;\
        s!=/usr!=${PREFIX}!g;\
        s!=/etc !=${PREFIX}/etc !g;\
        s!/etc/dovecot!${PREFIX}&!g;\
        s![[:<:]]doc/(dovecot-[^-]+)-example.conf[[:>:]]!${EXAMPLESDIR}/\1.conf!g;\
        s!\#sendmail_path = /usr/.*!sendmail_path = /usr/sbin/sendmail!g;

.if ${PORT_OPTIONS:MDOCS}
DOCS=       AUTHORS COPYING COPYING.LGPL COPYING.MIT INSTALL NEWS TODO README
PORTDOCS=   *
PLIST_SUB+= PORT=""
.else
CONFIGURE_ARGS+=    --without-docs
PLIST_SUB+= PORT="@comment "
.endif

.if ${PORT_OPTIONS:MEXAMPLES}
PORTEXAMPLES=   *
.endif

## kqueue(2) support
#
.if ${PORT_OPTIONS:MKQUEUE)
CONFIGURE_ARGS+=--with-ioloop=kqueue
.endif

## SSL support
#
.if ${PORT_OPTIONS:MSSL}
PROTOCOLS+= imaps pop3s
.else
CONFIGURE_ARGS+=--without-ssl
.endif

## GSSAPI support
#
.if ${PORT_OPTIONS:MGSSAPI}
CONFIGURE_ARGS+=--with-gssapi
.else
CONFIGURE_ARGS+=--without-gssapi
.endif

## VPopMail Support
#
.if ${PORT_OPTIONS:MVPOPMAIL}
BUILD_DEPENDS+= ${LOCALBASE}/vpopmail/bin/vchkpw:${PORTSDIR}/mail/vpopmail
CONFIGURE_ARGS+=--with-vpopmail
.else
CONFIGURE_ARGS+=--without-vpopmail
.endif

## OpenLDAP Support
#
.if ${PORT_OPTIONS:MLDAP}
USE_OPENLDAP=   yes
CONFIGURE_ARGS+=--with-ldap
PLIST_SUB+= LDAP=""
_REQUIRE+=  slapd
.else
CONFIGURE_ARGS+=--without-ldap
PLIST_SUB+= LDAP="@comment "
.endif

## PostgreSQL Support
#
.if ${PORT_OPTIONS:MPGSQL}
USE_PGSQL=  yes
CONFIGURE_ARGS+=--with-pgsql
PLIST_SUB+= SQL=""
_REQUIRE+=  postgresql
.else
CONFIGURE_ARGS+=--without-pgsql
PLIST_SUB+= SQL="@comment "
.endif

## MySQL Support
#
.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=  yes
CONFIGURE_ARGS+=--with-mysql
PLIST_SUB+= SQL=""
_REQUIRE+=  mysql
.else
CONFIGURE_ARGS+=--without-mysql
PLIST_SUB+= SQL="@comment "
.endif

## SQLite Support
#
.if ${PORT_OPTIONS:MSQLITE}
USE_SQLITE= 3
CONFIGURE_ARGS+=--with-sqlite
PLIST_SUB+= SQL=""
.else
CONFIGURE_ARGS+=--without-sqlite
PLIST_SUB+= SQL="@comment "
.endif

## SOLR support
#
.if ${PORT_OPTIONS:MSOLR}
CONFIGURE_ARGS+=--with-solr
BUILD_DEPENDS+= curl:${PORTSDIR}/ftp/curl
LIB_DEPENDS+=   expat:${PORTSDIR}/textproc/expat2
PLIST_SUB+= SOLR=""
.else
CONFIGURE_ARGS+=--without-solr
PLIST_SUB+= SOLR="@comment "
.endif

SUB_LIST=   REQUIRE="${_REQUIRE}"
SUB_FILES=  pkg-deinstall pkg-message

MAN1=       deliver.1 \
        doveadm-altmove.1 \
        doveadm-auth.1 \
        doveadm-config.1 \
        doveadm-director.1 \
        doveadm-dump.1 \
        doveadm-expunge.1 \
        doveadm-fetch.1 \
        doveadm-force-resync.1 \
        doveadm-help.1 \
        doveadm-import.1 \
        doveadm-index.1 \
        doveadm-instance.1 \
        doveadm-kick.1 \
        doveadm-log.1 \
        doveadm-mailbox.1 \
        doveadm-mount.1 \
        doveadm-move.1 \
        doveadm-penalty.1 \
        doveadm-purge.1 \
        doveadm-pw.1 \
        doveadm-quota.1 \
        doveadm-reload.1 \
        doveadm-search.1 \
        doveadm-stop.1 \
        doveadm-user.1 \
        doveadm-who.1 \
        doveadm.1 \
        doveconf.1 \
        dovecot-lda.1 \
        dovecot.1 \
        dsync.1
MAN7=       doveadm-search-query.7

post-patch:
    @${REINPLACE_CMD} -E -e '${REINPLACE}' \
        ${WRKSRC}/doc/example-config/dovecot.conf
    @${REINPLACE_CMD} -E -e'\
        s!-example\.conf[[:>:]]!.conf!g;\
        s!^(confdir[[:space:]]+=[[:space:]]+)\$$\(sysconfdir\)!\1${EXAMPLESDIR}!g;\
        ' ${WRKSRC}/*/Makefile.in ${WRKSRC}/Makefile.in

post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
    @${MKDIR} ${EXAMPLESDIR}
    cd ${WRKSRC}/doc && ${INSTALL_SCRIPT} dovecot-openssl.cnf mkcert.sh ${EXAMPLESDIR}
.endif
.if ${PORT_OPTIONS:MDOCS}
    cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>