develooper Front page | perl.module-authors | Postings from November 2003

Re: How to indicate a dependency in my module

Thread Previous | Thread Next
From:
Randy W. Sims
Date:
November 10, 2003 12:50
Subject:
Re: How to indicate a dependency in my module
Message ID:
3FAFF9F2.7010308@ThePierianSpring.org
darren chamberlain wrote:
> * Bruno Negrao <qmail at engepel.com.br> [2003-11-10 17:10]:
> 
>>I?m finishing to write a module, Proc::Daemontools, and it requires that the
>>daemontools package be installed on a machine for it to work.
>>Where must I indicate that this module have a dependency? I already wrote
>>this on the README file. Is there any other place?
>>
>>In my test script, I cause the test to fail if it cannot find a process,
>>'svscan', running on the machine. Do you think that this can cause all the
>>cpan-testers to fail?
> 
> 
> I think the best thing to do in your test would be something like:
> 
>   my $have_svscan = 0;
> 
>   if (find_svscan()) {
>       $have_svscan = 1;
>       plan tests => 2;
>   }
>   else {
>       plan tests => 1;
>   }
> 
>   use_ok("Proc::Daemontools");
>   ok("Some svscan related test") if $have_svscan;
> 
> Where find_svscan looks in the Appropriate Places for svscan, and runs
> the tests if it can be found.
> 
> (darren)
> 

It would be nice to see functionality like this incorporated into a 
Module::Build::Configure package (or similar) along with other configure 
type routines common in current Makefile.PLs. Routines that find if libs 
or executables are installed, find appropriate install paths for 
installing perl programs that don't belong in the perl tree, etc.

Also, as I noted in the AFS thread the other day, this info should be 
written in META.yml so that cpan-testers can determine programatically 
whether a module should be tested. Info like required non-perl packages 
and libraries, whether the build/test/install process is interactive (or 
scriptable) or automated, and whether it runs only on certain OSs or 
excludes certain OSs.

Randy.



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About