[Nagiosplug-devel] Does Nagios::Plugin really need other modules?

Ton Voon ton.voon at altinity.com
Fri Dec 7 01:14:49 CET 2007


Hi John,

On 6 Dec 2007, at 23:27, John P. Rouillard wrote:

> I thought I would go and try out the new Nagios::Plugins library for
> some new perl plugins.  However trying to build the RPM resulted in:
>
>> cpan2rpm Nagios::Plugin
>  -- module: Nagios::Plugin --
>  Using cached URL: http://search.cpan.org//CPAN/authors/id/T/TO/TONVOON/Nagios-Plugin-0.21.tar.gz
>  Tarball found - not fetching
>  Metadata retrieval
>  Tarball extraction: [/home/rouilj/rpm/SOURCES/Nagios- 
> Plugin-0.21.tar.gz]
>  Unable to build module, the following dependencies have failed:
>    Class::Accessor >= 0
>    Test::More >= 0.62
>    Params::Validate >= 0
>    Math::Calc::Units >= 0
>
> none of these dependencies are listed on the cpan manual page for
> Nagios::Plugins. I truly don't see how we can distribute a copy of
> Nagios::Plugin with the plugins and expect it to work with all these
> dependencies.

It was my call to use dependent CPAN modules, rather than trying to re- 
write everything, and, so far, I stick by that decision. If we tried  
to create a getopt routine with the sophistication of  
Params::Validate, well, we'd end up with Params::Validate. So we  
should use it instead of trying to reinvent very good wheels.

This moves it from being a programmer problem to an implementation  
problem. I'm happy to spend some time on the implementation side to  
get that smoother.


> Also cpan2rpm of Test::More resulted in:
>
>  -- module: Test::More --
>  Module not found on CPAN web site! at /usr/bin/cpan2rpm line 1201.
>
> So please tell me something is wrong with cpan2rpm and that all of
> these are optional dependencies and that basic functionality is
> available without them.


Test::More is not actually a package on CPAN. Test::More belongs to  
the Test::Simple package (http://search.cpan.org/~mschwern/Test-Simple-0.74/ 
).  Try running a cpan2rpm for Test::Simple.

In perl's dependency speak, you specify the module, not the package.  
If the above works, maybe an enhancement to cpan2rpm to allow  
specification of a module to then lookup the package would be useful.

Also, if the above works, then you could amend the Nagios::Plugin  
tarball to specify Test::Simple as the dependency instead and see  
whether this causes it to build all the dependencies correctly. If so,  
then I definitely think a patch to cpan2rpm is in order.

Unfortunately, building from CPAN is still not quite as smooth as it  
could be but I think it is worthwhile trying to fix this in the  
general case.

Ton

http://www.altinity.com
UK: +44 (0)870 787 9243
US: +1 866 879 9184
Fax: +44 (0)845 280 1725
Skype: tonvoon





More information about the Devel mailing list