[csw-devel] SF.net SVN: gar:[8508] csw/mgar/pkg/postfix/branches/postfix-2.6

skayser at users.sourceforge.net skayser at users.sourceforge.net
Fri Feb 12 02:16:22 CET 2010


Revision: 8508
          http://gar.svn.sourceforge.net/gar/?rev=8508&view=rev
Author:   skayser
Date:     2010-02-12 01:16:22 +0000 (Fri, 12 Feb 2010)

Log Message:
-----------
postfix: 2.6 release getting closer

Modified Paths:
--------------
    csw/mgar/pkg/postfix/branches/postfix-2.6/Makefile
    csw/mgar/pkg/postfix/branches/postfix-2.6/files/cswpostfix

Added Paths:
-----------
    csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.CSW
    csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.upgradefrom.24
    csw/mgar/pkg/postfix/branches/postfix-2.6/files/migrate-queuefiles.sh

Removed Paths:
-------------
    csw/mgar/pkg/postfix/branches/postfix-2.6/files/CSWpostfix.checkinstall
    csw/mgar/pkg/postfix/branches/postfix-2.6/files/upgrade

Modified: csw/mgar/pkg/postfix/branches/postfix-2.6/Makefile
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/Makefile	2010-02-11 23:58:44 UTC (rev 8507)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/Makefile	2010-02-12 01:16:22 UTC (rev 8508)
@@ -1,12 +1,8 @@
 # TODO (release-critical prefixed with !, non release-critical with *)
-# ! Handle system integration (refer to README.CSW or alike), see
-#   http://article.gmane.org/gmane.os.solaris.opencsw.maintainers/5313
 # ! Update to most recent postfix version (2.6.5 as of 13th Jan 2010)
-# ! Verify CONFIG_FILES list (can this be generated on the fly?)
-# ! Ship simple default configuration
-# ! Build, install and test package (bails out on existing spool files?
-#   works? spool permissions ok?)
+# ! Build, install and test package (works? spool permissions ok?)
 #   WRT to permissions, run "postfix set-permissions" and compare
+# * Ship simple default configuration
 #
 # NICE TO KNOW
 # - 2.4.6,REV=2008.05.28 preserves modified configuration files via
@@ -31,12 +27,11 @@
 MASTER_SITES = ftp://ftp.porcupine.org/mirrors/postfix-release/official/
 DISTFILES    = $(GARNAME)-$(GARVERSION).tar.gz
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
+LICENSE      = LICENSE TLS_LICENSE
 
-DISTFILES += CSWpostfix.checkinstall
-
 # Tag configuration files for handling via cswclassutils
-CONFIG_BASE   = /etc/opt/csw/postfix/
-CONFIG_FILES  = access 
+CONFIG_BASE  := /etc/opt/csw/postfix/
+CONFIG_FILES := access 
 CONFIG_FILES += aliases
 CONFIG_FILES += canonical
 CONFIG_FILES += generic
@@ -46,11 +41,17 @@
 CONFIG_FILES += relocated
 CONFIG_FILES += transport
 CONFIG_FILES += virtual
-SAMPLECONF    = $(addprefix $(CONFIG_BASE), $(CONFIG_FILES))
+SAMPLECONF   := $(addprefix $(CONFIG_BASE), $(CONFIG_FILES))
 
-INITSMF     = /etc/opt/csw/init.d/cswpostfix
-USERGROUP   = $(sysconfdir)/pkg/CSWpostfix/cswusergroup
+sysconfdir  = /etc/opt/csw
+INITSMF     = $(sysconfdir)/init.d/csw$(GARNAME)
+USERGROUP   = $(sysconfdir)/pkg/CSW$(GARNAME)/cswusergroup
 
+# For the sake of simplicity and user choice we dropped the automatic
+# replacement of the /usr/{lib,bin} sendmail binaries. Ref.
+# http://article.gmane.org/gmane.os.solaris.opencsw.maintainers/5313
+POSTMSG     = POSTMSG = $(DOCDIR)/$(GARNAME)/README.upgradefrom.24
+
 # Make postdrop setgid so that it can deliver to $(DEF_QUEUE_DIR)/maildrop
 PROTOTYPE_MODIFIERS = makesgid
 PROTOTYPE_FILES_makesgid = $(sbindir)/postdrop
