# $Id: Makefile.PL,v 1.2 2002/12/14 20:10:37 m_ilya Exp $ use 5.005; use strict; use ExtUtils::MakeMaker; use File::Spec; my $VERSION_FROM = File::Spec->catfile(qw(lib HTTP WebTest Plugin Apache.pm)); my $AUTHOR = 'Richard Anderson , ' . 'Ilya Martynov '; my $ABSTRACT = 'HTTP::WebTest plugin for local web file test mode'; WriteMakefile( NAME => 'HTTP::WebTest::Plugin::Apache', VERSION_FROM => $VERSION_FROM, PREREQ_PM => { 'File::Temp' => 0, 'HTTP::WebTest' => 2.00 }, realclean => { FILES => '.config' }, AUTHOR => $AUTHOR, ABSTRACT => $ABSTRACT); package MY; sub libscan { my $self = shift; my $path = shift; # ignore backup files return undef if $path =~ /~/; return $self->SUPER::libscan($path); } sub test { my $self = shift; my $make = $self->SUPER::test(@_); # add dependencies for test targets $make =~ s/(test(?:db)? :: )(.*)/$1test_config $2/g; return $make; } sub dist_core { my $self = shift; my $make = $self->SUPER::dist_core(); # add our hook for dist target $make =~ s/^dist : /dist : distprepare /m; return $make; } sub postamble { my $make = ''; # verify standard input and output are attached to a terminal if(-t STDIN and -t STDOUT) { $make .= apache_dir_setup(); print STDOUT "\n"; } # add test_config target (test and testdb targets depend on it) my $test_config_pl = File::Spec->catfile(qw(scripts test_config.PL)); $make .= <catfile(qw(scripts make_readme.PL)); my $apache_pm = File::Spec->catfile(qw(lib HTTP WebTest Plugin Apache.pm)); $make .= <; chomp($response); if($response =~ /^(?:y(?:es)?|)$/i) { # user asked for directory installation $apache_dir = '/usr/local/etc'; print_prompt(<; chomp($response); $apache_dir = $response if $response; last if -d $apache_dir; print STDOUT <