aboutsummaryrefslogtreecommitdiff
path: root/mail/mailscanner/files/pkg-deinstall.in
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mailscanner/files/pkg-deinstall.in')
-rw-r--r--mail/mailscanner/files/pkg-deinstall.in79
1 files changed, 79 insertions, 0 deletions
diff --git a/mail/mailscanner/files/pkg-deinstall.in b/mail/mailscanner/files/pkg-deinstall.in
new file mode 100644
index 000000000000..27e81ef8c19c
--- /dev/null
+++ b/mail/mailscanner/files/pkg-deinstall.in
@@ -0,0 +1,79 @@
+#!/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