Net::IDN::Encode Build procedure in external dir.?

T

Tuxedo

The Net::IDN::Encode module converts IDN domains into ASCII and vice versa:
http://search.cpan.org/~cfaerber/Net-IDN-Encode-2.003/lib/Net/IDN/Encode.pm

The documented build procedure is:
perl Build.PL
../Build
../Build test
../Build install

However, I'm not sure how to install this particular module in an non-root
owned directory, if at all possible. My installation procedure for modules
on typical Unix and Linux systems usually include a PREFIX argument, as in:
perl Makefile.PL PREFIX=/some/external/directory

As noted in Net::IDN::Encode's README at
http://cpansearch.perl.org/src/CFAERBER/Net-IDN-Encode-2.003/README the
module depends on Unicode::Stringprep, which has the same build procedure:
http://search.cpan.org/dist/Unicode-Stringprep/

Without quite expecting it to work, I tried: ...
perl Build.PL PREFIX=/some/external/directory
.... but PREFIX is obviously unrecognised here, so for both modules the
installation failed at the last 'Build install' step with an expected
permission error:
ERROR: Can't create '/usr/lib/perl5/site_perl/5.14.2/Unicode'
mkdir /usr/lib/perl5/site_perl/5.14.2/Unicode: Permission denied at
/usr/lib/perl5/5.14.2/ExtUtils/Install.pm line 494

While I can usually install as root that is not always the case, so I
prefer to place most non-core modules in non-root directories.

Can anyone advise me how this module and other modules that may use similar
build procedures may be installed in a non-root directory?

Many thanks for any advise.

Tuxedo
 
T

Tuxedo

Ben said:
For Build.PL the argument is '--install_base /some/dir'; see the
Module::Build documentation. Note that this won't always install things
in quite the same place as MakeMaker's PREFIX parameter, since PREFIX is
a little weird; in fact, MakeMaker's documentation currently recommends
using INSTALL_BASE instead of PREFIX, which matches Module::Build's
--install_base and is more predictable than PREFIX.

If you are maintaining a repository of modules under your home
directory, you may also want to look at the local::lib module, which
will help you set up your environment so modules are installed to and
loaded from there automatically. This also means you can use a CPAN
client to install modules with their dependencies automatically; cpanm
(on CPAN as App::cpanminus) has explicit support for installing into a
local::lib-managed directory.

Ben

Installing by Build.PL --install_base flag works perfectly and so does the
methods offered by Net::IDN::Encode to convert IDN strings to/from ASCII.
I will bear the module management techniques in mind for future use.

Thank you for the clear and detailed explanation!

Tuxedo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,044
Messages
2,570,388
Members
47,052
Latest member
ketan

Latest Threads

Top