Need help with ExtUtils::MakeMaker

J

jill

I am trying to package a CGI script and associated modules so that
they can be installed using Perl's standard sequence (perl Makefile.PL
&& make && make test && make install).

My installation has some non-standard (although not at all tricky)
features, and I can't figure out how to coax MakeMaker into generating
the right makefile.

(Is it just me, or the documentation for the ExtUtils modules is
far below average for widely used Perl modules? Is there a better
guide to MakeMaker, etc. than the standard documentation. I have
spent many days on this, and I'm about to go nuts. My many posts
on this are a record of my frustration. I have searched *everywhere*
for clarifications on what MakeMaker does, to no avail. The
ExtUtils::ManMaker man page is useless. What is the directory auto
for? What is the file autosplit.ix? Why does MakeMaker generate
the particular directory structure it generates by default? I have
dozens of questions like this, but there's no information anywhere!
What is a developer supposed to do? No wonder managers prefer
Java! But I digress...)

OK, here's the installation structure I'm trying to achieve
(directories are indicated with trailing slashes):

PATH_TO_CGI_DIR/
INSTALL_DIR/
cgi_script.pl
Module_1.pm
Module_1/
Submodule_1.pm (Module_1::Submodule_1 package)
Submodule_2.pm (Module_1::Submodule_2 package)
Module_2.pm
i386-linux/
Module_3.pm
auto/
Module_3/
Module_3.bs
Module_3.so
autosplit.ix
data_dir/
data_file_1
data_file_2
data_subdir_1/
data_file_3

cgi_script.pl uses Module_1, Module_1::Submodule_1, Module_1::Submodule_2,
Module_2, and Module_3 (which is a Perl extension).

The user is supposed to specify the value for PATH_TO_CGI_DIR/INSTALL_DIR,
e.g.:
perl Makefile.PL LIB=${PATH_TO_CGI_DIR}/${INSTALL_DIR}

Could someone be so kind as to tell me what I must put in Makefile.PL
that will result in the above structure?

Many, many thanks!

jill
 
S

Sisyphus

jill said:
(Is it just me, or the documentation for the ExtUtils modules is
far below average for widely used Perl modules?

I also find that much of the documentation is a little too intuitive for
me :)
OK, here's the installation structure I'm trying to achieve
(directories are indicated with trailing slashes):

PATH_TO_CGI_DIR/
INSTALL_DIR/
cgi_script.pl
Module_1.pm
Module_1/
Submodule_1.pm (Module_1::Submodule_1 package)
Submodule_2.pm (Module_1::Submodule_2 package)
Module_2.pm
i386-linux/
Module_3.pm
auto/
Module_3/
Module_3.bs
Module_3.so
autosplit.ix

Does Module_3 really need to go into the i386-linux directory ? Module_3
and its compiled '.so' will be found just as well if Module_3 is
placed in the same directory as Module_1 and Module_2. (I'm thinking
that this may be an unnecessary complication, that's all - and that you
can simply let makemaker decide where to put Module_3 without doing
anything special with it. That could mean that Module_3 gets put in the
i386-linux/ directory anyway.)
data_dir/
data_file_1
data_file_2
data_subdir_1/
data_file_3
Could someone be so kind as to tell me what I must put in Makefile.PL
that will result in the above structure?

I would certainly have to play around with it to work out an answer - no
doubt you have been doing just that. Actually "play" is hardly the
appropriate word - I imagine it gets fairly tedious.

If you can't get a satisfactory answer here then all I can suggest is
the makemaker mailing list. See http://lists.perl.org .

Cheers,
Rob
 
J

James Willmore

I am trying to package a CGI script and associated modules so that
they can be installed using Perl's standard sequence (perl Makefile.PL
&& make && make test && make install).

<snip>

Use h2xs ;-)

This does all of the "nasty" work for you. For example, suppose you want
to create a module called Foo::Bar. If, in a working/temp/whatever
directory, you execute:

h2xs -XAn Foo::Bar

this takes care of creating files for you - to populate with your code.
(Thanks to Randal Schwartz for helping me see the light of modules in his
book "Learning Perl Objects, References, & Modules").

You may also want to look over perltoot, perlboot, perlmod and h2xs.

I don't have any experience with ExtUtils::MakeMaker ... because there are
other tools Perl offers. But, if you *really* want the straight poop on
this module, try posting to comp.lang.perl.modules - which deals with ...
Perl modules ;-)

A side note - Java is far more complicated IMHO. Setting the proper
CLASSPATH alone is a task and a half. Perl is much easier to
incorporate packages into your install. But, of course, it's just my
opinion.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
War is peace. Freedom is slavery. Ketchup is a vegetable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top