pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/qmail Build and install config-fast-pkgsrc, which...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fcce89bb49b2
branches:  trunk
changeset: 387311:fcce89bb49b2
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Nov 14 16:43:17 2018 +0000

description:
Build and install config-fast-pkgsrc, which is like config-fast but
installs the generated files elsewhere, so we can simulate
CONF_FILES-like behavior. qmail-run will switch to config-fast-pkgsrc.
We'll take advantage to deinstall these config files (as well as the
three basic .qmail files in ~alias) provided they haven't been changed.

Both of these commands stop leaving leftovers in ${PKG_SYSCONFDIR}:

# pkg_add qmail && pkg_delete qmail
# pkg_add qmail-run && pkg_delete -r qmail

While here, warn if the queue directory is on a case-insensitive
filesystem. Probably not gonna work perfectly.

Bump PKGREVISION.

diffstat:

 mail/qmail/DEINSTALL |  23 +++++++++++++++++------
 mail/qmail/INSTALL   |  27 ++++++++++++++++++++++++++-
 mail/qmail/Makefile  |  12 +++++++++---
 mail/qmail/PLIST     |   3 ++-
 4 files changed, 54 insertions(+), 11 deletions(-)

diffs (153 lines):

diff -r 9a1f89de021e -r fcce89bb49b2 mail/qmail/DEINSTALL
--- a/mail/qmail/DEINSTALL      Wed Nov 14 16:09:13 2018 +0000
+++ b/mail/qmail/DEINSTALL      Wed Nov 14 16:43:17 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: DEINSTALL,v 1.5 2006/04/29 04:53:17 schmonz Exp $
+# $NetBSD: DEINSTALL,v 1.6 2018/11/14 16:43:17 schmonz Exp $
 
 QMAILDIR=@QMAILDIR@
 
@@ -6,12 +6,23 @@
 
 case "${STAGE}" in
 
-POST-DEINSTALL)
+DEINSTALL)
+       cd ${PKG_SYSCONFDIR}
+       for i in postmaster mailer-daemon root; do
+               [ -s alias/.qmail-${i} ] \
+                       || ${RM} -f alias/.qmail-${i}
+       done
+       for i in defaultdomain locals me plusdomain rcpthosts; do
+               ${CMP} -s control/${i} .pkgsrc-defaults-do-not-edit/${i} \
+                       && ${RM} -f control/${i}
+               ${RM} -f .pkgsrc-defaults-do-not-edit/${i}
+       done
 
-       for dir in $VAR_QMAIL_DIRS; do
-               if [ -h ${QMAILDIR}/$dir ]; then
-                       ${RM} -f ${QMAILDIR}/$dir
-               fi
+       cd ${QMAILDIR}
+       for dir in ${VAR_QMAIL_DIRS}; do
+               [ -h ${dir} ] \
+                       && ${RM} -f ${dir}
        done
+
        ;;
 esac
diff -r 9a1f89de021e -r fcce89bb49b2 mail/qmail/INSTALL
--- a/mail/qmail/INSTALL        Wed Nov 14 16:09:13 2018 +0000
+++ b/mail/qmail/INSTALL        Wed Nov 14 16:43:17 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.10 2017/08/13 23:42:55 schmonz Exp $
+# $NetBSD: INSTALL,v 1.11 2018/11/14 16:43:17 schmonz Exp $
 
 DOCDIR=@DOCDIR@
 EGDIR=@EGDIR@
@@ -6,9 +6,24 @@
 QMAILDIR=@QMAILDIR@
 QMAIL_QUEUE_DIR=@QMAIL_QUEUE_DIR@
 QMAIL_QUEUE_EXTRA=@QMAIL_QUEUE_EXTRA@
+WC=@WC@
 
 VAR_QMAIL_DIRS="alias bin boot control doc man queue users"
 
+is_queue_fs_case_sensitive() {
+       cd ${QMAIL_QUEUE_DIR}
+       ${MKDIR} pkgsrc
+        ${TOUCH} pkgsrc/case-check pkgsrc/case-CHECK
+       count=$(${ECHO} case-* | ${WC} -w)
+       ${RM} -f pkgsrc/case-*
+       ${RMDIR} pkgsrc
+       if [ ${count} -eq 2 ]; then
+               return 0
+       else
+               return 1
+       fi
+}
+
 case ${STAGE} in
 
 PRE-INSTALL)
