FreeBSD Bugzilla – Attachment 251751 Details for
Bug 280019
mail/postfix: post-install script not found when installed with 'pkg -r <rootdir>'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] mail/postfix: fix pkg -r installation
0001-mail-postfix-fix-pkg-r-installation.patch (text/plain), 7.19 KB, created by
Siva Mahadevan
on 2024-06-28 21:37:11 UTC
(
hide
)
Description:
[PATCH] mail/postfix: fix pkg -r installation
Filename:
MIME Type:
Creator:
Siva Mahadevan
Created:
2024-06-28 21:37:11 UTC
Size:
7.19 KB
patch
obsolete
>From 4f1ddece2b273ac8058a40b2a3c71e8a2a53bcea Mon Sep 17 00:00:00 2001 >From: Siva Mahadevan <me@svmhdvn.name> >Date: Fri, 28 Jun 2024 17:05:15 -0400 >Subject: [PATCH] mail/postfix: fix pkg -r installation > >--- > mail/postfix/Makefile | 30 +++++++++---------- > mail/postfix/files/pkg-install.in | 48 +++++++++++-------------------- > mail/postfix/pkg-plist | 2 +- > 3 files changed, 31 insertions(+), 49 deletions(-) > >diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile >index 15fa802a36b8..68bfe70178f7 100644 >--- a/mail/postfix/Makefile >+++ b/mail/postfix/Makefile >@@ -1,6 +1,6 @@ > PORTNAME= postfix > DISTVERSION= 3.9.0 >-PORTREVISION?= 1 >+PORTREVISION?= 2 > PORTEPOCH= 1 > CATEGORIES= mail > MASTER_SITES= https://postfix-mirror.horus-it.com/postfix-release/ \ >@@ -141,6 +141,8 @@ PGSQL_USES= pgsql > 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 \ >@@ -197,17 +199,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 >+# keep compatiblity with Postfix 2.6 .. 2.11 and use DAEMONDIR > 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}\\\" \ >@@ -383,19 +382,18 @@ post-patch: > >> ${WRKSRC}/conf/postfix-files > > do-configure: >- (cd ${WRKSRC} && ${MAKE} -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) >+ ${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}" > > 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} \ >@@ -407,7 +405,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/files/pkg-install.in b/mail/postfix/files/pkg-install.in >index f4e07fb3759c..eea37c184f64 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,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 > > # ============================================================================== >@@ -130,7 +114,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 +124,7 @@ if [ -f "${MC_BASE}" ]; then > install_choice ${MC_BASE} > else > show_activated_msg ${MC_BASE} >- try_reload >+ show_needs_reload_msg > fi > fi > >@@ -151,4 +135,4 @@ else > show_not_activated_msg ${MC_BASE} > fi > fi # -f "${MC_BASE}" >-fi # "$2" = "POST-INSTALL" -a -z "${PACKAGE_BUILDING}" >+fi # "$2" = "POST-INSTALL" -a -z "${PACKAGE_BUILDING}" >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 >-- >2.45.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 280019
: 251751