You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Florian Effenberger <fl...@arcor.de> on 2005/04/29 14:12:59 UTC
supplying additional path for Perl modules
Hello,
what is the right way for supplying additional path for Perl modules in
a self-compiled (perl Makefile.PL && make && make install) SpamAssassin?
I have modules in non-standard directories I would like to include for
compilation.
Thanks
Florian
Re: supplying additional path for Perl modules
Posted by Florian Effenberger <fl...@arcor.de>.
Hi Dave,
> In the top of the various perl scripts you'd add the "use line" after
> where you call perl eg
okay, thanks a lot, then I'll look into it!
Florian
Re: supplying additional path for Perl modules
Posted by da...@umiacs.umd.edu.
On Fri, 29 Apr 2005, Florian Effenberger wrote:
> Hi Dave,
>
>> No, The "use" construct tells perl to look elsewhere for libraries when
>> running. All of the above assumes you're installing the modules somewhere
>> other than where the system would normally look for it. eg You don't have
>> root access so installed the modules in your home directory. You still
>> obviously have to build and install the modules (as defined in the perl
>> install docs), just not into system space.
>
> of course, but in which places do I have to tell SA where to look for the
> modules? Is it enough to give the path when invoking Makefile.PL, and
> Makefile.PL correctly modifies SA, or do I have to give it everytime I invoke
> SA?
In the top of the various perl scripts you'd add the "use line" after
where you call perl eg
sa-learn
::::::::::::::
#!/usr/local/perl-5.8.0/bin/perl
eval 'exec /usr/local/stow/perl-5.8.0-extra/bin/perl -T -w -S $0 ${1+"$@"}'
if 0; # not running under some shell
use strict;
use lib '/opt/spamassassin/mylib';
use File::Spec;
=-=-=-=-=-=-=-=-=-=- generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=
David Stern University of Maryland
Institute for Advanced Computer Studies
Re: supplying additional path for Perl modules
Posted by Florian Effenberger <fl...@arcor.de>.
Hi Dave,
> No, The "use" construct tells perl to look elsewhere for libraries when
> running. All of the above assumes you're installing the modules somewhere
> other than where the system would normally look for it. eg You don't have
> root access so installed the modules in your home directory. You still
> obviously have to build and install the modules (as defined in the perl
> install docs), just not into system space.
of course, but in which places do I have to tell SA where to look for
the modules? Is it enough to give the path when invoking Makefile.PL,
and Makefile.PL correctly modifies SA, or do I have to give it everytime
I invoke SA?
Thanks
Florian
Re: supplying additional path for Perl modules
Posted by da...@umiacs.umd.edu.
On Fri, 29 Apr 2005, Florian Effenberger wrote:
> Hi Dave,
>
>> use lib "/my/perl_directory/lib/site_perl";
>>
>> or sometimes you can just say:
>>
>> use "/my/perl_directory";
>
> is it enough to add it to Makefile.PL, or do I need to add it to every single
> SpamAssassin .PL file?
>
No, The "use" construct tells perl to look elsewhere for libraries when
running. All of the above assumes you're installing the modules somewhere
other than where the system would normally look for it. eg You don't have
root access so installed the modules in your home directory. You still
obviously have to build and install the modules (as defined in the perl
install docs), just not into system space.
=-=-=-=-=-=-=-=-=-=- generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=
David Stern University of Maryland
Institute for Advanced Computer Studies
Re: supplying additional path for Perl modules
Posted by Florian Effenberger <fl...@arcor.de>.
Hi Dave,
> use lib "/my/perl_directory/lib/site_perl";
>
> or sometimes you can just say:
>
> use "/my/perl_directory";
is it enough to add it to Makefile.PL, or do I need to add it to every
single SpamAssassin .PL file?
Thanks!
FLorian
Re: supplying additional path for Perl modules
Posted by da...@umiacs.umd.edu.
On Fri, 29 Apr 2005, Florian Effenberger wrote:
> Hi Theo,
>
>> Set PERL5LIB appropriately? This is a perl question, not SA specific. :)
>
> I'm absolutely no Perl expert, so I thought I'd ask here. ;-) Where can I set
> PERL5LIB? Most libraries are installed in the default location, but I have
> installed some libraries (e.g. a newer Net::DNS) in other paths, via
>
> perl Makefile.PL LIB=/usr/local/share/perlmods
> PREFIX=/usr/local/share/perlmods
>
> How can I tell SpamAssassin to use the Net::DNS installed in the above
> location?
>
use lib "/my/perl_directory/lib/site_perl";
or sometimes you can just say:
use "/my/perl_directory";
=-=-=-=-=-=-=-=-=-=- generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=
David Stern University of Maryland
Institute for Advanced Computer Studies
Re: supplying additional path for Perl modules
Posted by Florian Effenberger <fl...@arcor.de>.
Hi Theo,
> If you're installing it into a different place and need modules from a
> different place, you can do something like the following, depending on
> your shell:
>
> export PERL5LIB=/usr/local/share/perlmods
I'll add that to the init script and see if it works or not. ;-)
Thanks for your help!
Florian
Re: supplying additional path for Perl modules
Posted by Theo Van Dinter <fe...@kluge.net>.
On Fri, Apr 29, 2005 at 05:21:43PM +0200, Florian Effenberger wrote:
> I'm absolutely no Perl expert, so I thought I'd ask here. ;-) Where can
> I set PERL5LIB? Most libraries are installed in the default location,
> but I have installed some libraries (e.g. a newer Net::DNS) in other
> paths, via
>
> perl Makefile.PL LIB=/usr/local/share/perlmods
> PREFIX=/usr/local/share/perlmods
>
> How can I tell SpamAssassin to use the Net::DNS installed in the above
> location?
Well, if you're installing into that same space, there shouldn't be a problem.
("spamassassin" will already need to look there for its own modules)
If you're installing it into a different place and need modules from a
different place, you can do something like the following, depending on
your shell:
export PERL5LIB=/usr/local/share/perlmods
--
Randomly Generated Tagline:
"No pixels were harmed in the making of this game." - WarCraft II
Re: supplying additional path for Perl modules
Posted by Florian Effenberger <fl...@arcor.de>.
Hi Brian,
> Just set PERL5LIB on the command line that you use to start
> spamassassin. (if you are using BASH or KSH anyway.)
>
> PERL5LIB="/usr/local/share/perlmods" spamassassin <options>
>
> or just put it in the envronment that SA runs from.
thanks, at least for Makefile.PL it seems to work! :-) Will try to put
that in initscript. If you have an idea on how to do this the best way,
I'm open for anything. :-)
Thanks for your tip with PERL5LIB!
Florian
Re: supplying additional path for Perl modules
Posted by "Brian R. Jones" <bj...@castlejones.net>.
Florian Effenberger wrote:
> Hi Theo,
>
>> Set PERL5LIB appropriately? This is a perl question, not SA specific. :)
>
>
> I'm absolutely no Perl expert, so I thought I'd ask here. ;-) Where can
> I set PERL5LIB? Most libraries are installed in the default location,
> but I have installed some libraries (e.g. a newer Net::DNS) in other
> paths, via
>
> perl Makefile.PL LIB=/usr/local/share/perlmods
> PREFIX=/usr/local/share/perlmods
>
> How can I tell SpamAssassin to use the Net::DNS installed in the above
> location?
>
> Thanks
> Florian
>
Just set PERL5LIB on the command line that you use to start
spamassassin. (if you are using BASH or KSH anyway.)
PERL5LIB="/usr/local/share/perlmods" spamassassin <options>
or just put it in the envronment that SA runs from.
--
Brian R. Jones
Ob. tagline:
"I never follow the herd.
Even when it's going the right direction."
Re: supplying additional path for Perl modules
Posted by Florian Effenberger <fl...@arcor.de>.
Hi Theo,
> Set PERL5LIB appropriately? This is a perl question, not SA specific. :)
I'm absolutely no Perl expert, so I thought I'd ask here. ;-) Where can
I set PERL5LIB? Most libraries are installed in the default location,
but I have installed some libraries (e.g. a newer Net::DNS) in other
paths, via
perl Makefile.PL LIB=/usr/local/share/perlmods
PREFIX=/usr/local/share/perlmods
How can I tell SpamAssassin to use the Net::DNS installed in the above
location?
Thanks
Florian
Re: supplying additional path for Perl modules
Posted by Theo Van Dinter <fe...@kluge.net>.
On Fri, Apr 29, 2005 at 02:12:59PM +0200, Florian Effenberger wrote:
> what is the right way for supplying additional path for Perl modules in
> a self-compiled (perl Makefile.PL && make && make install) SpamAssassin?
> I have modules in non-standard directories I would like to include for
> compilation.
Set PERL5LIB appropriately? This is a perl question, not SA specific. :)
--
Randomly Generated Tagline:
"... And weren't we thankful that the aliens were Mac compatible?"
- Bill Maher talking about ID4