Seeking advice on migrating modules into standard module format 
Author Message
 Seeking advice on migrating modules into standard module format

Hi,

Say you have a number of modules (100+) in a namespace like Foo::*. These
have been developed over the years, dating from perl 5.002 to present, so
few if any of the modules install via the standard "perl Makefile.PL;
make; make test; make install" method [1].

Armed with a directory tree and h2xs, is there a good[2] way of packaging
these modules en masse? Or do I have to loop over all the whole namespace
to generate Makefile.PL for each individual module and manually edit
MANIFESTs? Note that I expect to edit each module to ensure that
MakeMaker can parse $VERSION.

Also, there are subtrees within the namespace that I'd like packaged
individually. For example, the Foo-Monitor-0.00.tar.gz  package should
contain

Foo::Monitor::Disk::*,
Foo::Monitor::Kernel::*, etc.,

the upshot being that you can install Foo::Monitor and all the subordinate
glop gets installed as you would expect - no individual installation of
Foo::Monitor::Disk::Whatver.pm. I vaguely recall doing this once before
by playing trial-and-error with MANIFEST and file locations. It wasn't
pleasant.

I have some experience creating modules with 'h2xs -AXn <module::name>'.
The scope of this project is daunting and I thought it best to check if
anyone else had experience with a project like this or had suggestions on
how to do this with the least effort, pain, and suffering.

Once everything has been properly packaged, the next step is to create a
Bundle::Foo distribution and migrate the lot to a local CPAN server.
I'm still anxiously awaiting the day that CPAN::Site gets folded into
the main CPAN distribution...

Thanks for your time,

-- Bob

[1] Please don't ask how they currently get installed; I'm still trying to
figure it out. I suspect it involves something like:

export GOO=`perl -MConfig -e 'print $Config{installsitelib};'`
cd $GOO tar
xf modules.tar

Chicken bones and black candles may also be involved. Nothing would
surprise me.

[2] Not excessively tedious or manual. The method should also wax my car,
paint my house, and make me fabulously wealthy, popular, and happy. It
should also provide me with my own theme music. If I'm going to make a
wish, I'm going to make it a good one... :)



Sun, 09 Nov 2003 15:14:08 GMT  
 Seeking advice on migrating modules into standard module format
Hi Bob!

Quote:
> Say you have a number of modules (100+) in a namespace like Foo::*.
> These
> have been developed over the years, dating from perl 5.002 to present,
> so
> few if any of the modules install via the standard "perl Makefile.PL;
> make; make test; make install" method [1].

ExtUtils::MakeMaker recognizes a 'lib/' directory, so if you have

Foo::Monitor::Disk   as lib/Foo/Monitor/Disk.pm
Foo::Monitor::Kernel as lib/Foo/Monitor/Kernel.pm
etc.

and list those files in the MANIFEST, then they can be found as well.
So you only have one distribution, but many modules within.

See 'perldoc ExtUtils::MakeMaker' for details.

<plug type="shameless" />

By the way, you might find Devel::SearchINC (from yours truly) useful
for testing modules right in their development directories without
having to install each one over and over to test every little change.
Say you do your 'h2xs -XAn ...' from a /home/bob/dev directory, then
you can say

        use Devel::SearchINC '/home/bob/dev';
        use Foo::Monitor::Disk;

and it will be found even if it isn't installed.

</plug>

Quote:
> [2] Not excessively tedious or manual. The method should also wax my
> car,
> paint my house, and make me fabulously wealthy, popular, and happy. It
> should also provide me with my own theme music. If I'm going to make a
> wish, I'm going to make it a good one... :)

If you have a sound card, it will swear at you.

Marcel

--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
  -- London.pm strategy aka "embrace and extend" aka "mark and sweep"



Sun, 09 Nov 2003 17:01:33 GMT  
 Seeking advice on migrating modules into standard module format

Quote:

> Hi,

> Say you have a number of modules (100+) in a namespace like Foo::*. These
> have been developed over the years, dating from perl 5.002 to present, so
> few if any of the modules install via the standard "perl Makefile.PL;
> make; make test; make install" method [1].

> Armed with a directory tree and h2xs, is there a good[2] way of packaging
> these modules en masse? Or do I have to loop over all the whole namespace
> to generate Makefile.PL for each individual module and manually edit
> MANIFESTs?

You can use "make mkmanifest" to create MANIFEST files. Before that
put a good MANIFEST.SKIP file to prevent blib, pm_to_blib,
Makefile.old etc. from going into MANIFEST.

Quote:
> Note that I expect to edit each module to ensure that
> MakeMaker can parse $VERSION.

> Also, there are subtrees within the namespace that I'd like packaged
> individually. For example, the Foo-Monitor-0.00.tar.gz  package should
> contain

> Foo::Monitor::Disk::*,
> Foo::Monitor::Kernel::*, etc.,

> the upshot being that you can install Foo::Monitor and all the subordinate
> glop gets installed as you would expect - no individual installation of
> Foo::Monitor::Disk::Whatver.pm. I vaguely recall doing this once before
> by playing trial-and-error with MANIFEST and file locations. It wasn't
> pleasant.

If you put everything under a "lib" subdirectory, it should work
out-of-the-box.

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s!\n!!g;map{create$c 'line'=>
map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split''}split"!";$x+=12}split/_/=>'K
PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+
KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop



Mon, 10 Nov 2003 02:53:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Upgrading 3.5 to NT4 client on Oracle? Read!

2. ADOExpress available?

3. TDBGrid

4. Seeking advice on semantics (pros / cons and best ways of) using constants across modules

5. Config Module: Comments and advice sought...

6. Why aren't standard modules standard?

7. Convert Pictures into Data for Pascal

8. unsubscribe

9. My Module - Plan B (was My First Module Advice)

10. migrate modules to perl5.6.0

11. Install BDE 16Bit with Installshield ?

12. ASCII codes in Windows 98

 

 
Powered by phpBB® Forum Software