From isometry@mx.dsl.isometry.net  Sun Jan 25 12:57:15 2004
Return-Path: <isometry@mx.dsl.isometry.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 7CFA816A4CE; Sun, 25 Jan 2004 12:57:15 -0800 (PST)
Received: from mx.dsl.isometry.net (cpc3-oxfd2-6-0-cust207.oxfd.cable.ntl.com [81.103.193.207])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id BB36943D41; Sun, 25 Jan 2004 12:57:10 -0800 (PST)
	(envelope-from isometry@mx.dsl.isometry.net)
Received: by mx.dsl.isometry.net (Postfix, from userid 1000)
	id A555AA5; Sun, 25 Jan 2004 20:57:08 +0000 (UTC)
Message-Id: <20040125205708.A555AA5@mx.dsl.isometry.net>
Date: Sun, 25 Jan 2004 20:57:08 +0000 (UTC)
From: Robin Breathe <robin@isometry.net>
Reply-To: Robin Breathe <robin@isometry.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ume@FreeBSD.org, kris@obsecurity.org
Subject: Maintainer update: mail/dovecot
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         61905
>Category:       ports
>Synopsis:       Maintainer update: mail/dovecot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sergei
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 25 13:00:36 PST 2004
>Closed-Date:    Sun Feb 01 08:01:50 PST 2004
>Last-Modified:  Sun Feb 01 08:01:50 PST 2004
>Originator:     Robin Breathe
>Release:        FreeBSD 5.2-RELEASE i386
>Organization:
>Environment:
>Description:
Updates:
 - Fix build on -CURRENT following deprecation of EAI_NODATA (see RFC 3493)
 - Use PORTDOCS macro
 - Use OPTIONS macro for 'make config'
 - USE_RC_SUBR

>How-To-Repeat:
>Fix:
1) Delete ports/mail/dovecot/files/dovecot.sh.sample

2) Apply the following diff against dovecot-0.99.10.4_1:

--- dovecot-0.99.10.4_2.diff begins here ---
diff -ruN dovecot-0.99.10.4/Makefile dovecot/Makefile
--- dovecot-0.99.10.4/Makefile	Sun Jan 25 20:32:56 2004
+++ dovecot/Makefile	Sun Jan 25 20:39:02 2004
@@ -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/
 
@@ -28,60 +29,68 @@
 
 PKGMESSAGE=	${WRKDIR}/pkg-message
 
-DOCS=		auth.txt configuration.txt design.txt \
-		index.txt mail-storages.txt mkcert.sh multiaccess.txt \
-		nfs.txt dovecot-ldap.conf dovecot-pgsql.conf \
-		dovecot-openssl.cnf securecoding.txt
+.if !defined(NOPORTDOCS)
+PORTDOCS=	auth.txt configuration.txt design.txt index.txt \
+		mail-storages.txt mkcert.sh multiaccess.txt nfs.txt \
+		dovecot-ldap.conf dovecot-pgsql.conf dovecot-openssl.cnf \
+		securecoding.txt
+.endif
 
