Add ExtUtils::Miniperl to the list of core modules for all versions >= 5.00504
[p5sagit/p5-mst-13.2.git] / lib / Module / Build / Platform / Unix.pm
CommitLineData
bb4e9162 1package Module::Build::Platform::Unix;
2
3use strict;
7a827510 4use vars qw($VERSION);
15cb7b9d 5$VERSION = '0.31012';
7a827510 6$VERSION = eval $VERSION;
bb4e9162 7use Module::Build::Base;
8
9use vars qw(@ISA);
10@ISA = qw(Module::Build::Base);
11
12sub make_tarball {
13 my $self = shift;
14 $self->{args}{tar} ||= ['tar'];
15 $self->{args}{gzip} ||= ['gzip'];
16 $self->SUPER::make_tarball(@_);
17}
18
f943a5bf 19sub is_executable {
20 # We consider the owner bit to be authoritative on a file, because
21 # -x will always return true if the user is root and *any*
22 # executable bit is set. The -x test seems to try to answer the
23 # question "can I execute this file", but I think we want "is this
24 # file executable".
25
26 my ($self, $file) = @_;
27 return +(stat $file)[2] & 0100;
28}
29
bb4e9162 30sub _startperl { "#! " . shift()->perl }
31
32sub _construct {
33 my $self = shift()->SUPER::_construct(@_);
34
35 # perl 5.8.1-RC[1-3] had some broken %Config entries, and
36 # unfortunately Red Hat 9 shipped it like that. Fix 'em up here.
37 my $c = $self->{config};
38 for (qw(siteman1 siteman3 vendorman1 vendorman3)) {
39 $c->{"install${_}dir"} ||= $c->{"install${_}"};
40 }
41
42 return $self;
43}
44
7a827510 45sub _detildefy {
46 my ($self, $value) = @_;
738349a8 47 $value =~ s[^~(\w[-\w]*)?(?=/|$)] # tilde with optional username
7a827510 48 [$1 ?
49 ((getpwnam $1)[7] || "~$1") :
15cb7b9d 50 ($ENV{HOME} || (getpwuid $>)[7])
7a827510 51 ]ex;
52 return $value;
53}
54
bb4e9162 551;
56__END__
57
58
59=head1 NAME
60
61Module::Build::Platform::Unix - Builder class for Unix platforms
62
63=head1 DESCRIPTION
64
65The sole purpose of this module is to inherit from
66C<Module::Build::Base>. Please see the L<Module::Build> for the docs.
67
68=head1 AUTHOR
69
77e96e88 70Ken Williams <kwilliams@cpan.org>
bb4e9162 71
72=head1 SEE ALSO
73
74perl(1), Module::Build(3), ExtUtils::MakeMaker(3)
75
76=cut