summaryrefslogtreecommitdiffstats
path: root/testing/dspam
diff options
context:
space:
mode:
Diffstat (limited to 'testing/dspam')
-rw-r--r--testing/dspam/0001-Support-for-parallell-builds.patch77
-rw-r--r--testing/dspam/APKBUILD78
-rw-r--r--testing/dspam/dspam.initd46
-rw-r--r--testing/dspam/dspam.logrotate6
-rw-r--r--testing/dspam/dspam.pre-install6
5 files changed, 213 insertions, 0 deletions
diff --git a/testing/dspam/0001-Support-for-parallell-builds.patch b/testing/dspam/0001-Support-for-parallell-builds.patch
new file mode 100644
index 00000000..7044d5f6
--- /dev/null
+++ b/testing/dspam/0001-Support-for-parallell-builds.patch
@@ -0,0 +1,77 @@
+From 80f81670323a09025ffb7d030be56e47aec5492c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 6 Jan 2010 12:34:15 +0000
+Subject: [PATCH] Support for parallell builds
+
+---
+ src/Makefile.am | 12 +++++++-----
+ 1 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6e8a774..49d6b16 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -134,7 +134,7 @@ libmysql_drv_la_LIBADD = $(libmysql_drv_libs) -L. -ldspam
+ libmysql_drv_la_CPPFLAGS = $(libmysql_drv_cppflags)
+ libmysql_drv_la_LDFLAGS = $(libmysql_drv_ldflags)
+ libmysql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
+-libmysql_drv_la_DEPENDENCIES =
++libmysql_drv_la_DEPENDENCIES = libdspam.la
+
+ libpgsql_drv_la_SOURCES = \
+ pgsql_drv.c pgsql_drv.h
+@@ -142,7 +142,7 @@ libpgsql_drv_la_LIBADD = $(libpgsql_drv_libs) -L. -ldspam
+ libpgsql_drv_la_CPPFLAGS = $(libpgsql_drv_cppflags)
+ libpgsql_drv_la_LDFLAGS = $(libpgsql_drv_ldflags)
+ libpgsql_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
+-libpgsql_drv_la_DEPENDENCIES =
++libpgsql_drv_la_DEPENDENCIES = libdspam.la
+
+ libsqlite_drv_la_SOURCES = \
+ sqlite_drv.c sqlite_drv.h
+@@ -150,7 +150,7 @@ libsqlite_drv_la_LIBADD = $(libsqlite_drv_libs) -L. -ldspam
+ libsqlite_drv_la_CPPFLAGS = $(libsqlite_drv_cppflags)
+ libsqlite_drv_la_LDFLAGS = $(libsqlite_drv_ldflags)
+ libsqlite_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
+-libsqlite_drv_la_DEPENDENCIES =
++libsqlite_drv_la_DEPENDENCIES = libdspam.la
+
+ libsqlite3_drv_la_SOURCES = \
+ sqlite3_drv.c sqlite3_drv.h
+@@ -158,7 +158,7 @@ libsqlite3_drv_la_LIBADD = $(libsqlite3_drv_libs) -L. -ldspam
+ libsqlite3_drv_la_CPPFLAGS = $(libsqlite3_drv_cppflags)
+ libsqlite3_drv_la_LDFLAGS = $(libsqlite3_drv_ldflags)
+ libsqlite3_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
+-libsqlite3_drv_la_DEPENDENCIES =
++libsqlite3_drv_la_DEPENDENCIES = libdspam.la
+
+ libhash_drv_la_SOURCES = \
+ hash_drv.c hash_drv.h
+@@ -166,7 +166,7 @@ libhash_drv_la_LIBADD = $(libhash_drv_libs) -L. -ldspam
+ libhash_drv_la_CPPFLAGS = $(libhash_drv_cppflags)
+ libhash_drv_la_LDFLAGS = $(libhash_drv_ldflags)
+ libhash_drv_la_LDFLAGS += -rpath '$(pkglibdir)' -version-info $(libversion)
+-libhash_drv_la_DEPENDENCIES =
++libhash_drv_la_DEPENDENCIES = libdspam.la
+
+ endif
+
+@@ -181,6 +181,7 @@ dspam_SOURCES = \
+ agent_shared.c agent_shared.h
+
+ dspam_LDADD = -lm pref.o libdspam.la
++dspam_DEPENDENCIES = pref.o libdspam.la
+
+ dspamc_SOURCES = \
+ config.h language.h \
+@@ -192,6 +193,7 @@ dspamc_SOURCES = \
+
+ dspamc_LDADD = -lm buffer.o config_shared.o error.o read_config.o pref.o nodetree.o util.o $(NETLIBS)
+ dspamc_LDFLAGS =
++dspamc_DEPENDENCIES = buffer.o config_shared.o error.o read_config.o pref.o nodetree.o util.o
+
+ # Failing of chgrp is expected and normal case when someone do
+ # make install DESTDIR=...
+--
+1.6.6
+
diff --git a/testing/dspam/APKBUILD b/testing/dspam/APKBUILD
new file mode 100644
index 00000000..1d049cfb
--- /dev/null
+++ b/testing/dspam/APKBUILD
@@ -0,0 +1,78 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=dspam
+pkgver=3.9.0_rc2
+_ver=3.9.0-RC2
+pkgrel=0
+pkgdesc="A statistical-algorithmic hybrid anti-spam filter"
+url="http://dspam.nuclearelephant.com/"
+pkgusers="dspam"
+pkggroups="dspam"
+license="GPL-2"
+depends=
+install="$pkgname.pre-install"
+makedepends="postgresql-dev sqlite-dev mysql-dev autoconf automake libtool"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-pgsql $pkgname-mysql
+ $pkgname-sqlite"
+
+install= #dspam.install
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$_ver.tar.gz
+ 0001-Support-for-parallell-builds.patch
+ dspam.logrotate
+ dspam.initd"
+
+
+prepare() {
+ cd "$srcdir"/$pkgname-$_ver
+ for i in "$srcdir"/*.patch; do
+ [ -f "$i" ] || continue
+ msg "Applying $i"
+ patch -p1 -i "$i" || return 1
+ done
+ aclocal -I m4 && libtoolize && autoconf && automake
+}
+
+build() {
+ cd "$srcdir"/$pkgname-$_ver
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc/dspam \
+ --with-dspam-home=/var/lib/dspam \
+ --enable-virtual-users \
+ --enable-preferences-extension \
+ --enable-daemon \
+ --with-storage-driver="hash_drv,sqlite3_drv,pgsql_drv,mysql_drv" \
+ --with-mysql-includes=/usr/include/mysql \
+ --with-mysql-libraries=/usr/lib/mysql \
+ || return 1
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$_ver
+ make install DESTDIR="$pkgdir"
+ install -Dm755 "$srcdir"/dspam.initd "$pkgdir"/etc/init.d/dspam
+ install -Dm644 "$srcdir"/dspam.logrotate "$pkgdir"/etc/logrotate.d/dspam
+
+}
+
+pgsql() {
+ pkgdesc="dspam postgresql driver"
+ install -d "$subpkgdir"/usr/lib/dspam
+ mv "$pkgdir"/usr/lib/dspam/*pgsql* "$subpkgdir"/usr/lib/dspam/
+}
+
+mysql() {
+ pkgdesc="dspam mysql driver"
+ install -d "$subpkgdir"/usr/lib/dspam
+ mv "$pkgdir"/usr/lib/dspam/*mysql* "$subpkgdir"/usr/lib/dspam/
+}
+
+sqlite() {
+ pkgdesc="dspam sqlite driver"
+ install -d "$subpkgdir"/usr/lib/dspam
+ mv "$pkgdir"/usr/lib/dspam/*sqlite* "$subpkgdir"/usr/lib/dspam/
+}
+
+md5sums="013dc6700f7c5a757b7a656626b36248 dspam-3.9.0-RC2.tar.gz
+0f9f6b32cab7b8e3ad342daad119535d 0001-Support-for-parallell-builds.patch
+a798e9a6e2d5c30724f84d004bb96339 dspam.logrotate
+7d1fb0820f4a23f593f22186ef77d02a dspam.initd"
diff --git a/testing/dspam/dspam.initd b/testing/dspam/dspam.initd
new file mode 100644
index 00000000..d91fefeb
--- /dev/null
+++ b/testing/dspam/dspam.initd
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/files/dspam.rc,v 1.1 2005/03/21 00:10:30 st_lim Exp $
+
+conf=/etc/dspam/dspam.conf
+
+depend() {
+ use logger
+ need net
+ before mta
+ after pg_autovacuum postgresql mysql
+}
+
+checkconfig() {
+ if [ ! -f "$conf" ]
+ then
+ eerror "You need a DSPAM configuration in $conf"
+ return 1
+ fi
+ if (! grep -q "^ServerPID" $conf); then
+ eerror "ServerPID missing in DSPAM configuration $conf"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting DSPAM"
+ start-stop-daemon --start --quiet --background \
+ --exec /usr/bin/dspam -- --daemon
+ eend ${?}
+}
+
+stop() {
+ checkconfig || return 1
+
+ local DSPAM_PID="$(grep "^ServerPID" $conf)"
+ DSPAM_PID="${DSPAM_PID/ServerPID/}"
+
+ ebegin "Stopping DSPAM"
+ start-stop-daemon --stop --quiet --pidfile ${DSPAM_PID}
+ eend ${?}
+}
+
diff --git a/testing/dspam/dspam.logrotate b/testing/dspam/dspam.logrotate
new file mode 100644
index 00000000..1fb3e04c
--- /dev/null
+++ b/testing/dspam/dspam.logrotate
@@ -0,0 +1,6 @@
+/var/log/dspam/sql.errors /var/log/dspam/dspam.log /var/log/dspam/dspam.debug /var/log/dspam/dspam.messages {
+ weekly
+ compress
+ missingok
+ copytruncate
+}
diff --git a/testing/dspam/dspam.pre-install b/testing/dspam/dspam.pre-install
new file mode 100644
index 00000000..9a6cc6f1
--- /dev/null
+++ b/testing/dspam/dspam.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+adduser -h /var/lib/dspam -s /bin/false -D dspam 2>/dev/null
+chown dspam:dspam /var/lib/dspam
+exit 0
+