aboutsummaryrefslogtreecommitdiffstats
path: root/mail/dovecot/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'mail/dovecot/Makefile')
-rw-r--r--mail/dovecot/Makefile116
1 files changed, 85 insertions, 31 deletions
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
index 789e10a76e74..cdda905efea0 100644
--- a/mail/dovecot/Makefile
+++ b/mail/dovecot/Makefile
@@ -7,8 +7,7 @@
#
PORTNAME= dovecot
-DISTVERSION= 1.1.2
-PORTREVISION= 1
+DISTVERSION= 1.1.3
CATEGORIES= mail ipv6
MASTER_SITES= http://www.dovecot.org/releases/1.1/
@@ -19,7 +18,8 @@ USE_ICONV= yes
USE_RC_SUBR= dovecot.sh
GNU_CONFIGURE= yes
-CONFIGURE_ARGS= --without-shadow --localstatedir=/var
+CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ARGS= --localstatedir=/var --without-shadow
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
USE_LDCONFIG= ${PREFIX}/lib/dovecot \
@@ -27,16 +27,17 @@ USE_LDCONFIG= ${PREFIX}/lib/dovecot \
${PREFIX}/lib/dovecot/pop3 \
${PREFIX}/lib/dovecot/lda
-.if !defined(NOPORTDOCS)
-PORTDOCS= *.txt wiki
-.else
+.if defined(NOPORTDOCS)
CONFIGURE_ARGS+= --without-docs
+.else
+DOCS= AUTHORS COPYING COPYING.LGPL COPYING.MIT INSTALL NEWS TODO README
+PORTDOCS= *.txt wiki ${DOCS}
.endif
DOVECOT_UID?= 143
DOVECOT_GID?= 143
-SCRIPT_ENV+= DOVECOT_UID=${DOVECOT_UID} \
- DOVECOT_GID=${DOVECOT_GID}
+
+PROTOCOLS= imap
OPTIONS= KQUEUE "kqueue(2) support" on \
SSL "SSL support" on \
@@ -46,6 +47,7 @@ OPTIONS= KQUEUE "kqueue(2) support" on \
MANAGESIEVE "ManageSieve support" off \
GSSAPI "GSSAPI support" off \
VPOPMAIL "VPopMail support" off \
+ BDB "BerkleyDB support" off \
LDAP "OpenLDAP support" off \
PGSQL "PostgreSQL support" off \
MYSQL "MySQL support" off \
@@ -56,6 +58,15 @@ OPTIONS= KQUEUE "kqueue(2) support" on \
# Default requirement for dovecot rc script
_REQUIRE= LOGIN
+# sed script for dovecot.conf
+SED_CONF= 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;
+
## kqueue(2) support
#
.if !defined(WITHOUT_KQUEUE)
@@ -64,7 +75,9 @@ CONFIGURE_ARGS+= --with-ioloop=kqueue
## SSL support
#
-.if defined(WITHOUT_SSL)
+.if defined(WITH_SSL) && !defined(WITHOUT_SSL)
+PROTOCOLS+= imaps
+.else
CONFIGURE_ARGS+= --without-ssl
.endif
@@ -78,10 +91,12 @@ CONFIGURE_ARGS+= --disable-ipv6
#
.if defined(WITHOUT_POP3)
CONFIGURE_ARGS+= --without-pop3d
-PROTOCOLS= imap
PLIST_SUB+= POP3="@comment "
.else
-PROTOCOLS= imap pop3
+PROTOCOLS+= pop3
+.if defined(WITH_SSL) && !defined(WITHOUT_SSL)
+PROTOCOLS+= pop3s
+.endif
PLIST_SUB+= POP3=""
.endif
@@ -96,16 +111,18 @@ PLIST_SUB+= LDA=""
## ManageSieve support
#
-.if defined(WITH_MANAGESIEVE)
+.if defined(WITH_MANAGESIEVE) && !defined(WITHOUT_MANAGESIEVE)
MANAGESIEVEVERSION!= ${MAKE} -C ${.CURDIR}/../dovecot-managesieve -V PORTVERSION
PATCH_SITES!= ${MAKE} -C ${.CURDIR}/../dovecot-managesieve -V MASTER_SITES
PATCHFILES+= dovecot-${PORTVERSION}-managesieve-${MANAGESIEVEVERSION}.diff.gz
PATCH_DIST_STRIP= -p1
+PROTOCOLS+= managesieve
+DOCS+= README.managesieve
.endif
## GSSAPI support
#
-.if defined(WITH_GSSAPI)
+.if defined(WITH_GSSAPI) && !defined(WITHOUT_GSSAPI)
CONFIGURE_ARGS+= --with-gssapi
.else
CONFIGURE_ARGS+= --without-gssapi
@@ -113,7 +130,7 @@ CONFIGURE_ARGS+= --without-gssapi
## VPopMail Support
#
-.if defined(WITH_VPOPMAIL)
+.if defined(WITH_VPOPMAIL) && !defined(WITHOUT_VPOPMAIL)
VPOPMAIL= ${LOCALBASE}/vpopmail/bin/vchkpw
BUILD_DEPENDS+= ${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
CONFIGURE_ARGS+= --with-vpopmail
@@ -121,67 +138,104 @@ CONFIGURE_ARGS+= --with-vpopmail
CONFIGURE_ARGS+= --without-vpopmail
.endif
+## BDB Support
+#
+.if defined(WITH_BDB) && !defined(WITHOUT_BDB)
+USE_BDB= yes
+CONFIGURE_ARGS+= --with-db
+CFLAGS+= -I${BDB_INCLUDE_DIR} -L${BDB_LIB_DIR}
+PLIST_SUB+= BDB=""
+SED_CONF+= s!^\#(dict_db_config)!\1!;
+.else
+PLIST_SUB+= BDB="@comment "
+.endif
+
## OpenLDAP Support
#
-.if defined(WITH_LDAP)
+.if defined(WITH_LDAP) && !defined(WITHOUT_LDAP)
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 defined(WITH_PGSQL)
+.if defined(WITH_PGSQL) && !defined(WITHOUT_PGSQL)
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 defined(WITH_MYSQL)
+.if defined(WITH_MYSQL) && !defined(WITHOUT_MYSQL)
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 defined(WITH_SQLITE)
+.if defined(WITH_SQLITE) && !defined(WITHOUT_SQLITE)
USE_SQLITE= 3
CONFIGURE_ARGS+= --with-sqlite
+PLIST_SUB+= SQL=""
.else
CONFIGURE_ARGS+= --without-sqlite
+PLIST_SUB+= SQL="@comment "
.endif
-SUB_LIST+= REQUIRE="${_REQUIRE}"
+SUB_LIST+= REQUIRE="${_REQUIRE}" DOVECOT_UID=${DOVECOT_UID} DOVECOT_GID=${DOVECOT_GID}
+SUB_FILES+= pkg-install pkg-deinstall pkg-message
post-patch:
+ @${REINPLACE_CMD} -E -e '${SED_CONF}' \
+ ${WRKSRC}/dovecot-example.conf
+ @${REINPLACE_CMD} -E -e'\
+ s!-example\.conf[[:>:]]!.conf!g;\
+ s!^(confdir[[:space:]]+=[[:space:]]+)\$$\(sysconfdir\)!\1${EXAMPLESDIR}!g;\
+ ' ${WRKSRC}/*/Makefile.in ${WRKSRC}/Makefile.in
.if defined(WITH_GSSAPI)
- @${REINPLACE_CMD} -e 's,<gssapi/gssapi\.h>,<gssapi.h>,' \
- ${WRKSRC}/src/auth/mech-gssapi.c \
- ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e '\
+ s!<gssapi/gssapi\.h>!<gssapi.h>!;\
+ ' ${WRKSRC}/src/auth/mech-gssapi.c ${WRKSRC}/configure
.endif
-
-post-build:
- @${REINPLACE_CMD} \
- -e 's,%%PREFIX%%,${PREFIX},g' \
- -e 's,%%PROTOCOLS%%,${PROTOCOLS},g' \
- ${WRKSRC}/dovecot-example.conf
+ @${LN} -f ${WRKSRC}/dovecot-example.conf ${WRKSRC}/dovecot.conf
+ @${LN} -f ${WRKSRC}/doc/dovecot-db-example.conf ${WRKSRC}/doc/dovecot-db.conf
+ @${LN} -f ${WRKSRC}/doc/dovecot-ldap-example.conf ${WRKSRC}/doc/dovecot-ldap.conf
+ @${LN} -f ${WRKSRC}/doc/dovecot-sql-example.conf ${WRKSRC}/doc/dovecot-sql.conf
pre-install:
@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
- @${MKDIR} ${DATADIR}
- ${INSTALL_SCRIPT} ${WRKSRC}/doc/mkcert.sh ${DATADIR}
- ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-openssl.cnf ${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/dovecot.conf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-db.conf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-ldap.conf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-sql.conf ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-openssl.cnf ${EXAMPLESDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/doc/mkcert.sh ${EXAMPLESDIR}
+ @${GREP} '^@exec ' ${TMPPLIST} \
+ | ${SED} -e 's:^@exec ::; s:%D:${PREFIX}:g;' \
+ > ${WRKDIR}/.PLIST.exec \
+ && ${SH} ${WRKDIR}/.PLIST.exec
+.if !defined(NOPORTDOCS)
+.for f in ${DOCS}
+ ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
+.endfor
+.endif
@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}