@@ -80,6 +81,7 @@
 PROTOTYPE_CLASS_pid = ugfiles
 
 EXTRA_MERGE_EXCLUDE_FILES  = /etc/opt/csw/postfix/LICENSE
+EXTRA_MERGE_EXCLUDE_FILES += /etc/opt/csw/postfix/TLS_LICENSE
 EXTRA_MERGE_EXCLUDE_FILES += /etc/opt/csw/postfix/makedefs.out
 
 STRIP_DIRS = $(DESTDIR)$(libexecdir)/postfix
@@ -190,7 +192,7 @@
 		AUXLIBS='$(AUXLIBS)' \
 		DEBUG= \
 		OPT=
-	@$(MAKECOOKIE)
+	@$(MAKECOOIE)
 
 install-custom:
 	$(MAKE) -C $(WORKSRC) non-interactive-package install_root=$(DESTDIR) \
@@ -212,4 +214,28 @@
 		$(DESTDIR)/etc/opt/csw/init.d/cswpostfix
 	ginstall -D $(FILEDIR)/cswusergroup \
 		$(DESTDIR)$(sysconfdir)/pkg/CSWpostfix/cswusergroup
+
+    # Helper script for spool location migration (2.4.x -> 2.6.x)
+	ginstall -Dm 755 $(FILEDIR)/migrate-queuefiles.sh \
+		$(DESTDIR)$(docdir)/$(GARNAME)/scripts/migrate-queuefiles.sh
 	@$(MAKECOOKIE)
+
+post-merge-modulated: verify-config
+
+# Warn if there are any files in $(sysconfdir)/postfix which are not
+# covered by cswsampleconf. This is a safety net in case new config file
+# get introduced by more recent postfix versions. I know this runs for
+# most bloated awkwardness. Feel free to trim it down.
+verify-config: SHIPPED_CFGFILES  = $(wildcard $(PKGROOT)$(CONFIG_BASE)*)
+verify-config: SHIPPED_CFGFILES := $(subst $(PKGROOT),,$(SHIPPED_CFGFILES))
+verify-config: IGNORE_FILES += /etc/opt/csw/postfix/bounce.cf.default
+verify-config: IGNORE_FILES += /etc/opt/csw/postfix/main.cf.default
+verify-config: IGNORE_FILES += $(addsuffix .CSW, $(SAMPLECONF))
+verify-config: SHELL=/bin/bash
+verify-config:
+	@echo "Checking for files in $(CONFIG_BASE) not covered by cswsampleconf"
+	@gdiff \
+		<( echo $(IGNORE_FILES) | tr " " "\n" | sort) \
+		<( echo $(SHIPPED_CFGFILES) | tr " " "\n" | sort )
+	@echo "OK"
+	@$(MAKECOOKIE)	

