From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Mar 12 03:50:03 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7D0516A4CF for ; Sat, 12 Mar 2005 03:50:03 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21F4143D48 for ; Sat, 12 Mar 2005 03:50:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2C3o256090453 for ; Sat, 12 Mar 2005 03:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2C3o29D090452; Sat, 12 Mar 2005 03:50:02 GMT (envelope-from gnats) Resent-Date: Sat, 12 Mar 2005 03:50:02 GMT Resent-Message-Id: <200503120350.j2C3o29D090452@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Marcus Grando Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BD3716A4CE for ; Sat, 12 Mar 2005 03:40:54 +0000 (GMT) Received: from gwmail1.grupos.com.br (gwmail1.grupos.com.br [66.90.64.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDF4443D41 for ; Sat, 12 Mar 2005 03:40:53 +0000 (GMT) (envelope-from root@corp.grupos.com.br) Received: from corp.grupos.com.br (unknown [150.162.166.55]) by gwmail1.grupos.com.br (Postfix) with ESMTP id B500E3CE73 for ; Sat, 12 Mar 2005 00:40:52 -0300 (BRT) Received: by corp.grupos.com.br (Postfix, from userid 0) id 12EC520A32; Sat, 12 Mar 2005 00:40:52 -0300 (BRT) Message-Id: <20050312034052.12EC520A32@corp.grupos.com.br> Date: Sat, 12 Mar 2005 00:40:52 -0300 (BRT) From: Marcus Grando To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/78720: [MAINTAINER] Update port: mail/postfix-current changes X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Marcus Grando List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Mar 2005 03:50:03 -0000 >Number: 78720 >Category: ports >Synopsis: [MAINTAINER] Update port: mail/postfix-current changes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sat Mar 12 03:50:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Marcus Grando >Release: FreeBSD 4.11-STABLE i386 >Organization: Grupos Internet S/A >Environment: System: FreeBSD corp.grupos.com.br 4.11-STABLE FreeBSD 4.11-STABLE #42: Sun Feb 27 20:04:47 BRT 2005 root@corp.grupos.com.br:/usr/obj/usr/src/sys/CORP i386 >Description: Update port: mail/postfix-current changes - Change etc/postfix/dist-* to etc/postfix/dist/* on etc/postfix - Change spaces to tabs - Change echo -> /bin/echo, sh -> /bin/sh and others >How-To-Repeat: >Fix: --- postfix-current.patch begins here --- diff -ruN postfix-current.old/pkg-install postfix-current/pkg-install --- postfix-current.old/pkg-install Sun May 2 14:31:56 2004 +++ postfix-current/pkg-install Sat Mar 12 00:26:47 2005 @@ -12,180 +12,169 @@ POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no} if [ x${POSTFIX_DEFAULT_MTA} = xno ]; then - DEFAULT_REPLACE_MAILERCONF=n + DEFAULT_REPLACE_MAILERCONF=n else - DEFAULT_REPLACE_MAILERCONF=y + DEFAULT_REPLACE_MAILERCONF=y fi if [ -x /usr/sbin/nologin ]; then - NOLOGIN=/usr/sbin/nologin + NOLOGIN=/usr/sbin/nologin else - NOLOGIN=/sbin/nologin + NOLOGIN=/sbin/nologin fi ask() { - local question default answer + local question default answer - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then + /usr/bin/read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + /bin/echo ${answer} } 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 + /bin/echo "Please answer yes or no." + done } if [ x"$2" = xPRE-INSTALL ]; then - USER=postfix - UID=125 - GROUP=postfix - GID=125 - GROUP2=maildrop - GID2=126 - - if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if /usr/sbin/pw groupadd ${GROUP} -g ${GID} - then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then - echo "You already have a group \"${GROUP2}\", so I will use it." - else - if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2} - then - echo "Added group \"${GROUP2}\"." - else - echo "Adding group \"${GROUP2}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d /var/spool/postfix \ - -s ${NOLOGIN} \ - -c "Postfix Mail System" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then - echo "You already have user \"${USER}\" in group \"mail\", so I will use it." - else - echo "You need user \"${USER}\" added to group \"mail\"." - if yesno "Would you like me to add it" y; then - /usr/sbin/pw groupmod mail -m ${USER} || exit - echo "Done." - else - echo "Please create it, and try again." - exit 1 - fi - fi + USER=postfix + UID=125 + GROUP=postfix + GID=125 + GROUP2=maildrop + GID2=126 + + if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then + /bin/echo "You already have a group \"${GROUP}\", so I will use it." + else + if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then + /bin/echo "Added group \"${GROUP}\"." + else + /bin/echo "Adding group \"${GROUP}\" failed..." + /bin/echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then + /bin/echo "You already have a group \"${GROUP2}\", so I will use it." + else + if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2}; then + /bin/echo "Added group \"${GROUP2}\"." + else + /bin/echo "Adding group \"${GROUP2}\" failed..." + /bin/echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw user show "${USER}" 2>/dev/null; then + /bin/echo "You already have a user \"${USER}\", so I will use it." + else + if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/spool/postfix -s ${NOLOGIN} -c "Postfix Mail System"; then + /bin/echo "Added user \"${USER}\"." + else + /bin/echo "Adding user \"${USER}\" failed..." + /bin/echo "Please create it, and try again." + exit 1 + fi + fi + if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then + /bin/echo "You already have user \"${USER}\" in group \"mail\", so I will use it." + else + /bin/echo "You need user \"${USER}\" added to group \"mail\"." + if yesno "Would you like me to add it" y; then + /usr/sbin/pw groupmod mail -m ${USER} || exit + /bin/echo "Done." + else + /bin/echo "Please create it, and try again." + exit 1 + fi + fi fi if [ x"$2" = xPOST-INSTALL ]; then - # CONF1 copied from Makefile. Keep consistent! - CONF1="main.cf master.cf access aliases canonical \ - header_checks relocated transport virtual" - - for file in $CONF1 - do - if [ ! -f ${PKG_PREFIX}/etc/postfix/$file ]; then - cp ${PKG_PREFIX}/etc/postfix/dist-$file ${PKG_PREFIX}/etc/postfix/$file - fi - done - - sh ${PKG_PREFIX}/etc/postfix/post-install tempdir=/tmp \ - config_directory=${PKG_PREFIX}/etc/postfix \ - daemon_directory=${PKG_PREFIX}/libexec/postfix \ - command_directory=${PKG_PREFIX}/sbin \ - queue_directory=/var/spool/postfix \ - sendmail_path=${PKG_PREFIX}/sbin/sendmail \ - newaliases_path=${PKG_PREFIX}/bin/newaliases \ - mailq_path=${PKG_PREFIX}/bin/mailq \ - mail_owner=postfix \ - setgid_group=maildrop \ - manpage_directory=${PKG_PREFIX}/man \ - sample_directory=${PKG_PREFIX}/etc/postfix \ - readme_directory=no \ - upgrade-package + if [ -d ${PKG_PREFIX}/etc/postfix/dist ]; then + for file in ${PKG_PREFIX}/etc/postfix/dist/*; do + if [ ! -f ${PKG_PREFIX}/etc/postfix/${file#${PKG_PREFIX}/etc/postfix/dist} ]; then + cp $file ${PKG_PREFIX}/etc/postfix/ + fi + done + fi + + /bin/sh ${PKG_PREFIX}/etc/postfix/post-install tempdir=/tmp \ + config_directory=${PKG_PREFIX}/etc/postfix \ + daemon_directory=${PKG_PREFIX}/libexec/postfix \ + command_directory=${PKG_PREFIX}/sbin \ + queue_directory=/var/spool/postfix \ + sendmail_path=${PKG_PREFIX}/sbin/sendmail \ + newaliases_path=${PKG_PREFIX}/bin/newaliases \ + mailq_path=${PKG_PREFIX}/bin/mailq \ + mail_owner=postfix \ + setgid_group=maildrop \ + manpage_directory=${PKG_PREFIX}/man \ + sample_directory=${PKG_PREFIX}/etc/postfix \ + readme_directory=no \ + upgrade-package +fi # readme_directory is "no" above since the package will have correct perms # already, and we don't know if they had PORTDOCS. -fi replace() { - local orig repl - - orig=$1 - repl=$2 - if [ -e ${orig} ]; then - mv -f ${orig} ${orig}.OFF - chmod 0 ${orig}.OFF - fi - if [ -e ${repl} ]; then - ln -s ${repl} ${orig} - fi + local orig repl + + orig=$1 + repl=$2 + if [ -e ${orig} ]; then + /bin/mv -f ${orig} ${orig}.OFF + /bin/chmod 0 ${orig}.OFF + fi + if [ -e ${repl} ]; then + /bin/ln -s ${repl} ${orig} + fi } if [ x"$2" = xPOST-INSTALL -a -z "${PACKAGE_BUILDING}" ]; then - if [ -x /sbin/sysctl ]; then - OSVERSION=`/sbin/sysctl -n kern.osreldate` - else - OSVERSION=`/usr/sbin/sysctl -n kern.osreldate` - fi - if [ ${OSVERSION} -ge 400014 ]; then - if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" \ - ${DEFAULT_REPLACE_MAILERCONF}; then - mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old - echo "#" > /etc/mail/mailer.conf - echo -n "# Execute the Postfix sendmail program" >> /etc/mail/mailer.conf - echo ", named ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "#" >> /etc/mail/mailer.conf - echo "sendmail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "send-mail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "mailq ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "newaliases ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - fi - else - if yesno "Would you like to replace {sendmail,mailq,newaliases} with Postfix versions" n; then - replace /usr/sbin/sendmail ${PKG_PREFIX}/sbin/sendmail - replace /usr/bin/mailq ${PKG_PREFIX}/sbin/sendmail - replace /usr/bin/newaliases ${PKG_PREFIX}/sbin/sendmail - echo "Done." - fi - fi + if [ -x /sbin/sysctl ]; then + OSVERSION=`/sbin/sysctl -n kern.osreldate` + else + OSVERSION=`/usr/sbin/sysctl -n kern.osreldate` + fi + if [ ${OSVERSION} -ge 400014 ]; then + if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" ${DEFAULT_REPLACE_MAILERCONF}; then + /bin/mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old + /bin/echo "#" > /etc/mail/mailer.conf + /bin/echo -n "# Execute the Postfix sendmail program" >> /etc/mail/mailer.conf + /bin/echo ", named ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + /bin/echo "#" >> /etc/mail/mailer.conf + /bin/echo "sendmail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + /bin/echo "send-mail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + /bin/echo "mailq ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + /bin/echo "newaliases ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + fi + else + if yesno "Would you like to replace {sendmail,mailq,newaliases} with Postfix versions" n; then + replace /usr/sbin/sendmail ${PKG_PREFIX}/sbin/sendmail + replace /usr/bin/mailq ${PKG_PREFIX}/sbin/sendmail + replace /usr/bin/newaliases ${PKG_PREFIX}/sbin/sendmail + /bin/echo "Done." + fi + fi fi --- postfix-current.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: