Skip to content
Permalink
Browse files

Update from netqmail 1.06 (2007) to notqmail 1.07 (just released). From

the changelog:

- code: remove incorrect usage of vfork()
- code: detect and prefer utmpx where available
- code: removed idedit, install-big. var-qmail packages are no more
- portability problem: explicitly initialize strerr_sys and
  define BIND_8_COMPAT to work around Mac OS X
- code: add instchown to set ownership and mode on installed files
- code: add instpackage to install without root access
- doc: rename INSTALL, SENDMAIL to INSTALL.md, SENDMAIL.md to
  support building on case-insensitive filesystems
- code: lookup uid/gid at runtime
- code: use DESTDIR environment variable as root directory in install

pkgsrc changes:

- If hostname isn't FQDN, config-fast-pkgsrc wouldn't produce a working
  config, so don't run it; tell user what to do instead
- Stage QMAIL_QUEUE_DIR into DESTDIR/tmp, to be more obvious that it's
  not being packaged up (and is not how a queue gets created at
  pkg_add time)
- Drop custom destdir, qbiffutmpx, and Darwin patches
- Rebase TLS-onlyremote, QMAILREMOTE, and SRS patches
- Require latest ucspi-ssl and ucspi-tcp6 for IPv4 fixes
- Move MESSAGE.tls to README.tls, and remove other MESSAGE*
- Set PKG_HOME even for non-default values of QMAIL_ALIAS_USER
- Check whether alias/.qmail-foo exist before trying to remove

Bump PKGREVISION.
  • Loading branch information...
schmonz committed Aug 20, 2019
1 parent e63a31e commit e1bbfdbd03f2607dd43bf91154647b56db9e063f
@@ -1,4 +1,4 @@
# $NetBSD: DEINSTALL,v 1.7 2018/12/04 17:01:39 schmonz Exp $
# $NetBSD: DEINSTALL,v 1.8 2019/08/20 02:38:04 schmonz Exp $

QMAILDIR=@QMAILDIR@
QMAIL_QUEUE_EXTRA=@QMAIL_QUEUE_EXTRA@
@@ -10,10 +10,13 @@ case "${STAGE}" in
DEINSTALL)
cd ${PKG_SYSCONFDIR}
for i in mailer-daemon postmaster root ${QMAIL_QUEUE_EXTRA}; do
contents=$(${CAT} alias/.qmail-${i})
if [ "${contents}" = '# pkgsrc says: replace this comment with your config' ] \
|| [ "${contents}" = '' ]; then
${RM} -f alias/.qmail-${i}
f="alias/.qmail-${i}"
if [ -e ${f} ]; then
contents=$(${CAT} ${f})
if [ "${contents}" = '# pkgsrc says: replace this comment with your config' ] \
|| [ "${contents}" = '' ]; then
${RM} -f ${f}
fi
fi
done
for i in defaultdomain locals me plusdomain rcpthosts; do
@@ -1,109 +1,126 @@
# $NetBSD: INSTALL,v 1.15 2019/07/15 16:11:58 schmonz Exp $
# $NetBSD: INSTALL,v 1.16 2019/08/20 02:38:04 schmonz Exp $

DOCDIR=@DOCDIR@
EGDIR=@EGDIR@
PKGMANDIR=@PKGMANDIR@
QMAILDIR=@QMAILDIR@
QMAIL_QUEUE_DIR=@QMAIL_QUEUE_DIR@
QMAIL_QUEUE_EXTRA=@QMAIL_QUEUE_EXTRA@

VAR_QMAIL_DIRS="alias bin boot control doc man queue users"

case ${STAGE} in
error_qmaildir() {
local _qmaildir
_qmaildir="$1"

PRE-INSTALL)
for dir in $VAR_QMAIL_DIRS; do
if [ -e ${QMAILDIR}/$dir ]; then
${CAT} <<EOF
${CAT} <<EOF
===========================================================================

ERROR: ${QMAILDIR} exists and is non-empty.
ERROR: ${_qmaildir} exists and is non-empty.

Please remove or rename it, then try again.

===========================================================================
EOF
exit 1
fi
done
exit 1
}

error_instchown() {
local _exitcode
_exitcode="$1"

if ${ECHO} ${QMAIL_QUEUE_DIR} | ${GREP} -q "^${QMAILDIR}/"; then
${CAT} <<EOF
${CAT} <<EOF
===========================================================================

ERROR: QMAIL_QUEUE_DIR must not be under ${QMAILDIR}.
ERROR: instchown exited ${_exitcode}.

Please adjust your definition of QMAIL_QUEUE_DIR, then try again.
Permissions are likely wrong, and/or the queue may be uninitialized.

===========================================================================
EOF
exit 1
fi
exit 1
}