Deleted: csw/mgar/pkg/postfix/branches/postfix-2.6/files/CSWpostfix.checkinstall
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/files/CSWpostfix.checkinstall	2010-02-11 23:58:44 UTC (rev 8507)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/files/CSWpostfix.checkinstall	2010-02-12 01:16:22 UTC (rev 8508)
@@ -1,71 +0,0 @@
-#!/bin/sh
-# Copied from the CSWcupsd.preinstall script (obsolete_dir_file_name adjusted)
-# https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/cups/trunk/files/CSWcupsd.preinstall
-#
-# $Id$
-#
-
-set -u
-
-PKG_INSTALL_ROOT="${PKG_INSTALL_ROOT:-}"
-readonly PKG_INSTALL_ROOT
-
-obsolete_directories="/opt/csw/etc/postfix:/etc/opt/csw/postfix"
-
-obsolete_dir_information="
-This directory is obsolete.  Files in this directory are going to be ignored.
-Please move your data to the new location.
-
-Feel free to remove this file afterwards.
-"
-obsolete_dir_file_name="README.THIS_DIRECTORY_IS_OBSOLETE"
-
-for dirpair in ${obsolete_directories}; do
-  obsolete_dir=`echo ${dirpair} | cut -d: -f1`
-  new_dir=`echo ${dirpair} | cut -d: -f2`
-  if [ -d "${PKG_INSTALL_ROOT}/${obsolete_dir}" ]; then
-    echo
-    echo "*******************************************************************"
-    echo "* The old configuration directory ${obsolete_dir} still exists.    "
-    echo "* Please move your configuration to ${new_dir}.                    "
-    echo "*                                                                  "
-    echo "*       Installation will continue in 10 seconds.                  "
-    echo "*         Press CTRL+C if you want to stop now.                    "
-    echo "*******************************************************************"
-    echo
-    sleep 10
-
-    # Leaving a note for the sysadmin if the they proceed with the installation.
-    fn="${PKG_INSTALL_ROOT}/${obsolete_dir}/${obsolete_dir_file_name}"
-    if touch "${fn}" 2>/dev/null; then
-      echo "${obsolete_dir_information}" > "${fn}"
-    fi
-  fi
-done
-
-# Verify that there are no possibly important files in the old spool location
-# (where old <= 2.4.6,REV=2008.05.28). Bail out otherwise and instruct user to
-# manually migrate. Skips named pipes as well as all files in pid/.
-old_spooldir="/opt/csw/var/spool/postfix/"
-new_spooldir="/var/opt/csw/
-old_spoolfiles=`find ${PKG_INSTALL_ROOT}/opt/csw/var/spool/postfix/ \
-  -name pid -prune -o ! -type d ! -type p | grep -v '/pid$'`
-if [ "${old_spoolfiles}" != "" ]; then
-    echo
-    echo "*******************************************************************"
-    echo "* The old spool directory ${old_spooldir} still contains files.    "
-    echo "* Please migrate these as needed to ${new_spooldir}.               "
-    echo "*                                                                  "
-    echo "* Installation will now terminate. Please restart the installation "
-    echo "* once the files have been migrated or removed.                    "
-    echo "*******************************************************************"
-    echo
-    echo "*******************************************************************"
-    echo "* This is the list of affected files:                              "
-    echo ${old_spoolfiles}
-    echo
-
-    exit 1
-fi
-
-exit 0

