in reply to [SOLVED] Where should one place support scripts and resources within a Catalyst project?

My understanding of the configuration of Module::Install is limited and I am incapable of understanding the documentation

This.

Drop distname_any-file.pl you wish to install into script subdirectory and install_script glob('script/*.pl'); in Makefile.PL takes care of installing it

Its a good idea to follow the catalyst naming convention

  • Comment on Re: Where should one place support scripts and resources within a Catalyst project?
  • Download Code

Replies are listed 'Best First'.
Re^2: Where should one place support scripts and resources within a Catalyst project?
by JNW (Novice) on Aug 25, 2011 at 08:23 UTC

    A very excellent suggestion and certainly part of the story, thank you :)

    My understanding is that install_script will perform all of the necessary work to install the various additional scripts.

    Is there a way to additionally include the execution of distname_any-file.pl as part of the make install procedure?

    Perhaps it's easier with a working example to explain what I am doing (disclaimer: I have substituted my project name for the standard Catalyst tutorial myapp):

    Leaning on the advice of another reply to my original post (and to keep this explanation as simple as possible), I have created a database directory called database in the root directory of the project (so it's a sibling of script, root, lib, etc.), with the database update-upgrade script myapp_database.pl, and a directory called sql containing the necessary SQL files. The relevant part of the output of tree -fi is:

    ./database ./database/myapp_database.pl ./database/sql ./database/sql/create-tables.sql ./database/sql/create-data.sql

    My Makefile.PL now also includes:

    install_script glob('database/myapp_database.pl'); install_share ( 'dist', 'database/sql');

    This nicely places the script and the SQL files in sensible places within the blib directory (genuinely impressed at how easy this was!)

    What I would like to do at this point is add something like:

    post_install_execute 'myapp_database.pl';

    Is this, or something equivalent, possible?

    Thank you again!

        Brilliant! Thank you so much. That's led me to the answer that I was looking for:

        postamble <<EOPOST; install :: run_myapp_database run_myapp_database: myapp_database.pl EOPOST

        (Where the space before myapp_database.pl is a tab character)

        Thank you so much for your time!