diff options
author | LukenShiro <lukenshiro@ngi.it> | 2010-05-11 22:55:02 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-11 22:55:02 +0200 |
commit | 5353c184c86aed67139de4eec525ae4e29724c50 (patch) | |
tree | 2e4b8db366f502641de12e387d1453d62ebdfd02 /network/spamassassin | |
parent | 514dcdf4e2f4e11c75ec9b78be869fa9999da133 (diff) |
network/spamassassin: Added to 12.1 repository
Diffstat (limited to 'network/spamassassin')
-rw-r--r-- | network/spamassassin/README | 16 | ||||
-rw-r--r-- | network/spamassassin/doinst.sh | 32 | ||||
-rw-r--r-- | network/spamassassin/slack-desc | 19 | ||||
-rw-r--r-- | network/spamassassin/spamassassin.SlackBuild | 118 | ||||
-rw-r--r-- | network/spamassassin/spamassassin.info | 8 |
5 files changed, 193 insertions, 0 deletions
diff --git a/network/spamassassin/README b/network/spamassassin/README new file mode 100644 index 0000000000000..f0558e3253799 --- /dev/null +++ b/network/spamassassin/README @@ -0,0 +1,16 @@ +spamassassin - perl e-mail filter to identify spam + +Spamassassin is an intelligent email filter which uses a diverse range +of tests to identify unsolicited bulk email, more commonly known as Spam. +These tests are applied to email headers and content to classify email using +advanced statistical methods. It has a modular architecture that allows +other technologies to be quickly wielded against spam and is designed for +easy integration into virtually any email system. + +spamassassin requires: +- for basic functions, perl-digest-sha1, perl-net-dns and perl-html-parser. +- for sa-compile (to compile regex into c code): re2c. +- for sa-update (to update spamassassin rules): libwww-perl. +All required packages are available from SlackBuilds.org. + +For advanced functions it may rely on other (optional) perl modules. diff --git a/network/spamassassin/doinst.sh b/network/spamassassin/doinst.sh new file mode 100644 index 0000000000000..470032e47d74d --- /dev/null +++ b/network/spamassassin/doinst.sh @@ -0,0 +1,32 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same permissions on rc.spamd.new as an existing rc.spamd: +if [ -e etc/rc.d/rc.spamd ]; then + cp -a etc/rc.d/rc.spamd etc/rc.d/rc.spamd.new.incoming + cat etc/rc.d/rc.spamd.new > etc/rc.d/rc.spamd.new.incoming + mv etc/rc.d/rc.spamd.new.incoming etc/rc.d/rc.spamd.new +else + # If rc.spamd does not exist, make the new one executable by default, + # which won't matter unless it's called from rc.local anyway + chmod 0755 etc/rc.d/rc.spamd.new +fi + +config etc/mail/spamassassin/init.pre.new +config etc/mail/spamassassin/local.cf.new +config etc/mail/spamassassin/v310.pre.new +config etc/mail/spamassassin/v312.pre.new +config etc/mail/spamassassin/v320.pre.new +config etc/rc.d/rc.spamd.new +config etc/spamassassin.conf.new + diff --git a/network/spamassassin/slack-desc b/network/spamassassin/slack-desc new file mode 100644 index 0000000000000..472bd54517f53 --- /dev/null +++ b/network/spamassassin/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------| +spamassassin: spamassassin (perl e-mail filter to identify spam) +spamassassin: +spamassassin: It is an intelligent email filter which uses a diverse range +spamassassin: of tests to identify unsolicited bulk email, more commonly +spamassassin: known as Spam. These tests are applied to email headers and +spamassassin: content to classify email using advanced statistical methods. +spamassassin: +spamassassin: Homepage: http://spamassassin.apache.org +spamassassin: +spamassassin: +spamassassin: diff --git a/network/spamassassin/spamassassin.SlackBuild b/network/spamassassin/spamassassin.SlackBuild new file mode 100644 index 0000000000000..d4def1edd1328 --- /dev/null +++ b/network/spamassassin/spamassassin.SlackBuild @@ -0,0 +1,118 @@ +#!/bin/sh + +# Slackware build script for spamassassin + +# Copyright 2008 LukenShiro <lukenshiro@ngi.it> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=spamassassin +VERSION=${VERSION:-3.2.5} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +SRC_PRGNAM=Mail-SpamAssassin +DOCFILES="Changes CREDITS INSTALL LICENSE NOTICE PACKAGING procmailrc.example \ +sample-nonspam.txt sample-spam.txt README TRADEMARK UPGRADE USAGE" + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRC_PRGNAM-$VERSION +tar xvf $CWD/$SRC_PRGNAM-$VERSION.tar.bz2 +cd $SRC_PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +echo "y" | perl Makefile.PL INSTALLDIRS=vendor + +CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" \ +make +make install DESTDIR=$PKG + +# Move man-pages to appropriate place +mv $PKG/usr/share/man $PKG/usr/ + +# Remove perlocal.pod, .packlist and .bs from $PKG +( for i in perllocal.pod .packlist *.bs; do + find $PKG -name "$i" -exec rm -rf {} \; + done +) + +# Remove empty directories +find $PKG -depth -type d -empty -exec rm -rf {} \; + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +# Compress man pages +( cd $PKG/usr/man || exit 1 + find . -type f -exec gzip -9 {} \; + for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +) + +# Preserve config files +( cd $PKG/etc/mail/spamassassin + mv init.pre init.pre.new + mv local.cf local.cf.new + mv v310.pre v310.pre.new + mv v312.pre v312.pre.new + mv v320.pre v320.pre.new +) + +# Copy init script to /etc/rc.d and modify it for name consistency +mkdir -p $PKG/etc/rc.d/ +install -m 0755 spamd/slackware-rc-script.sh $PKG/etc/rc.d/rc.spamd.new +sed -i "s#SNAME=rc.spamassassin#SNAME=rc.spamd#g" $PKG/etc/rc.d/rc.spamd.new + +# Create file for enabling rc.spamd's start +cat > $PKG/etc/spamassassin.conf.new << EOF +ENABLED=1 +EOF + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/spamassassin/spamassassin.info b/network/spamassassin/spamassassin.info new file mode 100644 index 0000000000000..5db5de641ab66 --- /dev/null +++ b/network/spamassassin/spamassassin.info @@ -0,0 +1,8 @@ +PRGNAM="spamassassin" +VERSION="3.2.5" +HOMEPAGE="http://spamassassin.apache.org/" +DOWNLOAD="http://mirror.tomato.it/apache/spamassassin/source/Mail-SpamAssassin-3.2.5.tar.bz2" +MD5SUM="695f9107b240383e48df8938f2de334e" +MAINTAINER="LukenShiro" +EMAIL="lukenshiro@ngi.it" +APPROVED="David Somero" |