Andreas J. König > Perl-Repository-APC-2.002001 > Makefile.PL

Download:
Perl-Repository-APC-2.002001.tar.gz

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

Valuable advice I got ^

http://rgarciasuarez.free.fr/perl/svnmm.html

In development ^

Currently I'm developing the mechanism for a convenient 'make dist'.

1. The first thing that 'make dist' has to do is making sure that $VERSION is right in at least one module, the VERSION_FROM module.

2. We add a target called 'setversion' to DIST_DEFAULT:

    DIST_DEFAULT => 'setversion all tardist',

3. We define the target in a postamble:

    sub MY::postamble {
      q{setversion:
            $(PERL) Makefile.PL --setversion
    }
    }

4. When the Makefile is called with --setversion, we do the following:

4.1. We verify that everything has been checked in. We allow only '?' in the first column of the output of 'svn st -u'. If we have something else, we die, halting any pending make targets.

4.2. We compare what svnversion has to say about "." and the VERSION_FROM module. If the upper limit of "." has a higher rev than the VERSION_FROM module, then we set a "cpan:release" property on the VERSION_FROM module and check it in. Otherwise we exit immediately and are done.

4.3. Then we write a new Makefile

4.4. And finally we die, so that the calling make also dies. Our message says, "...please rerun the make command".

5. As 'make dist' now always starts with the 'setversion' target, we call 'Makefile.PL --setversion' early and fail if we either have not checked in or our VERSION_FROM module isn't fresh enough.

6. On an immediate second call to 'make dist' the VERSION_FROM module is always fresh enough and the Makefile reflects the exact $VERSION we have in the VERSION_FROM module.

syntax highlighting: