use ExtUtils::MakeMaker; use Config; use mod_perl 1.16; $VERSION = '1.02'; my @programs_to_install = qw(PATCH); my %pl_files = map {("bin/$_.PL" => "bin/$_")} @programs_to_install; my @cgi_compat = qw{ ch4/guestbook.cgi ch2/hello2.pl ch4/missing.cgi ch5/hangman1.cgi ch5/hangman2.cgi ch5/hangman3.cgi ch5/hangman4.cgi ch5/hangman5.cgi ch5/hangman6.cgi ch5/hangman7.cgi}; for (@cgi_compat) { #$pl_files{"perl/$_.PL"} = "perl/$_"; gen_script("perl/$_"); } for (qw(authtiedbi-mysql checksum)) { gen_script("bin/$_.pl"); } WriteMakefile( NAME => "wrapmod-code", VERSION => $VERSION, PL_FILES => \%pl_files, EXE_FILES => [ map {"bin/$_"} @programs_to_install ], 'clean' => { FILES => '$(EXE_FILES)' }, 'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, ); sub gen_script { my $file = shift; local(*IN,*OUT); open IN, "$file.PL" or die "Couldn't open $file.PL: $!"; open OUT, ">$file" or die "Couldn't open $file: $!"; print OUT "#!$Config{perlpath}\n", join '', ; close OUT; close IN; chmod 0755, "$file"; } package MY; sub MY::test { my $self = shift; my $test = $self->MM::test; return <<'EOF' unless -x "httpd"; test: @echo "No ./httpd to test against" EOF return <<'EOF'; MP_TEST_SCRIPT=t/TEST TEST_VERBOSE=0 run_tests: $(FULLPERL) $(MP_TEST_SCRIPT) $(TEST_VERBOSE) test: run_tests EOF } sub libscan { my($self, $path) = @_; return '' if $path =~ m/.(pl|dtd|sgml)$/; return '' if $path =~ m:\bCVS/:; return '' if $path =~ m/~$/; $path; } sub manifypods { my $self = shift; return <<'EOF'; manifypods :: Makefile @$(NOOP) EOF }