Fixed bugs 68630 68559 67423
authorLim Swee Tat <st_lim@gentoo.org>
Sun, 24 Oct 2004 15:08:56 +0000 (15:08 +0000)
committerLim Swee Tat <st_lim@gentoo.org>
Sun, 24 Oct 2004 15:08:56 +0000 (15:08 +0000)
mail-filter/dspam/ChangeLog
mail-filter/dspam/Manifest
mail-filter/dspam/dspam-3.0.0.ebuild
mail-filter/dspam/dspam-3.1.0.ebuild
mail-filter/dspam/dspam-3.1.1.ebuild
mail-filter/dspam/dspam-3.1.2.ebuild
mail-filter/dspam/dspam-3.2.0.ebuild [new file with mode: 0644]
mail-filter/dspam/dspam-3.2_beta1.ebuild
mail-filter/dspam/dspam-3.2_rc3.ebuild
mail-filter/dspam/files/digest-dspam-3.2.0 [new file with mode: 0644]

index cb87903e7f6abfcf4d12252460a4992a65d2bdcd..28522419915f9ce2d5a2516a0d34b118ba4b32ff 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for mail-filter/dspam
 # Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/ChangeLog,v 1.19 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/ChangeLog,v 1.20 2004/10/24 15:08:56 st_lim Exp $
+
+*dspam-3.2_rc3 (24 Oct 2004)
+
+  24 Oct 2004; Lim Swee Tat <st_lim@gentoo.org> dspam-3.0.0.ebuild,
+  dspam-3.1.0.ebuild, dspam-3.1.1.ebuild, dspam-3.1.2.ebuild,
+  dspam-3.2_beta1.ebuild, dspam-3.2_rc3.ebuild:
+  Fixed user permissions on the data directory, and provided correct instructions for train.pl
 
   17 Oct 2004; Lim Swee Tat <st_lim@gentoo.org> dspam-3.0.0.ebuild,
   dspam-3.1.0.ebuild, dspam-3.1.1.ebuild, dspam-3.1.2.ebuild,
index c2b229dd0cbe077af66c7313eb4c4e4619add270..78c58fb7354e32a4fb835f01c4e6d3d20a00cf7b 100644 (file)
@@ -1,10 +1,11 @@
-MD5 0c38d474dec414a775494e1fa0cbc967 ChangeLog 4133
-MD5 a2941e5706cbc789bc7db8c00164d708 dspam-3.0.0.ebuild 7028
-MD5 916de18bcb5c5fc1072957f382d67c78 dspam-3.1.0.ebuild 9416
-MD5 ac15770c787d7056ba9877d98c7bf98a dspam-3.1.1.ebuild 15431
-MD5 92f8323ff38fcb18e3cc1b3168490577 dspam-3.1.2.ebuild 15431
-MD5 00dce308bc1c012375d06546a906cd89 dspam-3.2_beta1.ebuild 15434
-MD5 a75a74ad82a78f8f6ed5a6983dfb4c99 dspam-3.2_rc3.ebuild 15740
+MD5 af62485d0755dc66523b4fb9506ca798 ChangeLog 4437
+MD5 818341ff579ee7d21ed37a42b91cb945 dspam-3.0.0.ebuild 7029
+MD5 8c2a3c84e374995428805968828b728c dspam-3.1.0.ebuild 9416
+MD5 08d93cfcdf4a026cf3d601c983b4dda7 dspam-3.1.1.ebuild 15437
+MD5 c4aada851b1ac0ae8e9a68cae991a062 dspam-3.1.2.ebuild 15437
+MD5 9d8b890d744a6377e24cb99a56868e8d dspam-3.2.0.ebuild 15716
+MD5 2110aa1bd6e825d66915921312870092 dspam-3.2_beta1.ebuild 15440
+MD5 1ec21263446b31fa4eaa197d48748a60 dspam-3.2_rc3.ebuild 15746
 MD5 dbfbe5a3bbe3347938107f5f5bd2197e metadata.xml 308
 MD5 c12a54112c6fec3530a7b1a368d04ac8 files/README.postfix 309
 MD5 e0469b961385fda4305602dc2519d319 files/README.qmail 2317
