diff --git a/sa-update.cronscript b/sa-update.cronscript new file mode 100644 index 0000000..381147f --- /dev/null +++ b/sa-update.cronscript @@ -0,0 +1,7 @@ +#!/bin/bash + +sleep $(expr $RANDOM % 7200) +echo SpamAssassin rule update begins at `date` +/usr/bin/sa-update +/etc/init.d/spamassassin condrestart +echo diff --git a/sa-update.crontab b/sa-update.crontab new file mode 100644 index 0000000..371481f --- /dev/null +++ b/sa-update.crontab @@ -0,0 +1,9 @@ +### OPTIONAL: Spamassassin Rules Updates ### +# +# http://wiki.apache.org/spamassassin/RuleUpdates +# Highly recommended that you read the documentation before using this. +# ENABLE UPDATES AT YOUR OWN RISK. +# +# /var/log/sa-update.log contains a history log of sa-update runs + +#10 4 * * * root /usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log diff --git a/sa-update.logrotate b/sa-update.logrotate new file mode 100644 index 0000000..ef807a3 --- /dev/null +++ b/sa-update.logrotate @@ -0,0 +1,5 @@ +/var/log/sa-update.log { + monthly + notifyempty + missingok +} diff --git a/spamassassin.spec b/spamassassin.spec index afa24ef..0d2f226 100644 --- a/spamassassin.spec +++ b/spamassassin.spec @@ -6,7 +6,7 @@ Summary: Spam filter for email which can be invoked from mail delivery agents. Name: spamassassin Version: 3.1.7 -Release: 2%{?dist} +Release: 3%{?dist} License: Apache License Group: Applications/Internet URL: http://spamassassin.apache.org/ @@ -15,6 +15,9 @@ Source2: redhat_local.cf Source3: spamassassin-default.rc Source4: spamassassin-spamc.rc Source5: spamassassin.sysconfig +Source6: sa-update.logrotate +Source7: sa-update.crontab +Source8: sa-update.cronscript Source10: spamassassin-helper.sh # Patches 0-99 are RH specific # none yet @@ -88,12 +91,17 @@ install -m 0755 spamd/redhat-rc-script.sh %buildroot/%{_initrddir}/spamassassin mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.d install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/mail/spamassassin/local.cf install -m644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/spamassassin install -m 0644 %{SOURCE3} %buildroot/etc/mail/spamassassin install -m 0644 %{SOURCE4} %buildroot/etc/mail/spamassassin install -m 0755 %{SOURCE10} %buildroot/etc/mail/spamassassin +install -m 0644 %{SOURCE6} %buildroot/etc/logrotate.d/sa-update +install -m 0600 %{SOURCE7} %buildroot/etc/cron.d/sa-update +install -m 0744 %{SOURCE8} %buildroot%{_datadir}/spamassassin/sa-update.cron [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress @@ -124,6 +132,8 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/spamassassin %dir %{_datadir}/spamassassin %dir %{_localstatedir}/run/spamassassin %dir %{_localstatedir}/lib/spamassassin +%{_sysconfdir}/cron.d/sa-update +%{_sysconfdir}/logrotate.d/spamassassin %clean rm -rf $RPM_BUILD_ROOT @@ -162,6 +172,9 @@ fi exit 0 %changelog +* Thu Dec 14 2006 Warren Togami - 3.1.7-3 +- add standardized sa-update cron script, disabled by default + * Thu Dec 14 2006 Warren Togami - 3.1.7-2 - own directory /var/lib/spamassassin