Installing module with cpan2dist blaims about missing module although it is available - cpan

i'd like to install some perl-modules with cpan2dist. Cpan2dist creates rpm's of perl-modules. I'd like to install Data-Dumper:
cpan2dist --format CPANPLUS::Dist::SUSE --verbose --buildprereq Data-Dumper .
Data-Dumper needs Test::More, which is installed:
cpan2dist ...
...
[MSG] 'perl-Test-Simple' is already installed (for Test::More)
...
Perl itself confirms it:
vm58820-6:~ # perl -MTest::More -e 'print "$Test::More::VERSION\n"'
1.001003
But later on cpan2dist complains about an unsatisfied dependency:
error: Failed build dependencies:
perl(Test::More) >= 0.98 is needed by perl-Data-Dumper-2.151-0.x86_64
[ERROR] unsatisfied builddeps!
Cpan2dist does not seem to be sure if Test::More is installed or not. But if it says Test::More is not installed, why doesn't it install the dependency ? The option --buildprereq should do that.
Thanks,
Bernd

SOLVED
Hi,
i found it out by myself. It seems that cpan2dist looks for already installed packages using different ways: the message "perl-Test-Simple' is already installed (for Test::More)" comes from cpan -l or autobundle in cpan, i believe. But cpan2dist also ask the rpm database, when it checks the dependencies. And "Test::More" has been installed with CPAN or it was included in the original perl-Installation. So the module is available for perl, but, because it was not installed with rpm, rpm knows nothing about it.
Bernd

Related

Installing a patch for a dependent module: cpanm still tries to install broken module after I have installed patched module manually

I am trying to install Net::SSH::Perl using cpanm (from perlbrew and perl version 5.30). The installation fails with:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758019.381709/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
The problem with installing Crypt::Curve25519 is described in this issue. I downloaded the problematic module Crypt::Curve25519 and patched it:
git clone git#github.com:ajgb/crypt-curve25519.git
wget https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
cd crypt-curve25519
git apply ../Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
perl Makefile.PL
make # No errors now
make test
make install
However, when I try again to install Crypt::Curve25519 it still tries to install the broken module from CPAN:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758833.382749/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
How can I make cpanm use the installed patch instead (i.e. skip installation of Crypt::Curve25519 since it is already installed)?
The problem seems to be missing VERSION information in the module. By adding a line
our $VERSION = 0.06;
to the top of the file lib/Crypt/Curve25519.pm and then reinstall, and then installing cpanm Net::SSH::Perl worked fine (it accepted the patched installation and did not try to download the broken version).
Here is the patch I used to lib/Crypt/Curve25519.pm:
diff --git a/lib/Crypt/Curve25519.pm b/lib/Crypt/Curve25519.pm
index 686b706..d9c2b3d 100644
--- a/lib/Crypt/Curve25519.pm
+++ b/lib/Crypt/Curve25519.pm
## -1,4 +1,5 ##
package Crypt::Curve25519;
+our $VERSION = 0.06;
#ABSTRACT: Generate shared secret using elliptic-curve Diffie-Hellman function
use strict;
There's a few things to check:
cpanm knows where to find your patched version.
The patched version has a version that's higher than the one on CPAN. The module idea in CPAN assumes that you always want the latest, so ensure that yours is.
You don't want to install a patched module at the standard location because you don't want a cpan client to overwrite it.
Some other things that can work:
Force install the module and ignore the failures (cpanm has a --notest feature). The CPAN version is still installed, but that doesn't matter.
Have your patched version in a separate directory that's at the front of #INC so your program finds it first. This effectively hides the CPAN version.

Need help for installing LDAP in unix