# keep in sync with Makefile:pre-install
${LN} -s ${PKG_SYSCONFDIR}/alias ${QMAILDIR}/alias
${LN} -s ${PREFIX}/bin ${QMAILDIR}/bin
${LN} -s ${EGDIR}/boot ${QMAILDIR}/boot
${LN} -s ${PKG_SYSCONFDIR}/control ${QMAILDIR}/control
${LN} -s ${DOCDIR} ${QMAILDIR}/doc
${LN} -s ${PREFIX}/${PKGMANDIR} ${QMAILDIR}/man
${LN} -s ${QMAIL_QUEUE_DIR} ${QMAILDIR}/queue
${LN} -s ${PKG_SYSCONFDIR}/users ${QMAILDIR}/users

;;
error_instcheck() {
local _output
_output="$1"

POST-INSTALL)
${PREFIX}/share/qmail/setup/install-destdir
QMAIL_SETUP_EXITCODE=$?
if [ ${QMAIL_SETUP_EXITCODE} -ne 0 ]; then
${CAT} <<EOF
${CAT} <<EOF
===========================================================================

ERROR: install-destdir exited nonzero (${QMAIL_SETUP_EXITCODE}).
ERROR: instcheck issued warnings:

${_output}

Permissions are likely wrong, and/or the queue may be uninitialized.

===========================================================================
EOF
exit 1
fi
exit 1
}

QMAIL_CHECK_OUTPUT=$(${PREFIX}/share/qmail/setup/instcheck 2>&1)
if [ -n "${QMAIL_CHECK_OUTPUT}" ]; then
${CAT} <<EOF
warning_fqdn() {
local _command _name
_command="$1"
_name="$2"

${CAT} <<EOF
===========================================================================

ERROR: instcheck issued warnings:
WARNING: "${_name}" is not a fully qualified name.

${QMAIL_CHECK_OUTPUT}
To configure basic qmail control files, please run this command:

Permissions are likely wrong, and/or the queue may be uninitialized.
# ${_command} ${_name}.YOURDOMAIN.TLD

===========================================================================
EOF
exit 1
fi
}

cd ${PREFIX}/share/qmail/setup && ./config-fast-pkgsrc `./hostname`
case "${STAGE}" in

cd ${PKG_SYSCONFDIR}/.pkgsrc-defaults-do-not-edit
for i in locals rcpthosts; do
${SORT} -u ${i} > ${i}.tmp && ${MV} ${i}.tmp ${i}
PRE-INSTALL)
for dir in $VAR_QMAIL_DIRS; do
if [ -e ${QMAILDIR}/$dir ]; then
error_qmaildir ${QMAILDIR}
fi
done

cd ${PKG_SYSCONFDIR}
for i in defaultdomain locals me plusdomain rcpthosts; do
[ -f control/${i} ] \
|| ${CP} .pkgsrc-defaults-do-not-edit/${i} control
done
# keep in sync with Makefile:pre-install
${LN} -s ${PKG_SYSCONFDIR}/alias ${QMAILDIR}/alias
${LN} -s ${PREFIX}/bin ${QMAILDIR}/bin
${LN} -s ${EGDIR}/boot ${QMAILDIR}/boot
${LN} -s ${PKG_SYSCONFDIR}/control ${QMAILDIR}/control
${LN} -s ${DOCDIR} ${QMAILDIR}/doc
${LN} -s ${PREFIX}/${PKGMANDIR} ${QMAILDIR}/man
${LN} -s ${QMAIL_QUEUE_DIR} ${QMAILDIR}/queue
${LN} -s ${PKG_SYSCONFDIR}/users ${QMAILDIR}/users

cd ${PKG_SYSCONFDIR}/alias
for i in mailer-daemon postmaster root ${QMAIL_QUEUE_EXTRA}; do
[ -s .qmail-${i} ] \
|| ${ECHO} '# pkgsrc says: replace this comment with your config' \
> .qmail-${i}
${CHMOD} 644 .qmail-${i}
done
;;

POST-INSTALL)
# create the queue
${PREFIX}/share/qmail/setup/instpackage >/dev/null 2>&1
${PREFIX}/share/qmail/setup/instchown
QMAIL_SETUP_EXITCODE=$?
if [ ${QMAIL_SETUP_EXITCODE} -ne 0 ]; then
error_instchown ${QMAIL_SETUP_EXITCODE}
fi

QMAIL_CHECK_OUTPUT=$(${PREFIX}/share/qmail/setup/instcheck 2>&1)
if [ -n "${QMAIL_CHECK_OUTPUT}" ]; then
error_instcheck "${QMAIL_CHECK_OUTPUT}"
fi

QMAIL_CONFIG_CMD="${PREFIX}/share/qmail/setup/config-fast-pkgsrc"
QMAIL_FQDN=$(${PREFIX}/share/qmail/setup/hostname)
case "${QMAIL_FQDN}" in
*.*)
${QMAIL_CONFIG_CMD} "${QMAIL_FQDN}"
;;
*)
warning_fqdn "${QMAIL_CONFIG_CMD}" "${QMAIL_FQDN}"
;;
esac

;;

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit e1bbfdb

Please sign in to comment.
You can’t perform that action at this time.