diff options
author | sem <sem@FreeBSD.org> | 2006-02-17 00:34:56 +0800 |
---|---|---|
committer | sem <sem@FreeBSD.org> | 2006-02-17 00:34:56 +0800 |
commit | 33619e22de65350d5d507f7d223cfc12c9803216 (patch) | |
tree | f46d933ccaeab0e5b7e66bddc2bdcae256926ae8 /mail | |
parent | 78361a8830cadfd6e967772abd88f95e9a4f7d64 (diff) | |
download | freebsd-ports-gnome-33619e22de65350d5d507f7d223cfc12c9803216.tar.gz freebsd-ports-gnome-33619e22de65350d5d507f7d223cfc12c9803216.tar.zst freebsd-ports-gnome-33619e22de65350d5d507f7d223cfc12c9803216.zip |
- Introduce a few more maintanence scripts
- Fix a bug in a startup script
- Add files/CHANGES.port where store history of the port changes
PR: ports/93420
Submitted by: maintainer
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mailscanner/Makefile | 52 | ||||
-rw-r--r-- | mail/mailscanner/files/CHANGES.port | 26 | ||||
-rw-r--r-- | mail/mailscanner/files/README.FreeBSD.port | 30 | ||||
-rw-r--r-- | mail/mailscanner/files/mailscanner.sh.in | 4 | ||||
-rw-r--r-- | mail/mailscanner/files/patch-bin:cron:update_phishing_sites.cron | 38 | ||||
-rw-r--r-- | mail/mailscanner/files/patch-bin:cron:update_virus_scanners.cron | 38 | ||||
-rw-r--r-- | mail/mailscanner/files/pkg-message.in | 3 | ||||
-rw-r--r-- | mail/mailscanner/files/rcwarning.txt | 3 | ||||
-rw-r--r-- | mail/mailscanner/pkg-plist | 12 |
9 files changed, 178 insertions, 28 deletions
diff --git a/mail/mailscanner/Makefile b/mail/mailscanner/Makefile index 83911339267f..047ac6618ecb 100644 --- a/mail/mailscanner/Makefile +++ b/mail/mailscanner/Makefile @@ -7,6 +7,7 @@ PORTNAME= MailScanner PORTVERSION= 4.50.15 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/tar/ DISTNAME= ${PORTNAME}-install-${PORTVERSION}-${PATCHLEVEL} @@ -38,9 +39,9 @@ BUILD_DEPENDS= \ ${SITE_PERL}/Time/Zone.pm:${PORTSDIR}/devel/p5-TimeDate RUN_DEPENDS= ${BUILD_DEPENDS} \ - ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash2 \ - ${LOCALBASE}/bin/tnef:${PORTSDIR}/converters/tnef \ - ${LOCALBASE}/bin/wget:${PORTSDIR}/ftp/wget + bash:${PORTSDIR}/shells/bash \ + tnef:${PORTSDIR}/converters/tnef \ + wget:${PORTSDIR}/ftp/wget OPTIONS= SPAMASSASSIN "Install SpamAssassin" on \ CLAMAV "Install ClamAV" on \ @@ -144,6 +145,21 @@ do-build: s,/opt/MailScanner/etc,${PREFIX}/etc/MailScanner,g;' \ ${WRKSRC}/bin/update_virus_scanners ${PERL} -pi -e \ + 's,/bin/bash,${LOCALBASE}/bin/bash,g; \ + s,/opt/MailScanner/bin,${PREFIX}/libexec/MailScanner,g;' \ + ${WRKSRC}/bin/cron/update_virus_scanners.cron + ${PERL} -pi -e \ + 's,/bin/bash,${LOCALBASE}/bin/bash,g; \ + s,/opt/MailScanner/etc,${PREFIX}/etc/MailScanner,g;' \ + ${WRKSRC}/bin/update_phishing_sites + ${PERL} -pi -e \ + 's,/bin/bash,${LOCALBASE}/bin/bash,g; \ + s,/opt/MailScanner/bin,${PREFIX}/libexec/MailScanner,g;' \ + ${WRKSRC}/bin/cron/update_phishing_sites.cron + ${PERL} -pi -e \ + 's,/etc/MailScanner/MailScanner.conf,${PREFIX}/etc/MailScanner/MailScanner.conf,g;' \ + ${WRKSRC}/bin/clean.SA.cache + ${PERL} -pi -e \ 's,/opt/MailScanner/var/MailScanner.pid,/var/run/MailScanner.pid,g; \ s,/usr/lib/sendmail,/usr/sbin/sendmail,g; \ s,/opt/MailScanner/bin,${PREFIX}/bin,g; \ @@ -168,19 +184,36 @@ do-build: .endfor do-install: - # Step 1: Install libexec files + # + # Step 1: Install bin files + # + ${INSTALL_SCRIPT} ${WRKSRC}/bin/MailScanner ${PREFIX}/sbin/mailscanner + ${LN} -s ${LOCALBASE}/sbin/mailscanner ${PREFIX}/sbin/MailScanner + # + # Step 2: Install libexec files # ${MKDIR} ${PREFIX}/libexec/MailScanner ${CHMOD} -R ${BINMODE} ${PREFIX}/libexec/MailScanner - ${INSTALL_SCRIPT} ${WRKSRC}/bin/MailScanner ${PREFIX}/libexec/MailScanner cd ${WRKSRC}/lib && ${FIND} * -name "*-wrapper" -exec \ ${INSTALL_SCRIPT} {} ${PREFIX}/libexec/MailScanner/{}.sample \; 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/update_phishing_sites \ + ${PREFIX}/libexec/MailScanner/update_phishing_sites + ${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_phishing_sites.cron \ + ${PREFIX}/libexec/MailScanner/update_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 # - # Step 2: Install etc files + # Step 3: Install etc files # ${MKDIR} ${PREFIX}/etc/MailScanner ${CHMOD} ${BINMODE} ${PREFIX}/etc/MailScanner @@ -200,7 +233,7 @@ do-install: ${PREFIX}/etc/MailScanner/mcp/${FILE}.sample .endfor # - # Step 3: Install files in share + # Step 4: Install files in share # @${MKDIR} ${DATADIR} cd ${WRKSRC}/etc && ${FIND} reports -type d ! -name "*.old" -exec \ @@ -210,7 +243,7 @@ do-install: -o \( -type f ! -name "*.orig" -exec ${INSTALL_DATA} {} ${DATADIR}/{}.sample \; \) ${CHMOD} -R ${BINMODE} ${DATADIR}/reports # - # Step 4: Install lib + # Step 5: Install lib # ${MKDIR} ${PREFIX}/lib/MailScanner/MailScanner ${MKDIR} ${PREFIX}/lib/MailScanner/MailScanner/CustomFunctions @@ -219,11 +252,12 @@ do-install: cd ${WRKSRC}/lib/MailScanner && ${FIND} * -type f ! -name "*.orig" -exec \ ${INSTALL_SCRIPT} {} ${PREFIX}/lib/MailScanner/MailScanner/{} \; # - # Step 5: Docs & Manpages + # Step 6: Docs & Manpages # .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${FILESDIR}/README.FreeBSD.port ${DOCSDIR} + ${INSTALL_DATA} ${FILESDIR}/CHANGES.port ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${DOCSDIR} cd ${WRKSRC}/docs && \ ${FIND} * -type d -exec ${MKDIR} ${DOCSDIR}/{} \; && \ diff --git a/mail/mailscanner/files/CHANGES.port b/mail/mailscanner/files/CHANGES.port new file mode 100644 index 000000000000..abc51fca8f3d --- /dev/null +++ b/mail/mailscanner/files/CHANGES.port @@ -0,0 +1,26 @@ +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. diff --git a/mail/mailscanner/files/README.FreeBSD.port b/mail/mailscanner/files/README.FreeBSD.port index 7004047a2f1d..d05954822716 100644 --- a/mail/mailscanner/files/README.FreeBSD.port +++ b/mail/mailscanner/files/README.FreeBSD.port @@ -1,17 +1,14 @@ The MailScanner port is using the original MailScanner tarball from -www.mailscanner.info. This tarball puts all the MailScanner files in -subdirectories +www.mailscanner.info. Unfortunatly the tarball consists of MailScanner +and perl modules etc. MailScanner depends on. The port is not using +Julians install.sh or the provided modules. All modules that MailScanner +depends on are installed via ports as well. -bin MailScanner binary / MailScanner start script etc. -etc MailScanner config files / rules / report templates -lib Virus wrapper and autoupdate scripts / MailScanner Perl libraries -docs Documentation -var pid file - -In order to make this FreeBSD compliant the port installs those files +In order to make the installation FreeBSD compliant the port installs files in the following directories: -/usr/local/libexec/MailScanner MailScanner binary, virus wrapper/autoupdate +/usr/local/sbin MailScanner binary +/usr/local/libexec/MailScanner virus wrapper/autoupdate, cron-scripts etc. /usr/local/lib/MailScanner MailScanner Perl libraries /usr/local/share/MailScanner MailScanner report templates /usr/local/share/doc/MailScanner Documentation @@ -20,22 +17,23 @@ in the following directories: The port installs two start/stop scripts in /usr/local/etc/rc.d: -mailscanner.sh.sample -mta.sh.sample +mailscanner.sh +mta.sh -My suggestion is to use these scripts instead of the usual FreeBSD MTA startup +My suggestion is to use mta.sh instead of the usual FreeBSD MTA startup process. This of course means that you will have to disable MTA startup in rc.conf completely. Put this in your rc.conf: sendmail_enable="NONE" -Then adjust sendmail.sh or exim.sh to your configuration. Have a look at the -MailScanner manpage for MTA setup hints. +Please have a look at the provided start scripts for settings you have to +make in rc.conf. When upgrading the port it will try to look for new options/variables in MailScanner.conf using Julians upgrade_MailScanner_conf script. If it finds changes it will create a newly merged MailScanner.conf and copy it to -/usr/local/etc/MailScanner/MailScanner.conf.new.PORTVERSION. +/usr/local/etc/MailScanner/MailScanner.conf.new.PORTVERSION. Moreover the +port will try to update all your languages conf files. If you have suggestions for this port please let me know and drop me an e-mail at diff --git a/mail/mailscanner/files/mailscanner.sh.in b/mail/mailscanner/files/mailscanner.sh.in index 30cf4f3f53dd..0ef8d417882f 100644 --- a/mail/mailscanner/files/mailscanner.sh.in +++ b/mail/mailscanner/files/mailscanner.sh.in @@ -23,7 +23,7 @@ load_rc_config $name : ${mailscanner_configfile="%%PREFIX%%/etc/MailScanner/MailScanner.conf"} : ${mailscanner_pidfile="/var/run/MailScanner.pid"} -command="%%PREFIX%%/libexec/MailScanner/MailScanner" +command="%%PREFIX%%/sbin/mailscanner" pidfile=${mailscanner_pidfile} command_args="${mailscanner_configfile}" @@ -37,5 +37,7 @@ _ms_start_precmd() { start_precmd=_ms_start_precmd +procname="MailScanner" + run_rc_command "$1" diff --git a/mail/mailscanner/files/patch-bin:cron:update_phishing_sites.cron b/mail/mailscanner/files/patch-bin:cron:update_phishing_sites.cron new file mode 100644 index 000000000000..7b1d955a9ebd --- /dev/null +++ b/mail/mailscanner/files/patch-bin:cron:update_phishing_sites.cron @@ -0,0 +1,38 @@ +--- ../MailScanner-install-4.50.15.orig/bin/cron/update_phishing_sites.cron Wed Feb 15 20:02:33 2006 ++++ bin/cron/update_phishing_sites.cron Wed Feb 15 20:14:45 2006 +@@ -1,20 +1,24 @@ + #!/bin/bash + +-# Insert a random delay up to this value, to spread virus updates round +-# the clock. 1800 seconds = 30 minutes. +-# Set this to 0 to disable it. +-UPDATEMAXDELAY=3600 +-if [ -f /etc/sysconfig/MailScanner ] ; then +- . /etc/sysconfig/MailScanner +-fi +-export UPDATEMAXDELAY ++# Add the following line to /etc/rc.conf to configure a maximum delay in ++# order to spread virus updates round the clock. 1800 seconds = 30 minutes. ++# Set this to 0 to disable it ++ ++. /usr/local/etc/rc.subr ++ ++name="mailscanner" ++rcvar=`set_rcvar` ++ ++load_rc_config $name ++ ++: ${mailscanner_updatemaxdelay="600"} + + [ -x /opt/MailScanner/bin/update_phishing_sites ] || exit 0 +-if [ "x$UPDATEMAXDELAY" = "x0" ]; then ++if [ "x${mailscanner_updatemaxdelay}" = "x0" ]; then + : + else +- logger -p mail.info -t update.phishing.sites Delaying cron job up to $UPDATEMAXDELAY seconds +- perl -e "sleep int(rand($UPDATEMAXDELAY));" ++ logger -p mail.info -t update.phishing.sites Delaying cron job up to ${mailscanner_updatemaxdelay} seconds ++ perl -e "sleep int(rand(${mailscanner_updatemaxdelay}));" + fi + exec /opt/MailScanner/bin/update_phishing_sites > /dev/null 2>&1 + exit 0 diff --git a/mail/mailscanner/files/patch-bin:cron:update_virus_scanners.cron b/mail/mailscanner/files/patch-bin:cron:update_virus_scanners.cron new file mode 100644 index 000000000000..59141df27b00 --- /dev/null +++ b/mail/mailscanner/files/patch-bin:cron:update_virus_scanners.cron @@ -0,0 +1,38 @@ +--- ../MailScanner-install-4.50.15.orig/bin/cron/update_virus_scanners.cron Wed Feb 15 20:02:33 2006 ++++ bin/cron/update_virus_scanners.cron Wed Feb 15 20:11:17 2006 +@@ -1,20 +1,24 @@ + #!/bin/bash + +-# Insert a random delay up to this value, to spread virus updates round +-# the clock. 1800 seconds = 30 minutes. +-# Set this to 0 to disable it. +-UPDATEMAXDELAY=600 +-if [ -f /etc/sysconfig/MailScanner ] ; then +- . /etc/sysconfig/MailScanner +-fi +-export UPDATEMAXDELAY ++# Add the following line to /etc/rc.conf to configure a maximum delay in ++# order to spread virus updates round the clock. 1800 seconds = 30 minutes. ++# Set this to 0 to disable it ++ ++. /usr/local/etc/rc.subr ++ ++name="mailscanner" ++rcvar=`set_rcvar` ++ ++load_rc_config $name ++ ++: ${mailscanner_updatemaxdelay="600"} + + [ -x /opt/MailScanner/bin/update_virus_scanners ] || exit 0 +-if [ "x$UPDATEMAXDELAY" = "x0" ]; then ++if [ "x${mailscanner_updatemaxdelay}" = "x0" ]; then + : + else +- logger -p mail.info -t update.virus.scanners Delaying cron job up to $UPDATEMAXDELAY seconds +- perl -e "sleep int(rand($UPDATEMAXDELAY));" ++ logger -p mail.info -t update.virus.scanners Delaying cron job up to ${mailscanner_updatemaxdelay} seconds ++ perl -e "sleep int(rand(${mailscanner_updatemaxdelay}));" + fi + exec /opt/MailScanner/bin/update_virus_scanners + exit 0 diff --git a/mail/mailscanner/files/pkg-message.in b/mail/mailscanner/files/pkg-message.in index edce99159358..1a6f8229db45 100644 --- a/mail/mailscanner/files/pkg-message.in +++ b/mail/mailscanner/files/pkg-message.in @@ -38,4 +38,7 @@ Sophos users: Please take a look at the Sophos install script %%PREFIX%%/share/doc/MailScanner/Sophos.install.freebsd + Please also always look at the port changelog at + %%PREFIX%%/share/doc/MailScanner/CHANGES.port + ************************************************************************* diff --git a/mail/mailscanner/files/rcwarning.txt b/mail/mailscanner/files/rcwarning.txt index 9b50675b3d3e..7703c802853a 100644 --- a/mail/mailscanner/files/rcwarning.txt +++ b/mail/mailscanner/files/rcwarning.txt @@ -11,5 +11,8 @@ 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 2643556763b0..f32693b35254 100644 --- a/mail/mailscanner/pkg-plist +++ b/mail/mailscanner/pkg-plist @@ -49,7 +49,13 @@ lib/MailScanner/MailScanner/WorkArea.pm lib/MailScanner/MailScanner/ZMDiskStore.pm lib/MailScanner/MailScanner/ZMailer.pm lib/MailScanner/MailScanner/notes.txt -libexec/MailScanner/MailScanner +libexec/MailScanner/analyse_SpamAssassin_cache +libexec/MailScanner/clean.SA.cache +libexec/MailScanner/clean.quarantine +libexec/MailScanner/update_phishing_sites +libexec/MailScanner/update_phishing_sites.cron +libexec/MailScanner/update_virus_scanners +libexec/MailScanner/update_virus_scanners.cron libexec/MailScanner/antivir-autoupdate.sample libexec/MailScanner/antivir-wrapper.sample libexec/MailScanner/avg-autoupdate.sample @@ -92,9 +98,10 @@ libexec/MailScanner/symscanengine-autoupdate.sample libexec/MailScanner/symscanengine-wrapper.sample libexec/MailScanner/trend-autoupdate.sample libexec/MailScanner/trend-wrapper.sample -libexec/MailScanner/update_virus_scanners libexec/MailScanner/vexira-autoupdate.sample libexec/MailScanner/vexira-wrapper.sample +sbin/mailscanner +sbin/MailScanner %%DATADIR%%/reports/ca/rejection.report.txt.sample %%DATADIR%%/reports/ca/deleted.content.message.txt.sample %%DATADIR%%/reports/ca/deleted.filename.message.txt.sample @@ -461,6 +468,7 @@ libexec/MailScanner/vexira-wrapper.sample %%PORTDOCS%%%%DOCSDIR%%/Book.Dec04-Aug05.pdf %%PORTDOCS%%%%DOCSDIR%%/COPYING %%PORTDOCS%%%%DOCSDIR%%/ChangeLog +%%PORTDOCS%%%%DOCSDIR%%/CHANGES.port %%PORTDOCS%%%%DOCSDIR%%/FreeBSD.html %%PORTDOCS%%%%DOCSDIR%%/INSTALL %%PORTDOCS%%%%DOCSDIR%%/INSTALL.FreeBSD |