git: c0d942b61396 - main - mail/postfix: Update to 3.10.0

From: Juraj Lutter <otis_at_FreeBSD.org>
Date: Thu, 20 Feb 2025 21:27:13 UTC
The branch main has been updated by otis:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c0d942b61396197af19a629ae7e5c95df8c33e3a

commit c0d942b61396197af19a629ae7e5c95df8c33e3a
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2025-02-19 20:09:14 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2025-02-20 21:26:58 +0000

    mail/postfix: Update to 3.10.0
    
    - Update to 3.10.0
    - Fix some typos
    - Incorporate changes from [1], namely:
      - Simplify some Makefile constructs
      - Fix post-install script
      - Fix plist
    
    PR:     280019
---
 mail/postfix/Makefile             | 22 +++++++++---------
 mail/postfix/distinfo             |  6 ++---
 mail/postfix/files/pkg-install.in | 47 +++++++++++++--------------------------
 mail/postfix/pkg-help             |  2 +-
 mail/postfix/pkg-plist            |  2 +-
 5 files changed, 31 insertions(+), 48 deletions(-)

diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile
index 5f1267f67f42..3fe0740e9228 100644
--- a/mail/postfix/Makefile
+++ b/mail/postfix/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	postfix
-DISTVERSION=	3.9.1
-PORTREVISION?=	1
+DISTVERSION=	3.10.0
+PORTREVISION?=	0
 PORTEPOCH=	1
 CATEGORIES=	mail
 MASTER_SITES=	https://postfix-mirror.horus-it.com/postfix-release/ \
@@ -144,6 +144,8 @@ SASLKMIT_LIB_DEPENDS=		libkrb5.so:security/krb5
 SASL_LIB_DEPENDS=		libsasl2.so:security/cyrus-sasl2
 SQLITE_USES=			sqlite
 
+ALL_TARGET=		default
+
 .include <bsd.port.options.mk>
 
 HTML1=		body_checks.5.html bounce.5.html postfix-power.png \
@@ -200,17 +202,14 @@ READMEDIR=	${DOCSDIR}
 READMEDIR=	no
 .endif
 
-# dynamic direcory location
+# dynamic directory location
 DAEMONDIR=		${PREFIX}/libexec/postfix
 SHLIB_DIRECTORY=	${PREFIX}/lib/postfix
 # new proposed location is ETCDIR (see README_FILES/INSTALL)
 # keep compatiblity with Postfix 2.6 .. 2.11 and use DAEMOMDIR
 META_DIRECTORY=		${DAEMONDIR}
 
-SUB_LIST+=	DAEMONDIR="${DAEMONDIR}" \
-		META_DIRECTORY="${META_DIRECTORY}" \
-		READMEDIR="${READMEDIR}" \
-		REQUIRE="${_REQUIRE}"
+SUB_LIST+=	REQUIRE="${_REQUIRE}"
 SUB_FILES+=	mailer.conf.postfix pkg-install pkg-message
 
 POSTFIX_CCARGS+=	-DDEF_CONFIG_DIR=\\\"${ETCDIR}\\\" \
@@ -396,19 +395,18 @@ post-patch:
 		>> ${WRKSRC}/conf/postfix-files
 
 do-configure:
-	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles \
+	${MAKE} -C ${WRKSRC} -f Makefile.init makefiles \
 	${MAKEFILEFLAGS} CCARGS="${POSTFIX_CCARGS}" \
 	shared=yes shlib_directory=${SHLIB_DIRECTORY} \
 	dynamicmaps=yes \
 	${POSTFIX_DYN_AUXLIBS} \
-	AUXLIBS="${POSTFIX_AUXLIBS}" && \
-	${ECHO_CMD} "all: default" >> Makefile)
+	AUXLIBS="${POSTFIX_AUXLIBS}"
 
 pre-install-INST_BASE-on:
 	${MKDIR} ${STAGEDIR}/etc/rc.d
 
 do-install:
