summaryrefslogtreecommitdiff
path: root/mail/mailwrapper
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-07-23 23:01:23 +0000
committerjlam <jlam@pkgsrc.org>2004-07-23 23:01:23 +0000
commitdfe7ee95b9c1c8f2270c913cb4e940e6c46be5ca (patch)
tree621b37c39c31d63580fc606bfa45e5d999fec49f /mail/mailwrapper
parent1c41847870abc7b25623fe6c1db0a53bc5b78252 (diff)
downloadpkgsrc-dfe7ee95b9c1c8f2270c913cb4e940e6c46be5ca.tar.gz
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 (limited to 'mail/mailwrapper')
-rw-r--r--mail/mailwrapper/DEINSTALL20
-rw-r--r--mail/mailwrapper/INSTALL40
-rw-r--r--mail/mailwrapper/MESSAGE.NetBSD5
-rw-r--r--mail/mailwrapper/Makefile49
-rw-r--r--mail/mailwrapper/PLIST22
5 files changed, 90 insertions, 46 deletions
diff --git a/mail/mailwrapper/DEINSTALL b/mail/mailwrapper/DEINSTALL
new file mode 100644
index 00000000000..e66231467d1
--- /dev/null
+++ b/mail/mailwrapper/DEINSTALL
@@ -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 --git a/mail/mailwrapper/INSTALL b/mail/mailwrapper/INSTALL
new file mode 100644
index 00000000000..8a1682bb43f
--- /dev/null
+++ b/mail/mailwrapper/INSTALL
@@ -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 --git a/mail/mailwrapper/MESSAGE.NetBSD b/mail/mailwrapper/MESSAGE.NetBSD
index 55b75aebb4f..7a9476ff63e 100644
--- a/mail/mailwrapper/MESSAGE.NetBSD
+++ b/mail/mailwrapper/MESSAGE.NetBSD
@@ -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 --git a/mail/mailwrapper/Makefile b/mail/mailwrapper/Makefile
index 2393315a2a9..8b0b9dfdc09 100644
--- a/mail/mailwrapper/Makefile
+++ b/mail/mailwrapper/Makefile
@@ -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
-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
-
-LIBEXECDIR= /usr/libexec/sendmail
-SENDMAIL= /usr/sbin/sendmail
-
-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
+USE_PKGINSTALL= yes
+DEINSTALL_EXTRA_TMPL= ${.CURDIR}/DEINSTALL
+INSTALL_EXTRA_TMPL= ${.CURDIR}/INSTALL
+EGDIR= ${PREFIX}/share/examples/mailwrapper
+
+MAILWRAPPEES= /usr/bin/mailq \
+ /usr/bin/newaliases /usr/sbin/newaliases \
+ /usr/sbin/sendmail /usr/lib/sendmail
+FILES_SUBST= MAILWRAPPEES=${MAILWRAPPEES:Q}
+
+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 --git a/mail/mailwrapper/PLIST b/mail/mailwrapper/PLIST
index 02156efce57..8b4360c7ea1 100644
--- a/mail/mailwrapper/PLIST
+++ b/mail/mailwrapper/PLIST
@@ -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