Date: Mon, 20 Sep 2010 20:15:23 +0200 (CEST) From: Martin Matuska <mm@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: scheidell@secnap.net Subject: ports/150764: [PATCH] mail/p5-Mail-SpamAssassin: fix dependencies for perl >= 5.10.1 Message-ID: <20100920181523.8AD31E2748@mail2.vx.sk> Resent-Message-ID: <201009201830.o8KIU2hC073456@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 150764 >Category: ports >Synopsis: [PATCH] mail/p5-Mail-SpamAssassin: fix dependencies for perl >= 5.10.1 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Sep 20 18:30:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Martin Matuska >Release: FreeBSD 8.1-STABLE amd64 >Organization: >Environment: System: FreeBSD neo.vx.sk 8.1-STABLE FreeBSD 8.1-STABLE #1 r212768M: Fri Sep 17 00:01:06 CEST >Description: - fix dependencies for perl >= 5.10.1 - add upstream patch for perl 5.12 Added file(s): - files/patch-bug6392 Port maintainer (scheidell@secnap.net) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: >Fix: --- p5-Mail-SpamAssassin-3.3.1.patch begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/mail/p5-Mail-SpamAssassin/Makefile,v retrieving revision 1.133 diff -u -r1.133 Makefile --- Makefile 9 Aug 2010 08:54:34 -0000 1.133 +++ Makefile 20 Sep 2010 18:14:36 -0000 @@ -17,19 +17,13 @@ COMMENT= A highly efficient mail filter for identifying spam BUILD_DEPENDS= p5-NetAddr-IP>=4.00.7:${PORTSDIR}/net-mgmt/p5-NetAddr-IP \ - p5-Archive-Tar>=1.23:${PORTSDIR}/archivers/p5-Archive-Tar \ p5-Net-DNS>=0.63:${PORTSDIR}/dns/p5-Net-DNS \ - p5-Compress-Zlib>=2.04:${PORTSDIR}/archivers/p5-Compress-Zlib \ - p5-IO-Zlib>=1.04:${PORTSDIR}/archivers/p5-IO-Zlib \ p5-HTML-Parser>=3.43:${PORTSDIR}/www/p5-HTML-Parser \ - p5-IO-Compress-Zlib>=2.04:${PORTSDIR}/archivers/p5-IO-Compress-Zlib \ - p5-Test-Harness>=3.16:${PORTSDIR}/devel/p5-Test-Harness \ ${SITE_PERL}/Bundle/LWP.pm:${PORTSDIR}/www/p5-libwww \ ${SITE_PERL}/${PERL_ARCH}/Encode/Detect.pm:${PORTSDIR}/converters/p5-Encode-Detect \ ${SITE_PERL}/Mail/Internet.pm:${PORTSDIR}/mail/p5-Mail-Tools -RUN_DEPENDS= ${BUILD_DEPENDS} \ - ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes +RUN_DEPENDS= ${BUILD_DEPENDS} CONFLICTS= ja-p5-Mail-SpamAssassin-[0-9]* @@ -62,6 +56,14 @@ .include <bsd.port.pre.mk> +.if ${PERL_LEVEL} < 501000 +BUILD_DEPENDS+= p5-Archive-Tar>=1.23:${PORTSDIR}/archivers/p5-Archive-Tar \ + p5-Compress-Zlib>=2.04:${PORTSDIR}/archivers/p5-Compress-Zlib \ + p5-IO-Zlib>=1.04:${PORTSDIR}/archivers/p5-IO-Zlib \ + p5-IO-Compress-Zlib>=2.04:${PORTSDIR}/archivers/p5-IO-Compress-Zlib \ + p5-Test-Harness>=3.16:${PORTSDIR}/devel/p5-Test-Harness +.endif + .if defined (WITH_SPAMC) CONFIGURE_ARGS+= BUILD_SPAMC=yes .else @@ -104,8 +106,8 @@ .if defined(WITH_RAZOR) RUN_DEPENDS+= razor-agents>=2.84:${PORTSDIR}/mail/razor-agents .else -.if !defined(WITH_DKIM) .if ${PERL_LEVEL} < 501000 +.if !defined(WITH_DKIM) BUILD_DEPENDS+= p5-Digest-SHA1>=2.11:${PORTSDIR}/security/p5-Digest-SHA1 .endif .endif @@ -113,7 +115,9 @@ .if defined(WITH_DKIM) BUILD_DEPENDS+= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL +. if ${PERL_LEVEL} < 501000 BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Digest/SHA.pm:${PORTSDIR}/security/p5-Digest-SHA +. endif BUILD_DEPENDS+= p5-Mail-DKIM>=0.37:${PORTSDIR}/mail/p5-Mail-DKIM BUILD_DEPENDS+= p5-Crypt-OpenSSL-RSA>=0.24:${PORTSDIR}/security/p5-Crypt-OpenSSL-RSA .endif Index: files/patch-bug6392 =================================================================== RCS file: files/patch-bug6392 diff -N files/patch-bug6392 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-bug6392 20 Sep 2010 18:14:36 -0000 @@ -0,0 +1,225 @@ +Index: lib/Mail/SpamAssassin/HTML.pm +=================================================================== +--- lib/Mail/SpamAssassin/HTML.pm (revision 943932) ++++ lib/Mail/SpamAssassin/HTML.pm (revision 943933) +@@ -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/Dns.pm +=================================================================== +--- lib/Mail/SpamAssassin/Dns.pm (revision 943932) ++++ lib/Mail/SpamAssassin/Dns.pm (revision 943933) +@@ -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/Plugin/Check.pm +=================================================================== +--- lib/Mail/SpamAssassin/Plugin/Check.pm (revision 943932) ++++ lib/Mail/SpamAssassin/Plugin/Check.pm (revision 943933) +@@ -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 +- ); ++ # 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); ++ # 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->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,41 +360,52 @@ + 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}; ++ 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 { ++ 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; ++ } + } + + sub begin_evalstr_chunk { +Index: lib/Mail/SpamAssassin/Plugin/BodyEval.pm +=================================================================== +--- lib/Mail/SpamAssassin/Plugin/BodyEval.pm (revision 943932) ++++ lib/Mail/SpamAssassin/Plugin/BodyEval.pm (revision 943933) +@@ -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; + } --- p5-Mail-SpamAssassin-3.3.1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100920181523.8AD31E2748>