File: Build.PL

package info (click to toggle)
libversion-perl 0.6701-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 268 kB
  • ctags: 587
  • sloc: ansic: 2,673; perl: 853; makefile: 116
file content (71 lines) | stat: -rw-r--r-- 1,616 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/perl

use Module::Build;
my $perl_only;

my $class = Module::Build->subclass
(
#    class => 'version::Builder',
    code => q{
    sub ACTION_dist{
        my $self = shift;
    	$self->do_system('svk log -x | gnuify-changelog.pl > Changes');
	$self->SUPER::ACTION_dist();
	};
    sub have_c_compiler{
	my $self = shift;
	my $have = eval {$self->SUPER::have_c_compiler};
	$have = 0 if $@;
	return $have;
	};
    },
);

my $t = $class->new(
    module_name     => 'version',
    get_options     => {
       'perl_only' => { store => \$perl_only },
    },
);

my %build_arguments = (
    dist_name       => 'version',
    dist_version_from => 'lib/version.pm',
    license         => 'perl',
    requires        => {
	perl => '> 5.005, < 5.009',
    },
    dynamic_config  => 1,
);

mkdir($t->config_dir(),0777);

if ( $] < 5.005_04 ) {
    # Cannot support 5.005_03 with the XS code
    $perl_only = 1;
}

if ( $perl_only or not $t->have_c_compiler() ) {
    $build_arguments{module_name} = 'version::vpp';
    $build_arguments{pm_files} = {
	'./lib/version.pm' => './lib/version.pm',
	'./vperl/vpp.pm' => './lib/version/vpp.pm',
    };
}
else {
    $build_arguments{c_source} = './vutil';
    $build_arguments{module_name} = 'version::vxs';
    $build_arguments{pm_files} = {
	'./lib/version.pm' => './lib/version.pm',
	'./vutil/lib/version/vxs.pm' => './lib/version/vxs.pm'
    };
    $build_arguments{xs_files} = {
	'./vutil/vxs.xs' => './lib/version/vxs.xs'
    };
    $build_arguments{add_to_cleanup} = 
    	['lib/version/vxs.*'];
}

my $m = $class->new(%build_arguments);

$m->create_build_script;