aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/dspam
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-03-26 10:32:35 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-03-26 10:32:35 +0000
commitb001c87f5d08678d4e891f84d70a9fed78ecf258 (patch)
treee56b9f86eeee76e68d560e8f51c39f8fef096b5e /unmaintained/dspam
parent1df361816c6a1773d5648e22746e57b29d35eae8 (diff)
downloadaports-b001c87f5d08678d4e891f84d70a9fed78ecf258.tar.bz2
aports-b001c87f5d08678d4e891f84d70a9fed78ecf258.tar.xz
unmaintained/dspam: move from testing
does not look like anything happened upstream
Diffstat (limited to 'unmaintained/dspam')
-rw-r--r--unmaintained/dspam/APKBUILD86
-rw-r--r--unmaintained/dspam/dspam.initd46
-rw-r--r--unmaintained/dspam/dspam.logrotate6
-rw-r--r--unmaintained/dspam/dspam.pre-install7
-rw-r--r--unmaintained/dspam/musl-fixes.patch124
5 files changed, 269 insertions, 0 deletions
diff --git a/unmaintained/dspam/APKBUILD b/unmaintained/dspam/APKBUILD
new file mode 100644
index 0000000000..d1dcf146e7
--- /dev/null
+++ b/unmaintained/dspam/APKBUILD
@@ -0,0 +1,86 @@
+# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=dspam
+pkgver=3.10.2
+_ver=$pkgver
+pkgrel=6
+pkgdesc="A statistical-algorithmic hybrid anti-spam filter"
+url="http://dspam.nuclearelephant.com/"
+pkgusers="dspam"
+pkggroups="dspam"
+arch="all"
+license="GPL-2.0"
+depends=
+install="$pkgname.pre-install"
+makedepends="postgresql-dev sqlite-dev mariadb-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
+ dspam.logrotate
+ dspam.initd
+ musl-fixes.patch"
+
+
+builddir="$srcdir/$pkgname-$_ver"
+
+prepare() {
+ cd "$builddir"
+ update_config_guess || return 1
+ default_prepare || return 1
+ #aclocal -I m4 && libtoolize && autoconf && automake
+}
+
+build() {
+ cd "$builddir"
+ ./autogen.sh || return 1
+ ./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 \
+ || return 1
+ make -j1 || return 1
+}
+
+package() {
+ cd "$builddir"
+ 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="0e0e405d3284485b2a43f47eaf6b09bb dspam-3.10.2.tar.gz
+a798e9a6e2d5c30724f84d004bb96339 dspam.logrotate
+7d1fb0820f4a23f593f22186ef77d02a dspam.initd
+5e77c0fd2fe8b4bfbdb5d7927835d73a musl-fixes.patch"
+sha256sums="ae76569604021f35b741fb95198a1e611a8c64c3838661973a6cf360bba593a9 dspam-3.10.2.tar.gz
+dd5bce638b92936e02ff02faf781cbf903faac7b73c61c1c666eb06cfb56bfac dspam.logrotate
+8fb3ae6a04f59798bc919e6a967015733e28fe0d52e7cbc6e7aa0dbe110edf4d dspam.initd
+ecd01cd869c44507d22f4b4d4804cf2053d5679e7a6f5a71159fc80a91da53b9 musl-fixes.patch"
+sha512sums="5fe53e1d0d7cabb3983f5c67274b074b7c647c1bae10ebc7ea3805542f99dbfb39abd4697e344e6eb80554522319a1253e1082ed6b389364bbaec1d6ddd43856 dspam-3.10.2.tar.gz
+b0e288f36f0aa2be48c9917bcfca39148df2682cb6bea88192c46dfa6e33226613bf2b5d7b977f2948a43c6932837e186949a99dece34431fac6e9b678f00da5 dspam.logrotate
+59177cbb3a42ed4f003a643239433d990c36e7531b6bae5841ac19164548a9ad0054be3d0b0ca5540af05b9a901a8d9f0b2b965d9969fee6779b81ac35b19262 dspam.initd
+4c600cccd6601db6c738a940d6309ee621e98d678a000614f4d4927c10a80528c642a32ae5a453d35c2679debacb04af6ca60d1c569d72751acc44e75446245a musl-fixes.patch"
diff --git a/unmaintained/dspam/dspam.initd b/unmaintained/dspam/dspam.initd
new file mode 100644
index 0000000000..d91fefeb89
--- /dev/null
+++ b/unmaintained/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/unmaintained/dspam/dspam.logrotate b/unmaintained/dspam/dspam.logrotate
new file mode 100644
index 0000000000..1fb3e04ccb
--- /dev/null
+++ b/unmaintained/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/unmaintained/dspam/dspam.pre-install b/unmaintained/dspam/dspam.pre-install
new file mode 100644
index 0000000000..8cffce83a3
--- /dev/null
+++ b/unmaintained/dspam/dspam.pre-install
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+addgroup -S dspam 2>/dev/null
+adduser -S -D -h /var/lib/dspam -s /bin/false -G dspam -g dspam dspam 2>/dev/null
+chown dspam:dspam /var/lib/dspam
+
+exit 0
diff --git a/unmaintained/dspam/musl-fixes.patch b/unmaintained/dspam/musl-fixes.patch
new file mode 100644
index 0000000000..23c2adf3b8
--- /dev/null
+++ b/unmaintained/dspam/musl-fixes.patch
@@ -0,0 +1,124 @@
+--- a/src/libdspam.h.orig
++++ b/src/libdspam.h
+@@ -51,10 +51,10 @@
+ int libdspam_shutdown(void);
+
+ DSPAM_CTX * dspam_init (const char *username, const char *group,
+- const char *home, int operating_mode, u_int32_t flags);
++ const char *home, int operating_mode, uint32_t flags);
+
+ DSPAM_CTX * dspam_create (const char *username, const char *group,
+- const char *home, int operating_mode, u_int32_t flags);
++ const char *home, int operating_mode, uint32_t flags);
+
+ int dspam_attach (DSPAM_CTX *CTX, void *dbh);
+ int dspam_detach (DSPAM_CTX *CTX);
+--- a/src/libdspam_objects.h.orig
++++ b/src/libdspam_objects.h
+@@ -31,17 +31,17 @@
+ #include "config_shared.h"
+ #include "decode.h"
+
+-#if ((defined(__sun__) && defined(__svr4__)) || (defined(__sun) && defined(__SUNPRO_C))) && !defined(u_int32_t) && !defined(__BIT_TYPES_DEFINED__)
++#if ((defined(__sun__) && defined(__svr4__)) || (defined(__sun) && defined(__SUNPRO_C))) && !defined(uint32_t) && !defined(__BIT_TYPES_DEFINED__)
+ #define __BIT_TYPES_DEFINED__
+ typedef unsigned long long u_int64_t;
+-typedef unsigned int u_int32_t;
++typedef unsigned int uint32_t;
+ typedef unsigned short u_int16_t;
+ typedef unsigned char u_int8_t;
+ #endif
+
+ #ifdef _WIN32
+-typedef unsigned int u_int32_t;
+-typedef u_int32_t uid_t;
++typedef unsigned int uint32_t;
++typedef uint32_t uid_t;
+ #endif
+
+ extern void *_drv_handle; /* Handle to storage driver library */
+@@ -312,8 +312,8 @@
+ int source; /* DSS_ */
+ int learned; /* Did we actually learn something? */
+ int tokenizer; /* DSZ_ */
+- u_int32_t flags;
+- u_int32_t algorithms;
++ uint32_t flags;
++ uint32_t algorithms;
+
+ int result;
+ char class[32];
+--- a/src/tokenizer.c.orig
++++ b/src/tokenizer.c
+@@ -524,7 +524,7 @@
+ const char *heading, const char *bitpattern)
+ {
+ int i, t, keylen, breadth;
+- u_int32_t mask;
++ uint32_t mask;
+ unsigned long long crc;
+ char key[256];
+ int active = 0, top, tokenizer = CTX->tokenizer;
+@@ -550,7 +550,7 @@
+ breadth = _ds_pow2(active);
+
+ /* Iterate and generate all keys necessary */
+- for (mask=0; mask < (u_int32_t)breadth; mask++) {
++ for (mask=0; mask < (uint32_t)breadth; mask++) {
+ int terms = 0;
+
+ key[0] = 0;
+@@ -633,7 +633,7 @@
+ unsigned long long crc;
+ char key[256];
+ int active = 0;
+- u_int32_t mask;
++ uint32_t mask;
+
+ /* Shift all previous tokens up */
+ for(i=0;i<SPARSE_WINDOW_SIZE-1;i++) {
+@@ -650,7 +650,7 @@
+
+ /* Iterate and generate all keys necessary */
+
+- for(mask=0;mask < (u_int32_t)breadth;mask++) {
++ for(mask=0;mask < (uint32_t)breadth;mask++) {
+ int terms = 0;
+ t = 0;
+
+@@ -960,13 +960,13 @@
+
+ char *_ds_generate_bitpattern(int breadth) {
+ char *bitpattern;
+- u_int32_t mask;
++ uint32_t mask;
+ unsigned long exp;
+ int i;
+
+ bitpattern = malloc(SPARSE_WINDOW_SIZE * breadth);
+
+- for(mask=0;mask<(u_int32_t)breadth;mask++) {
++ for(mask=0;mask<(uint32_t)breadth;mask++) {
+ for(i=0;i<SPARSE_WINDOW_SIZE;i++) {
+ exp = (i) ? _ds_pow2(i) : 1;
+ /* Reverse pos = SPARSE_WINDOW_SIZE - (i+1); */
+--- a/src/libdspam.c.orig
++++ b/src/libdspam.c
+@@ -122,7 +122,7 @@
+ const char *group,
+ const char *home,
+ int operating_mode,
+- u_int32_t flags)
++ uint32_t flags)
+ {
+ DSPAM_CTX *CTX = dspam_create(username, group, home, operating_mode, flags);
+
+@@ -159,7 +159,7 @@
+ const char *group,
+ const char *home,
+ int operating_mode,
+- u_int32_t flags)
++ uint32_t flags)
+ {
+ DSPAM_CTX *CTX;
+