@@ -40,6 +55,16 @@
                exit 1
        fi
 
+       if ! is_queue_fs_case_sensitive; then
+               ${CAT} <<EOF
+===========================================================================
+
+WARNING: QMAIL_QUEUE_DIR is on a case-insensitive filesystem.
+
+===========================================================================
+EOF
+       fi
+
        # keep in sync with Makefile:pre-install
        ${LN} -s ${PKG_SYSCONFDIR}/alias        ${QMAILDIR}/alias
        ${LN} -s ${PREFIX}/bin                  ${QMAILDIR}/bin
diff -r 9a1f89de021e -r fcce89bb49b2 mail/qmail/Makefile
--- a/mail/qmail/Makefile       Wed Nov 14 16:09:13 2018 +0000
+++ b/mail/qmail/Makefile       Wed Nov 14 16:43:17 2018 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.102 2018/11/10 16:42:52 schmonz Exp $
+# $NetBSD: Makefile,v 1.103 2018/11/14 16:43:17 schmonz Exp $
 #
 
 DISTNAME=              netqmail-1.06
 PKGNAME=               qmail-1.03
-PKGREVISION=           40
+PKGREVISION=           41
 CATEGORIES=            mail
 MASTER_SITES=          http://qmail.org/
 
@@ -42,6 +42,7 @@
 PKG_SYSCONFSUBDIR=     qmail
 OWN_DIRS+=             ${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR}/alias
 OWN_DIRS+=             ${PKG_SYSCONFDIR}/control ${PKG_SYSCONFDIR}/users
+OWN_DIRS+=             ${PKG_SYSCONFDIR}/.pkgsrc-defaults-do-not-edit
 OWN_DIRS+=             ${QMAILDIR} ${QMAIL_QUEUE_DIR}
 
 DOCDIR=                        ${PREFIX}/share/doc/qmail
@@ -57,10 +58,11 @@
 FILES_SUBST+=          QMAIL_QUEUE_DIR=${QMAIL_QUEUE_DIR:Q}
 FILES_SUBST+=          QMAIL_QUEUE_EXTRA=${QMAIL_QUEUE_EXTRA:Q}
 FILES_SUBST+=          PKGNAME=${PKGNAME:Q}
+FILES_SUBST+=          WC=${WC:Q}
 
 SETUP_PROGRAMS=                dnsfq dnsip dnsptr hostname ipmeprint
 SETUP_PROGRAMS+=       install-destdir instcheck
-SETUP_SCRIPTS=         config config-fast
+SETUP_SCRIPTS=         config config-fast config-fast-pkgsrc
 
 MANDIRS=               man
 .for j in 1 5 7 8
@@ -205,6 +207,10 @@
                mv $$i.new $$i; \
        done
 
+post-build:
+       cd ${WRKSRC}; \
+       ${SED} -e 's|${QMAILDIR}/control/|${PKG_SYSCONFDIR}/.pkgsrc-defaults-do-not-edit/|' < config-fast > config-fast-pkgsrc
+
 pre-install:
        ${MKDIR} ${DESTDIR}${QMAILDIR}
        ${MKDIR} ${DESTDIR}${QMAIL_QUEUE_DIR}
diff -r 9a1f89de021e -r fcce89bb49b2 mail/qmail/PLIST
--- a/mail/qmail/PLIST  Wed Nov 14 16:09:13 2018 +0000
+++ b/mail/qmail/PLIST  Wed Nov 14 16:43:17 2018 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.20 2018/05/28 12:57:36 schmonz Exp $
+@comment $NetBSD: PLIST,v 1.21 2018/11/14 16:43:17 schmonz Exp $
 bin/bouncesaying
 bin/condredirect
 bin/datemail
@@ -132,6 +132,7 @@
 share/examples/qmail/boot/proc+df
 share/qmail/setup/config
 share/qmail/setup/config-fast
+share/qmail/setup/config-fast-pkgsrc
 share/qmail/setup/dnsfq
 share/qmail/setup/dnsip
 share/qmail/setup/dnsptr



Home | Main Index | Thread Index | Old Index