-	@(cd ${WRKSRC} && ${MAKE} non-interactive-package \
+	${MAKE} -C ${WRKSRC} non-interactive-package \
 		install_root=${STAGEDIR} tempdir=${WRKDIR} \
 		shlib_directory=${SHLIB_DIRECTORY} \
 		config_directory=${ETCDIR} \
@@ -420,7 +418,7 @@ do-install:
 		manpage_directory=${PREFIX}/share/man \
 		newaliases_path=${PREFIX}/bin/newaliases \
 		readme_directory=${READMEDIR} \
-		sendmail_path=${PREFIX}/sbin/sendmail )
+		sendmail_path=${PREFIX}/sbin/sendmail
 
 	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/rmail/rmail ${STAGEDIR}${PREFIX}/bin/rmail
 	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${STAGEDIR}${PREFIX}/bin/qshape
diff --git a/mail/postfix/distinfo b/mail/postfix/distinfo
index 41b8145b42cf..b79be5ececde 100644
--- a/mail/postfix/distinfo
+++ b/mail/postfix/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1733394165
-SHA256 (postfix/postfix-3.9.1.tar.gz) = c488944eb0362576d18f5f8cc4b9b32a35bcb35d71b947daac9764af4770f643
-SIZE (postfix/postfix-3.9.1.tar.gz) = 4953855
+TIMESTAMP = 1740085398
+SHA256 (postfix/postfix-3.10.0.tar.gz) = f997115dbe08f99ff27bd99c36f76166b0876ed91978c40b35b1f70b2b11306e
+SIZE (postfix/postfix-3.10.0.tar.gz) = 5047589
diff --git a/mail/postfix/files/pkg-install.in b/mail/postfix/files/pkg-install.in
index f4e07fb3759c..8d2dc92fc99c 100644
--- a/mail/postfix/files/pkg-install.in
+++ b/mail/postfix/files/pkg-install.in
@@ -9,17 +9,12 @@ BATCH=${BATCH:=no}
 POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no}
 
 # fixed vars
-PREFIX="%%PREFIX%%"
-ETCDIR="%%ETCDIR%%"
-DAEMONDIR="%%DAEMONDIR%%"
-META_DIRECTORY="%%META_DIRECTORY%%"
-READMEDIR="%%READMEDIR%%"
-MC_TEMPLATE="%%DATADIR%%/mailer.conf.postfix"
+MC_TEMPLATE="${PKG_ROOTDIR}${PKG_PREFIX}/share/postfix/mailer.conf.postfix"
 
 # FreeBSD <= 10.3
-MC_BASE="/etc/mail/mailer.conf"
+MC_BASE="${PKG_ROOTDIR}etc/mail/mailer.conf"
 # FreeBSD >= 10.3 (and current)
-MC_LOCALBASE="%%LOCALBASE%%/etc/mail/mailer.conf"
+MC_LOCALBASE="${PKG_ROOTDIR}%%LOCALBASE%%/etc/mail/mailer.conf"
 USE_LOCALBASE_MAILER_CONF="%%USE_LOCALBASE_MAILER_CONF%%"
 
 if [ "${POSTFIX_DEFAULT_MTA}" = "no" ]; then