@@ -24,5 +25,6 @@ MD5 2cd345708a9889a04c472a9e5be7400e files/untrusted.mailer_args 24
 MD5 8b68501138fbe92e10bbd93a03c9f2ab files/upgrade.sql 807
 MD5 05dce5dc8cf516655657aa2a4cc5f1da files/digest-dspam-3.0.0 63
 MD5 7f1185a1a89bc7c74aafba93afc2b0cf files/digest-dspam-3.1.0 63
+MD5 4b7bb6bbede742676e3e7017210104c5 files/digest-dspam-3.2.0 63
 MD5 1abffcec9dd1aad2db3d68918b4aec05 files/digest-dspam-3.1.1 63
 MD5 a8c089a75fb1ee3c2b4f32ffc04c638e files/digest-dspam-3.1.2 63
index 8653dd841a3357ffbaada0c9be63133c8ddf7d84..2ebcf25dd9423e9950d66cf93c77e65189ccd87a 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.0.0.ebuild,v 1.9 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.0.0.ebuild,v 1.10 2004/10/24 15:08:56 st_lim Exp $
 
 inherit eutils
 
@@ -100,7 +100,7 @@ src_install () {
        keepdir ${HOMEDIR}
 
        # keeps dspam data in /var
-       diropts -m0770 -o dspam -g dspam
+       diropts -m0775 -o dspam -g dspam
        dodir ${DATADIR}
        keepdir ${DATADIR}
 
@@ -122,7 +122,7 @@ src_install () {
 
        # install some initial configuration
        insinto ${HOMEDIR}
-       insopts -m0640 -o dspam -g dspam
+       insopts -m0664 -o dspam -g dspam
        doins ${FILESDIR}/trusted.users
        if use cyrus; then
                echo "/usr/lib/cyrus/deliver %u" > ${T}/untrusted.mailer_args
index 8c0ea77d36058748236afd5954d85245b70eb175..a9fd93ec2b10f4ca5e466cdd8bb0df0ba3f1b86a 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.1.0.ebuild,v 1.5 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.1.0.ebuild,v 1.6 2004/10/24 15:08:56 st_lim Exp $
 
 inherit eutils
 
@@ -125,7 +125,7 @@ src_install () {
        keepdir ${HOMEDIR}
 
        # keeps dspam data in /var
-       diropts -m0770 -o dspam -g dspam
+       diropts -m0775 -o dspam -g dspam
        dodir ${DATADIR}
        keepdir ${DATADIR}
 
@@ -147,7 +147,7 @@ src_install () {
 
        # install some initial configuration
        insinto ${HOMEDIR}
-       insopts -m0640 -o dspam -g dspam
+       insopts -m0664 -o dspam -g dspam
        [ -f ${HOMEDIR}/trusted.users ] || doins ${FILESDIR}/trusted.users
        if use cyrus; then
                echo "/usr/lib/cyrus/deliver %u" > ${T}/untrusted.mailer_args
index 399e74ff492549f5c903825158e37f612e2df4fb..5e9b781e06ad5616228d42a0437be92fc73255d5 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.1.1.ebuild,v 1.7 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.1.1.ebuild,v 1.8 2004/10/24 15:08:56 st_lim Exp $
 
 inherit eutils
 
@@ -148,7 +148,7 @@ src_install () {
        keepdir ${HOMEDIR}
 
        # keeps dspam data in /var
-       diropts -m0770 -o dspam -g dspam
+       diropts -m0775 -o dspam -g dspam
        dodir ${DATADIR}
        keepdir ${DATADIR}
 
@@ -194,7 +194,7 @@ src_install () {
 
        # install some initial configuration
        insinto ${HOMEDIR}
-       insopts -m0640 -o dspam -g dspam
+       insopts -m0664 -o dspam -g dspam
        [ ! -f ${HOMEDIR}/trusted.users ] && doins ${FILESDIR}/trusted.users
        doins ${T}/untrusted.mailer_args
        doins ${T}/default.prefs
@@ -404,10 +404,10 @@ pkg_config () {
        einfo "  wget http://www.nuclearelephant.com/projects/dspam/SA-Corpus.tar.gz"
        einfo "  tar zxvf SA-Corpus.tar.gz"
        einfo "  cd ./SA-Corpus"
-       einfo "  ./train.pl user@example.com"
+       einfo "  perl train.pl user@example.com"
        einfo
        einfo "The current ebuild has installed a group called \"globaluser\". If you want"
        einfo "you could train the \"globaluser\" instead of a valid email address:"
-       einfo "  ./train.pl globaluser"
+       einfo "  perl train.pl globaluser"
        einfo
 }
index d8730458a944793440947827a7cf630eeec86e62..9a861ace39cba634bbaae6f48495ab9ff4af57a2 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.1.2.ebuild,v 1.3 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.1.2.ebuild,v 1.4 2004/10/24 15:08:56 st_lim Exp $
 
 inherit eutils
 
@@ -148,7 +148,7 @@ src_install () {
        keepdir ${HOMEDIR}
 
        # keeps dspam data in /var
-       diropts -m0770 -o dspam -g dspam
+       diropts -m0775 -o dspam -g dspam
        dodir ${DATADIR}
        keepdir ${DATADIR}
 
@@ -194,7 +194,7 @@ src_install () {
 
        # install some initial configuration
        insinto ${HOMEDIR}
-       insopts -m0640 -o dspam -g dspam
+       insopts -m0664 -o dspam -g dspam
        [ ! -f ${HOMEDIR}/trusted.users ] && doins ${FILESDIR}/trusted.users
        doins ${T}/untrusted.mailer_args
        doins ${T}/default.prefs
@@ -404,10 +404,10 @@ pkg_config () {
        einfo "  wget http://www.nuclearelephant.com/projects/dspam/SA-Corpus.tar.gz"
        einfo "  tar zxvf SA-Corpus.tar.gz"
        einfo "  cd ./SA-Corpus"
-       einfo "  ./train.pl user@example.com"
+       einfo "  perl train.pl user@example.com"
        einfo
        einfo "The current ebuild has installed a group called \"globaluser\". If you want"
        einfo "you could train the \"globaluser\" instead of a valid email address:"
-       einfo "  ./train.pl globaluser"
+       einfo "  perl train.pl globaluser"
        einfo
 }
diff --git a/mail-filter/dspam/dspam-3.2.0.ebuild b/mail-filter/dspam/dspam-3.2.0.ebuild
new file mode 100644 (file)
index 0000000..f4a6fb3
--- /dev/null
@@ -0,0 +1,402 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.2.0.ebuild,v 1.1 2004/10/24 15:08:56 st_lim Exp $
+
+inherit eutils
+
+S=${WORKDIR}/${PN}-${PV}
+DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
+SRC_URI="http://www.nuclearelephant.com/projects/dspam/sources/${PN}-${PV}.tar.gz"
+HOMEPAGE="http://www.nuclearelephant.com/projects/dspam/index.html"
+LICENSE="GPL-2"
+
+IUSE="cyrus debug exim mysql mysql41 maildrop neural oci8 postgres procmail sqlite"
+DEPEND="exim? ( >=mail-mta/exim-4.34 )
+               mysql? ( >=dev-db/mysql-3.23 ) || ( >=sys-libs/db-4.0 )
+               sqlite? ( >=dev-db/sqlite-3.0.6 )
+               maildrop? ( >=mail-filter/maildrop-1.5.3 )
+               postgres? ( >=dev-db/postgresql-7.4.3 )
+               procmail? ( >=mail-filter/procmail-3.22 )
+               x86? ( cyrus? ( >=net-mail/cyrus-imapd-2.1.15 ) )
+               "
+               #mysql41? ( >=dev-db/mysql-4.1 ) # There is no mysql-4.1 in gentoo!!!  Ouch
+RDEPEND="virtual/cron
+               app-admin/logrotate"
+KEYWORDS="~x86 ~ppc"
+SLOT="0"
+
+# some FHS-like structure
+HOMEDIR="/etc/mail/dspam"
+DATADIR="/var/spool/dspam"
+LOGDIR="/var/log/dspam"
+
+pkg_setup() {
+       if (use mysql && use postgres) || \
+               (use mysql && use oci8) || \
+               (use mysql && use sqlite) || \
+               (use postgres && use oci8) || \
+               (use postgres && use sqlite) || \
+               (use sqlite && use oci8); then
+               echo
+               ewarn "You have two of either \"mysql\", \"postgres\", \"oci8\" or \"sqlite\" in your USE flags."
+               ewarn "Will default to MySQL as your dspam database backend."
+               ewarn "If you want to build with Postgres/Oracle/SQLite support; hit Control-C now."
+               ewarn "Change your USE flag -mysql and emerge again."
+               echo
+               has_version ">=sys-apps/portage-2.0.50" && (
+               einfo "It would be best practice to add the set of USE flags that you use for this"
+               einfo "package to the file: /etc/portage/package.use. Example:"
+               einfo "\`echo \"net-mail/dspam -mysql postgres -oci8 -sqlite\" >> /etc/portage/package.use\`"
+               einfo "to build dspam with Postgres database as your dspam backend."
+               )
+               echo
+               ewarn "Waiting 30 seconds before starting..."
+               ewarn "(Control-C to abort)..."
+               epause 30
+       fi
+       id dspam 2>/dev/null || enewgroup dspam 65532
+       id dspam 2>/dev/null || enewuser dspam 65532 /bin/bash ${HOMEDIR} dspam
+}
+
+src_compile() {
+       local myconf
+
+       # these are the default settings
+       myconf="${myconf} --with-signature-life=14"
+       myconf="${myconf} --enable-broken-return-codes"
+       myconf="${myconf} --enable-preferences-extension"
+       myconf="${myconf} --enable-experimental"
+       myconf="${myconf} --enable-long-username"
+       myconf="${myconf} --enable-robinson"
+       #myconf="${myconf} --enable-chi-square"
+       myconf="${myconf} --enable-robinson-pvalues"
+       #myconf="${myconf} --enable-broken-mta"
+       myconf="${myconf} --enable-large-scale"
+       #myconf="${myconf} --enable-domain-scale"
+
+       # ${HOMEDIR}/data is a symlink to ${DATADIR}
+       myconf="${myconf} --with-dspam-mode=4755"
+       myconf="${myconf} --with-dspam-owner=dspam"
+       myconf="${myconf} --with-dspam-group=dspam"
+       myconf="${myconf} --enable-homedir --with-dspam-home=${HOMEDIR} --sysconfdir=${HOMEDIR}"
+       myconf="${myconf} --with-logdir=/var/log/dspam"
+
+       # enables support for debugging (touch /etc/dspam/.debug to turn on)
+       # optional: even MORE debugging output, use with extreme caution!
+       use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
+
+       # select storage driver
+       if use mysql || use mysql41; then
+               myconf="${myconf} --with-storage-driver=mysql_drv"
+               myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
+               myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
+               myconf="${myconf} --with-client-compression"
+               myconf="${myconf} --enable-virtual-users"
+
+               # an experimental feature available with MySQL and PgSQL backend
+               if use neural ; then
+                       myconf="${myconf} --enable-neural-networking"
+               fi
+       elif use postgres ; then
+               myconf="${myconf} --with-storage-driver=pgsql_drv"
+               myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
+               myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
+               myconf="${myconf} --enable-virtual-users"
+
+               # an experimental feature available with MySQL and PgSQL backend
+               if use neural ; then
+                       myconf="${myconf} --enable-neural-networking"
+               fi
+       elif use oci8 ; then
+               myconf="${myconf} --with-storage-driver=ora_drv"
+               myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
+               myconf="${myconf} --enable-virtual-users"
+
+               # I am in no way a Oracle specialist. If someone knows
+               # how to query the version of Oracle, then let me know.
+               if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1)
+               then
+                       --with-oracle-version=MAJOR
+                       myconf="${myconf} --with-oracle-version=10"
+               fi
+       elif use sqlite ; then
+               myconf="${myconf} --with-storage-driver=sqlite_drv"
+               myconf="${myconf} --enable-virtual-users"
+
+       else
+               myconf="${myconf} --with-storage-driver=libdb4_drv"
+               myconf="${myconf} --with-db4-includes=/usr/include"
+               myconf="${myconf} --with-db4-libraries=/usr/lib"
+       fi
+
+       econf ${myconf} \
+               --with-delivery-agent="${agent}" || die
+       emake || die
+
+}
+
+src_install () {
+       # open up perms on /etc/mail/dspam
+       diropts -m0775 -o dspam -g dspam
+       dodir ${HOMEDIR}
+       keepdir ${HOMEDIR}
+
+       # keeps dspam data in /var
+       diropts -m0775 -o dspam -g dspam
+       dodir ${DATADIR}
+       keepdir ${DATADIR}
+
+       # keeps dspam log in /var/log
+       diropts -m0775 -o dspam -g dspam
+       dodir ${LOGDIR}
+       keepdir ${LOGDIR}
+
+       # make install
+       sed -e 's/rm -f ..mandir.\(.*\)/rm -f ${D}${mandir}\1/g' \
+               -e 's/ln -s ..mandir.\(.*\) ..mandir.\(.*3\)/ln -s ${mandir}\1.gz ${D}${mandir}\2.gz/g' \
+               -i Makefile
+       make DESTDIR=${D} etcdest=${D}${HOMEDIR} sysconfdir=${D}${HOMEDIR} install || die
+       chmod 4755 ${D}/usr/bin/dspam
+
+       # documentation
+       dodoc CHANGELOG LICENSE README RELEASE.NOTES
+       dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
+       if use mysql || mysql41; then
+               newdoc tools.mysql_drv/README
+       elif use postgres ; then
+               newdoc tools.pgsql_drv/README
+       elif use oci8 ; then
+               newdoc tools.ora_drv/README
+       elif use sqlite ; then
+               newdoc tools.sqlite_drv/README
+       fi
+
+       # build some initial configuration data
+       if use cyrus; then
+               echo "UntrustedDeliveryAgent /usr/lib/cyrus/deliver %u" >> ${D}${HOMEDIR}/dspam.conf
+               sed -e 's:/usr/bin/procmail:/usr/lib/cyrus/deliver %u:g' \
+                       -i ${D}${HOMEDIR}/dspam.conf
+       elif use exim; then
+               echo "UntrustedDeliveryAgent /usr/sbin/exim -oMr spam-scanned %u" >> ${D}${HOMEDIR}/dspam.conf
+               sed -e 's:/usr/bin/procmail:/usr/sbin/exim -oMr spam-scanned %u:g' \
+                       -i ${D}${HOMEDIR}/dspam.conf
+       elif use maildrop; then
+               echo "UntrustedDeliveryAgent /usr/bin/maildrop -d %u" >> ${D}${HOMEDIR}/dspam.conf
+               sed -e 's:/usr/bin/procmail:/usr/bin/maildrop -d %u:g' \
+                       -i ${D}${HOMEDIR}/dspam.conf
+       elif use procmail; then
+               echo "UntrustedDeliveryAgent /usr/bin/procmail" >> ${D}${HOMEDIR}/dspam.conf
+       else
+               echo "UntrustedDeliveryAgent /usr/sbin/sendmail" >> ${D}${HOMEDIR}/dspam.conf
+               sed -e 's:/usr/bin/procmail:/usr/sbin/sendmail:g' \
+                       -i ${D}${HOMEDIR}/dspam.conf
+       fi
+
+       local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
+
+       # database related configuration and scripts
+       if use mysql || use mysql41; then
+               insinto ${HOMEDIR}
+               insopts -m644 -o dspam -g dspam
+
+               if [ -f ${HOMEDIR}/mysql.data ]; then
+                       # Use an existing password
+                       PASSWORD="$(tail -n 2 ${HOMEDIR}/mysql.data | head -n 1 )"
+               else
+                       # Create the mysql.data file
+                       echo "127.0.0.1" >${T}/mysql.data
+                       echo "3306" >>${T}/mysql.data
+                       echo "dspam" >>${T}/mysql.data
+                       echo "${PASSWORD}" >>${T}/mysql.data
+                       echo "dspam" >>${T}/mysql.data
+                       doins ${T}/mysql.data
+               fi
+
+               newins tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
+               newins tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
+               newins tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
+               newins tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
+               newins tools.mysql_drv/neural.sql mysql_neural.sql
+               newins tools.mysql_drv/purge.sql mysql_purge.sql
+               newins tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
+               newins ${FILESDIR}/upgrade.sql mysql_upgrade.sql
+       elif use postgres ; then
+               insinto ${HOMEDIR}
+               insopts -m644 -o dspam -g dspam
+
+               if [ -f ${HOMEDIR}/mysql.data ]; then
+                       # Use an existing password
+                       PASSWORD="$(tail -n 2 ${HOMEDIR}/pgsql.data | head -n 1 )"
+               else
+                       # Create the pgsql.data file
+                       echo "127.0.0.1" >${T}/pgsql.data
+                       echo "5432" >>${T}/pgsql.data
+                       echo "dspam" >>${T}/pgsql.data
+                       echo "${PASSWORD}" >>${T}/pgsql.data
+                       echo "dspam" >>${T}/pgsql.data
+                       doins ${T}/pgsql.data
+               fi
+
+               newins tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
+               newins tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
+               newins tools.pgsql_drv/purge.sql pgsql_purge.sql
+
+       elif use oci8 ; then
+               insinto ${HOMEDIR}
+               insopts -m644 -o dspam -g dspam
+
+               if [ -f ${HOMEDIR}/oracle.data ]; then
+                       # Use an existing password
+                       PASSWORD="$(tail -n 2 ${HOMEDIR}/oracle.data | head -n 1 )"
+               else
+                       # Create the pgsql.data file
+                       echo "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))" >${T}/oracle.data
+                       echo "dspam" >>${T}/oracle.data
+                       echo "${PASSWORD}" >>${T}/oracle.data
+                       echo "dspam" >>${T}/oracle.data
+                       doins ${T}/oracle.data
+               fi
+
+               newins tools.ora_drv/oral_objects.sql ora_objects.sql
+               newins tools.ora_drv/virtual_users.sql ora_virtual_users.sql
+               newins tools.ora_drv/purge.sql ora_purge.sql
+       elif use sqlite ; then
+               newins tools.sqlite_drv/purge.sql sqlite_purge.sql
+       fi
+
+       # installs the cron job to the cron directory
+       diropts -m0755 -o dspam -g dspam
+       dodir /etc/cron.daily
+       keepdir /etc/cron.daily
+       exeinto /etc/cron.daily
+       exeopts -m0755 -o dspam -g dspam
+       doexe ${FILESDIR}/dspam.cron
+
+       # installs the logrotation scripts to the logrotate.d directory
+       diropts -m0755 -o dspam -g dspam
+       dodir /etc/logrotate.d
+       keepdir /etc/logrotate.d
+       insinto /etc/logrotate.d
+       insopts -m0755 -o dspam -g dspam
+       newins ${FILESDIR}/logrotate.dspam dspam
+
+       # dspam enviroment
+       echo -ne "CONFIG_PROTECT_MASK=\"${HOMEDIR}\"\n\n" > ${T}/40dspam
+       doenvd ${T}/40dspam || die
+}
+
+pkg_postinst() {
+       if use mysql || use mysql41 || use postgres; then
+               einfo "To setup dspam to run out-of-the-box on your system with a mysql or pgsql database, run:"
+               einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
+       fi
+       if use exim ; then
+               echo
+               einfo "To use dspam in conjunction with your exim system, you should read the README"
+       fi
+}
+
+pkg_config () {
+       if use mysql ; then
+               [[ -f ${HOMEDIR}/mysql.data ]] && mv -f ${HOMEDIR}/mysql.data ${HOMEDIR}
+               DSPAM_MySQL_USER="$(cat ${HOMEDIR}/mysql.data|head -n 3|tail -n 1)"
+               DSPAM_MySQL_PWD="$(cat ${HOMEDIR}/mysql.data|head -n 4|tail -n 1)"
+               DSPAM_MySQL_DB="$(cat ${HOMEDIR}/mysql.data|head -n 5|tail -n 1)"
+
+               ewarn "When prompted for a password, please enter your MySQL root password"
+               ewarn ""
+
+               einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
+               /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
+
+               if use mysql41 ; then
+                       /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-4.1.sql
+               else
+                       einfo "Creating DSPAM MySQL tables for data objects"
+                       einfo "  Please select what kind of object database you like to use."
+                       einfo "    [1] Space optimized database"
+                       einfo "    [2] Speed optimized database"
+                       einfo
+                       while true
+                       do
+                               read -n 1 -s -p "  Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
+                               [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && break
+                       done
+
+                       if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
+                       then
+                               /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-space.sql
+                       else
+                               /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-speed.sql
+                       fi
+               fi
+
+               einfo "Creating DSPAM MySQL database for virtual users"
+               /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_virtual_users.sql
+
+               if use neural ; then
+                       /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_neural.sql
+               fi
+
+               einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
+               /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
+       elif use postgres ; then
+               [[ -f ${HOMEDIR}/pgsql.data ]] && mv -f ${HOMEDIR}/pgsql.data ${HOMEDIR}
+               DSPAM_PgSQL_USER="$(cat ${HOMEDIR}/pgsql.data|head -n 3|tail -n 1)"
+               DSPAM_PgSQL_PWD="$(cat ${HOMEDIR}/pgsql.data|head -n 4|tail -n 1)"
+               DSPAM_PgSQL_DB="$(cat ${HOMEDIR}/pgsql.data|head -n 5|tail -n 1)"
+
+               ewarn "When prompted for a password, please enter your PgSQL postgres password"
+               ewarn ""
+
+               einfo "Creating DSPAM PostgreSQL user \"${DSPAM_PgSQL_USER}\""
+               /usr/bin/psql -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER;" 1>/dev/null 2>&1
+
+               einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\""
+               /usr/bin/psql -d template1 -U postgres -c "CREATE DATABASE ${DSPAM_PgSQL_DB};" 1>/dev/null 2>&1
+
+               einfo "Getting DSPAM PostgreSQL userid for \"${DSPAM_PgSQL_USER}\""
+               DSPAM_PgSQL_USERID=$(/usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -t -c "SELECT usesysid FROM pg_user WHERE usename='${DSPAM_PgSQL_USER}';" | head -n1 | sed "s/^[ ]*\([^ ]*\).*/\1/g")
+               einfo "  UserID: ${DSPAM_PgSQL_USERID}"
+
+               einfo "Getting DSPAM PostgreSQL databaseid for \"${DSPAM_PgSQL_DB}\""
+               DSPAM_PgSQL_DBID=$(/usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -t -c "SELECT datdba FROM pg_database WHERE datname='${DSPAM_PgSQL_DB}';" | head -n1 | sed "s/^[ ]*\([^ ]*\).*/\1/g")
+               einfo "  DBID: ${DSPAM_PgSQL_DBID}"
+
+               einfo "Changing owner of DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" to \"${DSPAM_PgSQL_USER}\""
+               /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "UPDATE pg_database SET datdba=${DSPAM_PgSQL_USERID} WHERE datname='${DSPAM_PgSQL_DB}';" 1>/dev/null 2>&1
+
+               einfo "Creating DSPAM PostgreSQL tables"
+               PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${HOMEDIR}/pgsql_objects.sql 1>/dev/null 2>&1
+               PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${HOMEDIR}/pgsql_virtual_users.sql 1>/dev/null 2>&1
+
+               einfo "Grant privileges to DSPAM PostgreSQL objects to \"${DSPAM_PgSQL_USER}\""
+               for foo in $(/usr/bin/psql -t -d ${DSPAM_PgSQL_DB} -U postgres -c "SELECT tablename FROM pg_tables WHERE tablename LIKE 'dspam\%';")
+               do
+                       /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "GRANT ALL PRIVILEGES ON TABLE ${foo} TO ${DSPAM_PgSQL_USER};" 1>/dev/null 2>&1
+               done
+               /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER};" 1>/dev/null 2>&1
+               /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER};" 1>/dev/null 2>&1
+       elif use oci8 ; then
+               [[ -f ${HOMEDIR}/oracle.data ]] && mv -f ${HOMEDIR}/oracle.data ${HOMEDIR}
+       elif use sqlite ; then
+               einfo "sqlite_drv will automatically create the necessary database"
+               einfo "objects for each user upon first use of DSPAM by that user."
+       fi
+
+       echo -ne "\n\n\n\n"
+
+       einfo "If you want to train your DSPAM with some SPAM/HAM data, then download"
+       einfo "the SA-Training-Corpus from DSPAM's website:"
+       einfo
+       einfo "  cd /tmp"
+       einfo "  wget http://www.nuclearelephant.com/projects/dspam/SA-Corpus.tar.gz"
+       einfo "  tar zxvf SA-Corpus.tar.gz"
+       einfo "  cd ./SA-Corpus"
+       einfo "  perl train.pl user@example.com"
+       einfo
+       einfo "The current ebuild has installed a group called \"globaluser\". If you want"
+       einfo "you could train the \"globaluser\" instead of a valid email address:"
+       einfo "  perl train.pl globaluser"
+       einfo
+}
index 8c8f2c6fedaa4cbafb24a7461297a1bfdc16d57a..ff94b3642927cfcba607f38b46951d06f7f58ea8 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.2_beta1.ebuild,v 1.3 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.2_beta1.ebuild,v 1.4 2004/10/24 15:08:56 st_lim Exp $
 
 inherit eutils
 
@@ -148,7 +148,7 @@ src_install () {
        keepdir ${HOMEDIR}
 
        # keeps dspam data in /var
-       diropts -m0770 -o dspam -g dspam
+       diropts -m0775 -o dspam -g dspam
        dodir ${DATADIR}
        keepdir ${DATADIR}
 
@@ -194,7 +194,7 @@ src_install () {
 
        # install some initial configuration
        insinto ${HOMEDIR}
-       insopts -m0640 -o dspam -g dspam
+       insopts -m0664 -o dspam -g dspam
        [ ! -f ${HOMEDIR}/trusted.users ] && doins ${FILESDIR}/trusted.users
        doins ${T}/untrusted.mailer_args
        doins ${T}/default.prefs
@@ -404,10 +404,10 @@ pkg_config () {
        einfo "  wget http://www.nuclearelephant.com/projects/dspam/SA-Corpus.tar.gz"
        einfo "  tar zxvf SA-Corpus.tar.gz"
        einfo "  cd ./SA-Corpus"
-       einfo "  ./train.pl user@example.com"
+       einfo "  perl train.pl user@example.com"
        einfo
        einfo "The current ebuild has installed a group called \"globaluser\". If you want"
        einfo "you could train the \"globaluser\" instead of a valid email address:"
-       einfo "  ./train.pl globaluser"
+       einfo "  perl train.pl globaluser"
        einfo
 }
index 1d47c3816ea2446b7c153578e50522cdda86451e..2dba329624749991f9568e95f3c38372161e55b3 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.2_rc3.ebuild,v 1.1 2004/10/16 17:27:29 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.2_rc3.ebuild,v 1.2 2004/10/24 15:08:56 st_lim Exp $
 
 inherit eutils
 
@@ -143,7 +143,7 @@ src_install () {
        keepdir ${HOMEDIR}
 
        # keeps dspam data in /var
-       diropts -m0770 -o dspam -g dspam
+       diropts -m0775 -o dspam -g dspam
        dodir ${DATADIR}
        keepdir ${DATADIR}
 
@@ -394,10 +394,10 @@ pkg_config () {
        einfo "  wget http://www.nuclearelephant.com/projects/dspam/SA-Corpus.tar.gz"
        einfo "  tar zxvf SA-Corpus.tar.gz"
        einfo "  cd ./SA-Corpus"
-       einfo "  ./train.pl user@example.com"
+       einfo "  perl train.pl user@example.com"
        einfo
        einfo "The current ebuild has installed a group called \"globaluser\". If you want"
        einfo "you could train the \"globaluser\" instead of a valid email address:"
-       einfo "  ./train.pl globaluser"
+       einfo "  perl train.pl globaluser"
        einfo
 }
diff --git a/mail-filter/dspam/files/digest-dspam-3.2.0 b/mail-filter/dspam/files/digest-dspam-3.2.0
new file mode 100644 (file)
index 0000000..b5b46dd
--- /dev/null
@@ -0,0 +1 @@
+MD5 6ebcbc130afde2ef0dc00e95051ab362 dspam-3.2.0.tar.gz 617716