From 5a5101affe4998a697023c900e23b6ca5321bd94 Mon Sep 17 00:00:00 2001 From: Edwin Groothuis Date: Sun, 6 Apr 2003 00:07:58 +0000 Subject: cyrus port should add periodic file to prune deliverdb The cyrus port takes no steps to insure the deliver databases are properly pruned. This can be quite easily accomplished on a daily basis by adding a periodic file to take care of this. This should be a model for other ports that require daily/weekly/monthly actions. Why else did we bother to break up the cron jobs into the /etc/periodic* structure? PR: ports/26801 Submitted by: Nick Sayer --- mail/cyrus/Makefile | 7 ++++++- mail/cyrus/files/600.cyrus | 21 +++++++++++++++++++++ mail/cyrus/pkg-plist | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 mail/cyrus/files/600.cyrus (limited to 'mail/cyrus') diff --git a/mail/cyrus/Makefile b/mail/cyrus/Makefile index 7c8af703f5b3..98fc580876ac 100644 --- a/mail/cyrus/Makefile +++ b/mail/cyrus/Makefile @@ -7,7 +7,7 @@ PORTNAME= cyrus PORTVERSION= 1.6.24 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail tcl82 MASTER_SITES= ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ \ ftp://ftp.hanse.de/sites/transit/mirror/ftp.andrew.cmu.edu/pub/cyrus-mail/ @@ -36,11 +36,16 @@ MAN8= arbitron.8 collectnews.8 cyrquota.8 deliver.8 fud.8 \ imapd.8 mbpath.8 pop3d.8 reconstruct.8 rmnews.8 syncnews.8 \ timsieved.8 +post-patch: + ${CP} ${FILESDIR}/600.cyrus ${WRKDIR} + ${REINPLACE_CMD} -e 's,LOCALBASE,${LOCALBASE},g' ${WRKDIR}/600.cyrus + post-configure: @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/imap/config.c ${WRKSRC}/imap/krbck.c pre-install: @ ${CP} ${WRKSRC}/man/quota.8 ${WRKSRC}/man/cyrquota.8 + @ ${CP} ${WRKDIR}/600.cyrus /etc/periodic/daily/600.cyrus DOCS= README acl-extension anoncvs bugs changes copyrights install \ mailing-list overview quota-extension server-design diff --git a/mail/cyrus/files/600.cyrus b/mail/cyrus/files/600.cyrus new file mode 100644 index 000000000000..98ad9e8e5ba7 --- /dev/null +++ b/mail/cyrus/files/600.cyrus @@ -0,0 +1,21 @@ +#!/bin/sh +# +# $Id$ +# +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +if [ -x LOCALBASE/cyrus/bin/deliver ] ; then + echo LOCALBASE/cyrus/bin/deliver -E 3 | su -m cyrus && rc=0 || rc=3 + rc=0 +else + echo "deliver isn't executable" + rc=2 +fi + +exit $rc diff --git a/mail/cyrus/pkg-plist b/mail/cyrus/pkg-plist index 8e6811ee164e..125dac0d7617 100644 --- a/mail/cyrus/pkg-plist +++ b/mail/cyrus/pkg-plist @@ -37,6 +37,7 @@ include/cyrus/sysexits.h include/cyrus/util.h include/cyrus/xmalloc.h lib/libcyrus.a +@unexec rm /etc/periodic/daily/600.cyrus @dirrm cyrus/bin @dirrm cyrus @dirrm include/cyrus -- cgit v1.2.3