summaryrefslogtreecommitdiff
path: root/mail/postfix-current/files
diff options
context:
space:
mode:
authorJuraj Lutter <otis@FreeBSD.org>2025-03-05 09:06:07 +0100
committerJuraj Lutter <otis@FreeBSD.org>2025-03-05 09:10:58 +0100
commitf54649eb20a262dc8a7202dc75b3e472cbc3951b (patch)
tree7c3a15ea9a49ade50716ff4818da80510a58c108 /mail/postfix-current/files
parentdevel/ptlib: deorbit from gnome land (diff)
mail/postfix-current: Update to 3.11.20250304
And while here, also fix pkg-install in the same way as in mail/postfix Reported by: Herbert J. Skuhra <herbert@gojira.at>
Diffstat (limited to 'mail/postfix-current/files')
-rw-r--r--mail/postfix-current/files/pkg-install.in46
1 files changed, 15 insertions, 31 deletions
diff --git a/mail/postfix-current/files/pkg-install.in b/mail/postfix-current/files/pkg-install.in
index 340c1df561e7..71a7147d0c04 100644
--- a/mail/postfix-current/files/pkg-install.in
+++ b/mail/postfix-current/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
@@ -89,7 +84,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
@@ -121,36 +116,25 @@ 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 "${PKG_ROOTDIR}%%LOCALBASE%%/etc/mail" ] || \
+ mkdir -p "${PKG_ROOTDIR}/%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'"
+ 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
# ==============================================================================
@@ -165,7 +149,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
@@ -175,7 +159,7 @@ if [ -f "${MC_BASE}" ]; then
install_choice ${MC_BASE}
else
show_activated_msg ${MC_BASE}
- try_reload
+ show_needs_reload_msg
fi
fi