# HG changeset patch # User Michael Schloh von Bennewitz # Date 1316606111 -7200 # Node ID c158bb6622e1b398d79c3fce69b008067d9915c5 # Parent b8e8f9dbbfd382e9d6c43631ef5b14590836f2e5 Resynchronize with upstream package maintainer version. diff -r b8e8f9dbbfd3 -r c158bb6622e1 spamassassin/spamassassin.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spamassassin/spamassassin.patch Wed Sep 21 13:55:11 2011 +0200 @@ -0,0 +1,250 @@ +Index: lib/Mail/SpamAssassin/Dns.pm +--- lib/Mail/SpamAssassin/Dns.pm.orig 2010-03-16 15:49:21.000000000 +0100 ++++ lib/Mail/SpamAssassin/Dns.pm 2011-02-08 16:03:06.000000000 +0100 +@@ -754,7 +754,7 @@ + dbg("dns: entering helper-app run mode"); + $self->{old_slash} = $/; # Razor pollutes this + %{$self->{old_env}} = (); +- if ( defined %ENV ) { ++ if (%ENV) { + # undefined values in %ENV can result due to autovivification elsewhere, + # this prevents later possible warnings when we restore %ENV + while (my ($key, $value) = each %ENV) { +Index: lib/Mail/SpamAssassin/HTML.pm +--- lib/Mail/SpamAssassin/HTML.pm.orig 2010-03-16 15:49:21.000000000 +0100 ++++ lib/Mail/SpamAssassin/HTML.pm 2011-02-08 16:03:06.000000000 +0100 +@@ -191,7 +191,7 @@ + my $self = shift; + my %options = @_; + +- return join('', @{ $self->{text} }) unless keys %options; ++ return join('', @{ $self->{text} }) unless %options; + + my $mask; + while (my ($k, $v) = each %options) { +Index: lib/Mail/SpamAssassin/Plugin/AntiVirus.pm +--- lib/Mail/SpamAssassin/Plugin/AntiVirus.pm.orig 2010-03-16 15:49:21.000000000 +0100 ++++ lib/Mail/SpamAssassin/Plugin/AntiVirus.pm 2011-02-08 16:04:30.000000000 +0100 +@@ -98,9 +98,9 @@ + my ($ctype, $boundary, $charset, $name) = + Mail::SpamAssassin::Util::parse_content_type($p->get_header('content-type')); + +- $name = lc $name || ''; ++ $name = lc($name || ''); + +- my $cte = lc $p->get_header('content-transfer-encoding') || ''; ++ my $cte = lc($p->get_header('content-transfer-encoding') || ''); + $ctype = lc $ctype; + + if ($name && $name =~ /\.(?:ade|adp|asx|bas|bat|chm|cmd|com|cpl|crt|dll|exe|hlp|hta|inf|ins|isp|js|jse|lnk|mda|mdb|mde|mdt|mdw|mdz|msc|msi|msp|mst|nws|ops|pcd|pif|prf|reg|scf|scr\??|sct|shb|shs|shm|swf|url|vb|vbe|vbs|vbx|vxd|wsc|wsf|wsh)$/) +Index: lib/Mail/SpamAssassin/Plugin/BodyEval.pm +--- lib/Mail/SpamAssassin/Plugin/BodyEval.pm.orig 2010-03-16 15:49:21.000000000 +0100 ++++ lib/Mail/SpamAssassin/Plugin/BodyEval.pm 2011-02-08 16:03:06.000000000 +0100 +@@ -119,7 +119,7 @@ + } + + # If there are no words, mark if there's at least 1 image ... +- if (keys %html == 0 && exists $pms->{html}{inside}{img}) { ++ if (!%html && exists $pms->{html}{inside}{img}) { + # Use "\n" as the mark since it can't ever occur normally + $html{"\n"}=1; + } +Index: lib/Mail/SpamAssassin/Plugin/Check.pm +--- lib/Mail/SpamAssassin/Plugin/Check.pm.orig 2010-03-16 15:49:21.000000000 +0100 ++++ lib/Mail/SpamAssassin/Plugin/Check.pm 2011-02-08 16:03:06.000000000 +0100 +@@ -307,64 +307,51 @@ + my $package_name = __PACKAGE__; + my $methodname = $package_name."::_".$ruletype."_tests_".$clean_priority; + +- if (defined &{$methodname} && !$doing_user_rules) { +-run_compiled_method: +- # dbg("rules: run_generic_tests - calling %s", $methodname); +- my $t = Mail::SpamAssassin::Timeout->new({ deadline => $master_deadline }); +- my $err = $t->run(sub { +- no strict "refs"; +- $methodname->($pms, @{$opts{args}}); +- }); +- if ($t->timed_out() && $master_deadline && time > $master_deadline) { +- info("check: exceeded time limit in $methodname, skipping further tests"); +- $pms->{deadline_exceeded} = 1; +- } +- return; +- } ++ if (!defined &{$methodname} || $doing_user_rules) { + +- # use %nopts for named parameter-passing; it's more friendly to future-proof +- # subclassing, since new parameters can be added without breaking third-party +- # subclassed implementations of this plugin. +- my %nopts = ( +- ruletype => $ruletype, +- doing_user_rules => $doing_user_rules, +- priority => $priority, +- clean_priority => $clean_priority +- ); +- +- # build up the eval string... +- $self->{evalstr_methodname} = $methodname; +- $self->{evalstr_chunk_current_methodname} = undef; +- $self->{evalstr_chunk_methodnames} = []; +- $self->{evalstr_chunk_prefix} = []; # stack (array) of source code sections +- $self->{evalstr} = ''; $self->{evalstr_l} = 0; +- $self->{evalstr2} = ''; +- $self->begin_evalstr_chunk($pms); +- +- $self->push_evalstr_prefix($pms, ' +- # start_rules_plugin_code '.$ruletype.' '.$priority.' +- my $scoresptr = $self->{conf}->{scores}; +- '); +- if (defined $opts{pre_loop_body}) { +- $opts{pre_loop_body}->($self, $pms, $conf, %nopts); +- } +- $self->add_evalstr($pms, +- $self->start_rules_plugin_code($ruletype, $priority) ); +- while (my($rulename, $test) = each %{$opts{testhash}->{$priority}}) { +- $opts{loop_body}->($self, $pms, $conf, $rulename, $test, %nopts); +- } +- if (defined $opts{post_loop_body}) { +- $opts{post_loop_body}->($self, $pms, $conf, %nopts); +- } ++ # use %nopts for named parameter-passing; it's more friendly ++ # to future-proof subclassing, since new parameters can be added without ++ # breaking third-party subclassed implementations of this plugin. ++ my %nopts = ( ++ ruletype => $ruletype, ++ doing_user_rules => $doing_user_rules, ++ priority => $priority, ++ clean_priority => $clean_priority ++ ); ++ ++ # build up the eval string... ++ $self->{evalstr_methodname} = $methodname; ++ $self->{evalstr_chunk_current_methodname} = undef; ++ $self->{evalstr_chunk_methodnames} = []; ++ $self->{evalstr_chunk_prefix} = []; # stack (array) of source code sections ++ $self->{evalstr} = ''; $self->{evalstr_l} = 0; ++ $self->{evalstr2} = ''; ++ $self->begin_evalstr_chunk($pms); ++ ++ $self->push_evalstr_prefix($pms, ' ++ # start_rules_plugin_code '.$ruletype.' '.$priority.' ++ my $scoresptr = $self->{conf}->{scores}; ++ '); ++ if (defined $opts{pre_loop_body}) { ++ $opts{pre_loop_body}->($self, $pms, $conf, %nopts); ++ } ++ $self->add_evalstr($pms, ++ $self->start_rules_plugin_code($ruletype, $priority) ); ++ while (my($rulename, $test) = each %{$opts{testhash}->{$priority}}) { ++ $opts{loop_body}->($self, $pms, $conf, $rulename, $test, %nopts); ++ } ++ if (defined $opts{post_loop_body}) { ++ $opts{post_loop_body}->($self, $pms, $conf, %nopts); ++ } + +- $self->flush_evalstr($pms, 'run_generic_tests'); +- $self->free_ruleset_source($pms, $ruletype, $priority); ++ $self->flush_evalstr($pms, 'run_generic_tests'); ++ $self->free_ruleset_source($pms, $ruletype, $priority); + +- # clear out a previous version of this method +- undef &{$methodname}; ++ # clear out a previous version of this method ++ undef &{$methodname}; + +- # generate the loop that goes through each line... +- my $evalstr = <<"EOT"; ++ # generate the loop that goes through each line... ++ my $evalstr = <<"EOT"; + { + package $package_name; + +@@ -373,40 +360,51 @@ + sub $methodname { + EOT + +- for my $chunk_methodname (@{$self->{evalstr_chunk_methodnames}}) { +- $evalstr .= " $chunk_methodname(\@_);\n"; +- } ++ for my $chunk_methodname (@{$self->{evalstr_chunk_methodnames}}) { ++ $evalstr .= " $chunk_methodname(\@_);\n"; ++ } + +- $evalstr .= <<"EOT"; ++ $evalstr .= <<"EOT"; + } + + 1; + } + EOT + +- delete $self->{evalstr}; # free up some RAM before we eval() +- delete $self->{evalstr2}; +- delete $self->{evalstr_methodname}; +- delete $self->{evalstr_chunk_current_methodname}; +- delete $self->{evalstr_chunk_methodnames}; +- delete $self->{evalstr_chunk_prefix}; +- +- dbg("rules: run_generic_tests - compiling eval code: %s, priority %s", +- $ruletype, $priority); +-# dbg("rules: eval code to compile: $evalstr"); +- my $eval_result; +- { my $timer = $self->{main}->time_method('compile_gen'); +- $eval_result = eval($evalstr); +- } +- if (!$eval_result) { +- my $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat; +- warn "rules: failed to compile $ruletype tests, skipping:\n". +- "\t($eval_stat)\n"; +- $pms->{rule_errors}++; +- } +- else { ++ delete $self->{evalstr}; # free up some RAM before we eval() ++ delete $self->{evalstr2}; ++ delete $self->{evalstr_methodname}; ++ delete $self->{evalstr_chunk_current_methodname}; ++ delete $self->{evalstr_chunk_methodnames}; ++ delete $self->{evalstr_chunk_prefix}; ++ ++ dbg("rules: run_generic_tests - compiling eval code: %s, priority %s", ++ $ruletype, $priority); ++ # dbg("rules: eval code to compile: $evalstr"); ++ my $eval_result; ++ { my $timer = $self->{main}->time_method('compile_gen'); ++ $eval_result = eval($evalstr); ++ } ++ if (!$eval_result) { ++ my $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat; ++ warn "rules: failed to compile $ruletype tests, skipping:\n". ++ "\t($eval_stat)\n"; ++ $pms->{rule_errors}++; ++ return; ++ } + dbg("rules: compiled $ruletype tests"); +- goto run_compiled_method; ++ } ++ ++#run_compiled_method: ++# dbg("rules: run_generic_tests - calling %s", $methodname); ++ my $t = Mail::SpamAssassin::Timeout->new({ deadline => $master_deadline }); ++ my $err = $t->run(sub { ++ no strict "refs"; ++ $methodname->($pms, @{$opts{args}}); ++ }); ++ if ($t->timed_out() && $master_deadline && time > $master_deadline) { ++ info("check: exceeded time limit in $methodname, skipping further tests"); ++ $pms->{deadline_exceeded} = 1; + } + } + +Index: lib/Mail/SpamAssassin/Plugin/MIMEEval.pm +--- lib/Mail/SpamAssassin/Plugin/MIMEEval.pm.orig 2010-03-16 15:49:21.000000000 +0100 ++++ lib/Mail/SpamAssassin/Plugin/MIMEEval.pm 2011-02-08 16:03:32.000000000 +0100 +@@ -498,7 +498,7 @@ + # perhaps just limit to test, and image? + next if ($ctype eq 'application/ics'); + +- my $cte = lc $p->get_header('content-transfer-encoding') || ''; ++ my $cte = lc($p->get_header('content-transfer-encoding') || ''); + next if ($cte !~ /^base64$/); + foreach my $l ( @{$p->raw()} ) { + my $len = length $l; diff -r b8e8f9dbbfd3 -r c158bb6622e1 spamassassin/spamassassin.spec --- a/spamassassin/spamassassin.spec Wed Sep 21 13:51:49 2011 +0200 +++ b/spamassassin/spamassassin.spec Wed Sep 21 13:55:11 2011 +0200 @@ -1,6 +1,6 @@ ## ## spamassassin.spec -- OpenPKG RPM Package Specification -## Copyright (c) 2000-2009 OpenPKG Foundation e.V. +## Copyright (c) 2000-2011 OpenPKG Foundation e.V. ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that @@ -22,9 +22,9 @@ ## # package version -%define V_real 3.2.5 -%define V_here 3.2.5 -%define V_sdir 3.2.5 +%define V_real 3.3.1 +%define V_here 3.3.1 +%define V_sdir 3.3.1 # package information Name: spamassassin @@ -37,7 +37,7 @@ Group: Mail License: ASF Version: %{V_here} -Release: 20090420 +Release: 20110914 # package options %option with_fsl yes @@ -47,14 +47,15 @@ Source1: rc.spamassassin Source2: local.cf Source3: fsl.spamassassin +Patch0: spamassassin.patch # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 20060823, perl, perl-openpkg >= 5.8.4, make -PreReq: OpenPKG, openpkg >= 20060823, perl -BuildPreReq: perl-db, perl-crypto, perl-xml, perl-dns -PreReq: perl-db, perl-crypto, perl-xml, perl-dns +PreReq: OpenPKG, openpkg >= 20060823, perl, gnupg +BuildPreReq: perl-db, perl-crypto, perl-xml, perl-dns, perl-locale, perl-www +PreReq: perl-db, perl-crypto, perl-xml, perl-dns, perl-locale, perl-www %if "%{with_fsl}" == "yes" BuildPreReq: fsl PreReq: fsl @@ -80,6 +81,7 @@ %prep %setup -q -n Mail-SpamAssassin-%{V_sdir} + %patch -p0 %build # configure package @@ -114,7 +116,6 @@ # create directories for PID file and virtual users %{l_shtool} mkdir -f -p -m 755 \ - $RPM_BUILD_ROOT%{l_prefix}/var/spamassassin \ $RPM_BUILD_ROOT%{l_prefix}/var/spamassassin/spool # strip installation