-#.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 +99,13 @@
 	@${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
+
 do-install:
-	@${SETENV} ${SCRIPTS_ENV} \
-		${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
 	@${MKDIR} ${PREFIX}/libexec/dovecot
 	${INSTALL_PROGRAM} \
 		${WRKSRC}/src/imap/imap \
@@ -103,21 +116,18 @@
 			${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
+	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+	${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} ${PORTDOCS:S,^,${WRKSRC}/doc/,} ${DOCSDIR}
 	@${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
 .endif
+
+post-install:
 	@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
 		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-		${.CURDIR}/pkg-message >${PKGMESSAGE}
+			${.CURDIR}/pkg-message >${PKGMESSAGE}
 	@${CAT} ${PKGMESSAGE}
 
-#.include <bsd.port.post.mk>
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN dovecot-0.99.10.4/files/dovecot.sh dovecot/files/dovecot.sh
--- dovecot-0.99.10.4/files/dovecot.sh	Thu Jan  1 00:00:00 1970
+++ dovecot/files/dovecot.sh	Sun Jan 25 20:36:42 2004
@@ -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 -ruN dovecot-0.99.10.4/files/patch-network.c dovecot/files/patch-network.c
--- dovecot-0.99.10.4/files/patch-network.c	Thu Jan  1 00:00:00 1970
+++ dovecot/files/patch-network.c	Sun Jan 25 20:25:18 2004
@@ -0,0 +1,11 @@
+--- src/lib/network.c	Sun Jun 22 23:09:48 2003
++++ network.c	Sun Jan 25 20:22:17 2004
+@@ -591,7 +591,7 @@
+ int net_hosterror_notfound(int error)
+ {
+ #ifdef HAVE_IPV6
+-	return error != 1 && (error == EAI_NONAME || error == EAI_NODATA);
++	return error != 1 && (error == EAI_NONAME);
+ #else
+ 	return error == HOST_NOT_FOUND || error == NO_ADDRESS;
+ #endif
diff -ruN dovecot-0.99.10.4/pkg-message dovecot/pkg-message
--- dovecot-0.99.10.4/pkg-message	Sun Jan 25 20:32:56 2004
+++ dovecot/pkg-message	Sun Jan 25 20:31:42 2004
@@ -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 -ruN dovecot-0.99.10.4/pkg-plist dovecot/pkg-plist
--- dovecot-0.99.10.4/pkg-plist	Sun Jan 25 20:32:56 2004
+++ dovecot/pkg-plist	Sun Jan 25 19:33:14 2004
@@ -1,5 +1,5 @@
 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,20 +7,6 @@
 libexec/dovecot/pop3-login
 @dirrm libexec/dovecot
 sbin/dovecot
-%%PORTDOCS%%%%DOCSDIR%%/auth.txt
-%%PORTDOCS%%%%DOCSDIR%%/configuration.txt
-%%PORTDOCS%%%%DOCSDIR%%/design.txt
-%%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
--- dovecot-0.99.10.4_2.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->sergei 
Responsible-Changed-By: sergei 
Responsible-Changed-When: Sun Jan 25 13:39:21 PST 2004 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61905 

From: Robin Breathe <robin@isometry.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc: Sergei Kolobov <sergei@FreeBSD.org>
Subject: Re: ports/61905: Maintainer update: mail/dovecot
Date: Mon, 26 Jan 2004 17:55:27 +0000

 This is a multi-part message in MIME format.
 --------------000900030705080308030706
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Here's an updated patch.
 
 Delete pkg-plist and files/dovecot.sh.sample
 
 Updates:
   * Fix build on -CURRENT following deprecation of EAI_NODATA (see RFC 3493),
     with a portable patch (submitted to author).
   * Use PORTDOCS macro
   * Use OPTIONS macro for 'make config'
   * USE_RC_SUBR
   * Use PLIST_DIRS/PLIST_FILES macros instead of pkg-plist
   * Various whitespace amendments
 
 - Robin
 
 --------------000900030705080308030706
 Content-Type: text/plain;
  name="dovecot-0.99.10.4_2.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="dovecot-0.99.10.4_2.diff"
 
 diff -ruN dovecot-0.99.10.4_1/Makefile dovecot/Makefile
 --- dovecot-0.99.10.4_1/Makefile	Sun Jan 25 20:32:56 2004
 +++ dovecot/Makefile	Mon Jan 26 17:11:01 2004
 @@ -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/
  
 @@ -28,60 +29,78 @@
  
  PKGMESSAGE=	${WRKDIR}/pkg-message
  
 -DOCS=		auth.txt configuration.txt design.txt \
 +PLIST_DIRS=	libexec/dovecot
 +PLIST_FILES=	etc/dovecot-example.conf \
 +		etc/rc.d/dovecot.sh \
 +		libexec/dovecot/dovecot-auth \
 +		libexec/dovecot/imap \
 +		libexec/dovecot/imap-login \
 +		libexec/dovecot/pop3 \
 +		libexec/dovecot/pop3-login \
 +		sbin/dovecot
 +
 +.if !defined(NOPORTDOCS)
 +PORTDOCS=	auth.txt configuration.txt design.txt \
  		index.txt mail-storages.txt mkcert.sh multiaccess.txt \
  		nfs.txt dovecot-ldap.conf dovecot-pgsql.conf \
  		dovecot-openssl.cnf securecoding.txt
 +.endif
  
 -#.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 +109,15 @@
  	@${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 +128,18 @@
  			${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} ${PORTDOCS:S,^,${WRKSRC}/doc/,} ${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 -ruN dovecot-0.99.10.4_1/files/dovecot.sh dovecot/files/dovecot.sh
 --- dovecot-0.99.10.4_1/files/dovecot.sh	Thu Jan  1 00:00:00 1970
 +++ dovecot/files/dovecot.sh	Sun Jan 25 20:36:42 2004
 @@ -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 -ruN dovecot-0.99.10.4_1/files/patch-network.c dovecot/files/patch-network.c
 --- dovecot-0.99.10.4_1/files/patch-network.c	Thu Jan  1 00:00:00 1970
 +++ dovecot/files/patch-network.c	Mon Jan 26 13:24:57 2004
 @@ -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 -ruN dovecot-0.99.10.4_1/pkg-deinstall dovecot/pkg-deinstall
 --- dovecot-0.99.10.4_1/pkg-deinstall	Sun Jan 25 20:32:56 2004
 +++ dovecot/pkg-deinstall	Mon Jan 26 17:22:42 2004
 @@ -1,55 +1,65 @@
  #! /bin/sh
 +#
 +# 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
  }
  
  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 -ruN dovecot-0.99.10.4_1/pkg-install dovecot/pkg-install
 --- dovecot-0.99.10.4_1/pkg-install	Mon Jan 26 17:20:49 2004
 +++ dovecot/pkg-install	Mon Jan 26 13:45:49 2004
 @@ -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
 -
 -    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."
 +	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 "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 -ruN dovecot-0.99.10.4_1/pkg-message dovecot/pkg-message
 --- dovecot-0.99.10.4_1/pkg-message	Sun Jan 25 20:32:56 2004
 +++ dovecot/pkg-message	Sun Jan 25 20:31:42 2004
 @@ -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:
  
 
 --------------000900030705080308030706--
State-Changed-From-To: open->closed 
State-Changed-By: sergei 
State-Changed-When: Sun Feb 1 08:01:39 PST 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=61905 
>Unformatted:
