summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Abbott <dabbott@gentoo.org>2009-10-24 04:15:40 -0400
committerDavid Abbott <dabbott@gentoo.org>2009-10-24 04:15:40 -0400
commit4a0af89a8aed569d55363f854343af7fea90632f (patch)
treea13f4392f64be3db64fb44fc4e5f3d935436529b /mail-filter
parentBump dev-perl/Wx-Perl-ProcessStream-0.22 (diff)
downloadperl-overlay-4a0af89a8aed569d55363f854343af7fea90632f.tar.gz
perl-overlay-4a0af89a8aed569d55363f854343af7fea90632f.tar.bz2
perl-overlay-4a0af89a8aed569d55363f854343af7fea90632f.zip
spamassassin ebuild and patch fixes bug #289113
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/spamassassin/Manifest9
-rw-r--r--mail-filter/spamassassin/files/3.0.0-spamd.conf46
-rw-r--r--mail-filter/spamassassin/files/3.0.0-spamd.init39
-rw-r--r--mail-filter/spamassassin/files/3.1.8-archive-iterator.patch16
-rw-r--r--mail-filter/spamassassin/files/3.2.2-upstream-5574-fix.patch29
-rw-r--r--mail-filter/spamassassin/files/3.2.2-upstream-5574-testcase.patch62
-rw-r--r--mail-filter/spamassassin/files/secrets.cf14
-rw-r--r--mail-filter/spamassassin/files/spamassassin-3.2.5-DESTDIR.patch273
-rw-r--r--mail-filter/spamassassin/spamassassin-3.2.5-r1.ebuild257
9 files changed, 745 insertions, 0 deletions
diff --git a/mail-filter/spamassassin/Manifest b/mail-filter/spamassassin/Manifest
new file mode 100644
index 000000000..1bbcc810b
--- /dev/null
+++ b/mail-filter/spamassassin/Manifest
@@ -0,0 +1,9 @@
+AUX 3.0.0-spamd.conf 1527 RMD160 8075268aecdf6f41f5cdacb683fe92567d860dae SHA1 01623333cecb1ef38b25a130d3b5afe016e70f1c SHA256 ea61041e8b6b1616ec096cc42245ab8442b962f72c318695f5acff1fd794ee34
+AUX 3.0.0-spamd.init 891 RMD160 d8f80c02238e22704cd588f0fee5d198f787df38 SHA1 2ed966512c79a016f8bf2242c76879434367942c SHA256 09bcdf5287b2464e754f78647c939b0de86c135433eaa3ca45d89ab2b68a79ac
+AUX 3.1.8-archive-iterator.patch 501 RMD160 6eb7ef7c73d8f207d04e5cffe59e8d924d13c06e SHA1 0b3fbbeb778daffa72094a68d91a48073438ef0a SHA256 244fa7e6af21998f7ba1d7632c618b50924401effb84db79070b9c7c24e41215
+AUX 3.2.2-upstream-5574-fix.patch 1271 RMD160 4b8a47313b220701f2fb74d4c2c8f552f90a9c82 SHA1 6a1a42770f30eeef76d29fa38e5f19817b68b827 SHA256 ac262a3950e0d6c00619488d14be34859e774ff3b7b3bd6cf97ce556c36f660d
+AUX 3.2.2-upstream-5574-testcase.patch 1611 RMD160 e94baa4f60c825777744ffcd58fdcda2951721f6 SHA1 1a4e7947bb46d2e475d9db33e682136295075c91 SHA256 9d5439c465418c89c10bd10b0802c80f73332fc47d5ce7df3e506696f6cb559e
+AUX secrets.cf 664 RMD160 afb1212a464bd7053c1301c1a1e670b73216528a SHA1 a742beddf850e55bc4454a7548dc43c36f8e9760 SHA256 9f134c7b857b21689f612fc6d131f719e5a65e2ba341b282e7aa57402c854139
+AUX spamassassin-3.2.5-DESTDIR.patch 8856 RMD160 c7aa95f1ddc21e7668266fe3eb00342ba5569c8c SHA1 045a446362b8b0491164a53cff18391c49fe6786 SHA256 f73e3d63b7fd79c364799cd1e3525369ac483019e55c079f33529b6ce81c9264
+DIST Mail-SpamAssassin-3.2.5.tar.bz2 1011883 RMD160 444baab6d966d4366834b82cde34c81e3e521144 SHA1 32b701ffc68f7975eded107c456b902bc710d8b2 SHA256 baaab5e4da7d3b0e04c0db579bdb44bbd6be916d29540682346eccead23f6c8a
+EBUILD spamassassin-3.2.5-r1.ebuild 7949 RMD160 461d32b4b0661587c7d59c75917d6aeb0b621e12 SHA1 1ab3f93ccc184ef53d223bc0aefe3d9d174c29e6 SHA256 4a2a67f81c018c8cca12b6549ef41b57d80409440753394caa3cf5140444e51b
diff --git a/mail-filter/spamassassin/files/3.0.0-spamd.conf b/mail-filter/spamassassin/files/3.0.0-spamd.conf
new file mode 100644
index 000000000..b6fca036f
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.0.0-spamd.conf
@@ -0,0 +1,46 @@
+# Config file for /etc/init.d/spamd
+
+
+# ***WARNING***
+# spamd was not designed to listed to an untrusted network. spamd
+# is vulnerable to DoS attacks (and eternal doom) if used to listen
+# to an untrusted network.
+#
+
+
+# Some options:
+#
+# -c to create a per user configuration file
+# -H [dir] to switch home dirs for helper apps, dir optional
+# -i [ip] to listen on the specified IP,
+# 127.0.0.1 if omitted,
+# 0.0.0.0 (ie. all) if given without value;
+# must be used in combination with -A to actually allow
+# connections from anybody but localhost
+# -m limit to set the number of children, default 5
+# -u user the user to run spamd as
+# -L if you want to run no net tests
+#
+# for more help look in man spamd
+#
+# Note: if you plan on using the -u flag to spamd you will need to
+# make sure the location of the PID file is writable by that user.
+# This can be done by making the directory /var/run/spamd and
+# changing the owner to the UID that runs spamd. You will then
+# need to edit $pidfile in /etc/init.d/spamd. This should fix the
+# problem with stop/restart in the init scripts.
+#
+# See http://bugs.gentoo.org/show_bug.cgi?id=70124 for a full
+# explanation.
+
+SPAMD_OPTS="-m 5 -c -H"
+
+# spamd stores its pid in this file. If you use the -u option to
+# run spamd under another user, you might need to adjust it.
+
+PIDFILE="/var/run/spamd.pid"
+
+# SPAMD_NICELEVEL lets you set the 'nice'ness of the running
+# spamd process
+
+# SPAMD_NICELEVEL=5
diff --git a/mail-filter/spamassassin/files/3.0.0-spamd.init b/mail-filter/spamassassin/files/3.0.0-spamd.init
new file mode 100644
index 000000000..a5e465faf
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.0.0-spamd.init
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/files/3.0.0-spamd.init,v 1.8 2008/05/14 21:25:56 sbriesen Exp $
+
+# NB: Config is in /etc/conf.d/spamd
+
+# Provide a default location if they haven't in /etc/conf.d/spamd
+PIDFILE=${PIDFILE:-/var/run/spamd.pid}
+
+opts="reload"
+
+depend() {
+ need net
+ before mta
+ use logger
+}
+
+start() {
+ ebegin "Starting spamd"
+ start-stop-daemon --start --quiet \
+ --name spamd \
+ --nicelevel ${SPAMD_NICELEVEL:-0} \
+ --exec /usr/sbin/spamd -- -d -r ${PIDFILE} \
+ ${SPAMD_OPTS}
+ eend $? "Failed to start spamd"
+}
+
+stop() {
+ ebegin "Stopping spamd"
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ eend $? "Failed to stop spamd"
+}
+
+reload() {
+ ebegin "Reloading configuration"
+ kill -HUP $(< ${PIDFILE})
+ eend $?
+}
diff --git a/mail-filter/spamassassin/files/3.1.8-archive-iterator.patch b/mail-filter/spamassassin/files/3.1.8-archive-iterator.patch
new file mode 100644
index 000000000..b4007f099
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.1.8-archive-iterator.patch
@@ -0,0 +1,16 @@
+Index: sa-learn.raw
+===================================================================
+--- sa-learn.raw (revision 507745)
++++ sa-learn.raw (working copy)
+@@ -402,7 +402,10 @@
+
+ # make sure the target list is in the normal AI format
+ if ($targets[$elem] !~ /^[^:]*:[a-z]+:/) {
+- $targets[$elem] = target($targets[$elem]);
++ my $item = splice @targets, $elem, 1;
++ $elem--; # go back to this element again
++ target($item); # add back to the list
++ next;
+ }
+ }
+
diff --git a/mail-filter/spamassassin/files/3.2.2-upstream-5574-fix.patch b/mail-filter/spamassassin/files/3.2.2-upstream-5574-fix.patch
new file mode 100644
index 000000000..413353943
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.2.2-upstream-5574-fix.patch
@@ -0,0 +1,29 @@
+Index: spamd/spamd.raw
+===================================================================
+--- spamd/spamd.raw (revision 559081)
++++ spamd/spamd.raw (working copy)
+@@ -1024,10 +1024,11 @@
+ # use the POSIX functions to hide the platform specific workarounds
+ POSIX::setgid($ugid); # set effective and real gid
+ POSIX::setuid($uuid); # set effective and real UID
++ $< = $uuid; $> = $uuid; # bug 5574
+
+ # keep the sanity check to catch problems like bug 3900 just in case
+ if ( $> != $uuid and $> != ( $uuid - 2**32 ) ) {
+- die "spamd: setuid to uid $uuid failed\n";
++ die "spamd: setuid to uid $uuid failed (> = $>, < = $<)\n";
+ }
+ }
+
+Index: lib/Mail/SpamAssassin/Util.pm
+===================================================================
+--- lib/Mail/SpamAssassin/Util.pm (revision 559081)
++++ lib/Mail/SpamAssassin/Util.pm (working copy)
+@@ -1336,6 +1336,7 @@
+ # bug 3586: kludges needed to work around platform dependent behavior assigning to $<
+ # The POSIX functions deal with that so just use it here
+ POSIX::setuid($touid);
++ $< = $touid; $> = $touid; # bug 5574
+
+ # Check that we have now accomplished the setuid: catch bug 3586 if it comes back
+ if ($< != $touid) {
diff --git a/mail-filter/spamassassin/files/3.2.2-upstream-5574-testcase.patch b/mail-filter/spamassassin/files/3.2.2-upstream-5574-testcase.patch
new file mode 100644
index 000000000..67379769f
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.2.2-upstream-5574-testcase.patch
@@ -0,0 +1,62 @@
+Index: MANIFEST
+===================================================================
+--- MANIFEST (revision 559081)
++++ MANIFEST (working copy)
+@@ -504,3 +504,4 @@
+ t/root_spamd_x_u.t
+ t/spamc_x_E_R.t
+ t/spamc_x_e.t
++t/root_spamd_u.t
+Index: t/root_spamd_u.t
+===================================================================
+--- t/root_spamd_u.t (revision 0)
++++ t/root_spamd_u.t (revision 0)
+@@ -0,0 +1,42 @@
++#!/usr/bin/perl
++
++# run with: sudo prove -v t/root_spamd*
++
++use lib '.'; use lib 't';
++use SATest; sa_t_init("root_spamd_u");
++use Test;
++
++use constant TEST_ENABLED => conf_bool('run_root_tests');
++use constant IS_ROOT => eval { ($> == 0); };
++use constant RUN_TESTS => (TEST_ENABLED && IS_ROOT);
++
++BEGIN { plan tests => (RUN_TESTS ? 14 : 0) };
++exit unless RUN_TESTS;
++
++# ---------------------------------------------------------------------------
++
++%patterns = (
++
++q{ Return-Path: sb55sb55@yahoo.com}, 'firstline',
++q{ Subject: There yours for FREE!}, 'subj',
++q{ X-Spam-Status: Yes, score=}, 'status',
++q{ X-Spam-Flag: YES}, 'flag',
++q{ X-Spam-Level: **********}, 'stars',
++q{ TEST_ENDSNUMS}, 'endsinnums',
++q{ TEST_NOREALNAME}, 'noreal',
++q{ This must be the very last line}, 'lastline',
++
++);
++
++# run spamc as unpriv uid
++$spamc = "sudo -u nobody $spamc";
++
++ok(start_spamd("-L -u nobody"));
++
++$SIG{ALRM} = sub { die "timed out"; };
++alarm 10;
++ok(spamcrun("< data/spam/001", \&patterns_run_cb));
++alarm 0;
++ok_all_patterns();
++
++ok(stop_spamd());
+
+Property changes on: t/root_spamd_u.t
+___________________________________________________________________
+Name: svn:executable
+ + *
+
diff --git a/mail-filter/spamassassin/files/secrets.cf b/mail-filter/spamassassin/files/secrets.cf
new file mode 100644
index 000000000..efa31a6fb
--- /dev/null
+++ b/mail-filter/spamassassin/files/secrets.cf
@@ -0,0 +1,14 @@
+# The below sample from bug 91430 is an example of using mysql
+# for spam filter storage
+
+#(Tell Spamassissin to use MySQL for bayes data
+#bayes_store_module Mail::SpamAssassin::BayesStore::SQL
+#bayes_sql_dsn DBI:mysql:sa_bayes:localhost:3306
+#bayes_sql_username db_name
+#bayes_sql_password another_very_secret_password
+
+#(Tell Spamassissin to use MySQL for AWL data
+#auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList
+#user_awl_dsn DBI:mysql:sa_bayes:localhost:3306
+#user_awl_sql_username db_name
+#user_awl_sql_password another_very_secret_password
diff --git a/mail-filter/spamassassin/files/spamassassin-3.2.5-DESTDIR.patch b/mail-filter/spamassassin/files/spamassassin-3.2.5-DESTDIR.patch
new file mode 100644
index 000000000..a9765fc55
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin-3.2.5-DESTDIR.patch
@@ -0,0 +1,273 @@
+--- Mail-SpamAssassin-3.2.5/Makefile.PL.old 2009-10-21 23:25:18.000000000 +0200
++++ Mail-SpamAssassin-3.2.5/Makefile.PL 2009-10-21 23:31:28.000000000 +0200
+@@ -12,12 +12,12 @@
+
+ # avoid stupid 'Argument "6.30_01" isn't numeric in numeric ge (>=)' warnings;
+ # strip off the beta subversion noise that causes the trouble.
+ $mm_version =~ s/_\S+$//; # "6.30_01" => "6.30"
+
+-if ($mm_version+0 < 5.45) {
+- die "SpamAssassin Makefile.PL requires at least ExtUtils::MakeMaker v5.45";
++if ($mm_version < 6.17) {
++ die "SpamAssassin Makefile.PL requires at least ExtUtils::MakeMaker v6.17";
+ }
+
+ use constant RUNNING_ON_WINDOWS => ($^O =~ /^(mswin|dos|os2)/oi);
+ use constant HAS_DBI => eval { require DBI; };
+
+@@ -82,11 +82,10 @@
+ );
+
+
+ sub parse_arg {
+ my($val, $name) = (@_);
+-
+ if ($val =~ /^($name)=["']?(.*?)["']?$/) {
+ return $2;
+ } else {
+ return undef;
+ }
+@@ -107,53 +106,27 @@
+ return 'yes' if bool($val, $def);
+ return 'no';
+ }
+
+
+-
+ my %opt = (
+- 'build_spamc' => undef,
++ 'build_spamc' => undef,
+ 'enable_ssl' => undef,
+ 'contact_address' => undef,
+ 'destdir' => undef,
+ );
+ ARGV: foreach (@ARGV) {
+ foreach my $key (keys %opt) {
+- my $val;
+-
+- $val = parse_arg($_, uc($key));
++ my $val = parse_arg($_, uc($key));
+ if (defined $val) {
+ $opt{$key} = $val;
+ next ARGV;
+ }
+ }
+ }
+
+
+-# Gather some information about what EU::MM offers and/or needs
+-my(
+- $mm_knows_destdir,
+- $mm_has_destdir,
+- $mm_has_good_destdir,
+- $mm_needs_destdir,
+-);
+-
+-# MakeMaker prior to 6.11 doesn't support DESTDIR which is needed for
+-# packaging with builddir!=destdir. See bug 2388.
+-$mm_knows_destdir = $ExtUtils::MakeMaker::Recognized_Att_Keys{DESTDIR};
+-$mm_has_good_destdir = $mm_version >= 6.11;
+-# Add DESTDIR hack only if it's requested (and necessary)
+-$mm_needs_destdir = $opt{'destdir'} && !$mm_has_good_destdir;
+-$mm_has_destdir = $mm_knows_destdir || $mm_needs_destdir;
+-push(@ATT_KEYS, 'DESTDIR') if $mm_needs_destdir;
+-
+-# Now make EU::MM understand our extended vars
+-foreach my $key (@ATT_KEYS) {
+- $ExtUtils::MakeMaker::Recognized_Att_Keys{$key} = 1;
+-}
+-
+-
+ # Gather the rules files in the range 00-69; we do this in perl because
+ # it's more portable. Also, plugin .pm files.
+ my @datafiles = map { s,^rules/,,; $_ }
+ grep { -f $_ } (<rules/*.cf>, <rules/*.pm>);
+ my $datafiles = join(' ', (grep
+@@ -270,75 +243,27 @@
+
+ # We have only this Makefile.PL and this option keeps MakeMaker from
+ # asking all questions twice after a 'make dist*'.
+ 'NORECURS' => 1,
+
+- # bug 5074: perl 5.6.1 (with ExtUtils::MakeMaker 5.45) attempts to
+- # recurse anyway unless this is explicitly specified
+- 'DIR' => [ ],
+-
+ # Don't add META.yml to the MANIFEST for god's sake!
+ 'NO_META' => 1,
+ );
+
+ # rules/72_active.cf is built from "rulesrc", but *must* exist before
+ # WriteMakefile() is called due to shortcomings in MakeMaker.
+ my @FILES_THAT_MUST_EXIST = qw(
+ rules/72_active.cf
+ );
+
+-# That META.yml stuff was introduced with Perl 6.06_03, see
+-# <http://archive.develooper.com/makemaker@perl.org/msg00922.html>
+-# <http://archive.develooper.com/makemaker@perl.org/msg00984.html>
+-delete $makefile{'NO_META'} if $mm_version < 6.06_03;
+-
+ # make sure certain optional modules are up-to-date if they are installed
+ # also see PREREQ_PM above
+ my %CURRENT_PM = (
+ 'Net::DNS' => (RUNNING_ON_WINDOWS ? 0.46 : 0.34),
+ 'Razor2::Client::Agent' => 2.40,
+ );
+
+-if ($mm_needs_destdir) {
+- my $error = <<DESTDIR_HACK;
+-
+- ***********************************************************************
+- ExtUtils::MakeMaker ${mm_version} doesn't include support for DESTDIR,
+- so if you want to be on the safe side, you might want to upgrade your
+- ExtUtils::MakeMaker to version 6.11 or later. It is available via CPAN.
+-
+- You can use either the CPAN shell or go to
+- <http://search.cpan.org/search?module=ExtUtils::MakeMaker>
+- to get an up-to-date version.
+-
+- This should only be necessary if you are creating binary packages.
+- ***********************************************************************
+-
+-DESTDIR_HACK
+- $error =~ s/^ {4}//gm;
+- warn $error;
+-}
+-elsif ($opt{'destdir'} and !$mm_has_good_destdir) {
+- my $error = <<DESTDIR_BUG;
+-
+- ***********************************************************************
+- ExtUtils::MakeMaker ${mm_version} contains bugs that may cause problems
+- in the \"make\" process. It is recommended that you upgrade
+- ExtUtils::MakeMaker to version 6.11 or later. It is available via CPAN.
+-
+- You can use either the CPAN shell or go to
+- <http://search.cpan.org/search?module=ExtUtils::MakeMaker>
+- to get an up-to-date version.
+-
+- This should only be necessary if you are creating binary packages.
+- ***********************************************************************
+-
+-DESTDIR_BUG
+- $error =~ s/^ {4}//gm;
+- warn $error;
+-}
+-
+
+ # All the $(*MAN1*) stuff is empty/zero if Perl was Configured with -Dman1dir=none;
+ # however, support site/vendor man1 dirs (bug 5338)
+ unless($Config{installman1dir}
+ || $Config{installsiteman1dir}
+@@ -405,22 +330,19 @@
+
+ # Now finish the meta hash and dump the Makefile
+ $makefile{EXE_FILES} = [ values %{$makefile{EXE_FILES}} ];
+ $makefile{AUTHOR} =~ s/(<.+) at (.+>)/$1\@$2/;
+ WriteMakefile(%makefile);
+-print "Makefile written by ExtUtils::MakeMaker ${mm_version}\n";
++print "Makefile written by ExtUtils::MakeMaker $mm_version\n";
+
+ #######################################################################
+
+ package MY;
+
+-
+ use vars qw(
+ $MY_GLOBALS_ARE_SANE
+-
+ $RUNNING_ON_WINDOWS
+-
+ @REPOSITORIES
+
+ $MACRO_RE
+ $EQ_RE
+ $EQ
+@@ -906,19 +828,10 @@
+ init_MY_globals($self);
+
+ foreach (@code) {
+ # Add our install targets as a dependency to all top-level install targets
+ s/^(install(?:_[a-z]+)?\s*::?\s*.*)$/$1 conf__install data__install/;
+-
+- # Now do the DESTDIR hack, if necessary.
+- next if !$mm_needs_destdir;
+- # Write the correct path to perllocal.pod
+- next if /installed into/;
+-
+- # Replace all other $(INSTALL*) vars (except $(INSTALLDIRS) of course)
+- # with their $(DESTINSTALL*) counterparts
+- s/\Q$(\E(INSTALL(?!DIRS)${MACRO_RE})\Q)\E/\$(DEST$1)/g;
+ }
+
+ clean_MY_globals($self);
+ return join("\n", @code);
+ }
+@@ -956,32 +869,10 @@
+ set_macro($rprefix, macro_ref('PREFIX'));
+ $line .= "\n" . macro_def($rprefix);
+ }
+ }
+ }
+-
+- if (line_has_macro_def($line, 'MM_VERSION')) {
+- # These macros are just for debugging purposes.
+- $line = join("\n", $line,
+- macro_def(MM_HAS_DESTDIR => ::yesno($mm_has_destdir)),
+- macro_def(MM_HAS_GOOD_DESTDIR => ::yesno($mm_has_good_destdir)),
+- macro_def(MM_KNOWS_DESTDIR => ::yesno($mm_knows_destdir)),
+- macro_def(MM_NEEDS_DESTDIR => ::yesno($mm_needs_destdir)),
+- );
+- }
+-
+- # Add DESTDIR support if necessary
+- if ($mm_needs_destdir) {
+- if (line_has_macro_def($line, 'INSTALLDIRS')) {
+- $line .= "\n" . macro_def('DESTDIR');
+- }
+- elsif (line_has_macro_def($line, qr/INSTALL${MACRO_RE}/)) {
+- my $macro = get_macro_name_from_line($line);
+- $line .= "\n" . macro_def('DEST' . $macro,
+- macro_ref('DESTDIR') . macro_ref($macro));
+- }
+- }
+ }
+ push(@code, qq{});
+
+ # Add some additional target dirs
+ {
+@@ -1015,13 +906,11 @@
+ foreach my $r (@REPOSITORIES) {
+ my $macro = 'INSTALL' . repository($r) . $m;
+ # The INSTALL* macros.
+ push(@code, macro_def($macro));
+ # The DESTINSTALL* macros.
+- push(@code, macro_def('DEST' . $macro,
+- macro_ref('DESTDIR') . macro_ref($macro)))
+- if $mm_has_destdir;
++ push(@code, macro_def('DEST' . $macro, macro_ref('DESTDIR') . macro_ref($macro)));
+ }
+ }
+ }
+
+ # Set the PERL_* stuff
+@@ -1068,17 +957,12 @@
+ # SCRIPT macro is the same for all repositories.
+ foreach my $macro (qw(SCRIPT DATA CONF LIB)) {
+ push(@code, macro_def('I_' . $macro . 'DIR',
+ macro_ref('INSTALL' . repository($repository, $macro eq 'SCRIPT') . $macro)));
+
+- if ($mm_has_destdir) {
+- push(@code, macro_def('B_' . $macro . 'DIR',
+- macro_ref('DESTINSTALL' . repository($repository, $macro eq 'SCRIPT') . $macro)));
+- } else {
+- push(@code, macro_def('B_' . $macro . 'DIR',
+- macro_ref('I_' . $macro . 'DIR')));
+- }
++ push(@code, macro_def('B_' . $macro . 'DIR',
++ macro_ref('DESTINSTALL' . repository($repository, $macro eq 'SCRIPT') . $macro)));
+ }
+ }
+
+ clean_MY_globals($self);
+ return join("\n", @code);
diff --git a/mail-filter/spamassassin/spamassassin-3.2.5-r1.ebuild b/mail-filter/spamassassin/spamassassin-3.2.5-r1.ebuild
new file mode 100644
index 000000000..5fcfc6a75
--- /dev/null
+++ b/mail-filter/spamassassin/spamassassin-3.2.5-r1.ebuild
@@ -0,0 +1,257 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit perl-module eutils
+
+MY_P=Mail-SpamAssassin-${PV//_/-}
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam."
+HOMEPAGE="http://spamassassin.apache.org/"
+SRC_URI="http://archive.apache.org/dist/spamassassin/source/${MY_P}.tar.bz2 mirror://gentoo/${MY_P}.tar.bz2"
+
+SRC_TEST="do"
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="berkdb qmail ssl doc ldap mysql postgres sqlite tools ipv6"
+
+DEPEND=">=dev-lang/perl-5.8.2-r1
+ virtual/perl-MIME-Base64
+ >=virtual/perl-PodParser-1.32
+ virtual/perl-Storable
+ virtual/perl-Time-HiRes
+ >=dev-perl/HTML-Parser-3.43
+ >=dev-perl/Net-DNS-0.53
+ dev-perl/Digest-SHA1
+ dev-perl/libwww-perl
+ >=virtual/perl-Archive-Tar-1.26
+ app-crypt/gnupg
+ >=virtual/perl-IO-Zlib-1.04
+ >=dev-util/re2c-0.12.0
+ ssl? (
+ dev-perl/IO-Socket-SSL
+ dev-libs/openssl
+ )
+ berkdb? (
+ virtual/perl-DB_File
+ )
+ ldap? ( dev-perl/perl-ldap )
+ mysql? (
+ dev-perl/DBI
+ dev-perl/DBD-mysql
+ )
+ postgres? (
+ dev-perl/DBI
+ dev-perl/DBD-Pg
+ )
+ sqlite? (
+ dev-perl/DBI
+ dev-perl/DBD-SQLite
+ )
+
+ ipv6? (
+ dev-perl/IO-Socket-INET6
+ )"
+
+PATCHES=( "${FILESDIR}/${PN}-3.2.5-DESTDIR.patch" )
+
+
+src_compile() {
+ # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
+ # (just to be sure, nobody knows how it could happen in the first place).
+ myconf="SYSCONFDIR=/etc DATADIR=/usr/share/spamassassin"
+
+ # If ssl is enabled, spamc can be built with ssl support
+ if use ssl; then
+ myconf="${myconf} ENABLE_SSL=yes"
+ else
+ myconf="${myconf} ENABLE_SSL=no"
+ fi
+
+ # Set the path to the Perl executable explictly. This will be used to
+ # create the initial sharpbang line in the scripts and might cause
+ # a versioned app name end in there, see
+ # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
+ myconf="${myconf} PERL_BIN=/usr/bin/perl"
+
+ # If you are going to enable taint mode, make sure that the bug where
+ # spamd doesn't start when the PATH contains . is addressed, and make
+ # sure you deal with versions of razor <2.36-r1 not being taint-safe.
+ # <http://bugzilla.spamassassin.org/show_bug.cgi?id=2511> and
+ # <http://spamassassin.org/released/Razor2.patch>.
+ myconf="${myconf} PERL_TAINT=no"
+
+ # No settings needed for 'make all'.
+ mymake=""
+
+ # Neither for 'make install'.
+ myinst=""
+
+ # Add Gentoo tag to make it easier for the upstream devs to spot
+ # possible modifications or patches.
+ version_tag="g${PV:6}${PR}"
+ version_str="${PV//_/-}-${version_tag}"
+
+ # Create the Gentoo config file before Makefile.PL is called so it
+ # is copied later on.
+ echo "version_tag ${version_tag}" > rules/11_gentoo.cf
+
+ # Setting the following env var ensures that no questions are asked.
+ export PERL_MM_USE_DEFAULT=1
+ perl-module_src_prep
+ # Run the autoconf stuff now, just to make the build sequence look more
+ # familiar to the user :) Plus feeding the VERSION_STRING skips some
+ # calls to Perl.
+ make spamc/Makefile VERSION_STRING="${version_str}"
+
+ # Now compile all the stuff selected.
+ perl-module_src_compile
+ if use qmail; then
+ make spamc/qmail-spamc || die building qmail-spamc failed
+ fi
+
+ # Remove the MANIFEST files as they aren't docu files
+ rm -f MANIFEST*
+
+ use doc && make text_html_doc
+}
+
+src_install () {
+ perl-module_src_test
+}
+
+src_install () {
+ perl-module_src_install
+
+ # Create the stub dir used by sa-update and friends
+ dodir /var/lib/spamassassin
+
+ # Move spamd to sbin where it belongs.
+ dodir /usr/sbin
+ mv "${D}"/usr/bin/spamd "${D}"/usr/sbin/spamd || die
+
+ use qmail && dobin spamc/qmail-spamc
+
+ dosym /etc/mail/spamassassin /etc/spamassassin
+
+ # Disable plugin by default
+ sed -i -e 's/^loadplugin/\#loadplugin/g' "${D}"/etc/mail/spamassassin/init.pre
+
+ # Add the init and config scripts.
+ newinitd "${FILESDIR}"/3.0.0-spamd.init spamd
+ newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
+
+ if use doc; then
+ dodoc NOTICE TRADEMARK CREDITS INSTALL UPGRADE BUGS USAGE \
+ sql/README.bayes sql/README.awl README.ldap procmailrc.example \
+ sample-nonspam.txt sample-spam.txt rules/STATISTICS-set0.txt \
+ STATISTICS-set1.txt STATISTICS-set2.txt STATISTICS-set3.txt \
+ spamd/PROTOCOL
+
+ # Rename some docu files so they don't clash with others
+ newdoc spamd/README README.spamd
+ newdoc sql/README README.sql
+ newdoc ldap/README README.ldap
+ use qmail && newdoc spamc/README.qmail README.qmail
+
+ dohtml doc/*.html
+ docinto sql
+ dodoc sql/*.sql
+ fi
+
+ # Install provided tools. See bug 108168
+ if use tools; then
+ docinto tools
+ dodoc tools/*
+ fi
+
+ cp "${FILESDIR}"/secrets.cf "${D}"/etc/mail/spamassassin/secrets.cf.example
+ fperms 0400 /etc/mail/spamassassin/secrets.cf.example
+ echo "">>${D}/etc/mail/spamassassin/local.cf.example
+ echo "# Sensitive data, such as database connection info, should">>${D}/etc/mail/spamassassin/local.cf.example
+ echo "# be stored in /etc/mail/spamassassin/secrets.cf with">>${D}/etc/mail/spamassassin/local.cf.example
+ echo "# appropriate permissions">>${D}/etc/mail/spamassassin/local.cf.example
+}
+
+pkg_postinst() {
+ perl-module_pkg_postinst
+
+ if ! has_version "perl-core/DB_File"; then
+ einfo "The Bayes backend requires the Berkeley DB to store its data. You"
+ einfo "need to emerge perl-core/DB_File or USE=berkdb to make it available."
+ fi
+
+ if has_version "mail-filter/razor"; then
+ if ! has_version ">=mail-filter/razor-2.61"; then
+ ewarn "You have $(best_version mail-filter/razor) installed but SpamAssassin"
+ if has_version "<mail-filter/razor-2.40"; then
+ ewarn "requires at least version 2.40, version 2.61 or later is recommended."
+ else
+ ewarn "recommends at least version 2.61."
+ fi
+ fi
+ fi
+
+ if use doc; then
+ einfo
+ einfo "Please read the file INSTALL in"
+ einfo " /usr/share/doc/${PF}/"
+ einfo "to find out which optional modules you need to install to enable"
+ einfo "additional features which depend on them."
+ einfo
+ einfo "If upgraded from 2.x, please read the file UPGRADE in"
+ einfo " /usr/share/doc/${PF}/"
+ einfo
+ fi
+
+ ewarn
+ ewarn "spamd is not designed to listen to an untrusted network"
+ ewarn "and is vulnerable to DoS attacks (and eternal doom) if"
+ ewarn "configured to do so"
+ ewarn
+ elog "If you plan on using the -u flag to spamd, please read the notes"
+ elog "in /etc/conf.d/spamd regarding the location of the pid file."
+
+ einfo
+ einfo "If you build ${PN} with optional dependancy support,"
+ einfo "you can enable them in /etc/mail/spamassassin/init.pre"
+ einfo
+
+ if has_version '>=dev-lang/perl-5.8.8'; then
+ elog "A note from the SA developers:"
+ elog "Perl 5.8 now uses Unicode internally by default, which causes trouble for"
+ elog "SpamAssassin (and almost all other reasonably complex pieces of perl"
+ elog "code!)."
+ elog ""
+ elog "We've worked around this in most places, as far as we know, but there may"
+ elog "still be some issues. In addition, there is a speed hit, which it would"
+ elog "be nice to avoid."
+ elog ""
+ elog "Setting the LANG environment variable before any invocation of"
+ elog "SpamAssassin sometimes seems to help fix it, like so:"
+ elog ""
+ elog " export LANG=en_US"
+ elog ""
+ elog "Notably, the LANG setting must not include \"utf8\". However, some folks"
+ elog "have reported that this makes no difference. ;)"
+ fi
+ einfo
+ if ! has_version 'dev-perl/Mail-SPF-Query'; then
+ elog "For spf support, please emerge dev-perl/Mail-SPF-Query"
+ fi
+ if ! has_version 'mail-filter/dcc'; then
+ elog "For dcc support, please emerge mail-filter/dcc"
+ fi
+ if ! has_version 'dev-python/pyzor'; then
+ elog "For pyzor support, please emerge dev-python/pyzor"
+ fi
+ if ! has_version 'mail-filter/razor'; then
+ elog "For razor support, please emerge mail-filter/razor"
+ fi
+ einfo
+ elog "For addtional functionality, you may wish to emerge:"
+ elog "dev-perl/IP-Country dev-perl/Net-Ident "
+ elog "dev-perl/Mail-DKIM"
+
+}