Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to install multiple modules with one Makefile.PL

1 view
Skip to first unread message

Ted Zlatanov

unread,
Jul 2, 2008, 11:56:42 AM7/2/08
to
I'm packaging Lingua::BG::Numbers with Lingua::Slavic::Numbers for CPAN,
using ExtUtils::MakeMaker. What's the proper way to structure
Makefile.PL to indicate this? MANIFEST is already correct, but "make
test" doesn't automatically put Lingua::BG::Numbers in the lib path.

This is the current Makefile.PL:

use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Lingua::Slavic::Numbers',
VERSION_FROM => 'lib/Lingua/Slavic/Numbers.pm',
PREREQ_PM => { 'List::Util' => 1, 'Regexp::Common' => 1 },
ABSTRACT_FROM => 'lib/Lingua/Slavic/Numbers.pm',
AUTHOR => 'Ted Zlatanov <t...@lifelogs.com>',
);

The failing test just uses that module.

Thanks
Ted

Stephen Vance

unread,
Jul 2, 2008, 1:33:42 PM7/2/08
to
Add Lingua::BG::Numbers to the PREREQ_PM along with a version if necessary.
The value associated with the hash key is a package version number, not a
true/false. If you don't care what version, use 0 and it will just verify
the presence.

Steve

"Ted Zlatanov" <t...@lifelogs.com> wrote in message
news:868wwkt...@lifelogs.com...

Ted Zlatanov

unread,
Jul 2, 2008, 3:33:08 PM7/2/08
to
On Wed, 2 Jul 2008 13:33:42 -0400 "Stephen Vance" <Stephe...@mathworks.com> wrote:

SV> Add Lingua::BG::Numbers to the PREREQ_PM along with a version if necessary.
SV> The value associated with the hash key is a package version number, not a
SV> true/false. If you don't care what version, use 0 and it will just verify
SV> the presence.

Thanks for the advice.

Strangely, I tried

PREREQ_PM => { 'List::Util' => 1, 'Regexp::Common' => 1, 'Lingua::BG::Numbers' => 0 },

and `make test' still says

Warning: prerequisite Lingua::BG::Numbers 0 not found.

Lingua::BG::Numbers has version 0.02.

Also, is it enough to have Lingua::BG::Numbers in the distribution, or
do I also need to register it so CPAN will pick it up for search
results, CPAN shell i// searches, etc? I don't want to just upload it
and hope it works :)

Thanks
Ted

Stephen Vance

unread,
Jul 2, 2008, 5:29:54 PM7/2/08
to
You need to make sure it's in your search path (i.e. PERL5LIB, installed,
etc.). The version is pulled out of the 'our $VERSION = 0.02' line in the
module. If this doesn't exist then it's not CPAN compliant.

Steve

"Ted Zlatanov" <t...@lifelogs.com> wrote in message

news:86vdzoq...@lifelogs.com...

Ted Zlatanov

unread,
Jul 3, 2008, 9:22:08 AM7/3/08
to
On Wed, 2 Jul 2008 17:29:54 -0400 "Stephen Vance" <Stephe...@mathworks.com> wrote:

SV> You need to make sure it's in your search path (i.e. PERL5LIB, installed,
SV> etc.). The version is pulled out of the 'our $VERSION = 0.02' line in the
SV> module. If this doesn't exist then it's not CPAN compliant.

But Lingua::BG::Numbers is a part of Lingua::Slavic::Numbers. It can't
be installed already.

% ls lib/**/*.pm
lib/Lingua/BG/Numbers.pm lib/Lingua/Slavic/Numbers.pm

% grep pm MANIFEST
lib/Lingua/Slavic/Numbers.pm
lib/Lingua/BG/Numbers.pm

% cat Makefile.PL


use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Lingua::Slavic::Numbers',
VERSION_FROM => 'lib/Lingua/Slavic/Numbers.pm',

PREREQ_PM => { 'List::Util' => 1, 'Regexp::Common' => 1, 'Lingua::BG::Numbers' => 0 },

ABSTRACT_FROM => 'lib/Lingua/Slavic/Numbers.pm',
AUTHOR => 'Ted Zlatanov <t...@lifelogs.com>',
);


Lingua::BG::Numbers is a wrapper for Lingua::Slavic::Numbers, but due to
the convention for Lingua::LL::Numbers modules (LL is a 2-letter
language code) I can't name it Lingua::Slavic::BG::Numbers.

Does this make sense? Do I want to make a bundle instead?

Ted

Ted Zlatanov

unread,
Jul 10, 2008, 8:37:16 AM7/10/08
to
On Thu, 03 Jul 2008 08:22:08 -0500 Ted Zlatanov <t...@lifelogs.com> wrote:

TZ> Lingua::BG::Numbers is a wrapper for Lingua::Slavic::Numbers, but due to
TZ> the convention for Lingua::LL::Numbers modules (LL is a 2-letter
TZ> language code) I can't name it Lingua::Slavic::BG::Numbers.

The answer was to use Module::Build, which supports this kind of
inclusion for tests.

Thanks
Ted

Darin McBride

unread,
Jul 10, 2008, 10:55:40 AM7/10/08
to
Ted Zlatanov wrote:

> % cat Makefile.PL
> use ExtUtils::MakeMaker;
> WriteMakefile(
> NAME          => 'Lingua::Slavic::Numbers',
> VERSION_FROM  => 'lib/Lingua/Slavic/Numbers.pm',
> PREREQ_PM     => { 'List::Util' => 1, 'Regexp::Common' => 1,
> 'Lingua::BG::Numbers' => 0 }, ABSTRACT_FROM =>
> 'lib/Lingua/Slavic/Numbers.pm', AUTHOR        => 'Ted Zlatanov
> <t...@lifelogs.com>', );

First, since Lingua::BG::Numbers is part of your distribution, you are not
PRErequiring them. So remove that (as you had earlier).

Second, check the perldoc for ExtUtils::MakeMaker. Check PMLIBDIRS and PM.

Finally, Module::Build is, in my experience, far easier to deal with. So
don't use the above to be an argument to leave M::B, but merely
informational in case you prefer going back to EU::MM.

0 new messages