From be5b5a0d747cb442d4a6f114b507a126b90c575f Mon Sep 17 00:00:00 2001 From: Alin Năstac Date: Mon, 10 Sep 2007 04:06:02 +0000 Subject: Use Postgres command vacuumdb --analyse instead --full (#191271). Package-Manager: portage-2.1.2.12 --- mail-filter/dspam/ChangeLog | 8 +- mail-filter/dspam/Manifest | 28 +- mail-filter/dspam/dspam-3.8.0-r5.ebuild | 452 -------------------------- mail-filter/dspam/dspam-3.8.0-r6.ebuild | 452 ++++++++++++++++++++++++++ mail-filter/dspam/files/digest-dspam-3.8.0-r5 | 9 - mail-filter/dspam/files/digest-dspam-3.8.0-r6 | 9 + 6 files changed, 482 insertions(+), 476 deletions(-) delete mode 100644 mail-filter/dspam/dspam-3.8.0-r5.ebuild create mode 100644 mail-filter/dspam/dspam-3.8.0-r6.ebuild delete mode 100644 mail-filter/dspam/files/digest-dspam-3.8.0-r5 create mode 100644 mail-filter/dspam/files/digest-dspam-3.8.0-r6 (limited to 'mail-filter') diff --git a/mail-filter/dspam/ChangeLog b/mail-filter/dspam/ChangeLog index d6dd819513c5..95b5c7810176 100644 --- a/mail-filter/dspam/ChangeLog +++ b/mail-filter/dspam/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for mail-filter/dspam # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/ChangeLog,v 1.95 2007/09/09 20:29:34 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/ChangeLog,v 1.96 2007/09/10 04:06:01 mrness Exp $ + +*dspam-3.8.0-r6 (10 Sep 2007) + + 10 Sep 2007; Alin Năstac files/dspam.cron, + -dspam-3.8.0-r5.ebuild, +dspam-3.8.0-r6.ebuild: + Use Postgres command vacuumdb --analyse instead --full (#191271). *dspam-3.8.0-r5 (09 Sep 2007) diff --git a/mail-filter/dspam/Manifest b/mail-filter/dspam/Manifest index be380021583a..d96253bd4818 100644 --- a/mail-filter/dspam/Manifest +++ b/mail-filter/dspam/Manifest @@ -24,25 +24,25 @@ SHA256 75e04139e564ad55011ee77b8245dc5cdefbb6d56ca451feab5861ab907d614e files/lo DIST dspam-3.8.0-patches-20070909.tar.gz 7978 RMD160 7cc8d84fd74b7158a4b3d292f37b5cae5bb5fe43 SHA1 2f511ea80562ab6e4f81e4ad6db6a5c550cf5df5 SHA256 23401c5c85d50c48d4e7a286807d5bc45bd8afc78d9ca2c4816fb8aa746765d2 DIST dspam-3.8.0.tar.gz 726160 RMD160 e7831e2415e30e819dd9cbc0ba3f269e113e2fb9 SHA1 d1de7ee2134522adaf52f49167accecf1589fa96 SHA256 84a227934a7aee73516bdb82c33ee7b359e955c8cd95a1544a9a13069f79bfc7 DIST dspam_sa_trainer.tar.gz 1230 RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 SHA1 71a002f26a888bdfe47759cf1f780cd6478dacac SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 -EBUILD dspam-3.8.0-r5.ebuild 15494 RMD160 1580b7379962c06bf8d17bcfd7f94c4bf9818f2a SHA1 56c98c994b4147446711f5fdedf0dfc22b4b411d SHA256 04f42328604077a816989f485b50c6feec48e6b3e482e989ed22f05246b35a28 -MD5 db132ed7eea0dbcaa18f996b027d3973 dspam-3.8.0-r5.ebuild 15494 -RMD160 1580b7379962c06bf8d17bcfd7f94c4bf9818f2a dspam-3.8.0-r5.ebuild 15494 -SHA256 04f42328604077a816989f485b50c6feec48e6b3e482e989ed22f05246b35a28 dspam-3.8.0-r5.ebuild 15494 -MISC ChangeLog 17257 RMD160 d31533c9775a395f8b343c682816f0eae30af9c2 SHA1 2758ec7c703fdaa8a14c26a72be2e9e8760f0783 SHA256 77f9075134a7e99779c7677985501b839ba046660f300f013ed5e04beb054d83 -MD5 de976325558d4059987cd99312ae0288 ChangeLog 17257 -RMD160 d31533c9775a395f8b343c682816f0eae30af9c2 ChangeLog 17257 -SHA256 77f9075134a7e99779c7677985501b839ba046660f300f013ed5e04beb054d83 ChangeLog 17257 +EBUILD dspam-3.8.0-r6.ebuild 15494 RMD160 25252277c031b38c97aaf06b2330828824bc62d1 SHA1 8fc7d2ee48bf13ac193bb01f919ca2ecd58b17fd SHA256 55e3698d7aea37a792bb5f4bd538496050d78eab5d231717ebfa2485f9018c03 +MD5 43410b42a63c498118fdf872486dcb4b dspam-3.8.0-r6.ebuild 15494 +RMD160 25252277c031b38c97aaf06b2330828824bc62d1 dspam-3.8.0-r6.ebuild 15494 +SHA256 55e3698d7aea37a792bb5f4bd538496050d78eab5d231717ebfa2485f9018c03 dspam-3.8.0-r6.ebuild 15494 +MISC ChangeLog 17473 RMD160 1f461a4af5957cefbaa7541f59b087091e034420 SHA1 a665b63e3073d5e9c627100ce91cbf4a4967e0a2 SHA256 1f781779f929f4a534de9a6e13d5cb6b08551329512ad96cd9a1f6fb5d3099de +MD5 71e6284b42934b6b473afcd402f47496 ChangeLog 17473 +RMD160 1f461a4af5957cefbaa7541f59b087091e034420 ChangeLog 17473 +SHA256 1f781779f929f4a534de9a6e13d5cb6b08551329512ad96cd9a1f6fb5d3099de ChangeLog 17473 MISC metadata.xml 335 RMD160 acb18f015dcada8300ffce56be0c4a285ce2a215 SHA1 87ddabb196434e9e9363ba4b5b5596b78aa463f1 SHA256 23816215482cfc089c2e3fe9ae75547c364ad01fbb2a98886ad91d28f5971e17 MD5 47349dfc68ef142782e134a2e7696a37 metadata.xml 335 RMD160 acb18f015dcada8300ffce56be0c4a285ce2a215 metadata.xml 335 SHA256 23816215482cfc089c2e3fe9ae75547c364ad01fbb2a98886ad91d28f5971e17 metadata.xml 335 -MD5 4343b397e9fe9d22d5dbabe2ac198557 files/digest-dspam-3.8.0-r5 759 -RMD160 36dd6e606343aecc3747d3f6b30bb09623130c80 files/digest-dspam-3.8.0-r5 759 -SHA256 c2aab45cb71e549d8df7a4b4ac811901540883cedd6ec4352023e7a1581a7ce5 files/digest-dspam-3.8.0-r5 759 +MD5 4343b397e9fe9d22d5dbabe2ac198557 files/digest-dspam-3.8.0-r6 759 +RMD160 36dd6e606343aecc3747d3f6b30bb09623130c80 files/digest-dspam-3.8.0-r6 759 +SHA256 c2aab45cb71e549d8df7a4b4ac811901540883cedd6ec4352023e7a1581a7ce5 files/digest-dspam-3.8.0-r6 759 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.6 (GNU/Linux) -iD8DBQFG5MDJVSA5X31g7/gRAo6gAJ9R8qyZuVJjqIy+mZrRK5s48IYPIwCgl9oc -9O723T+yz8zNd8fDECmkcRI= -=Ebzi +iD8DBQFG5MKvVSA5X31g7/gRAqW5AJ4/MdkEeDP4H88G38IYa4P+AhLCUwCcCsQ/ +0CI875t/4IQ9YHfX2AYz5iU= +=KeT9 -----END PGP SIGNATURE----- diff --git a/mail-filter/dspam/dspam-3.8.0-r5.ebuild b/mail-filter/dspam/dspam-3.8.0-r5.ebuild deleted file mode 100644 index 25b98f1b3c17..000000000000 --- a/mail-filter/dspam/dspam-3.8.0-r5.ebuild +++ /dev/null @@ -1,452 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.8.0-r5.ebuild,v 1.1 2007/09/09 20:29:34 mrness Exp $ - -WANT_AUTOCONF="latest" -WANT_AUTOMAKE="latest" - -inherit eutils autotools flag-o-matic multilib - -DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter" -HOMEPAGE="http://dspam.nuclearelephant.com/" -SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz - mirror://gentoo/${P}-patches-20070909.tar.gz - http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -IUSE="clamav daemon debug large-domain ldap logrotate mysql postgres \ - sqlite sqlite3 virtual-users user-homedirs" - -DEPEND="clamav? ( >=app-antivirus/clamav-0.90.2 ) - ldap? ( >=net-nds/openldap-2.2 ) - mysql? ( virtual/mysql ) - postgres? ( >=dev-db/postgresql-7.4.3 ) - sqlite? ( = 1000, for being able to use suexec in apache - for euid in $(seq 1000 5000 ) ; do - [[ -z $(egetent passwd ${euid}) ]] && break - done - for egid in $(seq 1000 5000 ) ; do - [[ -z $(egetent group ${egid}) ]] && break - done - - enewgroup dspam ${egid} - enewuser dspam ${euid} -1 ${HOMEDIR} dspam,mail -} - -pkg_setup() { - if use virtual-users && use user-homedirs ; then - eerror "If the users are virtual, then they probably should not have home directories." - die "Incompatible USE flag selection" - fi - - create_dspam_usergroup -} - -src_unpack() { - unpack ${A} - cd "${S}" - - EPATCH_SUFFIX="patch" - epatch "${WORKDIR}"/patches - - # Fix Lazy bindings - append-flags $(bindnow-flags) - - AT_M4DIR="${S}/m4" - eautoreconf -} - -src_compile() { - local myconf="--enable-long-usernames --enable-syslog" - - use large-domain && myconf="${myconf} --enable-large-scale" || \ - myconf="${myconf} --enable-domain-scale" - - use user-homedirs && myconf="${myconf} --enable-homedir" - - use debug && myconf="${myconf} --enable-debug --enable-bnr-debug" - - if use virtual-users ; then - if use mysql || use postgres ; then - myconf="${myconf} --enable-virtual-users" - fi - fi - - if use mysql || use postgres ; then - myconf="${myconf} --enable-preferences-extension" - fi - - local STORAGE="hash_drv" - # select storage driver - if use sqlite ; then - STORAGE="${STORAGE},sqlite_drv" - fi - if use sqlite3 ; then - STORAGE="${STORAGE},sqlite3_drv" - fi - if use mysql; then - STORAGE="${STORAGE},mysql_drv" - myconf="${myconf} --with-mysql-includes=/usr/include/mysql" - myconf="${myconf} --with-mysql-libraries=/usr/$(get_libdir)/mysql" - fi - if use postgres ; then - STORAGE="${STORAGE},pgsql_drv" - myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql" - myconf="${myconf} --with-pgsql-libraries=/usr/$(get_libdir)/postgresql" - fi - - econf ${myconf} --with-storage-driver=${STORAGE} \ - --with-dspam-home=${HOMEDIR} \ - --sysconfdir=${CONFDIR} \ - $(use_enable daemon) \ - $(use_enable ldap) \ - $(use_enable clamav) \ - --with-dspam-group=dspam \ - --with-dspam-home-group=dspam \ - --with-dspam-mode=${DSPAMPERMS} \ - --with-logdir=${LOGDIR} || die "econf failed" - emake || die "emake failed" -} - -src_install () { - diropts -m0770 -o dspam -g dspam - dodir ${CONFDIR} - insinto ${CONFDIR} - insopts -m640 -o dspam -g dspam - doins src/dspam.conf - - dosym /etc/mail/dspam /etc/dspam - - # make install - make DESTDIR="${D}" install || die "make install failed" - - diropts -m0755 -o dspam -g dspam - keepdir /var/run/dspam - - # create logdir - if use debug ; then - diropts -m0770 -o dspam -g dspam - keepdir ${LOGDIR} - fi - - #clean options - diropts -m0755 - insopts -m0644 - - if use daemon; then - # We use sockets for the daemon instead of tcp port 24 - sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \ - -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \ - -e 's:^#*\(ClientHost[\t ]\{1,\}\)/.*:\1\"/var/run/dspam/dspam.sock\":gI' \ - -i "${D}/${CONFDIR}/dspam.conf" - - newinitd "${FILESDIR}/dspam.rc" dspam - - fowners root:dspam /usr/bin/dspamc - fperms u=rx,g=xs,o=x /usr/bin/dspamc - fi - - # generate random password - local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}" - - # database related configuration and scripts - if use sqlite; then - insinto ${CONFDIR} - newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql - fi - if use sqlite3; then - insinto ${CONFDIR} - newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql - fi - if use mysql; then - DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock" - DSPAM_DB_DATA[1]="" - DSPAM_DB_DATA[2]="dspam" - DSPAM_DB_DATA[3]="${PASSWORD}" - DSPAM_DB_DATA[4]="dspam" - DSPAM_DB_DATA[5]="true" - - # Modify configuration and create mysql.data file - sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \ - -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \ - -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \ - -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \ - -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \ - -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \ - -i "${D}"/${CONFDIR}/dspam.conf - for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do - echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> "${D}"/${CONFDIR}/mysql.data - done - - insinto ${CONFDIR} - newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql - newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql - newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql - if use virtual-users ; then - newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql - newins src/tools.mysql_drv/virtual_user_aliases.sql mysql_virtual_user_aliases.sql - fi - newins src/tools.mysql_drv/purge.sql mysql_purge.sql - newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql - - fperms 640 ${CONFDIR}/mysql.data - fowners root:dspam ${CONFDIR}/mysql.data - fi - if use postgres ; then - DSPAM_DB_DATA[0]="127.0.0.1" - DSPAM_DB_DATA[1]="5432" - DSPAM_DB_DATA[2]="dspam" - DSPAM_DB_DATA[3]="${PASSWORD}" - DSPAM_DB_DATA[4]="dspam" - - # Modify configuration and create pgsql.data file - sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \ - -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \ - -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \ - -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \ - -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \ - -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \ - -i "${D}"/${CONFDIR}/dspam.conf - for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do - echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> "${D}"/${CONFDIR}/pgsql.data - done - - insinto ${CONFDIR} - newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql - if use virtual-users ; then - newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql - fi - newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql - - fperms 640 ${CONFDIR}/pgsql.data - fowners root:dspam ${CONFDIR}/pgsql.data - fi - - sed -e "s:^\(Purge.*\):###\1:g" \ - -e "s:^#\(Purge.*\):\1:g" \ - -e "s:^###\(Purge.*\):#\1:g" \ - -i "${D}"/${CONFDIR}/dspam.conf - if ! ( use mysql || use postgres || use sqlite || use sqlite3 ) ; then - # When only one storage driver is compiled, it is linked statically with dspam - # thus you should not set the StorageDriver at all - # Also, hash_drv requires certain tokenizer and PValue (see bug #185718) - sed -e "s:^\(StorageDriver .*\)$:#\1:" \ - -e "s:^Tokenizer .*$:Tokenizer sbph:" \ - -e "/^#PValue/d" \ - -e "s:^PValue .*$:PValue markov:" \ - -i "${D}"/${CONFDIR}/dspam.conf - fi - - # installs the notification messages - # -> The documentation is wrong! The files need to be in ./txt - echo "Scanned and tagged as SPAM with DSPAM ${PV} by Your ISP.com">"${T}"/msgtag.spam - echo "Scanned and tagged as non-SPAM with DSPAM ${PV} by Your ISP.com">"${T}"/msgtag.nonspam - insinto ${CONFDIR}/txt - doins "${S}"/txt/*.txt - doins "${T}"/msgtag.* - - # Create the opt-in / opt-out directories - diropts -m0770 -o dspam -g dspam - dodir ${HOMEDIR} - keepdir ${HOMEDIR}/opt-in - keepdir ${HOMEDIR}/opt-out - diropts -m0755 - - # logrotation scripts - if use logrotate && use debug ; then - insinto /etc/logrotate.d - newins "${FILESDIR}/logrotate.dspam" dspam - fi - - # dspam cron job - exeinto /etc/cron.daily - newexe "${FILESDIR}/dspam.cron" dspam.cron - - # documentation - dodoc CHANGELOG README* RELEASE.NOTES UPGRADING - docinto doc - dodoc doc/*.txt - docinto gentoo - dodoc "${FILESDIR}"/README.{postfix,qmail} - docinto sa_train - dodoc "${WORKDIR}"/dspam_sa_trainer/* - doman man/dspam* -} - -pkg_preinst() { - # Preserve *.data files - local installed_datafiles="${ROOT}"/${CONFDIR}/*.data - if [[ "${installed_datafiles}" != *"*.data" ]]; then - cp "${ROOT}"/${CONFDIR}/*.data "${D}"/${CONFDIR} - fi -} - -pkg_postinst() { - # need enewgroup/enewuser in this function for binary install. - create_dspam_usergroup - - ewarn "The hash_drv storage backend has the following requirements:" - ewarn " - PValue must be set to 'markov'; Do not use this pvalue with any other storage backend!" - ewarn " - Tokenizer must be either 'sbph' or 'osb'" - ewarn "See markov.txt for more info." - - if use mysql || use postgres; then - elog - elog "To setup DSPAM to run out-of-the-box on your system with a MySQL" - elog "or PostgreSQL database, run:" - elog "emerge --config =${PF}" - fi - - if use postgres && has_version ">dev-db/postgresql-8.0"; then - elog - elog "Before executing the configuration command mentioned above you have" - elog "to execute the following command:" - elog "createlang plpgsql -U postgres dspam" - fi - - if use daemon; then - elog - elog "If you want to run DSPAM in the new daemon mode remember" - elog "to make the DSPAM daemon start during boot:" - elog " rc-update add dspam default" - fi - if use daemon ; then - elog - elog "To use the DSPAM daemon mode, the used storage driver must be thread-safe." - fi - - elog - elog "Edit /etc/mail/dspam.conf with your delivery agent" - elog "See http://dspamwiki.expass.de/Installation for more info" - elog -} - -pkg_config () { - local AVAIL_BACKENDS=() - use mysql && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} mysql ) - use postgres && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} postgres ) - use sqlite && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} sqlite ) - use sqlite3 && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} sqlite3 ) - local USE_BACKEND - read -p "Which backend do you want to configure? (available backends are ${AVAIL_BACKENDS[*]}) " USE_BACKEND - if [[ " ${AVAIL_BACKENDS[*]} " != *" ${USE_BACKEND} "* ]] - then - eerror "The '${USE_BACKEND}' backend is not available." - return 1 - fi - - case "${USE_BACKEND}" in - - sqlite | sqlite3) - einfo "sqlite_drv will automatically create the necessary database" - ;; - - mysql) - DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") ) - for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do - [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]="" - done - DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}" - DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}" - DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}" - - local MYSQL_ROOT_USER="" - echo -n "Please enter your administrative MySQL account (default root): " - read MYSQL_ROOT_USER - if [[ -z "${MYSQL_ROOT_USER}" ]]; then - MYSQL_ROOT_USER="root" - fi - ewarn "When prompted for a password, please enter your MySQL ${MYSQL_ROOT_USER} password" - ewarn - - einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\"" - /usr/bin/mysqladmin -u ${MYSQL_ROOT_USER} -p create ${DSPAM_MySQL_DB} - - if has_version ">=virtual/mysql-4.1"; then - /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/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" ]] && echo && break - done - - if [[ "${DSPAM_MySQL_DB_Type}" == "1" ]]; then - /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql - else - /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql - fi - fi - - if use virtual-users ; then - einfo "Creating DSPAM MySQL database for virtual-users users" - einfo " Please select what kind of virtual_uids table you like to use." - einfo " [1] Virtual users added automatically (use this if this server is the primary MX)" - einfo " [2] Virtual users added manually (use it if this server is a secondary MX)" - einfo - while true; do - read -n 1 -s -p " Press 1 or 2 on the keyboard to select table type" DSPAM_MySQL_DB_Type - [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break - done - - if [[ "${DSPAM_MySQL_DB_Type}" == "1" ]]; then - /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql - else - /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_user_aliases.sql - fi - fi - - einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\"" - /usr/bin/mysql -u ${MYSQL_ROOT_USER} -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 - ;; - - postgres) - DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") ) - for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do - [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]="" - done - DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}" - DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}" - DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}" - - ewarn "When prompted for a password, please enter your PgSQL postgres password" - ewarn - - einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\"" - /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';" - - 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 ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1 - - if use virtual-users ; then - einfo "Creating DSPAM PostgreSQL database for virtual-users users" - PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual_users.sql 1>/dev/null 2>&1 - fi - ;; - - esac -} diff --git a/mail-filter/dspam/dspam-3.8.0-r6.ebuild b/mail-filter/dspam/dspam-3.8.0-r6.ebuild new file mode 100644 index 000000000000..14ca5d4348e4 --- /dev/null +++ b/mail-filter/dspam/dspam-3.8.0-r6.ebuild @@ -0,0 +1,452 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.8.0-r6.ebuild,v 1.1 2007/09/10 04:06:01 mrness Exp $ + +WANT_AUTOCONF="latest" +WANT_AUTOMAKE="latest" + +inherit eutils autotools flag-o-matic multilib + +DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter" +HOMEPAGE="http://dspam.nuclearelephant.com/" +SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz + mirror://gentoo/${P}-patches-20070909.tar.gz + http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +IUSE="clamav daemon debug large-domain ldap logrotate mysql postgres \ + sqlite sqlite3 virtual-users user-homedirs" + +DEPEND="clamav? ( >=app-antivirus/clamav-0.90.2 ) + ldap? ( >=net-nds/openldap-2.2 ) + mysql? ( virtual/mysql ) + postgres? ( >=dev-db/postgresql-7.4.3 ) + sqlite? ( = 1000, for being able to use suexec in apache + for euid in $(seq 1000 5000 ) ; do + [[ -z $(egetent passwd ${euid}) ]] && break + done + for egid in $(seq 1000 5000 ) ; do + [[ -z $(egetent group ${egid}) ]] && break + done + + enewgroup dspam ${egid} + enewuser dspam ${euid} -1 ${HOMEDIR} dspam,mail +} + +pkg_setup() { + if use virtual-users && use user-homedirs ; then + eerror "If the users are virtual, then they probably should not have home directories." + die "Incompatible USE flag selection" + fi + + create_dspam_usergroup +} + +src_unpack() { + unpack ${A} + cd "${S}" + + EPATCH_SUFFIX="patch" + epatch "${WORKDIR}"/patches + + # Fix Lazy bindings + append-flags $(bindnow-flags) + + AT_M4DIR="${S}/m4" + eautoreconf +} + +src_compile() { + local myconf="--enable-long-usernames --enable-syslog" + + use large-domain && myconf="${myconf} --enable-large-scale" || \ + myconf="${myconf} --enable-domain-scale" + + use user-homedirs && myconf="${myconf} --enable-homedir" + + use debug && myconf="${myconf} --enable-debug --enable-bnr-debug" + + if use virtual-users ; then + if use mysql || use postgres ; then + myconf="${myconf} --enable-virtual-users" + fi + fi + + if use mysql || use postgres ; then + myconf="${myconf} --enable-preferences-extension" + fi + + local STORAGE="hash_drv" + # select storage driver + if use sqlite ; then + STORAGE="${STORAGE},sqlite_drv" + fi + if use sqlite3 ; then + STORAGE="${STORAGE},sqlite3_drv" + fi + if use mysql; then + STORAGE="${STORAGE},mysql_drv" + myconf="${myconf} --with-mysql-includes=/usr/include/mysql" + myconf="${myconf} --with-mysql-libraries=/usr/$(get_libdir)/mysql" + fi + if use postgres ; then + STORAGE="${STORAGE},pgsql_drv" + myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql" + myconf="${myconf} --with-pgsql-libraries=/usr/$(get_libdir)/postgresql" + fi + + econf ${myconf} --with-storage-driver=${STORAGE} \ + --with-dspam-home=${HOMEDIR} \ + --sysconfdir=${CONFDIR} \ + $(use_enable daemon) \ + $(use_enable ldap) \ + $(use_enable clamav) \ + --with-dspam-group=dspam \ + --with-dspam-home-group=dspam \ + --with-dspam-mode=${DSPAMPERMS} \ + --with-logdir=${LOGDIR} || die "econf failed" + emake || die "emake failed" +} + +src_install () { + diropts -m0770 -o dspam -g dspam + dodir ${CONFDIR} + insinto ${CONFDIR} + insopts -m640 -o dspam -g dspam + doins src/dspam.conf + + dosym /etc/mail/dspam /etc/dspam + + # make install + make DESTDIR="${D}" install || die "make install failed" + + diropts -m0755 -o dspam -g dspam + keepdir /var/run/dspam + + # create logdir + if use debug ; then + diropts -m0770 -o dspam -g dspam + keepdir ${LOGDIR} + fi + + #clean options + diropts -m0755 + insopts -m0644 + + if use daemon; then + # We use sockets for the daemon instead of tcp port 24 + sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \ + -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \ + -e 's:^#*\(ClientHost[\t ]\{1,\}\)/.*:\1\"/var/run/dspam/dspam.sock\":gI' \ + -i "${D}/${CONFDIR}/dspam.conf" + + newinitd "${FILESDIR}/dspam.rc" dspam + + fowners root:dspam /usr/bin/dspamc + fperms u=rx,g=xs,o=x /usr/bin/dspamc + fi + + # generate random password + local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}" + + # database related configuration and scripts + if use sqlite; then + insinto ${CONFDIR} + newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql + fi + if use sqlite3; then + insinto ${CONFDIR} + newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql + fi + if use mysql; then + DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock" + DSPAM_DB_DATA[1]="" + DSPAM_DB_DATA[2]="dspam" + DSPAM_DB_DATA[3]="${PASSWORD}" + DSPAM_DB_DATA[4]="dspam" + DSPAM_DB_DATA[5]="true" + + # Modify configuration and create mysql.data file + sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \ + -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \ + -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \ + -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \ + -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \ + -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \ + -i "${D}"/${CONFDIR}/dspam.conf + for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do + echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> "${D}"/${CONFDIR}/mysql.data + done + + insinto ${CONFDIR} + newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql + newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql + newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql + if use virtual-users ; then + newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql + newins src/tools.mysql_drv/virtual_user_aliases.sql mysql_virtual_user_aliases.sql + fi + newins src/tools.mysql_drv/purge.sql mysql_purge.sql + newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql + + fperms 640 ${CONFDIR}/mysql.data + fowners root:dspam ${CONFDIR}/mysql.data + fi + if use postgres ; then + DSPAM_DB_DATA[0]="127.0.0.1" + DSPAM_DB_DATA[1]="5432" + DSPAM_DB_DATA[2]="dspam" + DSPAM_DB_DATA[3]="${PASSWORD}" + DSPAM_DB_DATA[4]="dspam" + + # Modify configuration and create pgsql.data file + sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \ + -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \ + -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \ + -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \ + -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \ + -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \ + -i "${D}"/${CONFDIR}/dspam.conf + for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do + echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> "${D}"/${CONFDIR}/pgsql.data + done + + insinto ${CONFDIR} + newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql + if use virtual-users ; then + newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql + fi + newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql + + fperms 640 ${CONFDIR}/pgsql.data + fowners root:dspam ${CONFDIR}/pgsql.data + fi + + sed -e "s:^\(Purge.*\):###\1:g" \ + -e "s:^#\(Purge.*\):\1:g" \ + -e "s:^###\(Purge.*\):#\1:g" \ + -i "${D}"/${CONFDIR}/dspam.conf + if ! ( use mysql || use postgres || use sqlite || use sqlite3 ) ; then + # When only one storage driver is compiled, it is linked statically with dspam + # thus you should not set the StorageDriver at all + # Also, hash_drv requires certain tokenizer and PValue (see bug #185718) + sed -e "s:^\(StorageDriver .*\)$:#\1:" \ + -e "s:^Tokenizer .*$:Tokenizer sbph:" \ + -e "/^#PValue/d" \ + -e "s:^PValue .*$:PValue markov:" \ + -i "${D}"/${CONFDIR}/dspam.conf + fi + + # installs the notification messages + # -> The documentation is wrong! The files need to be in ./txt + echo "Scanned and tagged as SPAM with DSPAM ${PV} by Your ISP.com">"${T}"/msgtag.spam + echo "Scanned and tagged as non-SPAM with DSPAM ${PV} by Your ISP.com">"${T}"/msgtag.nonspam + insinto ${CONFDIR}/txt + doins "${S}"/txt/*.txt + doins "${T}"/msgtag.* + + # Create the opt-in / opt-out directories + diropts -m0770 -o dspam -g dspam + dodir ${HOMEDIR} + keepdir ${HOMEDIR}/opt-in + keepdir ${HOMEDIR}/opt-out + diropts -m0755 + + # logrotation scripts + if use logrotate && use debug ; then + insinto /etc/logrotate.d + newins "${FILESDIR}/logrotate.dspam" dspam + fi + + # dspam cron job + exeinto /etc/cron.daily + newexe "${FILESDIR}/dspam.cron" dspam.cron + + # documentation + dodoc CHANGELOG README* RELEASE.NOTES UPGRADING + docinto doc + dodoc doc/*.txt + docinto gentoo + dodoc "${FILESDIR}"/README.{postfix,qmail} + docinto sa_train + dodoc "${WORKDIR}"/dspam_sa_trainer/* + doman man/dspam* +} + +pkg_preinst() { + # Preserve *.data files + local installed_datafiles="${ROOT}"/${CONFDIR}/*.data + if [[ "${installed_datafiles}" != *"*.data" ]]; then + cp "${ROOT}"/${CONFDIR}/*.data "${D}"/${CONFDIR} + fi +} + +pkg_postinst() { + # need enewgroup/enewuser in this function for binary install. + create_dspam_usergroup + + ewarn "The hash_drv storage backend has the following requirements:" + ewarn " - PValue must be set to 'markov'; Do not use this pvalue with any other storage backend!" + ewarn " - Tokenizer must be either 'sbph' or 'osb'" + ewarn "See markov.txt for more info." + + if use mysql || use postgres; then + elog + elog "To setup DSPAM to run out-of-the-box on your system with a MySQL" + elog "or PostgreSQL database, run:" + elog "emerge --config =${PF}" + fi + + if use postgres && has_version ">dev-db/postgresql-8.0"; then + elog + elog "Before executing the configuration command mentioned above you have" + elog "to execute the following command:" + elog "createlang plpgsql -U postgres dspam" + fi + + if use daemon; then + elog + elog "If you want to run DSPAM in the new daemon mode remember" + elog "to make the DSPAM daemon start during boot:" + elog " rc-update add dspam default" + fi + if use daemon ; then + elog + elog "To use the DSPAM daemon mode, the used storage driver must be thread-safe." + fi + + elog + elog "Edit /etc/mail/dspam.conf with your delivery agent" + elog "See http://dspamwiki.expass.de/Installation for more info" + elog +} + +pkg_config () { + local AVAIL_BACKENDS=() + use mysql && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} mysql ) + use postgres && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} postgres ) + use sqlite && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} sqlite ) + use sqlite3 && AVAIL_BACKENDS=( ${AVAIL_BACKENDS[*]} sqlite3 ) + local USE_BACKEND + read -p "Which backend do you want to configure? (available backends are ${AVAIL_BACKENDS[*]}) " USE_BACKEND + if [[ " ${AVAIL_BACKENDS[*]} " != *" ${USE_BACKEND} "* ]] + then + eerror "The '${USE_BACKEND}' backend is not available." + return 1 + fi + + case "${USE_BACKEND}" in + + sqlite | sqlite3) + einfo "sqlite_drv will automatically create the necessary database" + ;; + + mysql) + DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") ) + for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do + [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]="" + done + DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}" + DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}" + DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}" + + local MYSQL_ROOT_USER="" + echo -n "Please enter your administrative MySQL account (default root): " + read MYSQL_ROOT_USER + if [[ -z "${MYSQL_ROOT_USER}" ]]; then + MYSQL_ROOT_USER="root" + fi + ewarn "When prompted for a password, please enter your MySQL ${MYSQL_ROOT_USER} password" + ewarn + + einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\"" + /usr/bin/mysqladmin -u ${MYSQL_ROOT_USER} -p create ${DSPAM_MySQL_DB} + + if has_version ">=virtual/mysql-4.1"; then + /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/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" ]] && echo && break + done + + if [[ "${DSPAM_MySQL_DB_Type}" == "1" ]]; then + /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql + else + /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql + fi + fi + + if use virtual-users ; then + einfo "Creating DSPAM MySQL database for virtual-users users" + einfo " Please select what kind of virtual_uids table you like to use." + einfo " [1] Virtual users added automatically (use this if this server is the primary MX)" + einfo " [2] Virtual users added manually (use it if this server is a secondary MX)" + einfo + while true; do + read -n 1 -s -p " Press 1 or 2 on the keyboard to select table type" DSPAM_MySQL_DB_Type + [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break + done + + if [[ "${DSPAM_MySQL_DB_Type}" == "1" ]]; then + /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql + else + /usr/bin/mysql -u ${MYSQL_ROOT_USER} -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_user_aliases.sql + fi + fi + + einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\"" + /usr/bin/mysql -u ${MYSQL_ROOT_USER} -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 + ;; + + postgres) + DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") ) + for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do + [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]="" + done + DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}" + DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}" + DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}" + + ewarn "When prompted for a password, please enter your PgSQL postgres password" + ewarn + + einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\"" + /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';" + + 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 ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1 + + if use virtual-users ; then + einfo "Creating DSPAM PostgreSQL database for virtual-users users" + PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual_users.sql 1>/dev/null 2>&1 + fi + ;; + + esac +} diff --git a/mail-filter/dspam/files/digest-dspam-3.8.0-r5 b/mail-filter/dspam/files/digest-dspam-3.8.0-r5 deleted file mode 100644 index a8b8a87b8423..000000000000 --- a/mail-filter/dspam/files/digest-dspam-3.8.0-r5 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 5e0e9a8641d622239c5a5dfcd73e77c6 dspam-3.8.0-patches-20070909.tar.gz 7978 -RMD160 7cc8d84fd74b7158a4b3d292f37b5cae5bb5fe43 dspam-3.8.0-patches-20070909.tar.gz 7978 -SHA256 23401c5c85d50c48d4e7a286807d5bc45bd8afc78d9ca2c4816fb8aa746765d2 dspam-3.8.0-patches-20070909.tar.gz 7978 -MD5 056b8c8b3ad9415a52c01b22ff1e64cf dspam-3.8.0.tar.gz 726160 -RMD160 e7831e2415e30e819dd9cbc0ba3f269e113e2fb9 dspam-3.8.0.tar.gz 726160 -SHA256 84a227934a7aee73516bdb82c33ee7b359e955c8cd95a1544a9a13069f79bfc7 dspam-3.8.0.tar.gz 726160 -MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230 -RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230 -SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230 diff --git a/mail-filter/dspam/files/digest-dspam-3.8.0-r6 b/mail-filter/dspam/files/digest-dspam-3.8.0-r6 new file mode 100644 index 000000000000..a8b8a87b8423 --- /dev/null +++ b/mail-filter/dspam/files/digest-dspam-3.8.0-r6 @@ -0,0 +1,9 @@ +MD5 5e0e9a8641d622239c5a5dfcd73e77c6 dspam-3.8.0-patches-20070909.tar.gz 7978 +RMD160 7cc8d84fd74b7158a4b3d292f37b5cae5bb5fe43 dspam-3.8.0-patches-20070909.tar.gz 7978 +SHA256 23401c5c85d50c48d4e7a286807d5bc45bd8afc78d9ca2c4816fb8aa746765d2 dspam-3.8.0-patches-20070909.tar.gz 7978 +MD5 056b8c8b3ad9415a52c01b22ff1e64cf dspam-3.8.0.tar.gz 726160 +RMD160 e7831e2415e30e819dd9cbc0ba3f269e113e2fb9 dspam-3.8.0.tar.gz 726160 +SHA256 84a227934a7aee73516bdb82c33ee7b359e955c8cd95a1544a9a13069f79bfc7 dspam-3.8.0.tar.gz 726160 +MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230 +RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230 +SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230 -- cgit v1.2.3-65-gdbad