App-Build
view release on metacpan or search on metacpan
lib/App/Build.pm view on Meta::CPAN
it also supports deployment of applications which are not
included or are not on CPAN at all.
Anyone who finds a useful perl application somewhere
(i.e. "Foo") can write a small perl distribution called
App-Build-Foo and upload it to CPAN.
When someone uses the CPAN shell, they can install the
application simply by typing
install App::Build::Foo
Within the App-Build-Foo distribution would be a module,
App::Build::Foo, which would be a subclass of App::Build.
It would contain any specific logic necessary to download
and install the Foo application.
All applications installed with App::Build (and its
derivatives) should conform to a set of standards (see
below) so that when multiple applications are installed,
they are integrated seamlessly and work side by side.
=head1 APPLICATION INSTALLATION REQUIREMENTS
The following are the requirements of all App::Build
installations.
* The installation MUST be useful to ISP's (internet
service providers) and ASP's (application service
providers) such that the software is installed
in such a way that each customer of theirs may use
it without any interactions with other customers.
* The installation SHOULD allow for multiple versions
even for an unprivileged user (an ISP/ASP customer).
This allows a user to install a new version of an
application and evaluate it and run it in parallel
with an existing version of the application.
=head1 APPLICATION INSTALLATION STANDARDS
The following are additional standards of all App::Build
installations.
* TBD
=head1 App::Build CONFIGURABILITY
Since App::Build uses App::Options, App::Options makes all the
of the --var=value options available via the global %App::options hash.
App::Build however does not remove the --var=value options from @ARGV.
This will be put to good use sometime in the future.
=head1 FIX-UPS
Module::Build complains if the PREFIX environment variable is
set. App::Build doesn't. It just ignores it.
The CPAN shell (for some reason I don't understand) runs Build.PL
as "perl Build.PL Build" and this fails.
App::Build just throws away the "Build" so that the default "build"
action is invoked.
Module::Build deprecated the PREFIX option to Makefile.PL
(i.e. "perl Makefile.PL PREFIX=/usr/foo"). App::Build just makes
the PREFIX option a synonym for "install_base", which does
essentially the same thing.
=cut
delete $ENV{PREFIX}; # Module::Build protests if this var is set
# Enable the continued use of the PREFIX=$PREFIX option
# (from Makefile.PL and ExtUtils::MakeMaker) by making it
# an alias for the "install_base" option of Module::Build.
######################################################################
# BUILD: enhancements to "perl Build.PL"
######################################################################
=head1 METHODS
The documentation of the methods below is not for users of the
App::Build module (who are writing Build.PL scripts), but for people
interested in the internals of how App::Build extends Module::Build.
It is also so that I can remember what I was doing so that if the
internals of Module::Build change, I can maintain this code.
=head2 new()
We override the new() method in order to enhance the install paths.
In the future, we may also download and unpack external perl
distributions.
=cut
sub new {
my ($class, %args) = @_;
my $obj = $class->SUPER::new(%args);
$obj->_enhance_install_paths() if $obj->_prefix;
$obj->_get_supporting_software();
return($obj);
}
=head2 read_config()
Overridden to transparently call C<_enhance_install_paths()>.
=cut
sub read_config {
my ($self) = @_;
$self->SUPER::read_config();
$self->_enhance_install_paths() if $self->_prefix;
}
( run in 2.034 seconds using v1.01-cache-2.11-cpan-cdf2f3d4e48 )