pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mail/mailwrapper Remove @exec/@unexec lines from PLIST...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0aa490d79023
branches:  trunk
changeset: 478446:0aa490d79023
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Jul 23 23:01:23 2004 +0000

description:
Remove @exec/@unexec lines from PLIST and add INSTALL/DEINSTALL scripts
instead.  Be more careful about leaving a working MTA installation since
we're touching files in /usr.  Bump the PKGREVISION.

diffstat:

 mail/mailwrapper/DEINSTALL      |  20 ++++++++++++++++++
 mail/mailwrapper/INSTALL        |  40 ++++++++++++++++++++++++++++++++++++
 mail/mailwrapper/MESSAGE.NetBSD |   5 ++-
 mail/mailwrapper/Makefile       |  45 +++++++++++++++++-----------------------
 mail/mailwrapper/PLIST          |  22 +++++--------------
 5 files changed, 88 insertions(+), 44 deletions(-)

diffs (177 lines):

diff -r 7cd1ae017e8f -r 0aa490d79023 mail/mailwrapper/DEINSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/mailwrapper/DEINSTALL        Fri Jul 23 23:01:23 2004 +0000
@@ -0,0 +1,20 @@
+# $NetBSD: DEINSTALL,v 1.1 2004/07/23 23:01:23 jlam Exp $
+
+MAILWRAPPEES="@MAILWRAPPEES@"
+MAILWRAPPER="${PKG_PREFIX}/sbin/mailwrapper"
+MAILER_CONF="${PKG_SYSCONFDIR}/mailer.conf"
+MAILER_CONF_SAMPLE="${PKG_PREFIX}/share/examples/mailwrapper/mailer.conf.sendmail"
+
+ALL_FILES="${ALL_FILES} ${MAILER_CONF_SAMPLE} ${MAILER_CONF}"
+
+case ${STAGE} in
+DEINSTALL)
+       for file in ${MAILWRAPPEES}; do
+               if [ -f ${file}.mailwrappee ]; then
+                       ${ECHO} "Restoring ${file}.mailwrappee to ${file}."
+                       ${RM} -f ${file}
+                       ${MV} -f ${file}.mailwrappee ${file}
+               fi
+       done
+       ;;
+esac
diff -r 7cd1ae017e8f -r 0aa490d79023 mail/mailwrapper/INSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/mailwrapper/INSTALL  Fri Jul 23 23:01:23 2004 +0000
@@ -0,0 +1,40 @@
+# $NetBSD: INSTALL,v 1.1 2004/07/23 23:01:23 jlam Exp $
+
+MAILWRAPPEES="@MAILWRAPPEES@"
+MAILWRAPPER="${PKG_PREFIX}/sbin/mailwrapper"
+MAILER_CONF="${PKG_SYSCONFDIR}/mailer.conf"
+MAILER_CONF_SAMPLE="${PKG_SYSCONFDIR}/mailer.conf.sendmail"
+
+case ${STAGE} in
+POST-INSTALL)
+       for file in ${MAILWRAPPEES}; do
+               if [ -f ${file} ]; then
+                       ${ECHO} "Backing up ${file} as ${file}.mailwrappee."
+                       ${MV} -f ${file} ${file}.mailwrappee
+                       ${LN} -fs ${MAILWRAPPER} ${file}
+               fi
+       done
+       if [ ! -f ${MAILER_CONF} ]; then
+               for file in ${MAILWRAPPEES}; do
+                       if [ -f ${file}.mailwrappee ]; then
+                               ${ECHO} "`${BASENAME} ${file}`  ${file}.mailwrappee" >> ${MAILER_CONF}
+                               case ${file} in
+                               */sendmail)
+                                       ${ECHO} "send-mail      ${file}.mailwrappee" >> ${MAILER_CONF}
+                                       ;;
+                               esac
+                       fi
+               done
+       fi
+       if [ ! -f ${MAILER_CONF} ]; then
+               ${CP} ${MAILER_CONF_SAMPLE} ${MAILER_CONF}
+       fi
+       ${CAT} << EOF
+===========================================================================
+You may wish to customize the following files for ${PKGNAME}:
+
+       ${MAILER_CONF}
+===========================================================================
+EOF
+       ;;
+esac
diff -r 7cd1ae017e8f -r 0aa490d79023 mail/mailwrapper/MESSAGE.NetBSD
--- a/mail/mailwrapper/MESSAGE.NetBSD   Fri Jul 23 21:40:00 2004 +0000
+++ b/mail/mailwrapper/MESSAGE.NetBSD   Fri Jul 23 23:01:23 2004 +0000
@@ -1,6 +1,7 @@
 ===========================================================================
-$NetBSD: MESSAGE.NetBSD,v 1.1 2003/08/16 06:48:18 reed Exp $
+$NetBSD: MESSAGE.NetBSD,v 1.2 2004/07/23 23:01:23 jlam Exp $
 
-This package *must* be deinstalled before you update to NetBSD 1.4 or newer.
+This package *must* be deinstalled before you upgrade your NetBSD
+installation.
 
 ===========================================================================
diff -r 7cd1ae017e8f -r 0aa490d79023 mail/mailwrapper/Makefile
--- a/mail/mailwrapper/Makefile Fri Jul 23 21:40:00 2004 +0000
+++ b/mail/mailwrapper/Makefile Fri Jul 23 23:01:23 2004 +0000
@@ -1,45 +1,38 @@
-# $NetBSD: Makefile,v 1.16 2004/01/20 12:19:43 agc Exp $
+# $NetBSD: Makefile,v 1.17 2004/07/23 23:01:23 jlam Exp $
 
 DISTNAME=      mailwrapper-19990412
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    mail
 MASTER_SITES=  ${MASTER_SITE_LOCAL}
 
 MAINTAINER=    tech-pkg%NetBSD.org@localhost
