johnwashburn has asked for the wisdom of the Perl Monks concerning the following question:

I am in need of the wisdom of the monks of the monastery. I cannot get CPAN to untar the downloaded archives. CPAN is configured for non-root access and is limited to the tools available in cPanel.

I apologize for the length, but hope the detail justifies this length.

My domain, WashburnResearch.org, is hosted and my administration of the domain must be via cPanel. The consequence of this is that I am limited to non-root access and I have no access to a terminal session; no cpan shell. The system administrators of the hosting service will not run CPAN on my behalf to install a requested CPAN module so the results are compile and available to all users of the site in the system-wide Perl directories (e.g. /usr/lib/perl5). In spite of these limitations I have made much progress in installing CPAN modules into my local directory structure (/home/washburn/lib/perl5).

I have followed the sage advice of Using CPAN with a non-root account. I have successfully created ~/lib/perl5, ~/.cpan, and ~/.cpan/MyConfig.pm and for simple, pure-Perl modules such as CSS.pm I can upload the pure-Perl module to the appropriate location within the ~/lib/perl5 directory structure. Perl scripts can use these local modules by including the use lib "$ENV{HOME}/lib/perl5"; command.

My problem is using CPAN under these conditions where a make is required. Actually the problem is with any module, but my problem is acute for those modules which require compilation in the local *nix system. The module of interest to me is Unicode::Map8.

To simulate a terminal (e.g. shell) I submit a cron job (set to execute in two minutes) and then get the stdout and stderr output via email. Think of this as a very, very slow terminal. The hosting site is essentially a LAMP server.