Added: csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.CSW
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.CSW	                        (rev 0)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.CSW	2010-02-12 01:16:22 UTC (rev 8508)
@@ -0,0 +1,75 @@
+Replacing the system sendmail binaries
+--------------------------------------
+This package will not automatically substitute the common sendmail binaries
+with links to the postfix binaries. Thus, the following files will be untouched
+and possibly belong to the system sendmail installation.
+
+  /usr/lib/sendmail
+  /usr/bin/mailq
+  /usr/bin/newaliases
+
+This makes the package installation less troublesome for shared zones and
+leaves the choice of fully replacing your system sendmail up to you. If you
+intend to replace those binaries above with the ones from this postfix package,
+there are two approaches (both currently _not_ supported in in shared zones):
+
+#1: For testing purposes - allows for quick rollback, possibly harmful
+
+This approach temporarily moves away the system sendmail binaries and replaces
+them with links to the postfix binaries. This lets you test this postfix
+package and easily roll back to the system sendmail in case you need to. It is
+_not_ suited for long term operations as system sendmail patches will possibly
+break those symlinks or worse, overwrite your postfix binaries with patched
+sendmail versions.
+
+Put in place:
+
+  mv /usr/lib/sendmail /usr/lib/sendmail.SYSTEM
+  mv /usr/bin/mailq /usr/bin/mailq.SYSTEM
+  mv /usr/bin/newaliases /usr/bin/newaliases.SYSTEM
+  
+  ln -s /opt/csw/sbin/sendmail /usr/lib/sendmail
+  ln -s /opt/csw/bin/newaliases /usr/bin/newaliases
+  ln -s /opt/csw/bin/mailq /usr/bin/mailq
+
+Roll back:
+
+  rm /usr/lib/sendmail /usr/bin/newaliases /usr/bin/mailq
+  mv /usr/lib/sendmail.SYSTEM /usr/lib/sendmail
+  mv /usr/bin/mailq.SYSTEM /usr/bin/mailq
+  mv /usr/bin/newaliases.SYSTEM /usr/bin/newaliases
+
+#2: Recommended for production systems and long term operations
+
+This approach fully removes the system sendmail packages and replaces the
+binaries with links to the postfix binaries. Patches for the system sendmail
+will be skipped and won't harm your setup. Keep your Solaris media available
+in case you want to re-install the system sendmail packages.
+
+Remove system sendmail:
+
+  echo "rdepend=nocheck" > ~/admin-postfix
+  echo "action=nocheck" >> ~/admin-postfix
+  pkgrm -na ~/admin-postfix SUNWsndmr SUNWsndmu
+  rm ~/admin-postfix
+
+Depending on the speed of your system the pkgrm might take a while.
+
+Put in place:
+
+  ln -s /opt/csw/sbin/sendmail /usr/lib/sendmail
+  ln -s /opt/csw/bin/newaliases /usr/bin/newaliases
+  ln -s /opt/csw/bin/mailq /usr/bin/mailq
+
+Roll back:
+
+  echo "idepend=nocheck" > ~/admin-postfix
+  echo "action=nocheck" >> ~/admin-postfix
+  rm /usr/lib/sendmail /usr/bin/newaliases /usr/bin/mailq
+  pkgadd -na ~/admin-postfix \
+         -d <path_to_solaris_media>/Solaris_X/Products/ SUNWsndmr SUNWsndmu
+  rm ~/admin-postfix
+
+You might want to apply additional system sendmail patches that have been
+released since the Solaris release from which you install those sendmail
+packages.

Added: csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.upgradefrom.24
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.upgradefrom.24	                        (rev 0)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/files/README.upgradefrom.24	2010-02-12 01:16:22 UTC (rev 8508)
@@ -0,0 +1,27 @@
+Note for users upgrading from postfix 2.4.6 and previous
+--------------------------------------------------------
+
+- Starting with postfix 2.6.x the spool location has changed from 
+
+    /opt/csw/var/spool/postfix to
+    /var/opt/csw/spool/postfix
+
+  If you have any pending email in the old spool location, please move
+  it to the new spool location and run "postsuper" before starting
+  postfix. An example script on how this can be done is shipped with the
+  package (migrate-queuefiles.sh). Make sure to understand what you are
+  doing.
+
+- Starting with postfix 2.6.x this package will _not_ automatically
+  substitute the common sendmail binaries with links to the postfix
+  binaries any more. Thus, the following files will be untouched and
+  possibly belong to the system sendmail installation.
+  
+    /usr/lib/sendmail
+    /usr/bin/mailq
+    /usr/bin/newaliases
+  
+  This makes the package installation less troublesome for shared zones
+  and leaves the choice of fully replacing your system sendmail up to you.
+  If you intend to replace those binaries above with the ones from this
+  postfix package, please see README.CSW.

Modified: csw/mgar/pkg/postfix/branches/postfix-2.6/files/cswpostfix
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/files/cswpostfix	2010-02-11 23:58:44 UTC (rev 8507)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/files/cswpostfix	2010-02-12 01:16:22 UTC (rev 8508)
@@ -3,13 +3,15 @@
 # Start or stop Postfix
 #
 # Origionally written by Valery Kotchiev <valery at blastwave.org>
-# Maintained by Darin Perusich <darin at blastwave.org>
+# Adjusted by Darin Perusich <darin at blastwave.org>
+# Adjusted by Sebastian Kayser <skayser at opencsw.org>
 # based on debians's postfix init.d script
 #
 # cswclassutils settings
-#MANIFEST /var/opt/csw/svc/manifest/network/cswpostfix.xml
+#AUTOENABLE NO
 
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
+CFGDIR=/etc/opt/csw/postfix
 DAEMON=/opt/csw/sbin/postfix
 PIDFILE=/var/opt/csw/run/postfix.pid
 NAME=Postfix
