File: Build.PL

package info (click to toggle)
libapache-ssi-perl 2.19-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 292 kB
  • ctags: 65
  • sloc: perl: 842; makefile: 31
file content (46 lines) | stat: -rw-r--r-- 1,153 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use strict;
use Module::Build;
use lib 't/lib';  # distributed here until changes are incorporated into the real version
use Apache::test qw(have_httpd);

my %params = Apache::test->get_test_params();

my $class = 'Module::Build';

if (have_httpd()) {
  Apache::test->write_httpd_conf
      (%params,
       include => do {local $/; open FH, 't/config.incl' or die $!; <FH>});
  
  $class = $class->subclass
    (
     code => sprintf(<<'     EOF', Module::Build->cwd, $params{port}),
       sub ACTION_test {
	 my $self = shift;
	 
	 $self->depends_on('build');
	 
	 # Could be File::Spec-ified, but this is mostly a Unix module
	 $self->add_to_cleanup(qw(t/httpd t/httpd.conf t/error_log));
	 $self->do_system('t/httpd', '-f', "%s/t/httpd.conf");
	 
	 $ENV{PORT} = %s;  # Used by the test scripts
	 eval { $self->SUPER::ACTION_test };
	 warn $@ if $@;
	 
	 $self->do_system("kill `cat t/httpd.pid`");
       }
     EOF
    );
}

my $b = $class->new
  (
   module_name => 'Apache::SSI',
   license => 'perl',
   requires => { 'mod_perl' => '1.24_01',
		 'Apache::Constants' => '1.00',
		 'HTML::SimpleParse' => '0.06' },
  );

$b->create_build_script;