aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/mailscanner/Makefile262
-rw-r--r--mail/mailscanner/distinfo4
-rw-r--r--mail/mailscanner/files/CHANGES.port6
-rw-r--r--mail/mailscanner/files/pkg-deinstall.in79
-rw-r--r--mail/mailscanner/files/pkg-install.in115
-rw-r--r--mail/mailscanner/files/pkg-message.in30
-rw-r--r--mail/mailscanner/files/rcwarning.txt18
-rw-r--r--mail/mailscanner/pkg-plist54
8 files changed, 318 insertions, 250 deletions
diff --git a/mail/mailscanner/Makefile b/mail/mailscanner/Makefile
index 7eca27c582a9..e657db76a05d 100644
--- a/mail/mailscanner/Makefile
+++ b/mail/mailscanner/Makefile
@@ -6,12 +6,12 @@
#
PORTNAME= MailScanner
-PORTVERSION= 4.83.4
+PORTVERSION= 4.83.5
CATEGORIES= mail
MASTER_SITES= http://www.mailscanner.info/files/4/tar/
DISTNAME= ${PORTNAME}-install-${PORTVERSION}-${PATCHLEVEL}
-MAINTAINER= utisoft@gmail.com
+MAINTAINER= crees@FreeBSD.org
COMMENT= Powerful virus/spam scanning framework for mail gateways
BUILD_DEPENDS= \
@@ -51,7 +51,12 @@ PATCHLEVEL= 1
USE_PERL5= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-install-${PORTVERSION}
-SUB_FILES= pkg-message
+SUB_FILES= pkg-message pkg-install pkg-deinstall
+SUB_LIST= DATADIR=${DATADIR} \
+ PERL=${PERL} \
+ PKGVERSION=${PKGVERSION} \
+ ETC_FILES="${ETC_FILES}" \
+ MCP_FILES="${MCP_FILES}"
MAN8= MailScanner.8
MLINKS= MailScanner.8 mailscanner.8
@@ -101,7 +106,7 @@ RUN_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip \
RUN_DEPENDS+= bdc:${PORTSDIR}/security/bdc
.endif
-DOC_FILES= INSTALL.FreeBSD INSTALL.OpenBSD README
+DOC_FILES= INSTALL.FreeBSD README
ETC_FILES= MailScanner.conf filename.rules.conf \
archives.filename.rules.conf archives.filetype.rules.conf \
filetype.rules.conf spam.assassin.prefs.conf \
@@ -188,202 +193,97 @@ do-build:
@${FIND} ${WRKSRC} \( -name "*.bak" -or -name "*.orig" \) -delete
do-install:
- #
- # Step 1: Install bin files
- #
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/MailScanner ${PREFIX}/sbin/mailscanner
- ${LN} -s ${PREFIX}/sbin/mailscanner ${PREFIX}/sbin/MailScanner
- #
- # Step 2: Install libexec files
- #
- ${MKDIR} ${PREFIX}/libexec/MailScanner
- ${CHMOD} -R ${BINMODE} ${PREFIX}/libexec/MailScanner
- cd ${WRKSRC}/lib && ${FIND} * -name "*-wrapper" -exec \
+ @${ECHO_MSG} -n ">> Installing files in ${PREFIX}/sbin..."
+ @${INSTALL_SCRIPT} ${WRKSRC}/bin/MailScanner ${PREFIX}/sbin/mailscanner
+ @${LN} -s ${PREFIX}/sbin/mailscanner ${PREFIX}/sbin/MailScanner
+ @${ECHO_MSG} " [DONE]"
+ @${ECHO_MSG} -n \
+ ">> Installing files in ${PREFIX}/libexec/MailScanner..."
+ @${MKDIR} -m ${BINMODE} ${PREFIX}/libexec/MailScanner
+ @cd ${WRKSRC}/lib && ${FIND} * -name "*-wrapper" -exec \
${INSTALL_SCRIPT} {} ${PREFIX}/libexec/MailScanner/{}.sample \;
- cd ${WRKSRC}/lib && ${FIND} * -name "*-autoupdate" -exec \
+ @cd ${WRKSRC}/lib && ${FIND} * -name "*-autoupdate" -exec \
${INSTALL_SCRIPT} {} ${PREFIX}/libexec/MailScanner/{}.sample \;
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/analyse_SpamAssassin_cache \
- ${PREFIX}/libexec/MailScanner/analyse_SpamAssassin_cache
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/clean.SA.cache \
- ${PREFIX}/libexec/MailScanner/clean.SA.cache
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/clean.quarantine \
- ${PREFIX}/libexec/MailScanner/clean.quarantine
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/mailscanner_create_locks \
- ${PREFIX}/libexec/MailScanner/mailscanner_create_locks
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/processing_messages_alert \
- ${PREFIX}/libexec/MailScanner/processing_messages_alert
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/Quick.Peek \
- ${PREFIX}/libexec/MailScanner/Quick.Peek
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/update_bad_phishing_emails \
- ${PREFIX}/libexec/MailScanner/update_bad_phishing_emails
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/update_phishing_sites \
- ${PREFIX}/libexec/MailScanner/update_phishing_sites
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/update_bad_phishing_sites \
- ${PREFIX}/libexec/MailScanner/update_bad_phishing_sites
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_phishing_sites.cron \
- ${PREFIX}/libexec/MailScanner/update_phishing_sites.cron
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_bad_phishing_sites.cron \
- ${PREFIX}/libexec/MailScanner/update_bad_phishing_sites.cron
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/update_virus_scanners \
- ${PREFIX}/libexec/MailScanner/update_virus_scanners
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_virus_scanners.cron \
- ${PREFIX}/libexec/MailScanner/update_virus_scanners.cron
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/update_spamassassin \
- ${PREFIX}/libexec/MailScanner/update_spamassassin
- ${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_spamassassin.cron \
- ${PREFIX}/libexec/MailScanner/update_spamassassin.cron
- #
- # Step 3: Install etc files
- #
- ${MKDIR} ${PREFIX}/etc/MailScanner
- ${CHMOD} ${BINMODE} ${PREFIX}/etc/MailScanner
+.for FILE in analyse_SpamAssassin_cache clean.SA.cache clean.quarantine \
+ mailscanner_create_locks processing_messages_alert Quick.Peek \
+ update_bad_phishing_emails update_phishing_sites \
+ update_bad_phishing_sites cron/update_phishing_sites.cron \
+ cron/update_bad_phishing_sites.cron update_virus_scanners \
+ cron/update_virus_scanners.cron update_spamassassin \
+ cron/update_spamassassin.cron
+ @${INSTALL_SCRIPT} ${WRKSRC}/bin/${FILE} \
+ ${PREFIX}/libexec/MailScanner/
+.endfor
+ @${ECHO_MSG} " [DONE]"
+ @${ECHO_MSG} -n ">> Installing files in ${PREFIX}/etc/MailScanner..."
+ @${MKDIR} -m ${BINMODE} ${PREFIX}/etc/MailScanner
.for FILE in ${ETC_FILES}
- ${INSTALL_DATA} ${WRKSRC}/etc/${FILE} \
+ @${INSTALL_DATA} ${WRKSRC}/etc/${FILE} \
${PREFIX}/etc/MailScanner/${FILE}.sample
.endfor
- ${MKDIR} ${PREFIX}/etc/MailScanner/rules
- cd ${WRKSRC}/etc/rules && \
- ${INSTALL_DATA} EXAMPLES README ${PREFIX}/etc/MailScanner/rules
- ${INSTALL_DATA} ${WRKSRC}/etc/rules/spam.whitelist.rules \
- ${PREFIX}/etc/MailScanner/rules/spam.whitelist.rules.sample
- ${INSTALL_DATA} ${WRKSRC}/etc/rules/bounce.rules \
- ${PREFIX}/etc/MailScanner/rules/bounce.rules.sample
- ${INSTALL_DATA} ${WRKSRC}/etc/rules/max.message.size.rules \
- ${PREFIX}/etc/MailScanner/rules/max.message.size.rules.sample
- ${MKDIR} ${PREFIX}/etc/MailScanner/mcp
- ${CHMOD} ${BINMODE} ${PREFIX}/etc/MailScanner/mcp
+ @${MKDIR} ${PREFIX}/etc/MailScanner/rules
+ @cd ${WRKSRC}/etc/rules \
+ && ${INSTALL_DATA} EXAMPLES README \
+ ${PREFIX}/etc/MailScanner/rules
+.for RULES in spam.whitelist.rules bounce.rules max.message.size.rules
+ @${INSTALL_DATA} ${WRKSRC}/etc/rules/${RULES} \
+ ${PREFIX}/etc/MailScanner/rules/${RULES}.sample
+.endfor
+ @${MKDIR} -m ${BINMODE} ${PREFIX}/etc/MailScanner/mcp
.for FILE in ${MCP_FILES}
- ${INSTALL_DATA} ${WRKSRC}/etc/mcp/${FILE} \
+ @${INSTALL_DATA} ${WRKSRC}/etc/mcp/${FILE} \
${PREFIX}/etc/MailScanner/mcp/${FILE}.sample
.endfor
- ${MKDIR} ${PREFIX}/etc/MailScanner/conf.d
- ${INSTALL_DATA} ${WRKSRC}/etc/conf.d/README \
+ @${MKDIR} ${PREFIX}/etc/MailScanner/conf.d
+ @${INSTALL_DATA} ${WRKSRC}/etc/conf.d/README \
${PREFIX}/etc/MailScanner/conf.d/README
- #
- # Step 4: Install files in share
- #
+ @${ECHO_MSG} " [DONE]"
+ @${ECHO_MSG} -n ">> Installing files in ${DATADIR}..."
@${MKDIR} ${DATADIR}
- cd ${WRKSRC}/etc && ${FIND} reports -type d ! -name "*.old" -exec \
- ${MKDIR} ${DATADIR}/{} \;
- # cd ${WRKSRC}/etc && ${FIND} reports -type f ! \( -name "*.orig" -exec ...
- cd ${WRKSRC}/etc && ${FIND} reports \( -type d -name "*.old" -prune \) \
- -o \( -type f ! \( -name "*.orig" -o -name "*.bak" \) \
+ @cd ${WRKSRC}/etc && ${FIND} reports -type d ! -name "*.old" -exec \
+ ${MKDIR} -m ${BINMODE} ${DATADIR}/{} \;
+ @cd ${WRKSRC}/etc \
+ && ${FIND} reports \( -type d -name "*.old" -prune \) \
+ -o \( -type f ! \( -name "*.orig" -o -name "*.bak" \) \
-exec ${INSTALL_DATA} {} ${DATADIR}/{}.sample \; \)
- ${CHMOD} -R ${BINMODE} ${DATADIR}/reports
- #
- # Step 5: Install lib
- #
- ${MKDIR} ${PREFIX}/lib/MailScanner/MailScanner
- ${MKDIR} ${PREFIX}/lib/MailScanner/MailScanner/CustomFunctions
- ${INSTALL_SCRIPT} ${WRKSRC}/lib/MailScanner.pm \
+ @${INSTALL_SCRIPT} ${WRKSRC}/bin/upgrade_MailScanner_conf ${DATADIR}
+ @${LN} -s ${DATADIR}/upgrade_MailScanner_conf \
+ ${DATADIR}/upgrade_languages_conf
+ @${ECHO_MSG} " [DONE]"
+ @${ECHO_MSG} -n ">> Installing files in ${PREFIX}/lib..."
+ @${MKDIR} ${PREFIX}/lib/MailScanner/MailScanner/CustomFunctions
+ @${INSTALL_SCRIPT} ${WRKSRC}/lib/MailScanner.pm \
${PREFIX}/lib/MailScanner/MailScanner.pm
- cd ${WRKSRC}/lib/MailScanner && ${FIND} * -type f ! -name "*.orig" -exec \
+ @cd ${WRKSRC}/lib/MailScanner \
+ && ${FIND} * -type f ! -name "*.orig" -exec \
${INSTALL_SCRIPT} {} ${PREFIX}/lib/MailScanner/MailScanner/{} \;
- #
- # Step 6: Docs & Manpages
- #
- # Manpage
+ @${ECHO_MSG} " [DONE]"
.if !defined(NOPORTDOCS)
- ${MKDIR} ${DOCSDIR}
- ${INSTALL_DATA} ${FILESDIR}/README.FreeBSD.port ${DOCSDIR}
- # Sophos install script
- ${INSTALL_SCRIPT} ${FILESDIR}/Sophos.install.freebsd ${DOCSDIR}
- cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${DOCSDIR}
- cd ${FILESDIR} && ${INSTALL_DATA} CHANGES.port ${DOCSDIR}
-.endif
- cd ${FILESDIR} && \
- ${INSTALL_MAN} ${MAN8} ${MAN5PREFIX}/man/man8
- ${PERL} -pi -e \
- 's,%%LOCALBASE%%,${LOCALBASE},g; \
- s,%%PREFIX%%,${PREFIX},g;' \
+ @${ECHO_MSG} -n ">> Installing docs and manpage..."
+ @${MKDIR} ${DOCSDIR}
+ @${INSTALL_DATA} ${FILESDIR}/README.FreeBSD.port ${DOCSDIR}
+ @${INSTALL_SCRIPT} ${FILESDIR}/Sophos.install.freebsd ${DOCSDIR}
+ @cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${DOCSDIR}
+ @${REINPLACE_CMD} \
+ -e 's,%%LOCALBASE%%,${LOCALBASE},' \
+ -e 's,%%PREFIX%%,${PREFIX},' \
${DOCSDIR}/Sophos.install.freebsd
-.if exists(${PREFIX}/etc/MailScanner/MailScanner.conf)
- # Upgrading MailScanner.conf file... Please wait
- @${PERL} ${WRKSRC}/bin/upgrade_MailScanner_conf \
- ${PREFIX}/etc/MailScanner/MailScanner.conf \
- ${PREFIX}/etc/MailScanner/MailScanner.conf.sample > \
- ${PREFIX}/etc/MailScanner/MailScanner.conf.new.${PORTVERSION} \
- 2> /dev/null
- # Diff the files. If the files do not differ, delete the new file
- @if diff -b -B -q ${PREFIX}/etc/MailScanner/MailScanner.conf \
- ${PREFIX}/etc/MailScanner/MailScanner.conf.new.${PORTVERSION} ; \
- then ${ECHO} "No changes in MailScanner.conf options found" ; \
- ${RM} ${PREFIX}/etc/MailScanner/MailScanner.conf.new.${PORTVERSION} ; \
- else \
- ${ECHO} "Changes in MailScanner.conf found. Please look at \
- ${PREFIX}/etc/MailScanner/MailScanner.conf.new.${PORTVERSION}" ; \
- fi
+ @${RM} -f ${DOCSDIR}/Sophos.install.freebsd.bak
+.else
+ @${ECHO_MSG} -n ">> Installing manpage..."
.endif
- # Languages.conf update
- @for LANG_DIR in ${DATADIR}/reports/*; do \
- if [ -f $${LANG_DIR}/languages.conf ]; then \
- ${ECHO} -n Upgrading $${LANG_DIR}/languages.conf... Please wait...; \
- ${PERL} ${WRKSRC}/bin/upgrade_languages_conf \
- $${LANG_DIR}/languages.conf \
- $${LANG_DIR}/languages.conf.sample > \
- $${LANG_DIR}/languages.conf.new.${PORTVERSION} \
- 2> /dev/null ; \
- if diff -b -B -q $${LANG_DIR}/languages.conf \
- $${LANG_DIR}/languages.conf.new.${PORTVERSION} ; \
- then ${ECHO} " no changes"; \
- ${RM} $${LANG_DIR}/languages.conf.new.${PORTVERSION} ; \
- else ${ECHO} " done"; \
- ${CP} $${LANG_DIR}/languages.conf.new.${PORTVERSION} $${LANG_DIR}/languages.conf ; \
- fi; \
- fi; \
- done
- @${CAT} ${PKGMESSAGE}
+ @cd ${FILESDIR} && \
+ ${INSTALL_MAN} ${MAN8} ${MAN5PREFIX}/man/man8
+ @${ECHO_MSG} " [DONE]"
post-install:
.if defined(WITH_SPAMASSASSIN) && !defined(WITHOUT_SPAMASSASSIN_SYMLINK)
- @if [ ! -r ${PREFIX}/etc/mail/spamassassin/mailscanner.cf ]; then \
- ${ECHO} ${LN} -s ${PREFIX}/etc/MailScanner/spam.assassin.prefs.conf ${PREFIX}/etc/mail/spamassassin/mailscanner.cf; \
- ${LN} -s ${PREFIX}/etc/MailScanner/spam.assassin.prefs.conf ${PREFIX}/etc/mail/spamassassin/mailscanner.cf; \
- else \
- ${ECHO} "File ${PREFIX}/etc/mail/spamassassin/mailscanner.cf already exists!"; \
- fi;
-.endif
- # Display warning about new start/stop scripts
- @${CAT} ${FILESDIR}/rcwarning.txt
-.if !defined(BATCH)
- @${ECHO} Press ENTER to continue...
- @read a
+ @${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.else
+ @${SETENV} PKG_PREFIX=${PREFIX} WITHOUT_SPAMASSASSIN_SYMLINK=yes \
+ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.endif
-
-renew-wrapper: configure
- # Renew virus wrapper scripts
- ${INSTALL_SCRIPT} ${WRKSRC}/lib/*-wrapper ${PREFIX}/libexec/MailScanner
-
-renew-autoupdate: configure
- # Renew autoupdate scripts
- ${INSTALL_SCRIPT} ${WRKSRC}/lib/*-autoupdate ${PREFIX}/libexec/MailScanner
-
-renew-reports: configure
- # Renew reports
- cd ${WRKSRC}/etc/reports/en && ${FIND} * -type f ! -name "*.orig" \
- -exec ${INSTALL_DATA} {} ${DATADIR}/reports/en/{} \;
-
-initial-config: renew-wrapper renew-autoupdate renew-reports
- cd ${WRKSRC}/etc && ${INSTALL_DATA} ${ETC_FILES} \
- ${PREFIX}/etc/MailScanner
- ${INSTALL_DATA} ${WRKSRC}/etc/rules/spam.whitelist.rules \
- ${PREFIX}/etc/MailScanner/rules/spam.whitelist.rules
- ${INSTALL_DATA} ${WRKSRC}/etc/rules/bounce.rules \
- ${PREFIX}/etc/MailScanner/rules/bounce.rules
- ${INSTALL_DATA} ${WRKSRC}/etc/rules/max.message.size.rules \
- ${PREFIX}/etc/MailScanner/rules/max.message.size.rules
-.for FILE in ${MCP_FILES}
- ${INSTALL_DATA} ${WRKSRC}/etc/mcp/${FILE} \
- ${PREFIX}/etc/MailScanner/mcp/${FILE}
-.endfor
- @${ECHO} "******************************************************************************"
- @${ECHO} "The provided default configuration requires several directories to be created:"
- @${ECHO} "/var/spool/MailScanner/incoming"
- @${ECHO} "/var/spool/MailScanner/incoming/Locks"
- @${ECHO} "/var/spool/MailScanner/quarantine"
- @${ECHO} "/var/spool/mqueue"
- @${ECHO} "/var/spool/mqueue.in"
- @${ECHO} "Either create those directories or change the configuration."
- @${ECHO} "******************************************************************************"
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/mail/mailscanner/distinfo b/mail/mailscanner/distinfo
index 05c9377f4a60..524a7d2d8dc5 100644
--- a/mail/mailscanner/distinfo
+++ b/mail/mailscanner/distinfo
@@ -1,2 +1,2 @@
-SHA256 (MailScanner-install-4.83.4-1.tar.gz) = 567e1d576af39561f77b2113aa30e5ea864092081b5e0e08a9e679fa23754c89
-SIZE (MailScanner-install-4.83.4-1.tar.gz) = 9505704
+SHA256 (MailScanner-install-4.83.5-1.tar.gz) = 1c1fda2e9fc2268674e4228f2ec14d2c1d781fd0b9d3ae97ccaf487bdbcf8160
+SIZE (MailScanner-install-4.83.5-1.tar.gz) = 9507037
diff --git a/mail/mailscanner/files/CHANGES.port b/mail/mailscanner/files/CHANGES.port
index 6287f8d32dff..dfda32315135 100644
--- a/mail/mailscanner/files/CHANGES.port
+++ b/mail/mailscanner/files/CHANGES.port
@@ -1,3 +1,9 @@
+Version 4.84.5
+==============
+- Upgrade to 4.83.5
+- Remove extra config file targets-- config files are handled automatically
+ in pkg-(de)?install scripts now.
+
Version 4.83.4
==============
- Upgrade to 4.83.4
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
diff --git a/mail/mailscanner/files/pkg-install.in b/mail/mailscanner/files/pkg-install.in
new file mode 100644
index 000000000000..f9da1f520578
--- /dev/null
+++ b/mail/mailscanner/files/pkg-install.in
@@ -0,0 +1,115 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+CHMOD=/bin/chmod
+CP=/bin/cp
+DATADIR=%%DATADIR%%
+ECHO=echo
+LN=/bin/ln
+PERL=%%PERL%%
+RM=/bin/rm
+PKGVERSION=%%PKGVERSION%%
+
+upgrade_lang_conf()
+{
+ for LANG_DIR in ${DATADIR}/reports/*
+ do
+ if [ -f ${LANG_DIR}/languages.conf ] ; then
+ ${ECHO} -n Upgrading ${LANG_DIR}/languages.conf... Please wait..
+ ${PERL} ${DATADIR}/upgrade_languages_conf \
+ ${LANG_DIR}/languages.conf \
+ ${LANG_DIR}/languages.conf.sample > \
+ ${LANG_DIR}/languages.conf.new.${PKGVERSION} \
+ 2> /dev/null
+ if /usr/bin/diff -bBq ${LANG_DIR}/languages.conf \
+ ${LANG_DIR}/languages.conf.new.${PKGVERSION}
+ then ${ECHO} " no changes"
+ ${RM} ${LANG_DIR}/languages.conf.new.${PKGVERSION}
+ else ${ECHO} " done"
+ ${CP} ${LANG_DIR}/languages.conf.new.${PKGVERSION} \
+ ${LANG_DIR}/languages.conf
+ ${CHMOD} u+w ${LANG_DIR}/languages.conf
+ fi
+ fi
+ done
+}
+
+upgrade_mailscanner_conf()
+{
+ ${PERL} ${DATADIR}/upgrade_MailScanner_conf \
+ ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf \
+ ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf.sample > \
+ ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf.new.${PKGVERSION} \
+ 2> /dev/null
+ if diff -b -B -q ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf \
+ ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf.new.${PKGVERSION}
+ then ${ECHO} "No changes in MailScanner.conf options found"
+ else ${ECHO} -n "Changes in MailScanner.conf found. Please look at"
+ ${ECHO} \
+ "${PKG_PREFIX}/etc/MailScanner/MailScanner.conf.new.${PKGVERSION}"
+ fi
+}
+
+initial_config()
+{
+ for LANG_DIR in ${DATADIR}/reports/*
+ do
+ for REPORT_FILE in ${LANG_DIR}/*.sample
+ do
+ [ ! -f ${REPORT_FILE%.sample} ] \
+ && cp -p ${REPORT_FILE} ${REPORT_FILE%.sample} \
+ && ${CHMOD} u+w ${REPORT_FILE%.sample}
+ done
+ done
+
+ for WRAPPER in ${PKG_PREFIX}/libexec/MailScanner/*-wrapper.sample
+ do
+ [ ! -f ${WRAPPER%.sample} ] \
+ && cp -p ${WRAPPER} ${WRAPPER%.sample} \
+ && ${CHMOD} u+w ${WRAPPER%.sample}
+ done
+
+ for AUTOUPDATE in ${PKG_PREFIX}/libexec/MailScanner/*-autoupdate.sample
+ do
+ [ ! -f ${AUTOUPDATE%.sample} ] \
+ && cp -p ${AUTOUPDATE} ${AUTOUPDATE%.sample} \
+ && ${CHMOD} u+w ${AUTOUPDATE%.sample}
+ done
+
+ for RULES in ${PKG_PREFIX}/etc/MailScanner/rules/*.rules.sample
+ do
+ [ ! -f ${RULES%.sample} ] \
+ && cp -p ${RULES} ${RULES%.sample} \
+ && ${CHMOD} u+w ${RULES%.sample}
+ done
+
+ for MCP_FILES in %%MCP_FILES%%
+ do
+ [ ! -f ${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES} ] \
+ && cp -p ${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES}.sample \
+ ${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES} \
+ && ${CHMOD} u+w ${PKG_PREFIX}/etc/MailScanner/mcp/${MCP_FILES}
+ done
+
+ for ETC in ${PKG_PREFIX}/etc/MailScanner/*.sample
+ do
+ [ ! -f ${ETC%.sample} ] \
+ && cp -p ${ETC} ${ETC%.sample} \
+ && ${CHMOD} u+w ${ETC%.sample}
+ done
+}
+
+case $2 in
+POST-INSTALL)
+ [ ! -z "${WITHOUT_SPAMASSASSIN_SYMLINK}" ] \
+ && [ ! -r ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf ] \
+ && ${LN} -s ${PKG_PREFIX}/etc/MailScanner/spam.assassin.prefs.conf \
+ ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf
+ upgrade_lang_conf
+ [ -f ${PKG_PREFIX}/etc/MailScanner/MailScanner.conf ] \
+ && upgrade_mailscanner_conf
+ initial_config
+ exit 0
+ ;;
+esac
diff --git a/mail/mailscanner/files/pkg-message.in b/mail/mailscanner/files/pkg-message.in
index 54730653fc61..ab792b3d00c6 100644
--- a/mail/mailscanner/files/pkg-message.in
+++ b/mail/mailscanner/files/pkg-message.in
@@ -11,30 +11,18 @@
You will need to make several modifications to config files
before MailScanner will work correctly.
-
- If this is the first time you are installing this port you
- should create an initial set of configuration files with
-
- make initial-config
-
- within this directory. Without this step you will only have
- .sample files instead of real .conf files and report
- templates.
-
- If you are upgrading your port you might consider
- running
- make renew-wrapper
- make renew-autoupdate
- make renew-reports
+ The provided default configuration requires several directories
+ to be created:
- to update your virus-wrappers, autoupdates, reports and
- languages.conf
-
- The english languages.conf is updated automatically. For all
- other versions use the update_languages_conf tool found
- in the work directory of this port.
+ /var/spool/MailScanner/incoming
+ /var/spool/MailScanner/incoming/Locks
+ /var/spool/MailScanner/quarantine
+ /var/spool/mqueue
+ /var/spool/mqueue.in
+ Either create those directories or change the configuration.
+
Sophos users: Please take a look at the Sophos install
script %%PREFIX%%/share/doc/MailScanner/Sophos.install.freebsd
diff --git a/mail/mailscanner/files/rcwarning.txt b/mail/mailscanner/files/rcwarning.txt
deleted file mode 100644
index 7703c802853a..000000000000
--- a/mail/mailscanner/files/rcwarning.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-*************************************************************************
- _ _____ _____ _____ _ _ _____ ___ ___ _ _
- / \|_ _|_ _| ____| \ | |_ _|_ _/ _ \| \ | |
- / _ \ | | | | | _| | \| | | | | | | | | \| |
- / ___ \| | | | | |___| |\ | | | | | |_| | |\ |
- /_/ \_\_| |_| |_____|_| \_| |_| |___\___/|_| \_|
-
-
- The MailScanner port uses new start/stop scripts according to rc.subr
- standard. Your old scripts will be overwritten after you press ENTER.
- To start mailscanner and your mta, please put the correct statements in
- your rc.conf. For examples/syntax please look at mailscanner.sh and
- mta.sh in your rc.d directory.
-
- Please: Also have a look at CHANGES.port in your MailScanner
- doc dir (see above).
-
-*************************************************************************
diff --git a/mail/mailscanner/pkg-plist b/mail/mailscanner/pkg-plist
index d54d095bce35..5d35a5f921cb 100644
--- a/mail/mailscanner/pkg-plist
+++ b/mail/mailscanner/pkg-plist
@@ -1,24 +1,24 @@
@comment $FreeBSD$
-etc/MailScanner/archives.filename.rules.conf.sample
-etc/MailScanner/archives.filetype.rules.conf.sample
-etc/MailScanner/country.domains.conf.sample
-etc/MailScanner/MailScanner.conf.sample
-etc/MailScanner/filename.rules.conf.sample
-etc/MailScanner/filetype.rules.conf.sample
-etc/MailScanner/conf.d/README
-etc/MailScanner/mcp/10_example.cf.sample
-etc/MailScanner/mcp/mcp.spam.assassin.prefs.conf.sample
-etc/MailScanner/mcp/v320.pre.sample
-etc/MailScanner/rules/EXAMPLES
-etc/MailScanner/rules/README
-etc/MailScanner/rules/bounce.rules.sample
-etc/MailScanner/rules/max.message.size.rules.sample
-etc/MailScanner/rules/spam.whitelist.rules.sample
-etc/MailScanner/phishing.bad.sites.conf.sample
-etc/MailScanner/phishing.safe.sites.conf.sample
-etc/MailScanner/spam.assassin.prefs.conf.sample
-etc/MailScanner/spam.lists.conf.sample
-etc/MailScanner/virus.scanners.conf.sample
+%%ETCDIR%%/archives.filename.rules.conf.sample
+%%ETCDIR%%/archives.filetype.rules.conf.sample
+%%ETCDIR%%/country.domains.conf.sample
+%%ETCDIR%%/MailScanner.conf.sample
+%%ETCDIR%%/filename.rules.conf.sample
+%%ETCDIR%%/filetype.rules.conf.sample
+%%ETCDIR%%/conf.d/README
+%%ETCDIR%%/mcp/10_example.cf.sample
+%%ETCDIR%%/mcp/mcp.spam.assassin.prefs.conf.sample
+%%ETCDIR%%/mcp/v320.pre.sample
+%%ETCDIR%%/rules/EXAMPLES
+%%ETCDIR%%/rules/README
+%%ETCDIR%%/rules/bounce.rules.sample
+%%ETCDIR%%/rules/max.message.size.rules.sample
+%%ETCDIR%%/rules/spam.whitelist.rules.sample
+%%ETCDIR%%/phishing.bad.sites.conf.sample
+%%ETCDIR%%/phishing.safe.sites.conf.sample
+%%ETCDIR%%/spam.assassin.prefs.conf.sample
+%%ETCDIR%%/spam.lists.conf.sample
+%%ETCDIR%%/virus.scanners.conf.sample
lib/MailScanner/MailScanner.pm
lib/MailScanner/MailScanner/Antiword.pm
lib/MailScanner/MailScanner/BinHex.pm
@@ -544,15 +544,13 @@ sbin/MailScanner
%%DATADIR%%/reports/sk/deleted.size.message.txt.sample
%%DATADIR%%/reports/sk/sender.size.report.txt.sample
%%DATADIR%%/reports/sk/stored.size.message.txt.sample
+%%DATADIR%%/upgrade_MailScanner_conf
+%%DATADIR%%/upgrade_languages_conf
%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD.port
-%%PORTDOCS%%%%DOCSDIR%%/CHANGES.port
%%PORTDOCS%%%%DOCSDIR%%/Sophos.install.freebsd
%%PORTDOCS%%%%DOCSDIR%%/INSTALL.FreeBSD
-%%PORTDOCS%%%%DOCSDIR%%/INSTALL.OpenBSD
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-%%SPAMASSASSIN%%%%SPAMASSASSIN_SYMLINK%%@exec [ -e %D/etc/mail/spamassassin/mailscanner.cf ] || ln -s %D/etc/MailScanner/spam.assassin.prefs.conf %D/etc/mail/spamassassin/mailscanner.cf
-%%SPAMASSASSIN%%%%SPAMASSASSIN_SYMLINK%%@unexec [ -L %D/etc/mail/spamassassin/mailscanner.cf ] && rm -f %D/etc/mail/spamassassin/mailscanner.cf
@dirrm %%DATADIR%%/reports/sk
@dirrm %%DATADIR%%/reports/se
@dirrm %%DATADIR%%/reports/ro
@@ -574,7 +572,7 @@ sbin/MailScanner
@dirrm lib/MailScanner/MailScanner/CustomFunctions
@dirrm lib/MailScanner/MailScanner
@dirrm lib/MailScanner
-@dirrm etc/MailScanner/conf.d
-@dirrm etc/MailScanner/mcp
-@dirrm etc/MailScanner/rules
-@dirrm etc/MailScanner
+@dirrmtry %%ETCDIR%%/conf.d
+@dirrmtry %%ETCDIR%%/mcp
+@dirrmtry %%ETCDIR%%/rules
+@dirrmtry %%ETCDIR%%