Alien-Autotools
view release on metacpan or search on metacpan
#!/usr/bin/env perl
use v5.10;
use strict;
use warnings FATAL => "all";
use utf8;
use version;
use Archive::Tar;
use ExtUtils::CChecker;
use File::Spec::Functions qw(catdir catfile splitpath);
use IPC::Cmd qw(run can_run);
use Module::Build;
use Net::FTP;
use File::Path qw(make_path remove_tree);
# Prevent warnings about missing share directory:
make_path("share");
my $builder = Module::Build->new(
# Defaults inserted by DistZilla:
'build_requires' => {
'Module::Build' => '0.3601',
'Test::More' => '0',
'Test::Requires' => '0'
},
'configure_requires' => {
'Archive::Tar' => '0',
'ExtUtils::CChecker' => '0',
'File::Path' => '2.08',
'File::ShareDir' => '0',
'IPC::Cmd' => '0',
'Module::Build' => '0.3601',
'Net::FTP' => '0',
'perl' => '5.010_001',
'version' => '0'
},
'requires' => {
'perl' => 'v5.10.0'
},
'dist_abstract' => 'Build and install the GNU build system.',
'dist_name' => 'Alien-Autotools',
'license' => 'lgpl',
'dist_author' => [
'Richard Simões <rsimoes AT cpan DOT org>'
],
dist_version_from => "lib/Alien/Autotools.pm",
share_dir => "share" );
my $base_dir = $builder->base_dir;
my $share_dir = catdir($base_dir, "share");
# Automake needs a possibly newer autoconf than what the system has, so add the
# new bin dir to $ENV{PATH}.
$ENV{PATH} = catdir($share_dir, "bin") . ":$ENV{PATH}";
my %autotools = map {
my ($tool, $bin_path, $ftp_path) = @{$_}{qw(tool bin_path ftp_path)};
my ($version) = $bin_path
? do {
my ($output) = ( run(
command => [$bin_path, "--version"] ) )[2][0] =~ /([\d.]+)/ }
: "0.0.0";
# Convert to semantic version
$version ||= "0.0.0";
$version =~ s/^(?<!.)(\d\.\d+)$/$1.0/m;
if ( !$ENV{COMPILE_ALIEN_AUTOTOOLS}
( run in 0.547 second using v1.01-cache-2.11-cpan-e1769b4cff6 )