I am following the below procedure for installing LDAP in unix
1.tar -xzf perl-ldap-0.43.tar.gz
2.cd perl-ldap-0.43
3.perl MakeFile.PL
I am getting below message
* Checking for Perl dependencies...
We have to reconfigure CPAN.pm due to following uninitialized parameters:
cpan_home, keep_source_where, build_dir, build_cache, scan_cache, index_expire, gzip, tar, unzip, make, pager, makepl_arg, make_arg, make_install_arg, urllist, inhibit_startup_message, ftp_proxy, http_proxy, no_proxy, prerequisites_policy, cache_metadata
CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.
If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)
Are you ready for manual configuration? [yes]
How to install without CPAN and what are the dependent modules required to install Ldap?
Can anyone suggest me the standard process of installation.
Thanks In Advance
I assume that by perl-ldap-0.43.tar.gz you are trying to install Net::LDAP
How to install without CPAN?
CPAN is the recommended way of installing Perl modules. You have to configure it just once, after that if you need to install any Perl module you can just type the below.
$ cpan ModuleName like in your case instead of downloading, untaring and running makefile you can just do:
$ cpan Net::LDAP
What are the dependent modules required to install Ldap?
One more advantage of using CPAN is you don't have to care about dependencies. CPAN will install dependencies automatically if you ask it to do so. Do it by
$ perl -MCPAN -e shell
cpan[1]> o conf prerequisites_policy follow
cpan[2]> o conf commit
exit
Or just use App::cpanminus and run
$ cpanm Net::LDAP it will install the module with all its dependencies.
Also check out Perl LDAP page.
Edit: Based on your answer
You will get some errors like above, you will have to see the error log, check the Module which is missing, then go to CPAN and download that module's tar.gz and then do the same steps as you were doing, like untaring, and running Makefile. You will have to do this unless all of your dependencies are installed.
Can we ignore warnings while installing perl modules?
I have installed ExtUtils-MakeMaker-6.98.tar.gz by ignoring below warnings
Using included version of ExtUtils::Install (1.54) as it is newer than the installed version (1.33).
Using included version of CPAN::Meta::YAML (0.008) because it is not already installed.
Using included version of JSON::PP::Compat5006 (1.09) because it is not already installed.
Using included version of ExtUtils::Manifest (1.60) as it is newer than the installed version (1.46).
Using included version of version (0.88) because it is not already installed.
Using included version of ExtUtils::Command (1.16) as it is newer than the installed version (1.09).
Using included version of CPAN::Meta (2.120351) because it is not already installed.
Using included version of JSON::PP (2.27203) because it is not already installed.
Using included version of File::Temp (0.22) as it is newer than the installed version (0.16).
Using included version of Parse::CPAN::Meta (1.4405) because it is not already installed.
Using included version of File::Copy::Recursive (0.38) because it is not already installed.
Checking if your kit is complete...
Warning: the following files are missing in your kit:
't/liblist/win32/di
't/liblist/win32/space
Please inform the author.
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::MakeMaker
Writing MYMETA.yml and MYMETA.json**
But I'm able to install successfully. Will it create any problems in future?

cpan2rpm does not seem to get installed Perl version

I'm running on RHEL6, with RHEL's perl-5.10.1-130.el6_4 installed. I am trying to build some RPMs using cpan2rpm 2.028. Also, perl-version-0.77-130.el6_4 is installed. It's giving odd failures, saying the installed version of Perl is not new enough:
$ perl -
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
...
$ cpan2rpm --no-sign ExtUtils::MakeMaker
-- cpan2rpm - Ver: 2.028 --
Upgrade check
Fetch: HTTP
-- module: ExtUtils::MakeMaker --
Using cached URL: http://search.cpan.org//CPAN/authors/id/M/MS/MSCHWERN/ExtUtils-MakeMaker-6.64.tar.gz
Tarball found - not fetching
Metadata retrieval
Tarball extraction: [/root/rpm/SOURCES/ExtUtils-MakeMaker-6.64.tar.gz]
Unable to build module, the following dependencies have failed:
perl >= 5.006
Stopped at /usr/bin/cpan2rpm line 491.
cannot remove path when cwd is /tmp/bj8upl6poj/ExtUtils-MakeMaker-6.64 for /tmp/bj8upl6poj: at /usr/share/perl5/File/Temp.pm line 902
-- Done --
What's causing cpan2rpm not to know what version of perl is installed?
I'm not sure why cpan2rpm doesn't work here. But I'll point out that the Red Hat team now use cpanspec to build all of their RPMs of CPAN modules. You might try that instead.
Unless there a reason you want to build the rpm with cpan2rpm, you can simply install the Perl modules from the yum repository. For example:
# yum install perl-ExtUtils-MakeMaker.x86_64
# rpm -q perl-ExtUtils-MakeMaker
perl-ExtUtils-MakeMaker-6.55-130.el6_4.x86_64
I had the same problem and it's fixed by installing Perldoc.
$ cpan Perldoc

