This port uses pkg-install to create new users instead of using USERS= and GROUPS= Also, its use of CURDIR to find dovecot-sieve is troublesome if I'm testing the port in its own directory. I've changed it to use PORTSDIR/PKGCATEGORY which unfortunately is not assigned in time for the subshell to use it -- I had to assign it by hand. Fix: - Use USERS and GROUPS - Use @stopdaemon - Stop using .CURDIR Submitted by: Chris Rees (utisoft@gmail.com) Please bear in mind that files/pkg-install.in has been removed. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.--kpozl9PMsA4S8QAGadAmFBSTXnjAaERbS77UlZrXMhuF2M1V Content-Type: text/plain; name="mail-dovecot.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mail-dovecot.patch" Index: Makefile =================================================================== RCS file: /exports/cvsroot-freebsd/ports/mail/dovecot/Makefile,v retrieving revision 1.117 diff -u -r1.117 Makefile --- Makefile 23 Dec 2010 04:42:02 -0000 1.117 +++ Makefile 4 Jun 2011 11:09:19 -0000 @@ -17,6 +17,8 @@ CONFLICTS= dovecot-2.* DOVECOTVERSION= 1.2 +# Need to assign here because it's not assigned until after bsd.port.post.mk +PKGCATEGORY= mail ###################################################################### # Anytime PORTVERSION changes please bump PORTREVISIONs of # @@ -51,8 +53,8 @@ PORTDOCS= *.txt wiki ${DOCS} .endif -DOVECOT_UID?= 143 -DOVECOT_GID?= 143 +USERS= ${PORTNAME} +GROUPS= ${USERS} PROTOCOLS= imap pop3 @@ -98,8 +100,8 @@ ## ManageSieve support # .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 +MANAGESIEVEVERSION!= ${MAKE} -C ${PORTSDIR}/${PKGCATEGORY}/dovecot-managesieve -V PORTVERSION +PATCH_SITES!= ${MAKE} -C ${PORTSDIR}/${PKGCATEGORY}/dovecot-managesieve -V MASTER_SITES PATCHFILES+= dovecot-${PORTVERSION}-managesieve-${MANAGESIEVEVERSION}.diff.gz PATCH_DIST_STRIP= -p1 PROTOCOLS+= managesieve @@ -183,8 +185,8 @@ PLIST_SUB+= SQL="@comment " .endif -SUB_LIST+= REQUIRE="${_REQUIRE}" DOVECOT_UID=${DOVECOT_UID} DOVECOT_GID=${DOVECOT_GID} -SUB_FILES+= pkg-install pkg-deinstall pkg-message +SUB_LIST+= REQUIRE="${_REQUIRE}" +SUB_FILES+= pkg-deinstall pkg-message post-patch: @${REINPLACE_CMD} -E -e '${REINPLACE}' \ @@ -204,9 +206,6 @@ @${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-su-install: - @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - post-install: ${INSTALL_DATA} ${WRKSRC}/dovecot.conf ${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/doc/dovecot-db.conf ${EXAMPLESDIR} @@ -224,7 +223,6 @@ ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} .endfor .endif - @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> Index: pkg-plist =================================================================== RCS file: /exports/cvsroot-freebsd/ports/mail/dovecot/pkg-plist,v retrieving revision 1.32 diff -u -r1.32 pkg-plist --- pkg-plist 26 Jan 2010 14:23:20 -0000 1.32 +++ pkg-plist 2 Jun 2011 22:03:30 -0000 @@ -1,4 +1,5 @@ @comment $FreeBSD: ports/mail/dovecot/pkg-plist,v 1.32 2010/01/26 14:23:20 wxs Exp $ +@stopdaemon dovecot @dirrmtry include/dovecot lib/dovecot/imap/lib01_acl_plugin.so lib/dovecot/imap/lib02_imap_acl_plugin.so Index: files/pkg-deinstall.in =================================================================== RCS file: /exports/cvsroot-freebsd/ports/mail/dovecot/files/pkg-deinstall.in,v retrieving revision 1.2 diff -u -r1.2 pkg-deinstall.in --- files/pkg-deinstall.in 28 Nov 2008 14:38:26 -0000 1.2 +++ files/pkg-deinstall.in 2 Jun 2011 22:04:06 -0000 @@ -3,61 +3,8 @@ # $FreeBSD: ports/mail/dovecot/files/pkg-deinstall.in,v 1.2 2008/11/28 14:38:26 wxs Exp $ # -PKG_PREFIX=${PKG_PREFIX:=/usr/local} - -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}} -} - -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 -} - -delete_account() { - local port user uid group gid - - port=$1 - user=${2%:*} - uid=${2#*:} - group=${3%:*} - gid=${3#*:} - - echo "If you do not intend to reinstall ${port}, you should manually" - echo "remove user '${user}' (uid='${uid}') and group '${group}' (gid='${gid}')." -} - case $2 in - DEINSTALL) - if ps -axc | grep -qw dovecot; then - if yesno "Dovecot is still running. Shall I stop it?" y; then - ${PKG_PREFIX}/etc/rc.d/dovecot stop - sleep 2 - else - echo "OK ... I hope you know what you are doing." - fi - fi - - delete_account Dovecot dovecot:${DOVECOT_UID:-%%DOVECOT_UID%%} dovecot:${DOVECOT_GID:-%%DOVECOT_GID%%} - echo "Also manually 'rm -rf /var/db/dovecot' if anything was stored there." ;; Index: files/pkg-install.in =================================================================== RCS file: files/pkg-install.in diff -N files/pkg-install.in --- files/pkg-install.in 28 Nov 2008 14:38:26 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,92 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: ports/mail/dovecot/files/pkg-install.in,v 1.2 2008/11/28 14:38:26 wxs Exp $ -# - -PKG_PREFIX=${PKG_PREFIX:=/usr/local} - -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}} -} - -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 -} - -create_account() { - local port user uid group gid gcos home shell - - port=$1 - user=${2%:*} - uid=${2#*:} - group=${3%:*} - gid=${3#*:} - gcos=$4 - home=$5 - shell=$6 - - pw_user_uid=$(pw usershow -n "${user}" 2>/dev/null | cut -d: -f3) - pw_uid_user=$(pw usershow -u "${uid}" 2>/dev/null | cut -d: -f1) - pw_group_gid=$(pw groupshow -n "${group}" 2>/dev/null | cut -d: -f3) - pw_gid_group=$(pw groupshow -g "${gid}" 2>/dev/null | cut -d: -f1) - - if [ -z "${pw_group_gid}" -a -z "${pw_gid_group}" ]; then - echo "You need a ${group} group; creating it..." - pw groupadd "${group}" -g "${gid}" || exit - echo "Done." - elif [ "${gid}" = "${pw_group_gid}" -a "${group}" = "${pw_gid_group}" ]; then - echo "Using existing ${group} group." - else - echo "${port} has reserved the groupname '${group}' and gid '${gid}':" - [ -n "${pw_group_gid}" -a "${gid}" != "${pw_group_gid}" ] \ - && echo "ERROR: groupname '${group}' already in use by gid '${pw_group_gid}'" - [ -n "${pw_gid_group}" -a "${group}" != "${pw_gid_group}" ] \ - && echo "ERROR: gid '${gid}' already in use by group '${pw_gid_group}'" - echo "Please resolve these issues and try again:" - echo "Either remove the conflicting group or if you wish to continue using a legacy group override DOVECOT_GID." - exit 1 - fi - - if [ -z "${pw_user_uid}" -a -z "${pw_uid_user}" ]; then - echo "You need a ${user} user; creating it..." - pw useradd "${user}" -u "${uid}" -g "${group}" -c "${gcos}" -d "${home}" -s "${shell}" - echo "Done." - elif [ "${uid}" = "${pw_user_uid}" -a "${user}" = "${pw_uid_user}" ]; then - echo "Using existing ${user} user." - else - echo "${port} has reserved the username '${user}' and uid '${uid}':" - [ -n "${pw_user_uid}" -a "${uid}" != "${pw_user_uid}" ] \ - && echo "ERROR: username '${user}' already in use by uid '${pw_user_uid}'" - [ -n "${pw_uid_user}" -a "${user}" != "${pw_uid_user}" ] \ - && echo "ERROR: uid '${uid}' already in use by user '${pw_uid_user}'" - echo "Please resolve these issues and try again:" - echo "Either remove the conflicting user or if you wish to continue using a legacy user override DOVECOT_UID." - exit 1 - fi -} - -case $2 in - -PRE-INSTALL) - create_account Dovecot dovecot:${DOVECOT_UID:-%%DOVECOT_UID%%} dovecot:${DOVECOT_GID:-%%DOVECOT_GID%%} "Dovecot User" /var/empty /usr/sbin/nologin - ;; - -esac
Responsible Changed From-To: freebsd-ports-bugs->pgollucci pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Maintainer of mail/dovecot, Please note that PR ports/157607 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157607 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Responsible Changed From-To: pgollucci->crees Invalid autoassignment
Responsible Changed From-To: crees->freebsd-ports-bugs To pool to correct assign message
Responsible Changed From-To: freebsd-ports-bugs->crees Invalid autoassignment to pgollucci
On 22 June 2011 19:16, Yarema <yds@coolrat.org> wrote: > I'm rolling this in with an update I'm working on for the port. > Great, thanks. If you post it as a followup I'll commit it. Chris
State Changed From-To: feedback->closed Please open a new PR with your update.