loris has asked for the wisdom of the Perl Monks concerning the following question:

Having recently discovered ExtUtils::MakeMaker ExtUtils::ModuleMaker, I am wondering how to use it sensibly with a version control (VC) system.

I can imagine doing something like this:

  1. create MyModule-0.01 with MakeMaker ModuleMaker
  2. rename MyModule-0.01 to MyModule
  3. check MyModule in to VC
  4. write, test, become satisified with wonderful module
  5. create MyModule-0.01
  6. copy the contents of MyModule to MyModule-0.01

This, or a least my thinking, seems a little clunky. The problem is obviously the version in the main directory name, which I don't seem to be able to suppress via MakeMaker ModuleMaker(so I guess I shouldn't be trying to). How do real CPANers deal with this?

loris

Update:Got my Makes and my Modules mixed up. Doh!

Replies are listed 'Best First'.
Re: Using ExtUtils::MakeMaker with Version Control
by rinceWind (Monsignor) on Jun 07, 2005 at 10:11 UTC

    Normally, you create modules with h2xs or its modern equivalents: ExtUtils::ModuleMaker or Module::starter.

    For a module Foo::Bar, this will create a template module kit under ./Foo/Bar including a MANIFEST and Makefile.PL (which makes use of ExtUtils::MakeMaker). Your module Bar.pm itself can either live in ./Foo/Bar or in ./Foo/Bar/lib/Foo, which is where to put it if your module kit aims to deliver nore than one .pm module.

    This directory tree (no version number) is what you should check into the VCS.

    Inside the template Bar.pm will be a line which defines $Foo::Bar::VERSION - this is where WriteMakefile (in Makefile.PL) will get the version number from. make distdir will generate a directory tree with a version number on should you need one.

    See also How to make a CPAN Module Distribution

    Hope this helps

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

      just a small correction: latest versions of h2xs create module directories as Foo-Bar/ instead of the old Foo/Bar/

      Thanks for the help, rinceWind. I am, in fact using ExtUtils::ModuleMaker (see embarrassing update to original posting). Even more embarrassinngly I have realised that I am using a wrapper for ModuleMaker (see ExtUtils::ModuleMaker) that adds the version to the directory name.

      Sorry for bothering everyone - I'll go and stand in the corner for a while.

      Sheepishly,

      loris

Re: Using ExtUtils::ModuleMaker with Version Control
by salva (Canon) on Jun 07, 2005 at 10:39 UTC
    h2xs or ExtUtils::ModuleMaker creates a MyModule directory that you can just add to your VCS. Then work on it, and when you think it's ready for a release, check that $VERSION and the contents of MANIFEST are rigth and run make dist to automatically build MyModule-1.34.tar.gz.