Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Creating a special module install process

by graff (Chancellor)
on Jul 23, 2008 at 06:55 UTC ( [id://699520]=perlquestion: print w/replies, xml ) Need Help??

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

I want to distribute a module that needs to have a lot of tabular data included with it, organized into 6 special data files. The module will use these tables in the form of tied hashes, which means that the text table files distributed with the module need to be compiled into Berkeley DB files (via DB_File).

I have a perl script (to be included in the distro's "bin" directory, and installed along with a couple other executable scripts) that will read the text table files and create the corresponding DB_Files (the whole set of six tables is done in a single run of my "tbl2dbm" -- the data file names are "hardwired").

So, I'd like the "make" step to include running this script to build the DB_Files (which will be needed during "make test"), and then I want "make install" to put the DB_Files into a "standard" location -- presumably in a subdir next to the module's main .pm file in whatever lib path is targeted -- so the module always knows where to find them.

Sad to say, this really is my first dance with ExtUtils::MakeMaker, and I'm at a loss what to put into Makefile.PL to ensure that things go as intended. I know I can put  postamble => ..., as one of the key/value pairs that I pass to WriteMakefile(), but I'm unclear on what sort of thing(s) should be on the RHS there, how those get treated in  sub MY::postable { ... }, and how I access/refer to the various paths for inputs and outputs.

For that matter, I'm a little foggy on how to manage paths within the module itself (and in "tbl2dbm") so that locating the tables, during "make test" and after "make install", is a sure thing. Any ideas, examples and advice would be much appreciated.

(No, I haven't tried anything yet, beyond making sure that MakeMaker succeeds at doing the basic build and install of the module itself, without doing anything about the table data. I don't want the creation and positioning of the DB table files to be a manual, post-installation step, and I'd like to avoid requiring users edit the module or their shell environment to set the table path.)

Replies are listed 'Best First'.
Re: Creating a special module install process
by Anonymous Monk on Jul 23, 2008 at 07:47 UTC
Re: Creating a special module install process
by randyk (Parson) on Jul 24, 2008 at 03:38 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://699520]
Approved by Corion
Front-paged by bingos
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-26 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found