You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Shannon Eric Peevey <sp...@unt.edu> on 2003/06/23 05:20:31 UTC
informational notice in Makefile.PL
Hi!
In an attempt to simplify the install process for dependencies with my
modules, I have been using the ExtUtils::AutoInstall module. (Great
module, BTW :) ) But, with the current state of affairs with mod_perl
and its availability from CPAN, I wanted to through an information
notice to the effect of, "if you are planning to use mod_perl2 and
apache2, you will have to answer no here, and manually download it from
perl.apache.org..." I contacted Autrijus Tang, the maintainer of
ExtUtils::AutoInstall, and asked him if it was possible, (I didn't see
it documented), and he answered with this:
# notify the user about mod_perl 2
BEGIN { print q{
**************** NOTICE *********************
If you are planning to use mod_perl2 and Apache2, please, do not
answer yes when prompted to install mod_perl. You will need to
download mod_perl2 manually from
http://perl.apache.org/download/index.html
*********************************************
} }
I placed it after the first BEGIN block and voila! I am communicating :)
Hope this helps someone.
speeves
cws
Re: informational notice in Makefile.PL
Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Mon, 14 Jul 2003, Stas Bekman wrote:
>
> [ ... ]
>
>>Are you talking about the dependencies list? by 'the current
>>state of affairs with mod_perl 2.0', you mean that it's not
>>indexed by PAUSE. It's available from CPAN.
>>
>>Actually, once it gets indexed by CPAN it'll break all the
>>other modules which specify mod_perl (1.0) as a dependency and
>>won't work with 2.0.
>
>
> Perhaps it might be an idea, at this stage, to recommend to
> module authors that, if their package is for mod_perl 1 only, to
> use a module like Apache::Constants in their PREREQ_PM (ie,
> something available only within mod_perl 1), and if it's for
> mod_perl 2 only, use something like Apache::Const, or something
> available only with mod_perl 2. This won't help existing
> packages, but it would at least alert people that a problem is on
> the horizon.
Good idea, Randy. And there is an even more intuitive solution: either require
Apache or Apache2, depending on which version you need.
> To help in this, perhaps it would be worthwhile to promote the
> use of Module::Install? A package (Module::Install::mod_perl?)
> could be made which would make available a function to test for
> the mod_perl version a user has, and then decide if this is
> appropriate for the package about to be installed. If the
> required mod_perl version isn't present, one could either offer
> to add the required version to PREREQ_PM, or else just die, as
> automated installs of mod_perl can be tricky. A lot of the code
> for this could be extracted from Apache::Test; Stas, you've also
> worked through this logic in making packages that include
> different versions for different mod_perl versions. Only the
> package author need have Module::Install::* when constructing the
> Makefile.PL - the necessary stuff for the added functionality is
> added to the distribution, making it transparent to the user.
Yup, I was planning to look at how Module::Install solves this issue.
Unfortunatelly I've missed the BOF last week at the OSCon that was discussing
this module :(
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: informational notice in Makefile.PL
Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 15 Jul 2003, Shannon Eric Peevey wrote:
> Here is an example of my Makefile.PL using ModUtils::AutoInstall:
[ ... ]
> I then add the necessary code inside of the .pm file to check
> the version of mod_perl on the machine and perform
> appropriately. (I hope... ;) ) This allows a module to live in
> both worlds, and removes the necessity of supporting two code
> bases. I think that this type of porting will help authors to
> go ahead and port their modules, expanding the mp2 module base,
> and alleviate fears of jumping off of a cliff and leaving mp1
> behind.
ExtUtils::AutoInstall is pretty powerful, and flexible. It does
though add an extra external dependency that the end user must
normally install. For some packages (eg, those supplying custom
config directives that must 'use mod_perl;' right within
Makefile.PL to build), this is probably the easiest approach. For
other, less complicated dependencies, though, that still need
something extra beyond the standard ExtUtils::MakeMaker and
friends, Module::Install might be a simpler approach - there's
nothing extra that the user has to install, as the code for any
additional functionality is included within the distribution.
--
best regards,
randy
Re: informational notice in Makefile.PL
Posted by Shannon Eric Peevey <sp...@unt.edu>.
Randy Kobes wrote:
>On Mon, 14 Jul 2003, Stas Bekman wrote:
>
>[ ... ]
>
>
>>Are you talking about the dependencies list? by 'the current
>>state of affairs with mod_perl 2.0', you mean that it's not
>>indexed by PAUSE. It's available from CPAN.
>>
>>Actually, once it gets indexed by CPAN it'll break all the
>>other modules which specify mod_perl (1.0) as a dependency and
>>won't work with 2.0.
>>
>>
>
>Perhaps it might be an idea, at this stage, to recommend to
>module authors that, if their package is for mod_perl 1 only, to
>use a module like Apache::Constants in their PREREQ_PM (ie,
>something available only within mod_perl 1), and if it's for
>mod_perl 2 only, use something like Apache::Const, or something
>available only with mod_perl 2. This won't help existing
>packages, but it would at least alert people that a problem is on
>the horizon.
>
>To help in this, perhaps it would be worthwhile to promote the
>use of Module::Install? A package (Module::Install::mod_perl?)
>could be made which would make available a function to test for
>the mod_perl version a user has, and then decide if this is
>appropriate for the package about to be installed. If the
>required mod_perl version isn't present, one could either offer
>to add the required version to PREREQ_PM, or else just die, as
>automated installs of mod_perl can be tricky. A lot of the code
>for this could be extracted from Apache::Test; Stas, you've also
>worked through this logic in making packages that include
>different versions for different mod_perl versions. Only the
>package author need have Module::Install::* when constructing the
>Makefile.PL - the necessary stuff for the added functionality is
>added to the distribution, making it transparent to the user.
>
>
Here is an example of my Makefile.PL using ModUtils::AutoInstall:
# ExtUtils::AutoInstall Bootstrap Code, version 7.
BEGIN{my$p='ExtUtils::AutoInstall';my$v=0.52;$p->VERSION||0>=$v
or+eval"use $p $v;1"or+do{my$e=$ENV{PERL_EXTUTILS_AUTOINSTALL};
(!defined($e)||$e!~m/--(?:default|skip|testonly)/and-t STDIN or
eval"use ExtUtils::MakeMaker;WriteMakefile(PREREQ_PM=>{'$p',$v}
);1"and exit)and print"==> $p $v required. Install it from CP".
"AN? [Y/n] "and<STDIN>!~/^n/i and print"*** Installing $p\n"and
do{if (eval '$>' and lc(`sudo -V`) =~ /version/){system('sudo',
$^X,"-MCPANPLUS","-e","CPANPLUS::install $p");eval"use $p $v;1"
||system('sudo', $^X, "-MCPAN", "-e", "CPAN::install $p")}eval{
require CPANPLUS;CPANPLUS::install$p};eval"use $p $v;1"or eval{
require CPAN;CPAN::install$p};eval"use $p $v;1"||die"*** Please
manually install $p $v from cpan.org first...\n"}}}
# notify the user about mod_perl 2
BEGIN { print q{
**************** NOTICE *********************
If you are planning to use mod_perl2 and Apache2, please, do not
answer yes when prompted to install mod_perl. You will need to
download mod_perl2 manually from
http://perl.apache.org/download/index.html
*********************************************
} }
# optional pre-install handler; takes $module_name and $version
# sub MY::preinstall { return 1; } # return false to skip install
# optional post-install handler; takes $module_name, $version, $success
# sub MY::postinstall { return; } # the return value doesn't matter
# the above handlers must be declared before the 'use' statement
use ExtUtils::AutoInstall (
-version => '0.40', # required AutoInstall version
# usually 0.40 is sufficient
-config => {
make_args => '--hello', # option(s) for CPAN::Config
force => 1, # pseudo-option to force install
do_once => 1, # skip previously failed modules
},
-core => [
Convert::ASN1 => '',
Net::LDAP => '',
mod_perl => '',
], # core modules; may also be 'all'
);
WriteMakefile(
AUTHOR => 'Mark Wilcox (mjwilcox@wilcox.com) and
Shannon Eric Peevey (speeves@unt.edu)',
ABSTRACT => 'Apache::AuthNetLDAP -- Perl module which
authenticates users via LDAP using the Net::LDAP module.'
,
NAME => 'Apache::AuthNetLDAP',
VERSION_FROM => 'AuthNetLDAP.pm',
DISTNAME => 'Apache-AuthNetLDAP',
);
I then add the necessary code inside of the .pm file to check the
version of mod_perl on the machine and perform appropriately. (I
hope... ;) ) This allows a module to live in both worlds, and removes
the necessity of supporting two code bases. I think that this type of
porting will help authors to go ahead and port their modules, expanding
the mp2 module base, and alleviate fears of jumping off of a cliff and
leaving mp1 behind.
Just my .02...
speeves
cws
Re: informational notice in Makefile.PL
Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 14 Jul 2003, Stas Bekman wrote:
[ ... ]
> Are you talking about the dependencies list? by 'the current
> state of affairs with mod_perl 2.0', you mean that it's not
> indexed by PAUSE. It's available from CPAN.
>
> Actually, once it gets indexed by CPAN it'll break all the
> other modules which specify mod_perl (1.0) as a dependency and
> won't work with 2.0.
Perhaps it might be an idea, at this stage, to recommend to
module authors that, if their package is for mod_perl 1 only, to
use a module like Apache::Constants in their PREREQ_PM (ie,
something available only within mod_perl 1), and if it's for
mod_perl 2 only, use something like Apache::Const, or something
available only with mod_perl 2. This won't help existing
packages, but it would at least alert people that a problem is on
the horizon.
To help in this, perhaps it would be worthwhile to promote the
use of Module::Install? A package (Module::Install::mod_perl?)
could be made which would make available a function to test for
the mod_perl version a user has, and then decide if this is
appropriate for the package about to be installed. If the
required mod_perl version isn't present, one could either offer
to add the required version to PREREQ_PM, or else just die, as
automated installs of mod_perl can be tricky. A lot of the code
for this could be extracted from Apache::Test; Stas, you've also
worked through this logic in making packages that include
different versions for different mod_perl versions. Only the
package author need have Module::Install::* when constructing the
Makefile.PL - the necessary stuff for the added functionality is
added to the distribution, making it transparent to the user.
--
best regards,
randy kobes
Re: informational notice in Makefile.PL
Posted by Shannon Eric Peevey <sp...@unt.edu>.
Stas Bekman wrote:
> Shannon, can you please post this follow up to the list?
Sorry, thought I got...
>
>
> Eric Peevey wrote:
>
>> Stas Bekman wrote:
>>
>>> Shannon Eric Peevey wrote:
>>>
>>>> Hi!
>>>>
>>>> In an attempt to simplify the install process for dependencies with
>>>> my modules, I have been using the ExtUtils::AutoInstall module.
>>>> (Great module, BTW :) ) But, with the current state of affairs
>>>> with mod_perl and its availability from CPAN, I wanted to through
>>>> an information notice to the effect of, "if you are planning to use
>>>> mod_perl2 and apache2, you will have to answer no here, and
>>>> manually download it from perl.apache.org..." I contacted Autrijus
>>>> Tang, the maintainer of ExtUtils::AutoInstall, and asked him if it
>>>> was possible, (I didn't see it documented), and he answered with this:
>>>>
>>>> # notify the user about mod_perl 2
>>>> BEGIN { print q{
>>>> **************** NOTICE *********************
>>>> If you are planning to use mod_perl2 and Apache2, please, do
>>>> not
>>>> answer yes when prompted to install mod_perl. You will need to
>>>> download mod_perl2 manually from
>>>> http://perl.apache.org/download/index.html
>>>> *********************************************
>>>> } }
>>>>
>>>> I placed it after the first BEGIN block and voila! I am
>>>> communicating :)
>>>
>>>
>>>
>>>
>>> Are you talking about the dependencies list? by 'the current state
>>> of affairs with mod_perl 2.0', you mean that it's not indexed by
>>> PAUSE. It's available from CPAN.
>>>
>>> Actually, once it gets indexed by CPAN it'll break all the other
>>> modules which specify mod_perl (1.0) as a dependency and won't work
>>> with 2.0.
>>>
>>> __________________________________________________________________
>>> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
>>> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
>>> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
>>> http://modperlbook.org http://apache.org http://ticketmaster.com
>>
>>
>>
>> Hi!
>>
>> Since I am automating the download for the dependencies in the
>> Makefile.PL, I need to let the people know that they cannot
>> automatically download mod_perl 2 using my makefile. They will
>> instead need to download it from the appropriate site and install it
>> manually. That is why I am putting a notice in the Makefile.PL.
>> speeves
>> cws
>>
>
>
Re: informational notice in Makefile.PL
Posted by Stas Bekman <st...@stason.org>.
Shannon Eric Peevey wrote:
> Hi!
>
> In an attempt to simplify the install process for dependencies with my
> modules, I have been using the ExtUtils::AutoInstall module. (Great
> module, BTW :) ) But, with the current state of affairs with mod_perl
> and its availability from CPAN, I wanted to through an information
> notice to the effect of, "if you are planning to use mod_perl2 and
> apache2, you will have to answer no here, and manually download it from
> perl.apache.org..." I contacted Autrijus Tang, the maintainer of
> ExtUtils::AutoInstall, and asked him if it was possible, (I didn't see
> it documented), and he answered with this:
>
> # notify the user about mod_perl 2
> BEGIN { print q{
> **************** NOTICE *********************
> If you are planning to use mod_perl2 and Apache2, please, do not
> answer yes when prompted to install mod_perl. You will need to
> download mod_perl2 manually from
> http://perl.apache.org/download/index.html
> *********************************************
> } }
>
> I placed it after the first BEGIN block and voila! I am communicating :)
Are you talking about the dependencies list? by 'the current state of affairs
with mod_perl 2.0', you mean that it's not indexed by PAUSE. It's available
from CPAN.
Actually, once it gets indexed by CPAN it'll break all the other modules which
specify mod_perl (1.0) as a dependency and won't work with 2.0.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com