spamassassin and Perl 5.8 port broken

Bram Moolenaar Bram at moolenaar.net
Fri Jan 7 05:23:56 PST 2005


Anton Berezin wrote:

> > Oh, looking for where PERL_VERSION is set I found one obvious problem.
> > In /usr/ports/Mk/bsd.port.mk (around line 1174):
> > 
> > 	.if ${OSVERSION} >= 300000
> > 	PERL_VERSION?=	5.00503
> > 
> > It seems PERL_VERSION only depends on the OS version, it doesn't
> > actually check what Perl is installed.  This is an obvious lack of
> > intelligence.
> > 
> > When I change it to:
> > 
> > 	.if ${OSVERSION} >= 300000
> > 	#PERL_VERSION?=	5.00503
> > 	PERL_VERSION?=	5.6.1
> > 
> > Then the spamassassin port continues as expected (with the usual hickups
> > that require manual tweaking).  A dirty hack that gets me further.
> > Hopefully the new spamassassin works better, since the port system
> > doesn't allow for going back to an older version...
> 
> Well, this is exactly the problem.  When you install 5.6.1 from a
> package or a port, on 4.X systems it tells you to run
> /usr/local/bin/use.perl port afterwards (this is done automatically on
> 5.X systems).

If you install a port so much text scrolls over the screen that it's
nearly impossible to notice such a message.  I hope you are not
surprised I misssed this.

> One of the things that little script does is to override
> PERL_VERSION settings used by the ports collection (it does that by
> modifying /etc/make.conf).

	% man use.perl
	No manual entry for use.perl

Hmm, a tool without documentation.

Looking at the script, I notice it changes things in /usr/bin.  That's a
big no-no for a port.  I don't want to change the base system, I want to
install a new perl in /usr/local/.  So that /usr/bin/perl remains
available for scripts that rely on it.  That's not illogical, right?

> So if you did not perform this step, all perl-related ports in the ports
> collection will continue to operate with the default system perl, as
> opposed to the perl in /usr/local/bin, even though /usr/local/bin/perl
> works fine for your own scripts with #!/usr/local/bin/perl as opposed
> to #!/usr/bin/perl shebang.

I think the port should at least be very clear about why it fails to
build.  You can see I was completely confused.

More than that, after installing spamassassin it uses the perl in
/usr/local.  Thus the checks in the port should check the version of
that perl, not of /usr/bin/perl.  The installed
/usr/local/bin/spamassassin starts with the line:

	#!/usr/local/bin/perl5.6.1 -T -w

Thus apparently it finds out what version of perl is used and adjust to
it.  The port should thus check that version of perl.  Using
/etc/make.conf is unreliable.


By the way, notice that the symlinks are the wrong way around:

	%ls -l /usr/local/bin/perl*
-rwxr-xr-x  1 root  wheel  704676 Jan  6 22:55 /usr/local/bin/perl
lrwxr-xr-x  1 root  wheel      19 Jan  6 22:55 /usr/local/bin/perl5 -> /usr/local/bin/perl
lrwxr-xr-x  1 root  wheel      19 Jan  6 22:55 /usr/local/bin/perl5.6.1 -> /usr/local/bin/perl

When I would install a new version of perl as "/usr/local/bin/perl" then
"/usr/local/bin/perl5.6.1" suddenly changes to the new perl!   That is
very likely to cause trouble.  For example, spamassassin remembers the
lib path to perl: "use lib '/usr/local/lib/perl5/site_perl/5.6.1';".

I think installing Perl 5.8 actually did this (which is why perl 5.6.1
stopped working when installing Perl 5.8 failed halfway through).

-- 
hundred-and-one symptoms of being an internet addict:
261. You find diskettes in your pockets when doing laundry.

 /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///


More information about the freebsd-perl mailing list