@@ -20,7 +22,7 @@
 
 case "$1" in
     start)
-        if [ ! -f $pf_config_directory/aliases.dir ]; then
+        if [ ! -f $CFGDIR/aliases.dir ]; then
          /opt/csw/bin/newaliases
         fi
 

Added: csw/mgar/pkg/postfix/branches/postfix-2.6/files/migrate-queuefiles.sh
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/files/migrate-queuefiles.sh	                        (rev 0)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/files/migrate-queuefiles.sh	2010-02-12 01:16:22 UTC (rev 8508)
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# move-spool.sh:
+#  helper script to move possible queue files from the CSWpostfix 2.4.x
+#  spool location to the CSWpostfix >= 2.6.x spool location.
+#
+# $Id$
+
+
+SPOOL_OLD=/opt/csw/var/spool/postfix
+SPOOL_NEW=/var/opt/csw/spool/postfix
+QDIRS="incoming active deferred corrupt hold bounce defer trace"
+
+[ -x /usr/bin/zonename ] && ZONEOPT="-z `/usr/bin/zonename`"
+if pgrep $ZONEOPT master; then
+   echo "Make sure postfix is not running! Exiting."
+   exit 1
+fi
+
+for qdir in $QDIRS; do
+    [ -d ${SPOOL_OLD}/$qdir ] || continue
+	echo "Moving from ${SPOOL_OLD}/$qdir to ${SPOOL_NEW}/$qdir"
+	cd ${SPOOLDIR_NEW}/$qdir && \
+		find ${SPOOLDIR_OLD}/$qdir -type f -exec mv '{}' . +
+done
+
+echo "No errors so far? Then please run postsuper now."

Deleted: csw/mgar/pkg/postfix/branches/postfix-2.6/files/upgrade
===================================================================
--- csw/mgar/pkg/postfix/branches/postfix-2.6/files/upgrade	2010-02-11 23:58:44 UTC (rev 8507)
+++ csw/mgar/pkg/postfix/branches/postfix-2.6/files/upgrade	2010-02-12 01:16:22 UTC (rev 8508)
@@ -1,46 +0,0 @@
-#!/bin/sh
-# Copied from the CSWcupsd.preinstall script (obsolete_dir_file_name adjusted)
-# https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/cups/trunk/files/CSWcupsd.preinstall
-#
-# $Id$
-#
-
-set -u
-
-PKG_INSTALL_ROOT="${PKG_INSTALL_ROOT:-}"
-readonly PKG_INSTALL_ROOT
-
-obsolete_directories="/opt/csw/etc/postfix:/etc/opt/csw/postfix"
-
-obsolete_dir_information="
-This directory is obsolete.  Files in this directory are going to be ignored.
-Please move your data to the new location.
-
-Feel free to remove this file afterwards.
-"
-obsolete_dir_file_name="README.THIS_DIRECTORY_IS_OBSOLETE"
-
-for dirpair in ${obsolete_directories}; do
-  obsolete_dir=`echo ${dirpair} | cut -d: -f1`
-  new_dir=`echo ${dirpair} | cut -d: -f2`
-  if [ -d "${PKG_INSTALL_ROOT}/${obsolete_dir}" ]; then
-    echo
-    echo "*******************************************************************"
-    echo "* The old configuration directory ${obsolete_dir} still exists.    "
-    echo "* Please move your configuration to ${new_dir}.                    "
-    echo "*                                                                  "
-    echo "*       Installation will continue in 10 seconds.                  "
-    echo "*         Press CTRL+C if you want to stop now.                    "
-    echo "*******************************************************************"
-    echo
-    sleep 10
-
-    # Leaving a note for the sysadmin if the they proceed with the installation.
-    fn="${PKG_INSTALL_ROOT}/${obsolete_dir}/${obsolete_dir_file_name}"
-    if touch "${fn}" 2>/dev/null; then
-      echo "${obsolete_dir_information}" > "${fn}"
-    fi
-  fi
-done
-
-exit 0


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list