How to rebuild/reinstall dependencies of an up to date CPAN module?

I need to reinstall the dependencies of a CPAN module. Some dependencies which are usually installed are missing but the package itself is up to date to cpan.
So how can i still install the dependencies?
Be forceful.
From cpan command-line application:
$ cpan -f -i Module::With::Dependencies
From CPAN shell:
cpan[1]> force install Module::With::Dependencies
You might try installing App::cpanminus, then use its cpanm command-line tool to install the module and its dependencies (try cpanm --help to get a list of the options).
(I also just discovered App::pmuninstall, which helped with a nasty case of refusal to update all of the files for a module by letting me uninstall the module first before installing the up-to-date version.)

Dependency problem of Perl CPAN modules

I tried to install SOAP::WSDL on Ubuntu 8.04 Server through CPAN but got the following error message:
cpan> install SOAP::WSDL
Running install for module SOAP::WSDL
Running make for M/MK/MKUTTER/SOAP-WSDL-2.00.10.tar.gz
Checksum for /root/.cpan/sources/authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00.10.tar.gz ok
SOAP-WSDL-2.00.10/
SOAP-WSDL-2.00.10/benchmark/
(skipped many lines)
SOAP-WSDL-2.00.10/README
CPAN.pm: Going to build M/MK/MKUTTER/SOAP-WSDL-2.00.10.tar.gz
# running Build.PL --installdirs site
Creating new 'MYMETA.yml' with configuration results
Creating new 'Build' script for 'SOAP-WSDL' version '2.00.10'
Prereq '0.0.5' for 'Class::Std::Fast' is not supported by Module::Build::Compat
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
I have the latest versions of Class::Std::Fast and Module::Build::Compat:
$ perl -MModule::Build::Compat -e 'print $Module::Build::Compat::VERSION;'
0.3607
$ perl -MClass::Std::Fast -e 'print $Class::Std::Fast::VERSION;'
0.0.8
Any idea how to solve the problem? Perhaps I need to downgrade Class::Std::Fast to version 0.0.5?
Long story short, it looks like your CPAN installation is preferring to use the compatibility Makefile.PL instead of the Build.PL. It should prefer the Build.PL. The Makefile.PLs were intended for compatibility only and may not have all the features of Module::Build, such as supporting three part versions.
Fire up cpan. o conf will let you see your configuration. If prefer_installer isn't set to MB then do o conf prefer_installer MB. You may have to o conf commit to save it (it will tell you). You may also have to install Module::Build, either from the libmodule-build-perl package or from CPAN.
Bug reported to SOAP::WSDL.
PS You can work around this by installing Class::Std::Fast first, download SOAP::WSDL manually, edit the Build.PL to remove that dependency, and run cpan . in SOAP::WSDL's directory to install it and its deps.
What is your CPAN version? And configuration? (o conf at the cpan shell prompt.)
Hmm, that all looks ok. Unless for some reason CPAN wasn't able to load Module::Build?
Can you try the install again from a fresh CPAN shell, with no previous commands?
Or try doing a manual install without using CPAN.pm?
Try it,
cpan Module::Build
and
cpan Module::Build::Compat
And I forget to say something, the Ubuntu modify the packages if you are trying to install modules with root user, forget. Try again with local::lib.
After you do it, do:
cpan install CPAN
and finally,
cpan upgrade
It should solve your problem.