2004-07-24 11:19:14 +02:00
|
|
|
# $NetBSD: INSTALL,v 1.2 2004/07/24 09:19:15 jlam Exp $
|
2004-07-24 01:01:23 +02:00
|
|
|
|
|
|
|
MAILWRAPPEES="@MAILWRAPPEES@"
|
|
|
|
MAILWRAPPER="${PKG_PREFIX}/sbin/mailwrapper"
|
|
|
|
MAILER_CONF="${PKG_SYSCONFDIR}/mailer.conf"
|
2004-07-24 11:19:14 +02:00
|
|
|
MAILER_CONF_SAMPLE="${PKG_PREFIX}/share/examples/mailwrapper/mailer.conf.sendmail"
|
|
|
|
MW_BACKUP_SFX="@MAILWRAPPER_BACKUP_SFX@"
|
2004-07-24 01:01:23 +02:00
|
|
|
|
|
|
|
case ${STAGE} in
|
|
|
|
POST-INSTALL)
|
|
|
|
for file in ${MAILWRAPPEES}; do
|
|
|
|
if [ -f ${file} ]; then
|
2004-07-24 11:19:14 +02:00
|
|
|
${ECHO} "Backing up ${file} as ${file}${MW_BACKUP_SFX}."
|
|
|
|
${MV} -f ${file} ${file}${MW_BACKUP_SFX}
|
2004-07-24 01:01:23 +02:00
|
|
|
${LN} -fs ${MAILWRAPPER} ${file}
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ ! -f ${MAILER_CONF} ]; then
|
|
|
|
for file in ${MAILWRAPPEES}; do
|
|
|
|
if [ -f ${file}.mailwrappee ]; then
|
2004-07-24 11:19:14 +02:00
|
|
|
${ECHO} "`${BASENAME} ${file}` ${file}${MW_BACKUP_SFX}" >> ${MAILER_CONF}
|
2004-07-24 01:01:23 +02:00
|
|
|
case ${file} in
|
|
|
|
*/sendmail)
|
2004-07-24 11:19:14 +02:00
|
|
|
${ECHO} "send-mail ${file}${MW_BACKUP_SFX}" >> ${MAILER_CONF}
|
2004-07-24 01:01:23 +02:00
|
|
|
;;
|
|
|
|
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
|