summaryrefslogtreecommitdiff
path: root/mail/dovecot/options.mk
blob: afd694f1a87a8dcb7d0c270bc797a9b2347d1c4a (plain)
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
# $NetBSD: options.mk,v 1.29 2011/06/14 09:37:18 tron Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.dovecot
PKG_SUPPORTED_OPTIONS=	dovecot-sieve dovecot-managesieve gssapi
PKG_SUPPORTED_OPTIONS+=	kqueue ldap mysql pam pgsql sqlite
PKG_OPTIONS_OPTIONAL_GROUPS= ssl
PKG_OPTIONS_GROUP.ssl=	gnutls ssl
PKG_SUGGESTED_OPTIONS=	pam ssl

.if defined(PKG_HAVE_KQUEUE)
PKG_SUGGESTED_OPTIONS+=	kqueue
.endif

.include "../../mk/bsd.options.mk"

###
### Build with OpenSSL or GNU TLS as the underlying crypto library.
###
.if !empty(PKG_OPTIONS:Mssl)
CONFIGURE_ARGS+=	--with-ssl=openssl
CONFIGURE_ENV+=		SSL_CFLAGS="-I${BUILDLINK_PREFIX.openssl}/include"
CONFIGURE_ENV+=		SSL_LIBS="-lssl -lcrypto"
BUILDLINK_API_DEPENDS.openssl+=openssl>=0.9.8a
.  include "../../security/openssl/buildlink3.mk"
.elif !empty(PKG_OPTIONS:Mgnutls)
CONFIGURE_ARGS+=	--with-ssl=gnutls
.  include "../../security/gnutls/buildlink3.mk"
.else
CONFIGURE_ARGS+=	--without-ssl
.endif

###
### MySQL support.
###
.if !empty(PKG_OPTIONS:Mmysql)
CONFIGURE_ARGS+=	--with-mysql
.  include "../../mk/mysql.buildlink3.mk"
.endif

###
### PostgreSQL support.
###
.if !empty(PKG_OPTIONS:Mpgsql)
CONFIGURE_ARGS+=	--with-pgsql
CPPFLAGS+=		-I${BUILDLINK_DIR}/include/pgsql
.  include "../../mk/pgsql.buildlink3.mk"
.endif

###
### LDAP directory support.
###
.if !empty(PKG_OPTIONS:Mldap)
CONFIGURE_ARGS+=	--with-ldap
.  include "../../databases/openldap-client/buildlink3.mk"
.endif

###
### PAM support.
###
.if !empty(PKG_OPTIONS:Mpam)
CONFIGURE_ARGS+=	--with-pam
.  include "../../mk/pam.buildlink3.mk"
.else
CONFIGURE_ARGS+=	--without-pam
.endif

###
### SQLite support.
###
.if !empty(PKG_OPTIONS:Msqlite)
CONFIGURE_ARGS+=	--with-sqlite
.  include "../../databases/sqlite3/buildlink3.mk"
.endif

###
### kqueue support.
###
.if !empty(PKG_OPTIONS:Mkqueue)
CONFIGURE_ARGS+=	--with-ioloop=kqueue
CONFIGURE_ARGS+=	--with-notify=kqueue
.else
# use the defaults
.endif

###
### GSSAPI support.
###
.if !empty(PKG_OPTIONS:Mgssapi)
CONFIGURE_ARGS+=	--with-gssapi
.  include "../../mk/krb5.buildlink3.mk"
.else
CONFIGURE_ARGS+=	--without-gssapi
.endif

###
### Sieve and the ManageSieve patch
###
.if !empty(PKG_OPTIONS:Mdovecot-sieve) || make(distinfo) || make(makesum)
# ManageSieve needs Sieve to build.
# We can't simply use CONFIGURE_DIRS+= and BUILD_DIRS+=
#  because dovecot must be built before sieve can be configured
#  and sieve must be built before managesieve can be configured/built.
# So use post-build in Makefile. Sigh.
#
# Default so we can use += below
DISTFILES=		${DEFAULT_DISTFILES}
PLIST_SRC=		${PLIST_SRC_DFLT:Q}
INSTALL_DIRS=		.
# sieve (must be built after dovecot, before managesieve)
DISTFILES+=		dovecot-${DOVECOT_VERSION}-sieve-${SIEVE_VERSION}.tar.gz
SITES.dovecot-${DOVECOT_VERSION}-sieve-${SIEVE_VERSION}.tar.gz=\
			${DOVECOT_SIEVE_SITES}
WRKSRC.sieve=		${WRKDIR}/dovecot-${DOVECOT_VERSION}-sieve-${SIEVE_VERSION}
CONFIGURE_ARGS.sieve=	--with-dovecot=${WRKSRC}
CONFIGURE_ARGS.sieve+=	--docdir=${PREFIX}/share/doc
INSTALL_DIRS+=		${WRKSRC.sieve}
# Augment PLIST for sieve
PLIST_SRC+=		${PKGDIR}/PLIST.sieve

.  if !empty(PKG_OPTIONS:Mdovecot-managesieve) || make(distinfo) || make(makesum)
# The managesieve patch to dovecot
PATCHFILES+=		${MANAGESIEVE_PATCH}
# managesieve itself (built after both dovecot and sieve)
DISTFILES+=		dovecot-${DOVECOT_VERSION}-managesieve-${MANAGESIEVE_VERSION}.tar.gz
SITES.dovecot-${DOVECOT_VERSION}-managesieve-${MANAGESIEVE_VERSION}.tar.gz=\
			${DOVECOT_SIEVE_SITES}
WRKSRC.managesieve=	${WRKDIR}/dovecot-${DOVECOT_VERSION}-managesieve-${MANAGESIEVE_VERSION}
CONFIGURE_ARGS.managesieve=\
			--with-dovecot=${WRKSRC} --with-dovecot-sieve=${WRKSRC.sieve}
INSTALL_DIRS+=		${WRKSRC.managesieve}
# Augment PLIST for managesieve
PLIST_SRC+=		${PKGDIR}/PLIST.managesieve
.  endif # dovecot-managesieve
.endif # dovecot-sieve

.if !empty(PKG_OPTIONS:Mdovecot-managesieve) && empty(PKG_OPTIONS:Mdovecot-sieve)
PKG_FAIL_REASON+=	"You cannot enable dovecot-managesieve without dovecot-sieve."
.endif