d73b6de2b8
- Automate config file updates - Include config file handling in package - Update maintainer address PR: ports/157065 Submitted by: Chris Rees (utisoft@gmail.com) (self) Reviewed by: Kevin Kobb Approved by: tabthorpe (co-mentor)
79 lines
1.4 KiB
Bash
79 lines
1.4 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
DATADIR=%%DATADIR%%
|
|
ETC_FILES="%%ETC_FILES%%"
|
|
|
|
prune_lang_conf()
|
|
{
|
|
for LANG_DIR in ${DATADIR}/reports/*
|
|
do
|
|
for REPORT_FILE in ${LANG_DIR}/*.sample
|
|
do
|
|
cmp -s ${REPORT_FILE%.sample} ${REPORT_FILE} \
|
|
&& rm -f ${REPORT_FILE%.sample}
|
|
done
|
|
done
|
|
}
|
|
|
|
prune_wrappers()
|
|
{
|
|
for WRAPPER in ${PKG_PREFIX}/libexec/MailScanner/*-wrapper
|
|
do
|
|
cmp -s ${WRAPPER} ${WRAPPER}.sample \
|
|
&& rm -f ${WRAPPER}
|
|
done
|
|
}
|
|
|
|
prune_autoupdate()
|
|
{
|
|
for AUTOUPDATE in ${PKG_PREFIX}/libexec/MailScanner/*-autoupdate
|
|
do
|
|
cmp -s ${AUTOUPDATE} ${AUTOUPDATE}.sample \
|
|
&& rm -f ${AUTOUPDATE}
|
|
done
|
|
}
|
|
|
|
prune_rules()
|
|
{
|
|
for RULES in ${PKG_PREFIX}/etc/MailScanner/rules/*.rules
|
|
do
|
|
cmp -s ${RULES} ${RULES}.sample \
|
|
&& rm -f ${RULES}
|
|
done
|
|
}
|
|
|
|
prune_mcp()
|
|
{
|
|
for MCP_FILES in %%MCP_FILES%%
|
|
do
|
|
cmp -s ${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES}.sample \
|
|
${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES} \
|
|
&& rm -f ${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES}
|
|
done
|
|
}
|
|
|
|
prune_etc()
|
|
{
|
|
for ETC in ${ETC_FILES}
|
|
do
|
|
cmp -s ${PKG_PREFIX}/etc/MailScanner/${ETC}.sample \
|
|
${PKG_PREFIX}/etc/MailScanner/${ETC} \
|
|
&& rm -f ${PKG_PREFIX}/etc/MailScanner/${ETC}
|
|
done
|
|
}
|
|
|
|
case $2 in
|
|
DEINSTALL)
|
|
[ -L ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf ] \
|
|
&& rm -f ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf
|
|
prune_lang_conf
|
|
prune_wrappers
|
|
prune_autoupdate
|
|
prune_rules
|
|
prune_mcp
|
|
prune_etc
|
|
exit 0
|
|
;;
|
|
esac
|