diff options
author | Bartłomiej Piotrowski | 2018-01-05 17:23:22 +0100 |
---|---|---|
committer | Bartłomiej Piotrowski | 2018-01-05 17:23:22 +0100 |
commit | 399afaff82b650c0dc16010debb39f09ace8c6b3 (patch) | |
tree | 770ef07f94c7eb1b5d61d36fd17c79e1fcb4fae9 | |
download | aur-dspam.tar.gz |
Import from official repositories
-rw-r--r-- | .SRCINFO | 45 | ||||
-rw-r--r-- | PKGBUILD | 91 | ||||
-rw-r--r-- | dspam.install | 38 | ||||
-rw-r--r-- | dspam.logrotated | 10 | ||||
-rw-r--r-- | dspam.service | 11 | ||||
-rw-r--r-- | dspam.tmpfiles | 1 | ||||
-rw-r--r-- | dspam_maintenance.cron | 6 |
7 files changed, 202 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b734813de73a --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,45 @@ +pkgbase = dspam + pkgdesc = A scalable, open-source statistical anti-spam filter + pkgver = 3.10.2 + pkgrel = 15 + url = http://nuclearelephant.com/ + install = dspam.install + arch = x86_64 + license = GPL + makedepends = libmariadbclient + makedepends = postgresql-libs + makedepends = db + makedepends = sqlite + makedepends = libldap + depends = readline + depends = libcap + depends = ncurses + depends = zlib + depends = openssl + optdepends = libmariadbclient: MariaDB support + optdepends = postgresql-libs: PostgreSQL support + optdepends = db: BerkeleyDB support + optdepends = sqlite: SQLite support + optdepends = clamav: ClamAV support + optdepends = libldap: external lookup support + options = zipman + options = docs + backup = etc/dspam/dspam.conf + backup = srv/http/dspam/cgi-bin/admins + backup = srv/http/dspam/cgi-bin/subadmins + source = http://downloads.sourceforge.net/project/dspam/dspam/dspam-3.10.2/dspam-3.10.2.tar.gz + source = http://downloads.sourceforge.net/project/dspam/dspam/dspam-3.10.2/dspam-3.10.2.tar.gz.asc + source = dspam.logrotated + source = dspam.service + source = dspam.tmpfiles + source = dspam_maintenance.cron + validpgpkeys = C26F374F5E13157B5B427A1B93DF319D7D54EFF5 + sha256sums = ae76569604021f35b741fb95198a1e611a8c64c3838661973a6cf360bba593a9 + sha256sums = SKIP + sha256sums = 4177ff6d65011ff72d22389d7af4a13feaad034d3d68d9fafb7f5dc2518952de + sha256sums = d1088a4ba9e7c4ee17915b9955a20af826a3d6ccd75d92873510e51a00394bc8 + sha256sums = 7b7e44e081e6accb909b9af3663f416b7dbe030c1326355737f3150021a82bf4 + sha256sums = 054297d274acb3622653bb1ddf0af92721d8cdd7521ba31ecca7491004879ebb + +pkgname = dspam + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b7ca259ea43b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,91 @@ +# $Id: PKGBUILD 266875 2017-11-15 14:29:11Z foutrelis $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: William Rea <sillywilly@gmail.com> + +pkgname=dspam +pkgver=3.10.2 +pkgrel=15 +pkgdesc="A scalable, open-source statistical anti-spam filter" +arch=('x86_64') +url="http://nuclearelephant.com/" +backup=('etc/dspam/dspam.conf' + 'srv/http/dspam/cgi-bin/admins' + 'srv/http/dspam/cgi-bin/subadmins') +license=("GPL") +depends=(readline libcap ncurses zlib openssl) +makedepends=('libmariadbclient' 'postgresql-libs' 'db' 'sqlite' 'libldap') +optdepends=('libmariadbclient: MariaDB support' + 'postgresql-libs: PostgreSQL support' + 'db: BerkeleyDB support' + 'sqlite: SQLite support' + 'clamav: ClamAV support' + 'libldap: external lookup support') +options=('zipman' 'docs') +install=$pkgname.install +validpgpkeys=('C26F374F5E13157B5B427A1B93DF319D7D54EFF5') +source=(http://downloads.sourceforge.net/project/dspam/dspam/dspam-$pkgver/dspam-$pkgver.tar.gz{,.asc} + dspam.logrotated + dspam.service + dspam.tmpfiles + dspam_maintenance.cron) +sha256sums=('ae76569604021f35b741fb95198a1e611a8c64c3838661973a6cf360bba593a9' + 'SKIP' + '4177ff6d65011ff72d22389d7af4a13feaad034d3d68d9fafb7f5dc2518952de' + 'd1088a4ba9e7c4ee17915b9955a20af826a3d6ccd75d92873510e51a00394bc8' + '7b7e44e081e6accb909b9af3663f416b7dbe030c1326355737f3150021a82bf4' + '054297d274acb3622653bb1ddf0af92721d8cdd7521ba31ecca7491004879ebb') + +build() { + OPTS="--with-dspam-owner=dspam --with-dspam-group=dspam --with-dspam-home-group=dspam --with-dspam-mode=2510 \ + --enable-daemon --enable-virtual-users --enable-large-scale --enable-long-usernames --enable-external-lookup \ + --enable-split-configuration --enable-syslog --enable-clamav \ + --with-dspam-home=/var/lib/dspam --with-logdir=/var/log/dspam --with-logfile=/var/log/dspam/dspam.log \ + --with-mysql-includes=/usr/include/mysql --with-mysql-libraries=/usr/lib \ + --with-storage-driver="hash_drv,mysql_drv,libdb4_drv,pgsql_drv,sqlite3_drv" --enable-preferences-extension" + + export CFLAGS="-O2" + unset LDFLAGS + + cd "$srcdir"/$pkgname-$pkgver + ./configure --prefix=/usr --sysconfdir=/etc/dspam --localstatedir=/var ${OPTS} + make +} + +package() { + cd "$srcdir"/$pkgname-$pkgver + make DESTDIR="$pkgdir" install + + mkdir -p "$pkgdir"/srv/http/dspam + cp -a webui/* "$pkgdir"/srv/http/dspam/ + find "$pkgdir"/srv/http/dspam/ -type f -name 'Makefile*' -exec rm -f {} \; + find "$pkgdir"/srv/http/dspam/ -type f -name '*.in' -exec rm -f {} \; + + install -d "$pkgdir"/etc/logrotate.d \ + "$pkgdir"/usr/share/dspam/{mysql,pgsql} + install -m644 ../dspam.logrotated "$pkgdir"/etc/logrotate.d/dspam + + sed -i 's|#ServerPID|ServerPID|' "$pkgdir"/etc/dspam/dspam.conf + + sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/run/dspam/dspam.sock\":gI' \ + -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/run/dspam/dspam.pid:gI' \ + -i "$pkgdir"/etc/dspam/dspam.conf + + sed -i 's|/var/lib/mysql/mysql.sock|/run/mysqld/mysqld.sock|' "$pkgdir"/etc/dspam/dspam.conf + + cp -r src/tools.mysql_drv/*.sql "$pkgdir"/usr/share/dspam/mysql + cp -r src/tools.pgsql_drv/*.sql "$pkgdir"/usr/share/dspam/pgsql + + # install dspam_maintenance from contrib/ + install -Dm0755 contrib/dspam_maintenance/dspam_maintenance.sh "$pkgdir"/usr/bin/dspam_maintenance + install -Dm0644 contrib/dspam_maintenance/dspam_maintenance.1 "$pkgdir"/usr/share/man/man1/dspam_maintenance.1 + install -Dm0755 "$srcdir"/dspam_maintenance.cron "$pkgdir"/etc/cron.daily/dspam_maintenance + + cd "$pkgdir"/usr/share/man/man3 + find -type l -exec ln -sf libdspam.3 {} \; + + # make logrotate happy + chmod 750 "$pkgdir"/var/log/dspam + + install -Dm0644 "$srcdir"/$pkgname.service "$pkgdir"/usr/lib/systemd/system/$pkgname.service + install -Dm0644 "$srcdir"/$pkgname.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/$pkgname.conf +} diff --git a/dspam.install b/dspam.install new file mode 100644 index 000000000000..1d1125a759e7 --- /dev/null +++ b/dspam.install @@ -0,0 +1,38 @@ +post_install() { + echo -n "adding dspam system group... " + groupadd -r dspam && echo "done." + echo -n "adding dspam system user... " + useradd -r -c "DSPAM Daemon" -d /var/lib/dspam -g dspam -s /bin/false dspam \ + && echo "done." + passwd -l dspam &>/dev/null + chown root:dspam usr/bin/dspam{,c} + chown -R root:dspam etc/dspam + chmod g+rs usr/bin/dspam{,c} + +cat << EOF +>>> To populate the DSPAM database, you need to follow several steps. +>>> First create a database. Login to the mysql command prompt. + $ mysql -u root -p + mysql> CREATE database dspam; +>>> Next, you need to create a dspam user. At the same MySQL prompt: + mysql> GRANT ALL PRIVILEGES ON dspam.* TO dspam@'localhost' IDENTIFIED BY 'passwd'; +>>> Replacing passwd with your chosen password. +>>> Create dspam database: + $ mysql -u dspam dspam -p < /usr/share/dspam/mysql/mysql_objects-4.1.sql +>>> Create virtual user table: + $ mysql -u dspam dspam -p < /usr/share/dspam/mysql/virtual_users.sql +>>> Enter the password you set in the previous step, and the database should be populated. + +>>> Remember to edit /etc/dspam/dspam.conf accordingly +>>> If you want to use the postgresql, sqlite3 or Berekely DB4 backends, +>>> read the documentation +>>> +EOF +} + +post_upgrade() { + chown root:dspam usr/bin/dspam{,c} + chown -R root:dspam etc/dspam + chown dspam:dspam var/l{og,ib}/dspam + chmod g+s usr/bin/dspamc +} diff --git a/dspam.logrotated b/dspam.logrotated new file mode 100644 index 000000000000..c73b1dcb31df --- /dev/null +++ b/dspam.logrotated @@ -0,0 +1,10 @@ +/var/log/dspam/sql.errors +/var/lib/dspam/system.log +/var/log/dspam/dspam.debug +/var/log/dspam/dspam.messages +/var/log/dspam/dspam.log { + weekly + compress + missingok + copytruncate +} diff --git a/dspam.service b/dspam.service new file mode 100644 index 000000000000..1a5b1e710d74 --- /dev/null +++ b/dspam.service @@ -0,0 +1,11 @@ +[Unit] +Description=A highly accurate statistical spam filter that uses minimal resources + +[Service] +Type=forking +User=dspam +ExecStart=/usr/bin/dspam --daemon 2>/dev/null +PrivateTmp=true + +[Install] +WantedBy=multi-user.target
\ No newline at end of file diff --git a/dspam.tmpfiles b/dspam.tmpfiles new file mode 100644 index 000000000000..9f591096917d --- /dev/null +++ b/dspam.tmpfiles @@ -0,0 +1 @@ +d /var/run/dspam 0770 dspam mail - diff --git a/dspam_maintenance.cron b/dspam_maintenance.cron new file mode 100644 index 000000000000..940d8aed1fd1 --- /dev/null +++ b/dspam_maintenance.cron @@ -0,0 +1,6 @@ +#!/bin/sh + +# DSPAM maintenance tasks +# check "man 1 dspam_maintenance" for more options + +/usr/bin/dspam_maintenance --verbose --purgescriptdir=/usr/share/dspam 1> /dev/null |