I'm using ExtUtils::MakeMaker, which works great, and there's just one more thing I'd like to handle, but I don't quite see how...

My module includes some text tables that get turned into Berkeley DB files, and I have that covered as a first step in Makefile.PL. The "make install" step puts the DB files into a "MyModule_DB/v1_0" path that sits directly next to the installed "MyModule.pm", which is what I want. Now just one more thing:

Someday I'll send out a new version of the tables -- probably without any changes to the perl module -- so MyModule.pm stays exactly the same, but "MyModule_DB" will contain a "v2_0" or whatever (later on, tables and code will end up with separate versioning tracks and separate distros). In order to have a stable "default" behavior for the module as the tables get upgraded, I want "MyModule_DB" to also contain a symlink called "CurrentVersion", which would always point to the most recently installed version of the tables.

(Some users may want to keep older tables around for cross-version comparisons or backwards compatibility, and the module supports this.)

So back to the main question: what would I put into Makefile.PL (and/or elsewhere in the distro) so that the very last thing that happens during "make install" is: create a symlink called $(INSTALLSITELIB)/MyModule_DB/CurrentVersion that points to $(INSTALLSITELIB)/MyModule_DB/v1_0 (i.e the table version that goes out with this first release of the module).

I'm not exactly sure whether "INSTALLSITELIB" is the right monicker for this, or what the syntax would be to get it to interpolate properly within Makefile.PL; in fact, it would suffice if I just figure out how to run a specific perl script (to be supplied in the distro) as the last thing in the "make install" step. This script should be able to look up the path to MyModule.pm in %INC, work out the _DB path from that, and put the symlink there.

Whatever it takes, I just need that symlink created at install time. And when I send out new tables, a similar install process will replace the old symlink with a new one.

(I could also just put a loud note in the INSTALL instructions, telling the user to run this little script to make the symlink. But that's ugly, and some users are bound miss that step or screw it up somehow...)

UPDATE: As pointed out by Anonymonk below, I really just needed a better way to define what the "CurrentVersion" of the tables is.


In reply to Adding a "last step" to a MakeMaker installer (solved) by graff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.