-COMMENT=       NetBSD 1.4's wrapper to support arbitrary Mail Transport Agents
+COMMENT=       wrapper to support arbitrary Mail Transport Agents
 
 NO_SRC_ON_FTP=         Already in MASTER_SITE_LOCAL
 
 WRKSRC=                        ${WRKDIR}/mailwrapper
-USE_PKGINSTALL=                yes
-NO_CONFIGURE=          yes
 MANCOMPRESSED_IF_MANZ= yes
 
-.if exists(/usr/sbin/mailwrapper)
-PKG_SKIP_REASON= "${PKGNAME} is part of your ${OPSYS} distribution"
-.endif
-
-EGDIR=         ${PREFIX}/share/examples/mailwrapper
-CONF_FILES=    ${EGDIR}/mailer.conf ${PKG_SYSCONFDIR}/mailer.conf
+USE_PKGINSTALL=                yes
+DEINSTALL_EXTRA_TMPL=  ${.CURDIR}/DEINSTALL
+INSTALL_EXTRA_TMPL=    ${.CURDIR}/INSTALL
+EGDIR=                 ${PREFIX}/share/examples/mailwrapper
 
-LIBEXECDIR=    /usr/libexec/sendmail
-SENDMAIL=      /usr/sbin/sendmail
+MAILWRAPPEES=  /usr/bin/mailq                                          \
+               /usr/bin/newaliases     /usr/sbin/newaliases            \
+               /usr/sbin/sendmail      /usr/lib/sendmail
+FILES_SUBST=   MAILWRAPPEES=${MAILWRAPPEES:Q}
 
-post-patch:
-.for f in mailer.conf.5 mailwrapper.8 mailwrapper.c
-       ${SED} -e 's|/etc/mailer.conf|${PKG_SYSCONFDIR}/mailer.conf|g' \
-               < ${WRKSRC}/$f > ${WRKSRC}/$f.new
-       ${MV} ${WRKSRC}/$f.new ${WRKSRC}/$f
-.endfor
-.undef f
+do-configure:
+       cd ${WRKSRC};                                                   \
+       for file in mailer.conf.5 mailwrapper.8 mailwrapper.c; do       \
+               ${MV} $$file $$file.save;                               \
+               ${SED} -e "s|/etc/\(mailer.conf\)|${PKG_SYSCONFDIR}/\\1|g" \
+                       $$file.save > $$file;                           \
+       done
 
 post-install:
        ${INSTALL_DATA_DIR} ${EGDIR}
-       ${INSTALL_DATA} ${WRKSRC}/mailer.conf ${EGDIR}/mailer.conf
-       ${INSTALL_DATA_DIR} ${LIBEXECDIR}
-       ${MV} -i ${SENDMAIL} ${LIBEXECDIR} </dev/null 2>/dev/null || ${TRUE}
-       ${LN} -fs ${PREFIX}/sbin/mailwrapper /usr/bin/mailq
-       ${LN} -fs ${PREFIX}/sbin/mailwrapper /usr/bin/newaliases
-       ${LN} -fs ${PREFIX}/sbin/mailwrapper ${SENDMAIL}
+       ${INSTALL_DATA} ${WRKSRC}/mailer.conf ${EGDIR}/mailer.conf.sendmail
 
 .include "../../mk/bsd.pkg.mk"
diff -r 7cd1ae017e8f -r 0aa490d79023 mail/mailwrapper/PLIST
--- a/mail/mailwrapper/PLIST    Fri Jul 23 21:40:00 2004 +0000
+++ b/mail/mailwrapper/PLIST    Fri Jul 23 23:01:23 2004 +0000
@@ -1,18 +1,8 @@
-@comment $NetBSD: PLIST,v 1.5 2003/05/01 12:10:12 jmmv Exp $
-man/cat5/mailer.conf.0.gz
-man/cat8/mailwrapper.0.gz
-man/man5/mailer.conf.5.gz
-man/man8/mailwrapper.8.gz
+@comment $NetBSD: PLIST,v 1.6 2004/07/23 23:01:23 jlam Exp $
+man/cat5/mailer.conf.0
+man/cat8/mailwrapper.0
+man/man5/mailer.conf.5
+man/man8/mailwrapper.8
 sbin/mailwrapper
-share/examples/mailwrapper/mailer.conf
+share/examples/mailwrapper/mailer.conf.sendmail
 @dirrm share/examples/mailwrapper
-@exec ${MKDIR} /usr/libexec/sendmail
-@exec mv -i /usr/sbin/sendmail /usr/libexec/sendmail </dev/null 2>/dev/null || ${TRUE}
-@exec ln -fs %D/sbin/mailwrapper /usr/bin/mailq
-@exec ln -fs %D/sbin/mailwrapper /usr/bin/newaliases
-@exec ln -fs %D/sbin/mailwrapper /usr/sbin/sendmail
-@unexec ${RM} /usr/bin/mailq /usr/bin/newaliases /usr/sbin/sendmail
-@unexec mv /usr/libexec/sendmail/sendmail /usr/sbin/sendmail
-@unexec ln /usr/sbin/sendmail /usr/bin/mailq
-@unexec ln /usr/sbin/sendmail /usr/bin/newaliases
-@unexec ${RMDIR} /usr/libexec/sendmail



Home | Main Index | Thread Index | Old Index