Need help with ExtUtils::MakeMaker

Discussion in 'Perl Misc' started by jill, Jan 26, 2004.

  1. jill

    jill Guest

    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
     
    jill, Jan 26, 2004
    #1
    1. Advertising

  2. jill

    Sisyphus Guest

    jill wrote:

    > (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


    --
    To reply by email u have to take out the u in kalinaubears.
     
    Sisyphus, Jan 27, 2004
    #2
    1. Advertising

  3. On Mon, 26 Jan 2004 17:37:57 +0000, jill wrote:

    > 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.
     
    James Willmore, Jan 27, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. felipe200112
    Replies:
    0
    Views:
    276
    felipe200112
    Apr 19, 2004
  2. Irving Kimura

    Anything better than ExtUtils::MakeMaker ?

    Irving Kimura, May 11, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    131
    Jon Ericson
    May 14, 2004
  3. Abdul-Wahid Paterson

    installing extra file through ExtUtils::MakeMaker

    Abdul-Wahid Paterson, Nov 8, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    205
    Anno Siegel
    Nov 9, 2004
  4. Replies:
    1
    Views:
    105
    Sisyphus
    Mar 2, 2006
  5. kj
    Replies:
    2
    Views:
    105
Loading...

Share This Page