Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/mailscanner/Makefile,v
retrieving revision 1.95
diff -u -r1.95 Makefile
--- Makefile	8 May 2011 20:54:08 -0000	1.95
+++ Makefile	15 May 2011 15:12:00 -0000
@@ -6,7 +6,7 @@
 #
 
 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}
@@ -51,7 +51,12 @@
 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+=	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,101 @@
 	@${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}
+	@${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
+	@${RM} -f ${DOCSDIR}/Sophos.install.freebsd.bak
+.else
+	@${ECHO_MSG} -n ">> Installing manpage..."
 .endif
-	cd ${FILESDIR} && \
+	@cd ${FILESDIR} && \
 		${INSTALL_MAN} ${MAN8} ${MAN5PREFIX}/man/man8
-	${PERL} -pi -e \
-		's,%%LOCALBASE%%,${LOCALBASE},g; \
-		s,%%PREFIX%%,${PREFIX},g;' \
-		${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
-.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}
+	@${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;
+	@${SETENV} PKG_PREFIX=${PREFIX} \
+	    ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.else
+	@${SETENV} PKG_PREFIX=${PREFIX} WITHOUT_SPAMASSASSIN_SYMLINK=yes \
+	    ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 .endif
-	# Display warning about new start/stop scripts
-	@${CAT} ${FILESDIR}/rcwarning.txt
+	@${CAT} ${PKGMESSAGE}
 .if !defined(BATCH)
-	@${ECHO} Press ENTER to continue...
+	@${ECHO_MSG} Press ENTER to continue...
 	@read a
 .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} "******************************************************************************"
-
 .include <bsd.port.post.mk>
Index: distinfo
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/mailscanner/distinfo,v
retrieving revision 1.59
diff -u -r1.59 distinfo
--- distinfo	11 Apr 2011 15:01:50 -0000	1.59
+++ distinfo	15 May 2011 15:12:00 -0000
@@ -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
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/mailscanner/pkg-plist,v
retrieving revision 1.42
diff -u -r1.42 pkg-plist
--- pkg-plist	14 Sep 2010 04:11:47 -0000	1.42
+++ pkg-plist	15 May 2011 15:12:01 -0000
@@ -544,15 +544,13 @@
 %%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
Index: files/CHANGES.port
===================================================================
RCS file: files/CHANGES.port
diff -N files/CHANGES.port
--- files/CHANGES.port	11 Apr 2011 15:01:50 -0000	1.26
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,155 +0,0 @@
-Version 4.83.4
-==============
-- Upgrade to 4.83.4
-
-Version 4.83.2
-==============
-- Upgrade to 4.83.2
-- Update mta init script so it starts MTAs after other init scripts
-  (milters, etc) that should start before "mail".
-
-Version 4.82.6
-==============
-- Upgrade to 4.82.6
-
-Version 4.81.4
-==============
-- Upgrade to 4.81.4
-- Added dependency for p5-Sys-SigAction port
-
-Version 4.75.11
-===============
-- Upgrade to 4.75.11
-
-Version 4.67.6
-==============
-- Upgrade to 4.67.6
-- Now works with p5-Mail-Tools Version 2.x again
-
-Version 4.64.3
-==============
-- Upgrade to 4.64.3
-
-Version 4.62.9
-==============
-- Upgrade to 4.62.9
-- update_spamassassin and update_spamassassin.cron are untouched again. I
-  currently do not have enough time to get this running the FreeBSD way.
-  Patches are welcome.
-
-Version 4.61.7
-==============
-- Upgrade to 4.61.7
-- Attention: update_spamassassin and update_spamassassin.cron are rewritten to fit
-  FreeBSD. Untestet. If you are using non-standard directories or FreeBSD < 6 you will
-  have to tweck update_spamassassin.
-
-Version 4.60.8_2
-================
-- Fixed error in auto-zip: If a message contained 2 different attachments 
-  with exactly the same filename, the auto-zip feature would fail and 
-  MailScanner would die.
-
-Version 4.60.8
-==============
-- update to 4.60.8
-
-Version 4.59.4_2
-================
-- update to 4.59.4
-
-Version 4.58.9_2
-================
-- clamav-wrapper contained options unarj, unace and zoo. unace
-  seems to be dead and the other options are corrected to be
-  arj and unzoo.
-
-Version 4.58.9
-================
-- Upgrade to MailScanner 4.58
-- fix: CHANGES.port was not installed anymore
-- startscripts now honor RC_SUBR_SUFFIX
-
-Version 4.57.6_1
-================
-- Upgrade to MailScanner 4.57
-
-Version 4.56.8_1
-================
-- fixed problem with upgrade_mailscanner_config 
-
-Version 4.56.8
-==============
-- Upgrade to MailScanner 4.56
-
-Version 4.55.10
-===============
-- Upgrade to MailScanner 4.55
-- As Julian removed the documentation from the tarball I did the same in the port.
-  Manpage and html docs removed as well. All documentation can now be found on 
-  the web.
-
-Version 4.54.6_1
-=================
-- Path to gunzip in MailScanner.conf fixed
-
-Version 4.54.6
-=================
-- Upgrade to MailScanner 4.54
-- Download location changed
-- added sysutils/p5-Sys-Hostname-Long dependency
-
-Version 4.53.8
-=================
-- 4.53.7 contained a bug in scanning of phishing mails. This resulted in scanning loops
-
-Version 4.53.7
-=================
-- Upgrade to MailScanner 4.53
-- changed some patch-names
-- created sa-update.cron in libexece/MailScanner to periodically run sa-update
-
-Version 4.52.2_1
-=================
-- fixed bug in mta.sh script
-- fixed rc.subr reference in update_phishing_sites.cron and 
-  update_virus_scanners.cron --> now dynamically rewritten to correct
-  location
-- Exim 4.61 changed queue file format which was incompatible with 4.52.2 --> patched
-
-Version 4.52.2
-=================
-- Upgrade to MailScanner 4.52
-
-Version 4.51.5
-=================
-- Some changes in FreeBSD 6.1 resulted in problems in the mta.sh script.
-  Fixed.
-- Upgrade to MailScanenr 4.51
-
-Version 4.50.15_1
-=================
-- The MailScanner binary is now put into /usr/local/sbin allowing for
-  easy use of the command-line options for debugging etc.
-- From this version on all ports will contain this Change Log.
-- The following scripts are now installed by the port as well (into
-  /usr/local/libexec/MailScanner):
-	- analyse_SpamAssassin_cache
-	- clean.SA.cache (use this for manual clean or in crontab)
-	- clean.quarantine (use this for manual clean or in crontab)
-	- update_phishing_sites (use this for manual updates)
-	- update_phishing_sites.cron (use this in crontab)
-	- update_virus_scanners.cron (ise this in crontab)
-- The latter two can/should be used in your crontab for updating those
-  components. These scripts introduce a random delay for updating (can
-  be configured in rc.conf).
-- Fixed a small bug in mailscanner.sh script. Status/Stop was not
-  always working.
-
-Version 4.50.15
-===============
-- Upgrade to MailScanner 4.50.15-1
-- Start/Stop scripts are now rc.subr compliant. Please adjust your config!
-- The port now optionally installs Spamassassin, ClamAV and Bitdefender.
-- make renew-wrapper, renew-autoupdate and renew-reports now depend on 
-  configure instead of on install allowing their usage after a portupgrade.
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-deinstall.in	15 May 2011 15:12:01 -0000
@@ -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
Index: files/pkg-install.in
===================================================================
RCS file: files/pkg-install.in
diff -N files/pkg-install.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-install.in	15 May 2011 15:12:01 -0000
@@ -0,0 +1,107 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+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
+		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}
+	    done
+	done
+
+	for WRAPPER in ${PKG_PREFIX}/libexec/MailScanner/*-wrapper.sample
+	do
+	    [ ! -f ${WRAPPER%.sample} ] \
+		&& cp -p ${WRAPPER} ${WRAPPER%.sample}
+	done
+
+	for AUTOUPDATE in ${PKG_PREFIX}/libexec/MailScanner/*-autoupdate.sample
+	do
+	    [ ! -f ${AUTOUPDATE%.sample} ] \
+		&& cp -p ${AUTOUPDATE} ${AUTOUPDATE%.sample}
+	done
+
+	for RULES in ${PKG_PREFIX}/etc/MailScanner/rules/*.rules.sample
+	do
+	    [ ! -f ${RULES%.sample} ] \
+		&& cp -p ${RULES} ${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}
+	done
+
+	for ETC in ${PKG_PREFIX}/etc/MailScanner/*.sample
+	do
+	    [ ! -f ${ETC%.sample} ] \
+		&& cp -p ${ETC} ${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
Index: files/pkg-message.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/mailscanner/files/pkg-message.in,v
retrieving revision 1.6
diff -u -r1.6 pkg-message.in
--- files/pkg-message.in	1 Feb 2010 03:32:13 -0000	1.6
+++ files/pkg-message.in	15 May 2011 15:12:01 -0000
@@ -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
-
-	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.
 
+	The provided default configuration requires several directories
+	to be created:
+
+		/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
 
Index: files/rcwarning.txt
===================================================================
RCS file: files/rcwarning.txt
diff -N files/rcwarning.txt
--- files/rcwarning.txt	16 Feb 2006 16:34:56 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -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).
- 
-*************************************************************************