@@ -54,7 +49,7 @@ show_not_activated_msg() {
 	echo "To finish installation run the following commands:"
 	echo
 	if [ "${USE_LOCALBASE_MAILER_CONF}" = "yes" ]; then
-		echo "  mkdir -p %%LOCALBASE%%/etc/mail"
+		echo "  mkdir -p ${PKG_ROOTDIR}%%LOCALBASE%%/etc/mail"
 	else
 		echo "  mv -f ${mailerconf} ${mailerconf}.old"
 	fi
@@ -86,36 +81,26 @@ install_mailer_conf() {
 	mailerconf=$1
 	echo "Activate Postfix in ${mailerconf}"
 	if [ "${USE_LOCALBASE_MAILER_CONF}" = "yes" ]; then
-		[ -d %%LOCALBASE%%/etc/mail ] || mkdir -p %%LOCALBASE%%/etc/mail
+		[ -d "${PKGROOT}/%%LOCALBASE%%/etc/mail" ] || \
+			mkdir -p "${PKGROOT}/%%LOCALBASE%%/etc/mail"
 	fi
 	[ -f ${mailerconf} ] && mv -f ${mailerconf} ${mailerconf}.old
 	install -m 644 ${MC_TEMPLATE} ${mailerconf}
 }
 
-# ==============================================================================
-# Run postfix reload
-# This is a candidate for a dedicated pkg-post-upgrade script, but it seems
-# this not fully implemented in pkg :(see upstream PR 941)
-# ==============================================================================
-try_reload(){
-	${PREFIX}/sbin/postfix status 2>/dev/null
-if [ $? -eq 0 ]; then
-	${PREFIX}/sbin/postfix reload
-else
-	echo "postfix not running"
-fi
+show_needs_reload_msg(){
+	echo "==============================================================="
+	echo "Postfix installation changed, please run 'postfix reload' or"
+	echo "restart postfix"
+	echo "==============================================================="
 }
 
 # ==============================================================================
-# Run postfix post-install to fix permissions and new config values
+# Fix permissions and new config values after installation
 # ==============================================================================
 if [ "$2" = "POST-INSTALL" ]; then
-	/bin/sh ${DAEMONDIR}/post-install tempdir=/tmp \
-	 daemon_directory=${DAEMONDIR} \
- 	 meta_directory=${META_DIRECTORY} \
-	 html_directory=${READMEDIR} \
-	 readme_directory=${READMEDIR} \
-	 upgrade-package
+	chroot "${PKG_ROOTDIR}" \
+		"${PKG_PREFIX}"/sbin/postfix set-permissions upgrade-configuration
 fi
 
 # ==============================================================================
@@ -130,7 +115,7 @@ if [ -f "${MC_BASE}" ]; then
 		if [ $? -eq 0 ]; then
 			show_activated_msg ${MC_BASE}
 			cmp_mailer ${MC_LOCALBASE} || install_mailer_conf ${MC_LOCALBASE}
-			try_reload
+			show_needs_reload_msg
 		else
 			cmp_mailer ${MC_LOCALBASE} || install_choice ${MC_LOCALBASE}
 		fi
@@ -140,7 +125,7 @@ if [ -f "${MC_BASE}" ]; then
 			install_choice ${MC_BASE}
 		else
 			show_activated_msg ${MC_BASE}
-			try_reload
+			show_needs_reload_msg
 		fi
 	fi
 
diff --git a/mail/postfix/pkg-help b/mail/postfix/pkg-help
index f28015a0b496..c0efa6965e36 100644
--- a/mail/postfix/pkg-help
+++ b/mail/postfix/pkg-help
@@ -1,7 +1,7 @@
 Readme SASL:
 
 Dovecot uses its own daemon process for authentication.  Because there is no
-need to link extra libraries into Postfix, Dovecot SASL will be build into
+need to link extra libraries into Postfix, Dovecot SASL will be built into
 Postfix by default.
 
 Cyrus SASL is optional and will be the default if build with SASL=on
diff --git a/mail/postfix/pkg-plist b/mail/postfix/pkg-plist
index 09838ec67fbf..22ea5418c8ab 100644
--- a/mail/postfix/pkg-plist
+++ b/mail/postfix/pkg-plist
@@ -119,7 +119,7 @@ share/man/man5/ldap_table.5.gz
 share/man/man5/lmdb_table.5.gz
 share/man/man5/master.5.gz
 share/man/man5/memcache_table.5.gz
-%%MONGO%%share/man/man5/mongodb_table.5.gz
+share/man/man5/mongodb_table.5.gz
 share/man/man5/mysql_table.5.gz
 share/man/man5/nisplus_table.5.gz
 share/man/man5/pcre_table.5.gz