Randy Kobes wrote:
[...]
This sounds like a great idea, having it in a module like this
... Until that occurs, and becomes available on CPAN, perhaps
something that could be done is having an h2xs-ish tool that
would provide a template authors could use to, in particular,
have a function to detect the mod_perl version right in
Makefile.PL.
As soon as we define how it should work it can be on CPAN. Then authors can choose to use that module or if they prefer to have a full control that module is already the template that you are talking about. But I'd try to have all authors using that module if possible. So if things change internally, 1.0 users need to update that module 2.0 users will get it automatically and module authors won't need to touch their modules.

Another thing that might be considered is to have a convention
where mod_perl 2 versions are installed under Apache2/, with
mod_perl 1 verions under Apache/. I did this for Apache-GeoIP -
what happens there is, when the mod_perl version is decided, the
appropriate files in the distribution under Apache2/ or Apache/
(corresponding to mod_perl 2 and 1 versions), are then copied to
a lib/ directory, and MakeMaker takes care of the rest.
Are you talking about the source distribution?

I've tried the following approach.

mp1/Makefile.PL.in
mp2/Makefile.PL.in

now the function that we are discussing returns you 1 or 2, next the top Makefile.PL does:

cp mp1/Makefile.PL.in mp1/Makefile.PL

and runs WriteMakefile(), which descends only to the dir with Makefile.PL.

But it's really up to the author how to handle that. I've first tried this approach with Apache::Peek, but I've to handle 5 different combination, and I decided to go with files to avoid maintaining duplicates, so currently the distribution is:

Makefile.PL
MANIFEST
Peek.pm.mp1.perl5.5
Peek.pm.mp1.perl5.6
Peek.pm.mp1.perl5.8
Peek.pm.mp2.perl5.6
Peek.pm.mp2.perl5.8
Peek.xs.mp1.perl5.5
Peek.xs.mp1.perl5.6
Peek.xs.mp1.perl5.8
Peek.xs.mp2.perl5.6
Peek.xs.mp2.perl5.8
ppport.h
README
test.pl

Makefile.PL decides on the perl and mp versions and then creates the appropriate .pm and .xs files by copying them and glueing the pod to .pm.

So it's all depends on the complexity of your source distribution.

That's said, we could certain provide convenience wrappers to handle both: the pick-dir and pick-files approach.


__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to