aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Kolobov <sergei@FreeBSD.org>2004-02-01 16:01:30 +0000
committerSergei Kolobov <sergei@FreeBSD.org>2004-02-01 16:01:30 +0000
commitb0822e719f3aeae22dffab6d6bd766724e5a4c37 (patch)
treeb5a5816c32369e072c58137835d45e301f39ae05
parentc73a0b41bef83383e6dde4520d0f634376f361e3 (diff)
downloadports-b0822e719f3aeae22dffab6d6bd766724e5a4c37.tar.gz
ports-b0822e719f3aeae22dffab6d6bd766724e5a4c37.zip
- Fix build on -CURRENT following deprecation of EAI_NODATA (see RFC 3493)
- Use OPTIONS macro for 'make config' - Add rcNG startup script, add USE_RC_SUBR - Add SIZE to distinfo - Bump PORTREVISION PR: ports/61905 Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=99709
-rw-r--r--mail/dovecot-devel/Makefile62
-rw-r--r--mail/dovecot-devel/distinfo1
-rw-r--r--mail/dovecot-devel/files/dovecot.sh26
-rw-r--r--mail/dovecot-devel/files/dovecot.sh.sample21
-rw-r--r--mail/dovecot-devel/files/patch-network.c14
-rw-r--r--mail/dovecot-devel/pkg-deinstall82
-rw-r--r--mail/dovecot-devel/pkg-install128
-rw-r--r--mail/dovecot-devel/pkg-message14
-rw-r--r--mail/dovecot-devel/pkg-plist18
-rw-r--r--mail/dovecot/Makefile62
-rw-r--r--mail/dovecot/distinfo1
-rw-r--r--mail/dovecot/files/dovecot.sh26
-rw-r--r--mail/dovecot/files/dovecot.sh.sample21
-rw-r--r--mail/dovecot/files/patch-network.c14
-rw-r--r--mail/dovecot/pkg-deinstall82
-rw-r--r--mail/dovecot/pkg-install128
-rw-r--r--mail/dovecot/pkg-message14
-rw-r--r--mail/dovecot/pkg-plist18
18 files changed, 400 insertions, 332 deletions
diff --git a/mail/dovecot-devel/Makefile b/mail/dovecot-devel/Makefile
index cc8dd55c1685..34976184d68c 100644
--- a/mail/dovecot-devel/Makefile
+++ b/mail/dovecot-devel/Makefile
@@ -1,3 +1,4 @@
+# ex:ts=8
# New ports collection makefile for: dovecot
# Date created: 12/08/2002
# Whom: Dominic Marks <dominic.marks@btinternet.com>
@@ -7,7 +8,7 @@
PORTNAME= dovecot
PORTVERSION= 0.99.10.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= mail ipv6
MASTER_SITES= http://www.dovecot.org/
@@ -33,55 +34,61 @@ DOCS= auth.txt configuration.txt design.txt \
nfs.txt dovecot-ldap.conf dovecot-pgsql.conf \
dovecot-openssl.cnf securecoding.txt
-#.include <bsd.port.pre.mk>
+.include <bsd.port.pre.mk>
-## SASL2 support -> WITH_SASL2=1
+## SASL2 support
+OPTIONS+= SASL2 "SASL2 support" off
#
# SASL provides authentication support to
# session-based protocols. This is can be
# used by dovecot for authentication sources.
#
.if defined(WITH_SASL2)
-LIB_DEPENDS+= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
+LIB_DEPENDS+= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
CONFIGURE_ARGS+= --with-cyrus-sasl2
.endif
-## VPopMail Support -> WITH_VPOPMAIL=1
+## VPopMail Support
+OPTIONS+= VPOPMAIL "VPopMail support" off
#
# vpopmail provides easy authentication and
# multi-domain features. It was originally
# created for use with Qmail.
#
.if defined(WITH_VPOPMAIL)
-VPOPMAIL= ${LOCALBASE}/vpopmail/bin/vchkpw
-BUILD_DEPENDS+= ${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
+VPOPMAIL= ${LOCALBASE}/vpopmail/bin/vchkpw
+BUILD_DEPENDS+= ${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
CONFIGURE_ARGS+= --with-vpopmail
.endif
-## OpenLDAP Support -> WITH_LDAP=1
+## OpenLDAP Support
+OPTIONS+= LDAP "OpenLDAP support" off
#
# LDAP is the light-weight directory access
# protocol and can be used by Dovecot for its
# user database.
#
.if defined(WITH_LDAP)
-USE_OPENLDAP= yes
+USE_OPENLDAP= yes
CONFIGURE_ARGS+= --with-ldap
.endif
-## PostgreSQL Support -> WITH_PGSQL=1
+## PostgreSQL Support
+OPTIONS+= PGSQL "PostgreSQL support" off
#
# PostgreSQL is a powerful SQL database that
# can be used to store user tables.
#
.if defined(WITH_PGSQL)
-LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql7
+LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql7
CONFIGURE_ARGS+= --with-pgsql
.endif
-pre-configure:
- @${ECHO_MSG} "=> ${PORTNAME} options: see ${MAKEFILE} for descriptions"
- @${SED} -ne 's,^##,=> ,p' ${MAKEFILE}
+.if ${OSVERSION} >= 500038
+RC_SUBR?= /etc/rc.subr
+.else
+USE_RC_SUBR= yes
+.endif
pre-build:
@${REINPLACE_CMD} -e 's,%%SSLDIR%%,/var/dovecot/ssl,' \
@@ -90,9 +97,15 @@ pre-build:
@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
${WRKSRC}/dovecot-example.conf
+post-build:
+ @${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
+ -e 's,%%RC_SUBR%%,${RC_SUBR},g' \
+ ${FILESDIR}/dovecot.sh >${WRKDIR}/dovecot.sh
+
+pre-install:
+ @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
do-install:
- @${SETENV} ${SCRIPTS_ENV} \
- ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${MKDIR} ${PREFIX}/libexec/dovecot
${INSTALL_PROGRAM} \
${WRKSRC}/src/imap/imap \
@@ -103,21 +116,18 @@ do-install:
${PREFIX}/libexec/dovecot/
${INSTALL_DATA} ${WRKSRC}/dovecot-example.conf ${PREFIX}/etc/
${INSTALL_PROGRAM} ${WRKSRC}/src/master/dovecot ${PREFIX}/sbin/
- @${SETENV} ${SCRIPTS_ENV} \
- ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
- ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/dovecot.sh.sample \
- ${PREFIX}/etc/rc.d/dovecot.sh.sample
+ ${INSTALL_SCRIPT} ${WRKDIR}/dovecot.sh ${PREFIX}/etc/rc.d/
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
-.for document in ${DOCS}
- @${INSTALL_DATA} ${WRKSRC}/doc/${document} ${DOCSDIR}
-.endfor
- @${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
+ cd ${WRKSRC}/doc && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
+ ${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
.endif
+
+post-install:
+ @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
${.CURDIR}/pkg-message >${PKGMESSAGE}
@${CAT} ${PKGMESSAGE}
-#.include <bsd.port.post.mk>
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/mail/dovecot-devel/distinfo b/mail/dovecot-devel/distinfo
index 52c148d2d6a0..1dd163f140bc 100644
--- a/mail/dovecot-devel/distinfo
+++ b/mail/dovecot-devel/distinfo
@@ -1 +1,2 @@
MD5 (dovecot-0.99.10.4.tar.gz) = 81eda7985e99d28acd6d286aa0e13e07
+SIZE (dovecot-0.99.10.4.tar.gz) = 859856
diff --git a/mail/dovecot-devel/files/dovecot.sh b/mail/dovecot-devel/files/dovecot.sh
new file mode 100644
index 000000000000..42d116395a8d
--- /dev/null
+++ b/mail/dovecot-devel/files/dovecot.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: dovecot
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable dovecot:
+#
+#dovecot_enable="YES"
+#
+dovecot_enable="NO"
+
+. %%RC_SUBR%%
+
+name=dovecot
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/${name}
+required_files=%%PREFIX%%/etc/${name}.conf
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/mail/dovecot-devel/files/dovecot.sh.sample b/mail/dovecot-devel/files/dovecot.sh.sample
deleted file mode 100644
index e7c235c8d43a..000000000000
--- a/mail/dovecot-devel/files/dovecot.sh.sample
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $(realpath $(dirname $0)) : "\(.*\)/etc/rc\.d\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/sbin/dovecot ] && \
- ${PREFIX}/sbin/dovecot && echo -n ' dovecot'
- ;;
-stop)
- /usr/bin/killall dovecot && echo -n ' dovecot'
- ;;
-*)
- echo "Usage: `basename $0` { start | stop }" >&2
- ;;
-esac
-
-exit 0
diff --git a/mail/dovecot-devel/files/patch-network.c b/mail/dovecot-devel/files/patch-network.c
new file mode 100644
index 000000000000..2a133c381eb0
--- /dev/null
+++ b/mail/dovecot-devel/files/patch-network.c
@@ -0,0 +1,14 @@
+--- src/lib/network.c.orig Sun Jun 22 23:09:48 2003
++++ src/lib/network.c Sun Jan 25 20:22:17 2004
+@@ -591,7 +591,11 @@
+ int net_hosterror_notfound(int error)
+ {
+ #ifdef HAVE_IPV6
++#ifdef EAI_NODATA
+ return error != 1 && (error == EAI_NONAME || error == EAI_NODATA);
++#else
++ return error != 1 && (error == EAI_NONAME);
++#endif
+ #else
+ return error == HOST_NOT_FOUND || error == NO_ADDRESS;
+ #endif
diff --git a/mail/dovecot-devel/pkg-deinstall b/mail/dovecot-devel/pkg-deinstall
index 4f9c3a063539..d43f1baa46f8 100644
--- a/mail/dovecot-devel/pkg-deinstall
+++ b/mail/dovecot-devel/pkg-deinstall
@@ -1,55 +1,65 @@
#! /bin/sh
+#
+# ex:ts=4
ask() {
- local question default answer
-
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- echo ${answer:-${default}}
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ echo ${answer:-${default}}
}
yesno() {
- local question default answer
-
- question=$1
- default=$2
- while :; do
- answer=$(ask "${question}" "${default}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
+ local question default answer
+
+ question=$1
+ default=$2
+ while :; do
+ answer=$(ask "${question}" "${default}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
}
delete_account() {
- local u
+ local u
- u=$1
- if yesno "Do you want me to remove user \"${u}\"" n; then
- pw userdel -n ${u}
- echo "Done."
- fi
+ u=$1
+ if yesno "Do you want me to remove user \"${u}\"" n; then
+ pw userdel -n ${u}
+ echo "Done."
+ fi
}
case $2 in
DEINSTALL)
- if ps -axc | grep -qw dovecot; then
- if yesno "Dovecot is still running. Shall I stop it?" y; then
- killall dovecot
- sleep 2
- else
- echo "OK ... I hope you know what you are doing."
+ if ps -axc | grep -qw dovecot; then
+ if yesno "Dovecot is still running. Shall I stop it?" y; then
+ killall dovecot
+ sleep 2
+ else
+ echo "OK ... I hope you know what you are doing."
+ fi
fi
- fi
- delete_account dovecot
- delete_account dovecot-auth
- ;;
+ delete_account dovecot
+ delete_account dovecot-auth
+
+ base=/var/dovecot
+ DIRLIST="${base}/ssl/private ${base}/ssl/certs ${base}/ssl ${base}/private \
+ ${base}/login ${base}/auth ${base} /var/run/dovecot"
+ echo "Cleaning up \"${base}\"."
+ for directory in ${DIRLIST}; do
+ rmdir ${directory} 2>/dev/null || :
+ done
+ ;;
esac
diff --git a/mail/dovecot-devel/pkg-install b/mail/dovecot-devel/pkg-install
index 1cde7df41f58..fd7d1cb33ae9 100644
--- a/mail/dovecot-devel/pkg-install
+++ b/mail/dovecot-devel/pkg-install
@@ -2,93 +2,93 @@
#
# $FreeBSD$
#
-
-base=/var/dovecot
+# ex:ts=4
ask() {
- local question default answer
+ local question default answer
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- echo ${answer:-${default}}
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ echo ${answer:-${default}}
}
yesno() {
- local question default answer
+ local question default answer
- question=$1
- default=$2
- while :; do
- answer=$(ask "${question}" "${default}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
+ question=$1
+ default=$2
+ while :; do
+ answer=$(ask "${question}" "${default}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
}
make_account() {
- local u g gcos
+ local u g gcos
- u=$1
- g=$2
- gcos=$3
+ u=$1
+ g=$2
+ gcos=$3
- if pw group show "${g}" >/dev/null 2>&1; then
- echo "You already have a group \"${g}\", so I will use it."
- else
- echo "You need a group \"${g}\"."
- if which -s pw && yesno "Would you like me to create it" y
- then
- pw groupadd ${g} || exit
- echo "Done."
+ if pw group show "${g}" >/dev/null 2>&1; then
+ echo "You already have a group \"${g}\", so I will use it."
else
- echo "Please create it, and try again."
- exit 1
+ echo "You need a group \"${g}\"."
+ if which -s pw && yesno "Would you like me to create it" y
+ then
+ pw groupadd ${g} || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
fi
- fi
- if pw user show "${u}" >/dev/null 2>&1; then
- echo "You already have a user \"${u}\", so I will use it."
- else
- echo "You need a user \"${u}\"."
- if which -s pw && yesno "Would you like me to create it" y
- then
- pw useradd ${u} -g ${g} -h - -s /sbin/nologin -c "${gcos}" || exit
- echo "Done."
+ if pw user show "${u}" >/dev/null 2>&1; then
+ echo "You already have a user \"${u}\", so I will use it."
else
- echo "Please create it, and try again."
- exit 1
+ echo "You need a user \"${u}\"."
+ if which -s pw && yesno "Would you like me to create it" y
+ then
+ pw useradd ${u} -g ${g} -h - -s /sbin/nologin -c "${gcos}" || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
fi
- fi
}
case $2 in
PRE-INSTALL)
- make_account dovecot dovecot "Dovecot"
- make_account dovecot-auth dovecot-auth "Dovecot Auth"
- ;;
+ make_account dovecot dovecot "Dovecot"
+ make_account dovecot-auth dovecot-auth "Dovecot Auth"
+ ;;
POST-INSTALL)
- DIRLIST="${base} ${base}/auth ${base}/ssl ${base}/ssl/certs \
- ${base}/ssl/private ${base}/login /var/run/dovecot"
- echo "Fixing ownerships and modes in \"${base}\"."
- for directory in ${DIRLIST}; do
- if [ ! -d "${directory}" ]; then
- mkdir -p ${directory}
- echo "Created directory: ${directory}"
- fi
- done
- chown -R root:wheel ${base}
- chown -R dovecot:dovecot ${base}/auth ${base}/ssl
- chown root:dovecot ${base}/login /var/run/dovecot
- chmod 0750 ${base}/login
- chmod 0700 /var/run/dovecot
- ;;
+ base=/var/dovecot
+ DIRLIST="${base} ${base}/auth ${base}/ssl ${base}/ssl/certs \
+ ${base}/ssl/private ${base}/login /var/run/dovecot"
+ echo "Fixing ownerships and modes in \"${base}\"."
+ for directory in ${DIRLIST}; do
+ if [ ! -d "${directory}" ]; then
+ mkdir -p ${directory}
+ echo "Created directory: ${directory}"
+ fi
+ done
+ chown -R root:wheel ${base}
+ chown -R dovecot:dovecot ${base}/auth ${base}/ssl
+ chown root:dovecot ${base}/login /var/run/dovecot
+ chmod 0750 ${base}/login
+ chmod 0700 /var/run/dovecot
+ ;;
esac
diff --git a/mail/dovecot-devel/pkg-message b/mail/dovecot-devel/pkg-message
index 2acffc98aadf..907b6d67a4f3 100644
--- a/mail/dovecot-devel/pkg-message
+++ b/mail/dovecot-devel/pkg-message
@@ -1,15 +1,15 @@
---------------------------------------------------------------------
You can get default configured IMAP and POP3 services running by
- copying the following sample files to the given locations. In this
- simple configuration Dovecot will authenticate users against the
- systems passwd file and use the default /var/mail/$USER mbox files.
+ copying the sample configuration file to the given location and then
+ enabling dovecot in /etc/rc.conf.
+ In this simple configuration Dovecot will authenticate users against
+ the systems passwd file and use the default /var/mail/$USER mbox
+ files.
- %%PREFIX%%/etc/dovecot-example.conf
- -> %%PREFIX%%/etc/dovecot.conf
+ cd %%PREFIX%%/etc; cp dovecot-example.conf dovecot.conf
- %%PREFIX%%/etc/rc.d/dovecot.sh.sample
- -> %%PREFIX%%/etc/rc.d/dovecot.sh
+ echo dovecot_enable="YES" >> /etc/rc.conf
Further information on configuration can be found in:
diff --git a/mail/dovecot-devel/pkg-plist b/mail/dovecot-devel/pkg-plist
index d0494856497f..12fc5375f7bc 100644
--- a/mail/dovecot-devel/pkg-plist
+++ b/mail/dovecot-devel/pkg-plist
@@ -1,5 +1,6 @@
+@comment $FreeBSD$
etc/dovecot-example.conf
-etc/rc.d/dovecot.sh.sample
+etc/rc.d/dovecot.sh
libexec/dovecot/dovecot-auth
libexec/dovecot/imap
libexec/dovecot/imap-login
@@ -7,24 +8,17 @@ libexec/dovecot/pop3
libexec/dovecot/pop3-login
@dirrm libexec/dovecot
sbin/dovecot
+%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD
%%PORTDOCS%%%%DOCSDIR%%/auth.txt
%%PORTDOCS%%%%DOCSDIR%%/configuration.txt
%%PORTDOCS%%%%DOCSDIR%%/design.txt
+%%PORTDOCS%%%%DOCSDIR%%/dovecot-ldap.conf
+%%PORTDOCS%%%%DOCSDIR%%/dovecot-openssl.cnf
+%%PORTDOCS%%%%DOCSDIR%%/dovecot-pgsql.conf
%%PORTDOCS%%%%DOCSDIR%%/index.txt
%%PORTDOCS%%%%DOCSDIR%%/mail-storages.txt
%%PORTDOCS%%%%DOCSDIR%%/mkcert.sh
%%PORTDOCS%%%%DOCSDIR%%/multiaccess.txt
%%PORTDOCS%%%%DOCSDIR%%/nfs.txt
-%%PORTDOCS%%%%DOCSDIR%%/dovecot-ldap.conf
-%%PORTDOCS%%%%DOCSDIR%%/dovecot-pgsql.conf
-%%PORTDOCS%%%%DOCSDIR%%/dovecot-openssl.cnf
%%PORTDOCS%%%%DOCSDIR%%/securecoding.txt
-%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@unexec rmdir /var/dovecot/auth 2>/dev/null || true
-@unexec rmdir /var/dovecot/login 2>/dev/null || true
-@unexec rmdir /var/dovecot/ssl/certs 2>/dev/null || true
-@unexec rmdir /var/dovecot/ssl/private 2>/dev/null || true
-@unexec rmdir /var/dovecot/ssl 2>/dev/null || true
-@unexec rmdir /var/dovecot 2>/dev/null || true
-@unexec rmdir /var/run/dovecot 2>/dev/null || true
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
index cc8dd55c1685..34976184d68c 100644
--- a/mail/dovecot/Makefile
+++ b/mail/dovecot/Makefile
@@ -1,3 +1,4 @@
+# ex:ts=8
# New ports collection makefile for: dovecot
# Date created: 12/08/2002
# Whom: Dominic Marks <dominic.marks@btinternet.com>
@@ -7,7 +8,7 @@
PORTNAME= dovecot
PORTVERSION= 0.99.10.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= mail ipv6
MASTER_SITES= http://www.dovecot.org/
@@ -33,55 +34,61 @@ DOCS= auth.txt configuration.txt design.txt \
nfs.txt dovecot-ldap.conf dovecot-pgsql.conf \
dovecot-openssl.cnf securecoding.txt
-#.include <bsd.port.pre.mk>
+.include <bsd.port.pre.mk>
-## SASL2 support -> WITH_SASL2=1
+## SASL2 support
+OPTIONS+= SASL2 "SASL2 support" off
#
# SASL provides authentication support to
# session-based protocols. This is can be
# used by dovecot for authentication sources.
#
.if defined(WITH_SASL2)
-LIB_DEPENDS+= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
+LIB_DEPENDS+= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
CONFIGURE_ARGS+= --with-cyrus-sasl2
.endif
-## VPopMail Support -> WITH_VPOPMAIL=1
+## VPopMail Support
+OPTIONS+= VPOPMAIL "VPopMail support" off
#
# vpopmail provides easy authentication and
# multi-domain features. It was originally
# created for use with Qmail.
#
.if defined(WITH_VPOPMAIL)
-VPOPMAIL= ${LOCALBASE}/vpopmail/bin/vchkpw
-BUILD_DEPENDS+= ${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
+VPOPMAIL= ${LOCALBASE}/vpopmail/bin/vchkpw
+BUILD_DEPENDS+= ${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
CONFIGURE_ARGS+= --with-vpopmail
.endif
-## OpenLDAP Support -> WITH_LDAP=1
+## OpenLDAP Support
+OPTIONS+= LDAP "OpenLDAP support" off
#
# LDAP is the light-weight directory access
# protocol and can be used by Dovecot for its
# user database.
#
.if defined(WITH_LDAP)
-USE_OPENLDAP= yes
+USE_OPENLDAP= yes
CONFIGURE_ARGS+= --with-ldap
.endif
-## PostgreSQL Support -> WITH_PGSQL=1
+## PostgreSQL Support
+OPTIONS+= PGSQL "PostgreSQL support" off
#
# PostgreSQL is a powerful SQL database that
# can be used to store user tables.
#
.if defined(WITH_PGSQL)
-LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql7
+LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql7
CONFIGURE_ARGS+= --with-pgsql
.endif
-pre-configure:
- @${ECHO_MSG} "=> ${PORTNAME} options: see ${MAKEFILE} for descriptions"
- @${SED} -ne 's,^##,=> ,p' ${MAKEFILE}
+.if ${OSVERSION} >= 500038
+RC_SUBR?= /etc/rc.subr
+.else
+USE_RC_SUBR= yes
+.endif
pre-build:
@${REINPLACE_CMD} -e 's,%%SSLDIR%%,/var/dovecot/ssl,' \
@@ -90,9 +97,15 @@ pre-build:
@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
${WRKSRC}/dovecot-example.conf
+post-build:
+ @${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
+ -e 's,%%RC_SUBR%%,${RC_SUBR},g' \
+ ${FILESDIR}/dovecot.sh >${WRKDIR}/dovecot.sh
+
+pre-install:
+ @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
do-install:
- @${SETENV} ${SCRIPTS_ENV} \
- ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${MKDIR} ${PREFIX}/libexec/dovecot
${INSTALL_PROGRAM} \
${WRKSRC}/src/imap/imap \
@@ -103,21 +116,18 @@ do-install:
${PREFIX}/libexec/dovecot/
${INSTALL_DATA} ${WRKSRC}/dovecot-example.conf ${PREFIX}/etc/
${INSTALL_PROGRAM} ${WRKSRC}/src/master/dovecot ${PREFIX}/sbin/
- @${SETENV} ${SCRIPTS_ENV} \
- ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
- ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/dovecot.sh.sample \
- ${PREFIX}/etc/rc.d/dovecot.sh.sample
+ ${INSTALL_SCRIPT} ${WRKDIR}/dovecot.sh ${PREFIX}/etc/rc.d/
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
-.for document in ${DOCS}
- @${INSTALL_DATA} ${WRKSRC}/doc/${document} ${DOCSDIR}
-.endfor
- @${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
+ cd ${WRKSRC}/doc && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
+ ${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
.endif
+
+post-install:
+ @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
${.CURDIR}/pkg-message >${PKGMESSAGE}
@${CAT} ${PKGMESSAGE}
-#.include <bsd.port.post.mk>
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/mail/dovecot/distinfo b/mail/dovecot/distinfo
index 52c148d2d6a0..1dd163f140bc 100644
--- a/mail/dovecot/distinfo
+++ b/mail/dovecot/distinfo
@@ -1 +1,2 @@
MD5 (dovecot-0.99.10.4.tar.gz) = 81eda7985e99d28acd6d286aa0e13e07
+SIZE (dovecot-0.99.10.4.tar.gz) = 859856
diff --git a/mail/dovecot/files/dovecot.sh b/mail/dovecot/files/dovecot.sh
new file mode 100644
index 000000000000..42d116395a8d
--- /dev/null
+++ b/mail/dovecot/files/dovecot.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: dovecot
+# REQUIRE: LOGIN
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable dovecot:
+#
+#dovecot_enable="YES"
+#
+dovecot_enable="NO"
+
+. %%RC_SUBR%%
+
+name=dovecot
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/${name}
+required_files=%%PREFIX%%/etc/${name}.conf
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/mail/dovecot/files/dovecot.sh.sample b/mail/dovecot/files/dovecot.sh.sample
deleted file mode 100644
index e7c235c8d43a..000000000000
--- a/mail/dovecot/files/dovecot.sh.sample
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $(realpath $(dirname $0)) : "\(.*\)/etc/rc\.d\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-case "$1" in
-start)
- [ -x ${PREFIX}/sbin/dovecot ] && \
- ${PREFIX}/sbin/dovecot && echo -n ' dovecot'
- ;;
-stop)
- /usr/bin/killall dovecot && echo -n ' dovecot'
- ;;
-*)
- echo "Usage: `basename $0` { start | stop }" >&2
- ;;
-esac
-
-exit 0
diff --git a/mail/dovecot/files/patch-network.c b/mail/dovecot/files/patch-network.c
new file mode 100644
index 000000000000..2a133c381eb0
--- /dev/null
+++ b/mail/dovecot/files/patch-network.c
@@ -0,0 +1,14 @@
+--- src/lib/network.c.orig Sun Jun 22 23:09:48 2003
++++ src/lib/network.c Sun Jan 25 20:22:17 2004
+@@ -591,7 +591,11 @@
+ int net_hosterror_notfound(int error)
+ {
+ #ifdef HAVE_IPV6
++#ifdef EAI_NODATA
+ return error != 1 && (error == EAI_NONAME || error == EAI_NODATA);
++#else
++ return error != 1 && (error == EAI_NONAME);
++#endif
+ #else
+ return error == HOST_NOT_FOUND || error == NO_ADDRESS;
+ #endif
diff --git a/mail/dovecot/pkg-deinstall b/mail/dovecot/pkg-deinstall
index 4f9c3a063539..d43f1baa46f8 100644
--- a/mail/dovecot/pkg-deinstall
+++ b/mail/dovecot/pkg-deinstall
@@ -1,55 +1,65 @@
#! /bin/sh
+#
+# ex:ts=4
ask() {
- local question default answer
-
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- echo ${answer:-${default}}
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ echo ${answer:-${default}}
}
yesno() {
- local question default answer
-
- question=$1
- default=$2
- while :; do
- answer=$(ask "${question}" "${default}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
+ local question default answer
+
+ question=$1
+ default=$2
+ while :; do
+ answer=$(ask "${question}" "${default}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
}
delete_account() {
- local u
+ local u
- u=$1
- if yesno "Do you want me to remove user \"${u}\"" n; then
- pw userdel -n ${u}
- echo "Done."
- fi
+ u=$1
+ if yesno "Do you want me to remove user \"${u}\"" n; then
+ pw userdel -n ${u}
+ echo "Done."
+ fi
}
case $2 in
DEINSTALL)
- if ps -axc | grep -qw dovecot; then
- if yesno "Dovecot is still running. Shall I stop it?" y; then
- killall dovecot
- sleep 2
- else
- echo "OK ... I hope you know what you are doing."
+ if ps -axc | grep -qw dovecot; then
+ if yesno "Dovecot is still running. Shall I stop it?" y; then
+ killall dovecot
+ sleep 2
+ else
+ echo "OK ... I hope you know what you are doing."
+ fi
fi
- fi
- delete_account dovecot
- delete_account dovecot-auth
- ;;
+ delete_account dovecot
+ delete_account dovecot-auth
+
+ base=/var/dovecot
+ DIRLIST="${base}/ssl/private ${base}/ssl/certs ${base}/ssl ${base}/private \
+ ${base}/login ${base}/auth ${base} /var/run/dovecot"
+ echo "Cleaning up \"${base}\"."
+ for directory in ${DIRLIST}; do
+ rmdir ${directory} 2>/dev/null || :
+ done
+ ;;
esac
diff --git a/mail/dovecot/pkg-install b/mail/dovecot/pkg-install
index 1cde7df41f58..fd7d1cb33ae9 100644
--- a/mail/dovecot/pkg-install
+++ b/mail/dovecot/pkg-install
@@ -2,93 +2,93 @@
#
# $FreeBSD$
#
-
-base=/var/dovecot
+# ex:ts=4
ask() {
- local question default answer
+ local question default answer
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- echo ${answer:-${default}}
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ echo ${answer:-${default}}
}
yesno() {
- local question default answer
+ local question default answer
- question=$1
- default=$2
- while :; do
- answer=$(ask "${question}" "${default}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
+ question=$1
+ default=$2
+ while :; do
+ answer=$(ask "${question}" "${default}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
}
make_account() {
- local u g gcos
+ local u g gcos
- u=$1
- g=$2
- gcos=$3
+ u=$1
+ g=$2
+ gcos=$3
- if pw group show "${g}" >/dev/null 2>&1; then
- echo "You already have a group \"${g}\", so I will use it."
- else
- echo "You need a group \"${g}\"."
- if which -s pw && yesno "Would you like me to create it" y
- then
- pw groupadd ${g} || exit
- echo "Done."
+ if pw group show "${g}" >/dev/null 2>&1; then
+ echo "You already have a group \"${g}\", so I will use it."
else
- echo "Please create it, and try again."
- exit 1
+ echo "You need a group \"${g}\"."
+ if which -s pw && yesno "Would you like me to create it" y
+ then
+ pw groupadd ${g} || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
fi
- fi
- if pw user show "${u}" >/dev/null 2>&1; then
- echo "You already have a user \"${u}\", so I will use it."
- else
- echo "You need a user \"${u}\"."
- if which -s pw && yesno "Would you like me to create it" y
- then
- pw useradd ${u} -g ${g} -h - -s /sbin/nologin -c "${gcos}" || exit
- echo "Done."
+ if pw user show "${u}" >/dev/null 2>&1; then
+ echo "You already have a user \"${u}\", so I will use it."
else
- echo "Please create it, and try again."
- exit 1
+ echo "You need a user \"${u}\"."
+ if which -s pw && yesno "Would you like me to create it" y
+ then
+ pw useradd ${u} -g ${g} -h - -s /sbin/nologin -c "${gcos}" || exit
+ echo "Done."
+ else
+ echo "Please create it, and try again."
+ exit 1
+ fi
fi
- fi
}
case $2 in
PRE-INSTALL)
- make_account dovecot dovecot "Dovecot"
- make_account dovecot-auth dovecot-auth "Dovecot Auth"
- ;;
+ make_account dovecot dovecot "Dovecot"
+ make_account dovecot-auth dovecot-auth "Dovecot Auth"
+ ;;
POST-INSTALL)
- DIRLIST="${base} ${base}/auth ${base}/ssl ${base}/ssl/certs \
- ${base}/ssl/private ${base}/login /var/run/dovecot"
- echo "Fixing ownerships and modes in \"${base}\"."
- for directory in ${DIRLIST}; do
- if [ ! -d "${directory}" ]; then
- mkdir -p ${directory}
- echo "Created directory: ${directory}"
- fi
- done
- chown -R root:wheel ${base}
- chown -R dovecot:dovecot ${base}/auth ${base}/ssl
- chown root:dovecot ${base}/login /var/run/dovecot
- chmod 0750 ${base}/login
- chmod 0700 /var/run/dovecot
- ;;
+ base=/var/dovecot
+ DIRLIST="${base} ${base}/auth ${base}/ssl ${base}/ssl/certs \
+ ${base}/ssl/private ${base}/login /var/run/dovecot"
+ echo "Fixing ownerships and modes in \"${base}\"."
+ for directory in ${DIRLIST}; do
+ if [ ! -d "${directory}" ]; then
+ mkdir -p ${directory}
+ echo "Created directory: ${directory}"
+ fi
+ done
+ chown -R root:wheel ${base}
+ chown -R dovecot:dovecot ${base}/auth ${base}/ssl
+ chown root:dovecot ${base}/login /var/run/dovecot
+ chmod 0750 ${base}/login
+ chmod 0700 /var/run/dovecot
+ ;;
esac
diff --git a/mail/dovecot/pkg-message b/mail/dovecot/pkg-message
index 2acffc98aadf..907b6d67a4f3 100644
--- a/mail/dovecot/pkg-message
+++ b/mail/dovecot/pkg-message
@@ -1,15 +1,15 @@
---------------------------------------------------------------------
You can get default configured IMAP and POP3 services running by
- copying the following sample files to the given locations. In this
- simple configuration Dovecot will authenticate users against the
- systems passwd file and use the default /var/mail/$USER mbox files.
+ copying the sample configuration file to the given location and then
+ enabling dovecot in /etc/rc.conf.
+ In this simple configuration Dovecot will authenticate users against
+ the systems passwd file and use the default /var/mail/$USER mbox
+ files.
- %%PREFIX%%/etc/dovecot-example.conf
- -> %%PREFIX%%/etc/dovecot.conf
+ cd %%PREFIX%%/etc; cp dovecot-example.conf dovecot.conf
- %%PREFIX%%/etc/rc.d/dovecot.sh.sample
- -> %%PREFIX%%/etc/rc.d/dovecot.sh
+ echo dovecot_enable="YES" >> /etc/rc.conf
Further information on configuration can be found in:
diff --git a/mail/dovecot/pkg-plist b/mail/dovecot/pkg-plist
index d0494856497f..12fc5375f7bc 100644
--- a/mail/dovecot/pkg-plist
+++ b/mail/dovecot/pkg-plist
@@ -1,5 +1,6 @@
+@comment $FreeBSD$
etc/dovecot-example.conf
-etc/rc.d/dovecot.sh.sample
+etc/rc.d/dovecot.sh
libexec/dovecot/dovecot-auth
libexec/dovecot/imap
libexec/dovecot/imap-login
@@ -7,24 +8,17 @@ libexec/dovecot/pop3
libexec/dovecot/pop3-login
@dirrm libexec/dovecot
sbin/dovecot
+%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD
%%PORTDOCS%%%%DOCSDIR%%/auth.txt
%%PORTDOCS%%%%DOCSDIR%%/configuration.txt
%%PORTDOCS%%%%DOCSDIR%%/design.txt
+%%PORTDOCS%%%%DOCSDIR%%/dovecot-ldap.conf
+%%PORTDOCS%%%%DOCSDIR%%/dovecot-openssl.cnf
+%%PORTDOCS%%%%DOCSDIR%%/dovecot-pgsql.conf
%%PORTDOCS%%%%DOCSDIR%%/index.txt
%%PORTDOCS%%%%DOCSDIR%%/mail-storages.txt
%%PORTDOCS%%%%DOCSDIR%%/mkcert.sh
%%PORTDOCS%%%%DOCSDIR%%/multiaccess.txt
%%PORTDOCS%%%%DOCSDIR%%/nfs.txt
-%%PORTDOCS%%%%DOCSDIR%%/dovecot-ldap.conf
-%%PORTDOCS%%%%DOCSDIR%%/dovecot-pgsql.conf
-%%PORTDOCS%%%%DOCSDIR%%/dovecot-openssl.cnf
%%PORTDOCS%%%%DOCSDIR%%/securecoding.txt
-%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@unexec rmdir /var/dovecot/auth 2>/dev/null || true
-@unexec rmdir /var/dovecot/login 2>/dev/null || true
-@unexec rmdir /var/dovecot/ssl/certs 2>/dev/null || true
-@unexec rmdir /var/dovecot/ssl/private 2>/dev/null || true
-@unexec rmdir /var/dovecot/ssl 2>/dev/null || true
-@unexec rmdir /var/dovecot 2>/dev/null || true
-@unexec rmdir /var/run/dovecot 2>/dev/null || true