summaryrefslogtreecommitdiff
path: root/testing/spamassassin
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-08-18 00:02:28 +0000
committerroot <root@rshg054.dnsready.net>2012-08-18 00:02:28 +0000
commit948da5eabcbf8d74270e661d0730ba1c203913f5 (patch)
tree8536fd0b4622f9f6c77cb4716bf5c315c457038a /testing/spamassassin
parentbbf2c63849bdf1654e767058f277da2e983c5f0b (diff)
Sat Aug 18 00:02:28 UTC 2012
Diffstat (limited to 'testing/spamassassin')
-rw-r--r--testing/spamassassin/PKGBUILD60
-rw-r--r--testing/spamassassin/spamassassin.install11
-rw-r--r--testing/spamassassin/spamassassin.service14
-rw-r--r--testing/spamassassin/spamd55
-rw-r--r--testing/spamassassin/spamd.conf.d1
5 files changed, 141 insertions, 0 deletions
diff --git a/testing/spamassassin/PKGBUILD b/testing/spamassassin/PKGBUILD
new file mode 100644
index 000000000..a6b0dbb0b
--- /dev/null
+++ b/testing/spamassassin/PKGBUILD
@@ -0,0 +1,60 @@
+# $Id: PKGBUILD 165370 2012-08-16 16:16:07Z bluewind $
+# Maintainer: Dale Blount <dale@archlinux.org>
+# Contributor: Manolis Tzanidakis
+pkgname=spamassassin
+pkgver=3.3.2
+pkgrel=4
+pkgdesc="A mail filter to identify spam."
+arch=('i686' 'x86_64')
+license=('APACHE')
+url="http://spamassassin.apache.org"
+depends=('openssl' 'zlib' 're2c' 'perl-net-dns' 'perl-io-socket-ssl'
+ 'perl-libwww' 'perl-mail-spf' 'perl-http-message' 'perl-net-http'
+ 'perl-io-socket-inet6' 'perl-mail-dkim' 'perl-crypt-ssleay')
+makedepends=('razor' 'perl-dbi')
+optdepends=('razor: to identify collaborately-flagged spam')
+backup=('etc/conf.d/spamd'
+ 'etc/mail/spamassassin/local.cf'
+ 'etc/mail/spamassassin/init.pre'
+ 'etc/mail/spamassassin/v310.pre'
+ 'etc/mail/spamassassin/v312.pre'
+ 'etc/mail/spamassassin/v320.pre'
+ 'etc/mail/spamassassin/v330.pre')
+install="${pkgname}.install"
+options=('!emptydirs')
+source=("http://mirrors.devlib.org/apache/${pkgname}/source/Mail-SpamAssassin-${pkgver}.tar.gz"
+ 'spamd.conf.d' 'spamd' 'spamassassin.service')
+md5sums=('d1d62cc5c6eac57e88c4006d9633b81e'
+ 'af501c6b0bb937a2775b747cc4b6d150'
+ '57545e6877503d897db21e9a2e8bd2b9'
+ '1c39572b79bc20c822387814050ee5c1')
+
+build() {
+ cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
+
+ # install module in vendor directories.
+ PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor \
+ CONTACT_ADDRESS=root@localhost ENABLE_SSL=yes PERL_TAINT=no
+ make
+}
+
+check() {
+ cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
+
+ # SSLv2 is disabled by upstream so this test would fail
+ rm -rf t/spamd_ssl_v2.t
+
+ # parallel tests cause lots of failures; disable for now
+ #export HARNESS_OPTIONS="j$(echo $MAKEFLAGS | sed 's/.*-j\([0-9][0-9]*\).*/\1/')"
+
+ make test
+}
+
+package() {
+ cd "${srcdir}/Mail-SpamAssassin-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ install -D -m644 "${srcdir}/spamd.conf.d" "${pkgdir}/etc/conf.d/spamd"
+ install -D -m755 "${srcdir}/spamd" "${pkgdir}/etc/rc.d/spamd"
+ install -D -m644 "${srcdir}/spamassassin.service" "${pkgdir}/usr/lib/systemd/system/spamassassin.serivce"
+}
diff --git a/testing/spamassassin/spamassassin.install b/testing/spamassassin/spamassassin.install
new file mode 100644
index 000000000..fae0264b2
--- /dev/null
+++ b/testing/spamassassin/spamassassin.install
@@ -0,0 +1,11 @@
+post_install() {
+ echo "You must run 'sa-update' to install spam rules before use."
+}
+
+post_upgrade() {
+ # Compile rules, if rules have previously been compiled, and it's possible
+ if type re2c &>/dev/null && type sa-compile &>/dev/null && [[ -d /var/lib/spamassassin/compiled ]]
+ echo "Detected compiled rules, running sa-compile..."
+ sa-compile > /dev/null 2>&1
+fi
+}
diff --git a/testing/spamassassin/spamassassin.service b/testing/spamassassin/spamassassin.service
new file mode 100644
index 000000000..a74f6e644
--- /dev/null
+++ b/testing/spamassassin/spamassassin.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Spamassassin daemon
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/spamd.pid
+ExecStart=/usr/bin/vendor_perl/spamd --pidfile /var/run/spamd.pid -c
+StandardOutput=syslog
+StandardError=syslog
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/testing/spamassassin/spamd b/testing/spamassassin/spamd
new file mode 100644
index 000000000..3fb97566e
--- /dev/null
+++ b/testing/spamassassin/spamd
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# source application-specific settings
+[ -f /etc/conf.d/spamd ] && . /etc/conf.d/spamd
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PIDFILE=/var/run/spamd.pid
+if [ -f $PIDFILE ]; then
+ PID=$(cat $PIDFILE)
+else
+ PID=$(pidof -o %PPID /usr/bin/vendor_perl/spamd) #backward compat
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting spamd"
+ [ -z "$PID" ] && /usr/bin/vendor_perl/spamd -d -r "$PIDFILE" ${SPAMD_OPTS}
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon spamd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping spamd"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ # Some users report that a second attempt at stopping the process
+ # works. So, take a little nap and give it another whirl...
+ sleep 2
+ kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon spamd
+ stat_done
+ fi
+ else
+ rm_daemon spamd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
+# vim: ts=2 sw=2 et ft=sh
diff --git a/testing/spamassassin/spamd.conf.d b/testing/spamassassin/spamd.conf.d
new file mode 100644
index 000000000..4295e0073
--- /dev/null
+++ b/testing/spamassassin/spamd.conf.d
@@ -0,0 +1 @@
+SPAMD_OPTS="-c"