You want to start from this doc: http://world.std.com/~swmcd/steven/perl/module_mechanics.html
Per Einar wrote: > > Hi everyone, > > I'm working on a mod_perl application called OpenTMS > (<http://sourceforge.net/projects/opentms/>). It uses a set of modules > in the OpenTMS namespace for general functions, and the rest is handled > by Apache::Registry scripts. I might also add some Apache Perl handlers > in the future. Right now I'm wondering about the installation routines I > should adopt. > > Right now, the directory structure is like this: > lib/ > OpenTMS.pm > OpenTMS/ > rest of the modules > scripts/ > Apache::Registry scripts > docs/ > Documentation since at the end Makefile.PL will install things elsewhere, it doesn't matter much. Just look at a few major CPAN distros and copy from them what you like. usually it goes as lib/bin/docs/(eg|example)/ > I tried searching for the right way to run a Makefile.PL/make/make > test/install installation, but I couldn't find anything. I would like to > get the modules installed into @INC somewhere, and the scripts into a > directory which is handled by mod_perl. Is there any standard way of > doing this? I couldn't find it documented anywhere, and think that it > would be a good addition to the docs. again look at the existing modules. You can ask from Makefile.PL where a user wants to install the scripts, e.g. Apache::mod_perl guide does a similar thing, but not exactly that. > Also, should OpenTMS.pm reside in > lib/OpenTMS/, and the OpenTMS::* in lib/OpenTMS/OpenTMS/ or can they > stay like they are now? Usually it's: lib/OpenTMS.pm lib/OpenTMS/*.pm > I have some other questions too: > > testing: I guess that this might be complicated, but I know it's being > done. Any pointers? If you must test under running Apache/mod_perl. Use the new shiny Apache::Test framework, which is working for both mod_perl 1.x and 2.x and even used to test http-2.0 and 3rd party c/php/else modules. It's not released yet, but very stable. The instructions to get the cvs version are here: http://cvs.apache.org/viewcvs.cgi/modperl-2.0/pod/modperl_dev.pod?rev=1.44&content-type=text/vnd.viewcvs-markup You can find some documentation here: http://cvs.apache.org/viewcvs.cgi/~checkout~/modperl-docs/src/devel/writing_tests/writing_tests.pod?rev=1.23&content-type=text/plain If you have futher questions regarding Apache::Test, subscribe to [EMAIL PROTECTED] and ask. > configuration: How should I document/automate how the Apache server > should be configured? In the pod part of one of the relevant module. I don't think this should/could be automated. > Other automation on Makefile.PL: Do you have any pointers to tutorials > in customizing Makefile.PL? For example, would it be feasible to have it > ask for a database name/username/password and install the databases > automatically? Makefile.PL is just a perl script which writes Makefile, you can do anything you want. Read ExtUtils::MakeMaker, but the best way to learn is a per-usal of existing CPAN module's MakeMake.PL files. You can learn a lot from mod_perl's Makefile, but I won't suggest you looking at it when you just start. Go there when you think you know everything about Makefile.PL. :) > Registering the namespace: is there any point in registering the > namespace for such an application? If it's a modperl specific app, discuss it here in a separate email. > Bundle:: : How would I have to specify in a bundle package that mod_perl > must be installed. again, download any Bundle and learn from it or read the Bundles section in the CPAN.pm's manpage. > I think it would be good for mod_perl to have some documentation > concerning the packaging of complete applications, instead of just > Apache:: modules. If I have the time, I might write an addition to the > guide/a separate document based on what I find out here. This seems to be a very generic Perl issue, like most of the questions in this email. I don't see why anything should be special under mod_perl, regarding the packaging and stuff. Apache::Test is probably the only issue that has a lot to do with mod_perl :) Hope this helps. _____________________________________________________________________ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/