Re: CPAN and module dependancies
by Ovid (Cardinal) on Nov 05, 2002 at 23:38 UTC
|
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'HTML::TokeParser::Simple',
'VERSION_FROM' => 'Simple.pm', # finds $VERSION
'PREREQ_PM' => { 'HTML::Parser' => 3.25 },
($] >= 5.005
? (AUTHOR => 'Curtis "Ovid" Poe <poec@yahoo.com>')
: ()),
);
As you can see from the above, the module requires HTML::Parser. Unfortunately, that should actually read HTML::TokeParser, but I didn't discover the mistake until I responded to your post :)
Cheers,
Ovid
Join the Perlmonks Setiathome Group.
New address of my CGI Course. | [reply] [d/l] |
Re: CPAN and module dependancies
by Abigail-II (Bishop) on Nov 05, 2002 at 19:34 UTC
|
To get the requirements for say, Date::Calc, use the following
one-liner:
tar xfvzO Date-Calc-5.3.tar.gz Date-Calc-5.3/Makefile.PL | grep PR
+EREQ_PM
I don't think it's a good idea to make any requirements for
modules uploaded to CPAN. Modules uploaded to CPAN are a
gift from their authors; we should be happy. Adding requirements
will make that you'll lose some authors.
Abigail | [reply] [d/l] |
|
|
no no no... The other way..
When an author uploads a module, they can add something to the effect of
Module Dependancies:
Net::FTP
MIME::Base64
Digest::MD5
That way when you go to grab module A, you can check for modules b,c,d in your installation, and grab those as well if needed.
Update: Ahh.. I see what you are saying, but wouldn't it make sense? I mean there have been times (notably Net::SSH::Perl), where I would have loved to know that I needed over a dozen other modules, prior to trying to get it working on a host.
I hear what you are saying about possibly pushing authors away, but do you honestly think that will happen? I don't know what kind of reqs there are for getting your module on CPAN, but I can assume a simple find . -name "*.plm" -print | xargs grep "^use" wouldn't be that much more work..
/* And the Creator, against his better judgement, wrote man.c */
| [reply] |
|
|
| [reply] |
Re: CPAN and module dependancies
by hossman (Prior) on Nov 06, 2002 at 06:05 UTC
|
It sounds like what you really want is for the Dependencies
to show up on the search.cpan.org page for each distrobution
(right next to the "CPAN Testers" or "CPAN Request Tracker" links perhaps)
What people have tried to explain so far is that it's not
neccessary for Module authors to do anything new for this to
happen. For wellformed Distrobutions, the info is
allready in the PREREQ_PM section of
Makefile.PL (And for modules whose Makefile.PL isn't
wellformed, it would be just as easy to fix that as to
do something new).
What's needed is
for something on the search.cpan.org site to parse
the Makefile.PL and surface the list.
The appropriate place to submit suggestions like this is the search.cpan.org feedback form.
| [reply] [d/l] |
Re: CPAN and module dependancies
by PodMaster (Abbot) on Nov 06, 2002 at 08:22 UTC
|
I don't think this is neccessary, or a pain or anything like that.
CPAN.org already provides the README for every module, and that info should be in the README, as detailed as an author wants it to be. See:
E:\new>h2xs -AX Foo::Bar
Writing Foo/Bar/Bar.pm
Writing Foo/Bar/Makefile.PL
Writing Foo/Bar/README
Writing Foo/Bar/test.pl
Writing Foo/Bar/Changes
Writing Foo/Bar/MANIFEST
E:\new>more "Foo/Bar/README"
Foo/Bar version 0.01
====================
The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.
A README file is required for CPAN modules since CPAN extracts the
README file from a module distribution so that people browsing the
archive can use it get an idea of the modules uses. It is usually a
good idea to provide version information here so that people can
decide whether fixes for the module are worth downloading.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
blah blah blah
COPYRIGHT AND LICENCE
Put the correct copyright and licence information here.
Copyright (C) 2002 A. U. Thor
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
____________________________________________________ ** The Third rule of perl club is a statement of fact: pod is sexy. | [reply] [d/l] |
Re: CPAN and module dependancies
by Nitrox (Chaplain) on Nov 06, 2002 at 04:41 UTC
|
I've always had good luck with just eye-balling the readme online to find pre-req's as in:
File-Cache-0.16.readme
-Nitrox | [reply] |
Re: CPAN and module dependancies
by Aristotle (Chancellor) on Nov 06, 2002 at 13:13 UTC
|
Even if you had that option, it would still be a pain: you may be missing dependencies of a dependency of a module you're installing. There is no way to add all that information without knowledge of what is installed at your site.
The immediate dependencies of the one module you're looking at are already viewable, as already pointed out by others.
Makeshifts last the longest.
| [reply] |