# based on Makefile.PL from HTML::Mason
use ExtUtils::MakeMaker;
require 5.004;
require './makeconfig.pl';
#--- Installation check
sub chk_version2
{
my($pkg,$wanted,$msg) = @_;
local($|) = 1;
print "Checking for $pkg" . (($wanted > 0.01) ? " v$wanted..." : "...");
eval { my $p; ($p = $pkg . ".pm") =~ s#::#/#g; require $p; };
my $vstr = ${"${pkg}::VERSION"} ? "found v" . ${"${pkg}::VERSION"}
: "not found";
my $vnum = ${"${pkg}::VERSION"} || 0;
print $vnum >= $wanted ? "ok\n" : "failed " . $vstr . "\n";
if (($vnum < $wanted) && ($msg)) {
print " $msg\n\n";
}
$vnum >= $wanted;
}
my %prereqs = (
Apache::Constants => [ 0.01, 'Apache::Constants comes with mod_perl (perl.apache.org)' ],
Apache::Cookie => [ 0.01, 'Apache::Cookie can be found on CPAN (search.cpan.org)' ],
Apache::Session => [ 1.53, 'Apache::Session can be found on CPAN (search.cpan.org)' ],
Apache::Request => [ 0.01, 'Apache::Request comes with mod_perl (perl.apache.org)' ],
Apache::Util => [ 0.01, 'Apache::Util comes with mod_perl (perl.apache.org)' ],
Apache::File => [ 0.01, 'Apache::File comes with mod_perl (perl.apache.org)' ],
HTML::Mason => [ 1.00, 'HTML::Mason can be obtained from www.masonhq.com' ],
HTML::Parser => [ 0.01, 'HTML::Parser can be found on CPAN (search.cpan.org)' ],
HTML::Tagset => [ 0.01, 'HTML::Tagset can be found on CPAN (search.cpan.org)' ],
Image::Magick => [ 5.28, 'Photo albums require Image::Magick; Image::Magick can be found on CPAN (search.cpan.org)'],
Digest::MD5 => [ 0.01, 'Digest::MD5 can be found on CPAN (search.cpan.org)' ],
MD5 => [ 0.01, 'MD5 can be found on CPAN (search.cpan.org)' ],
MIME::Base64 => [ 0.01, 'MIME::Base64 can be found on CPAN (search.cpan.org)' ],
Storable => [ 0.01, 'Storable can be found on CPAN (search.cpan.org)' ],
Data::Dumper => [ 0.01, 'Data::Dumper can be found on CPAN (search.cpan.org)' ]
);
my %simple_prereqs;
foreach (sort keys %prereqs) {
chk_version2($_ => ${$prereqs{$_}}[0], ${$prereqs{$_}}[1]);
$simple_prereq{$_} = ${$prereqs{$_}}[0];
}
my $rconf = make_config();
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'HTML::Bricks',
'VERSION_FROM' => 'lib/HTML/Bricks.pm', # finds $VERSION
'PREREQ_PM' => \%simple_prereqs,
'AUTHOR' => 'Peter McDermott ',
'ABSTRACT' => 'DHTML Layout tool that enables users to build web pages without writing code',
clean => {
'FILES' => 'lib/HTML/Bricks/Config.pm',
}
);
package MY;
sub MY::install {
package MY;
my $self = shift;
my $install = $self->SUPER::install(@_);
$install =~ s/(install :: .*)$/$1 bricks_root_install www_root_install install_fin_msg/m;
$install .= <SUPER::test(@_);
$test =~ s/(runtests \@ARGV;)/\$\$ENV{MASON_VERBOSE}=\$(TEST_VERBOSE); $1/;
return $test;
}
sub libscan
{
my $self = shift;
my $file = shift;
return $file =~ /makeconfig\.pl/ ? 0 : $self->SUPER::libscan($file);
}