My CPAN configuration is :
cpan shell -- CPAN exploration and modules installation (v1.9304) Read +Line support suppressed cpan[1]> $CPAN::Config options from '/home/washburn/.cpan/CPAN/MyConfi +g.pm': commit [Commit changes to disk] defaults [Reload defaults from disk] help [Short help about 'o conf' usage] init [Interactive setting of all options] applypatch undef auto_commit [1] build_cache [5] build_dir [/home/washburn/.cpan/build] build_dir_reuse undef build_requires_install_policy undef bzip2 [/usr/bin/bzip2] cache_metadata [1] check_sigs undef colorize_debug undef colorize_output undef colorize_print undef colorize_warn undef commandnumber_in_prompt [1] commands_quote undef connect_to_internet_ok [0] cpan_home [/home/washburn/.cpan] curl [/usr/bin/curl] dontload_hash dontload_list undef ftp [/usr/bin/ftp] ftp_passive [1] ftp_proxy [] ftpstats_period undef ftpstats_size undef getcwd [cwd] gpg [/usr/bin/gpg] gzip [/usr/bin/gzip] halt_on_failure undef histfile [/home/washburn/.cpan/histfile] histsize [40] http_proxy [] inactivity_timeout [0] index_expire [1] inhibit_startup_message [0] keep_source_where [/home/washburn/.cpan/sources] load_module_verbosity [v] lynx [/usr/bin/lynx] make [/usr/bin/make] make_arg [] make_install_arg [] make_install_make_command [/usr/bin/make] makepl_arg [PREFIX=~/ SITELIBEXP=~/lib/perl5 LIB=~/lib/per +l5 INSTALLMAN1DIR=~/share/man/man1 INSTALLMAN3DIR=~/share/man/man3 IN +STALLSITEMAN1DIR=~/share/man/man1 INSTALLSITEMAN3DIR=~/share/man/man3 +] mbuild_arg [] mbuild_install_arg [] mbuild_install_build_command [./Build] mbuildpl_arg [] ncftp [ ] ncftpget [ ] no_proxy [] pager [less] password undef patch [/usr/bin/patch] perl5lib_verbosity [v] prefer_installer undef prefs_dir undef prerequisites_policy [follow] proxy_pass undef proxy_user [] randomize_urllist undef scan_cache [atstart] shell [/bin/sh] show_unparsable_versions undef show_upload_date [0] show_zero_versions undef tar [/usr/bin/tar] tar_verbosity [vv] term_is_latin [0] term_ornaments [1] test_report undef trust_test_report_history undef unzip [/usr/bin/unzip] urllist 0 [http://cpan.llarian.net/] 1 [ftp://cpan.nas.nasa.gov/pub/perl/CPAN/] 2 [ftp://cpan.pair.com/pub/CPAN/] 3 [ftp://ftp.duke.edu/pub/perl/] 4 [ftp://ftp.cs.colorado.edu/pub/perl/CPAN/] 5 [ftp://ftp.sunsite.utk.edu/pub/CPAN/] 6 [http://www.perl.com/CPAN/] use_sqlite [0] username undef wait_list 0 [wait://ls6.informatik.uni-dortmund.de:1404] wget [/usr/bin/wget] yaml_load_code undef yaml_module undef cpan[2]> cpan[2]> Lockfile removed.

This was generated with the cron job:
cpan < ~/scripts/Perl/CPAN/InstallText.txt
where ~/scripts/Perl/CPAN/InstallText.txt contains:
o conf exit

I removed ~/.cpan/build, ~/.cpan/sources, and ~/.cpan/ , in order to make a "clean execution". The result I get when I try to install Unicode::Map8 is:
CPAN: Storable loaded ok (v2.18) CPAN: LWP::UserAgent loaded ok (v5.823) CPAN: Time::HiRes loaded ok (v1.9719) Fetching with LWP: http://cpan.llarian.net/authors/01mailrc.txt.gz CPAN: YAML loaded ok (v0.68) Going to read /home/washburn/.cpan/sources/authors/01mailrc.txt.gz ...................................................................... +......DONE Fetching with LWP: http://cpan.llarian.net/modules/02packages.details.txt.gz Going to read /home/washburn/.cpan/sources/modules/02packages.details. +txt.gz Database was generated on Mon, 22 Jun 2009 00:26:55 GMT ............ +... New CPAN.pm version (v1.94) available. [Currently running version is v1.9304] You might want to try install CPAN reload cpan to both upgrade CPAN.pm and run the new version without leaving the current session. .............................................................DONE Fetching with LWP: http://cpan.llarian.net/modules/03modlist.data.gz Going to read /home/washburn/.cpan/sources/modules/03modlist.data.gz ...................................................................... +......DONE Going to write /home/washburn/.cpan/Metadata Running install for modul +e 'Unicode::Map8' Running make for G/GA/GAAS/Unicode-Map8-0.12.tar.gz Fetching with LWP: http://cpan.llarian.net/authors/id/G/GA/GAAS/Unicode-Map8-0.12.tar.g +z CPAN: Digest::SHA loaded ok (v5.47) Fetching with LWP: http://cpan.llarian.net/authors/id/G/GA/GAAS/CHECKSUMS Checksum for /home/washburn/.cpan/sources/authors/id/G/GA/GAAS/Unicode +-Map8-0.12.tar.gz ok sh: /usr/bin/tar: No such file or directory Uncompressed /home/washbur +n/.cpan/sources/authors/id/G/GA/GAAS/Unicode-Map8-0.12.tar.gz success +fully Using Tar:/usr/bin/tar xvvf "Unicode-Map8-0.12.tar": sh: /usr/bin/tar: No such file or directory Couldn't untar Unicode-Map +8-0.12.tar CPAN: File::Temp loaded ok (v0.21) Package seems to come without Makefile.PL. (The test -f "/home/washburn/.cpan/build/GAAS-bUUmGR/Makefile.PL" re +turned false.) Writing one on our own (setting NAME to UnicodeMap8) Had problems unarchiving. Please build manually Running make test Make had some problems, won't test Running make install Make had some problems, won't install

This was generated with the cron job:
cpan Unicode::Map8

I think this is either a permission problem or change directory problem. If I use the file manager in cPannel to navigate to
/home/washburn/.cpan/sources/authors/id/G/GA/GAAS/
I can use extract feature of cPanel and extract
/home/washburn/.cpan/sources/authors/id/G/GA/GAAS/Unicode-Map8-0.12.tar.gz
without error.

I suspect the change of directories because of the command:
/usr/bin/tar xvvf "Unicode-Map8-0.12.tar".
This seems to indicate the untar is from the current directory, because if the untar was not in the current directory you would have an untar command similar to:
/usr/bin/tar xvvf "/home/washburn/.cpan/sources/authors/id/G/GA/GAAS/Unicode-Map8-0.12.tar.gz"

This CPAN session also creates a build directory of:
/.cpan/build/GAAS-bUUmGR with the following files in it
/.cpan/build/GAAS-bUUmGR/Makefile.PL
/.cpan/build/GAAS-bUUmGR/Unicode-Map8-0.12.tar

The contents of the Makefile.PL is:
# This Makefile.PL has been autogenerated by the module CPAN.pm # because there was no Makefile.PL supplied. # Autogenerated on: Sun Jun 21 23:23:19 2009 use ExtUtils::MakeMaker; WriteMakefile( NAME => q[UnicodeMap8], );


And again I can use cPanel file manager to navigate to
/.cpan/build/GAAS-bUUmGR/
and extract the tar file without error. After the extract, within the directory,
/.cpan/build/GAAS-bUUmGR/Unicode-Map8-0.12/
is the Makefile.PL of:
require 5.004; use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Unicode::Map8', 'VERSION_FROM' => 'Map8.pm', 'LIBS' => [''], 'DEFINE' => '-DPERL', 'INC' => '', 'OBJECT' => q[Map8$(OBJ_EXT) map8x$(OBJ_EXT)], 'EXE_FILES' => [qw(umap)], 'PREREQ_PM' => { 'Unicode::String' => 2.00, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, );

The permission on the many files and directories are either 755 or 655.

I can at this point execute: perl /.cpan/build/GAAS-bUUmGR/Unicode-Map8-0.12/Makefile.PL
but, the pre-requisite, Unicode::String, is not found.

How can I get CPAN to work under these conditions?

I want to take advantage of the follow option so that pre-requisites are installed (and compiled) automatically. As you can see the fact that my administration of my site is mediated by cPanel is an interesting obstacle that I could not find when I searched the perl monk site.

Replies are listed 'Best First'.
Re: non-root CPAN with cPanel does not untar
by ysth (Canon) on Jun 22, 2009 at 05:46 UTC
      Yes. If I manually (using the extract feature of cPanel) extract the tar and then run the (via cron) script
      #!/bin/bash echo cd ~/.cpan/build/GAAS-fwrgdL/MIME-Base64-Perl-1.00 cd ~/.cpan/build/GAAS-fwrgdL/MIME-Base64-Perl-1.00 echo perl Makefile.PL -INSTALL_BASE=~ perl Makefile.PL INSTALL_BASE=~ echo make install make install
      which gives the following email:
      cd /home/washburn/.cpan/build/GAAS-fwrgdL/MIME-Base64-Perl-1.00 perl Makefile.PL -INSTALL_BASE=~ Writing Makefile for MIME::Base64::Perl make install Manifying blib/man3/MIME::QuotedPrint::Perl.3pm Manifying blib/man3/MIME::Base64::Perl.3pm Appending installation info + to /home/washburn/lib/perl5/x86_64-linux-thread-multi/perllocal.pod No virus found in this incoming message.
      The problem was I was not pointing to the tar program. See my response below. I hope my problem here will help others in the future.
Re: non-root CPAN with cPanel does not untar
by wirrwarr (Monk) on Jun 22, 2009 at 11:02 UTC
    To me, it looks like the program "/usr/bin/tar" is not found (sh: /usr/bin/tar: No such file or directory). On my local system, tar lies under /bin/tar, so probably you should try to find where it is installed? You should be able to use "which tar", using your cron method.


    daniel.

      Following this line of thought there is this line in your MyConfig.pm or config setting display:

      ... tar [/usr/bin/tar] ...

      Maybe change it to /bin/tar. Or wherever it is...

        You have put your finger on the problem

        I ran the following script (via cron):
        #!/bin/bash cd ~/.cpan/build/GAAS-fwrgdL/ /usr/bin/tar -xvvf MIME-Base64-Perl-1.00.tar
        with the following result:
        /home/washburn/scripts/TestTar.sh: line 5: /usr/bin/tar: No such file +or directory

        I then followed the above advice and changed the MyConfig.Pm line:

          'tar' => q[/usr/bin/tar],

        to

          'tar' => q[/bin/tar],

        and ran (via cron)

        cpan MIME::QuotedPrint::Perl

        which worked and produced the following email:

        I should have run this

        ls -lg /usr/bin/tar ls: /usr/bin/tar: No such file or directory
        before bothering the perl monks.
Re: non-root CPAN with cPanel does not untar
by Anonymous Monk on Jun 22, 2009 at 06:15 UTC
    I think you cpanel install is broken, needs sysadmin to fix once and for all.
Re: non-root CPAN with cPanel does not untar
by scorpio17 (Canon) on Jun 22, 2009 at 13:34 UTC

    You know, Pair Networks (see add banner at the top of the page) has hosting plans for as little as $19.95 a month... just saying...

    Not the answer you were hoping for, I know.

    Here's another suggestion: build yourself a unix box, and configure it so that the environment is as much like that used by your host as possible. Get everything working the way you want on this development box (make sure all the perl stuff is installed locally), then tar up your web stuff and upload/unpack it. If all goes well, everything should work. If it doesn't, then your development environment is not the same as the production environment. Note that your host may decide to change things without telling you, at any time... so even if this does work, it may be only temporary.