|
Packit Service |
992def |
use strict;
|
|
Packit Service |
992def |
use warnings FATAL => 'all';
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
my %META = (
|
|
Packit Service |
992def |
name => 'local-lib',
|
|
Packit Service |
992def |
license => 'perl_5',
|
|
Packit Service |
992def |
prereqs => {
|
|
Packit Service |
992def |
configure => { requires => {
|
|
Packit Service |
992def |
} },
|
|
Packit Service |
992def |
build => { requires => {
|
|
Packit Service |
992def |
} },
|
|
Packit Service |
992def |
test => { requires => {
|
|
Packit Service |
992def |
'Test::More' => 0,
|
|
Packit Service |
992def |
} },
|
|
Packit Service |
992def |
runtime => { requires => {
|
|
Packit Service |
992def |
'perl' => 5.006,
|
|
Packit Service |
992def |
'ExtUtils::MakeMaker' => '7.00', # version INSTALL_BASE taken as string, not shell
|
|
Packit Service |
992def |
'ExtUtils::Install' => '1.43', # version INSTALL_BASE was added
|
|
Packit Service |
992def |
'Module::Build' => '0.36', # PERL_MB_OPT
|
|
Packit Service |
992def |
'CPAN' => '1.82', # sudo support + CPAN::HandleConfig
|
|
Packit Service |
992def |
} },
|
|
Packit Service |
992def |
develop => {
|
|
Packit Service |
992def |
requires => {
|
|
Packit Service |
992def |
'Module::Build' => '0.36',
|
|
Packit Service |
992def |
'Test::EOL' => 0,
|
|
Packit Service |
992def |
'Test::NoTabs' => 0,
|
|
Packit Service |
992def |
'Test::Pod' => 0,
|
|
Packit Service |
992def |
'Capture::Tiny' => 0,
|
|
Packit Service |
992def |
'Test::More' => 0.81_01,
|
|
Packit Service |
992def |
'Test::CPAN::Changes' => 0,
|
|
Packit Service |
992def |
},
|
|
Packit Service |
992def |
},
|
|
Packit Service |
992def |
},
|
|
Packit Service |
992def |
resources => {
|
|
Packit Service |
992def |
repository => {
|
|
Packit Service |
992def |
url => 'git://github.com/Perl-Toolchain-Gang/local-lib',
|
|
Packit Service |
992def |
web => 'https://github.com/Perl-Toolchain-Gang/local-lib',
|
|
Packit Service |
992def |
type => 'git',
|
|
Packit Service |
992def |
},
|
|
Packit Service |
992def |
x_IRC => 'irc://irc.perl.org/#local-lib',
|
|
Packit Service |
992def |
bugtracker => {
|
|
Packit Service |
992def |
web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=local-lib',
|
|
Packit Service |
992def |
mailto => 'bug-local-lib@rt.cpan.org',
|
|
Packit Service |
992def |
},
|
|
Packit Service |
992def |
license => [ 'http://dev.perl.org/licenses/' ],
|
|
Packit Service |
992def |
},
|
|
Packit Service |
992def |
);
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
my %MM_ARGS = ();
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
##############################################################################
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
# Solaris (and possibly other Unices) have a tar in /usr/bin that, among
|
|
Packit Service |
992def |
# other things, does not understand @LongLink. This can cause
|
|
Packit Service |
992def |
# extraction to look like it succeeded, but it actually failed (because
|
|
Packit Service |
992def |
# the error message for the @LongLink failure scrolled offscreen).
|
|
Packit Service |
992def |
# Therefore, given the fact that GNU tar is the most widespread tar available,
|
|
Packit Service |
992def |
# and it actually supports the feature we want (I'd bet it originated in GNU
|
|
Packit Service |
992def |
# tar, but I digress), we'll look for GNU tar. If we don't find it, and the
|
|
Packit Service |
992def |
# user hasn't pointed us to a suitable tar, we'll bomb and tell them what to
|
|
Packit Service |
992def |
# do.
|
|
Packit Service |
992def |
#
|
|
Packit Service |
992def |
require File::Spec;
|
|
Packit Service |
992def |
unless (exists $ENV{PERL_LL_TAR} ? -x $ENV{PERL_LL_TAR}
|
|
Packit Service |
992def |
: $^O eq 'solaris'
|
|
Packit Service |
992def |
? (grep -x,
|
|
Packit Service |
992def |
map File::Spec->catfile($_, 'gtar'),
|
|
Packit Service |
992def |
File::Spec->path)
|
|
Packit Service |
992def |
: 1) {
|
|
Packit Service |
992def |
die <<'DEATH';
|
|
Packit Service |
992def |
You are using Solaris (or another traditional Unix) that does not provide a sane
|
|
Packit Service |
992def |
tar, capable of dealing with the output of GNU tar. Please either set the
|
|
Packit Service |
992def |
PERL_LL_TAR environment variable to the location of a version of tar that
|
|
Packit Service |
992def |
understands the @LongLink convention or put a binary named gtar somewhere on
|
|
Packit Service |
992def |
your PATH.
|
|
Packit Service |
992def |
DEATH
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
# watch out for fancy dashes. these can wind up in our @ARGV if the user is
|
|
Packit Service |
992def |
# copypasting the bootstrap command from the POD displayed e.g. by perldoc
|
|
Packit Service |
992def |
# on a Mac OS X terminal. since no software recognizes and handles these
|
|
Packit Service |
992def |
# dashes, it's better to die loudly telling the user exactly what happened
|
|
Packit Service |
992def |
# so they don't make the same mistake again rather than being the only
|
|
Packit Service |
992def |
# program in the universe that works with them.
|
|
Packit Service |
992def |
# the fancy dash is U+2212 or \xE2\x88\x92
|
|
Packit Service |
992def |
if(grep { /\xE2\x88\x92/ || /\x{2212}/ } @ARGV) {
|
|
Packit Service |
992def |
die <<'DEATH';
|
|
Packit Service |
992def |
WHOA THERE! It looks like you've got some fancy dashes in your commandline!
|
|
Packit Service |
992def |
These are *not* the traditional -- dashes that software recognizes. You
|
|
Packit Service |
992def |
probably got these by copy-pasting from the perldoc for this module as
|
|
Packit Service |
992def |
rendered by a UTF8-capable formatter. This most typically happens on an OS X
|
|
Packit Service |
992def |
terminal, but can happen elsewhere too. Please try again after replacing the
|
|
Packit Service |
992def |
dashes with normal minus signs.
|
|
Packit Service |
992def |
DEATH
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
my $disable_manpages;
|
|
Packit Service |
992def |
if(my ($x) = grep { /^--no-manpages$/ } @ARGV) {
|
|
Packit Service |
992def |
$disable_manpages = 1;
|
|
Packit Service |
992def |
@ARGV = grep { !/^--no-manpages/ } @ARGV;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
my $bootstrapping;
|
|
Packit Service |
992def |
if (my ($x) = grep { /^--bootstrap(?:=.*)?$/ } @ARGV) {
|
|
Packit Service |
992def |
@ARGV = grep { !/^--bootstrap(?:=.*)?$/ } @ARGV;
|
|
Packit Service |
992def |
my ($path) = $x =~ /^--bootstrap(?:=(.*))?$/;
|
|
Packit Service |
992def |
{
|
|
Packit Service |
992def |
local @INC = @INC;
|
|
Packit Service |
992def |
unshift(@INC, 'lib');
|
|
Packit Service |
992def |
require local::lib;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
local::lib->import($path || ());
|
|
Packit Service |
992def |
$bootstrapping = 1;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
my $requires = $MM_ARGS{PREREQ_PM} = { %{$META{prereqs}{runtime}{requires}} };
|
|
Packit Service |
992def |
if ($ENV{PERL5_CPANM_IS_RUNNING}) {
|
|
Packit Service |
992def |
$requires->{CPAN} = undef;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
for my $module (grep { $_ ne 'perl' } keys %$requires) {
|
|
Packit Service |
992def |
my $need_v = $requires->{$module} or next;
|
|
Packit Service |
992def |
my $res = system($^X, '-Iinc', '-MCheckVersion', '-', $module, $need_v);
|
|
Packit Service |
992def |
$res >>= 8;
|
|
Packit Service |
992def |
if ($res == 0 || $res == 1) {
|
|
Packit Service |
992def |
$requires->{$module} = undef;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
if ($disable_manpages) {
|
|
Packit Service |
992def |
$ENV{PERL_MM_OPT} = ($ENV{PERL_MM_OPT}||'') . ' INSTALLMAN1DIR=none INSTALLMAN3DIR=none';
|
|
Packit Service |
992def |
$ENV{PERL_MB_OPT} = ($ENV{PERL_MB_OPT}||'') . ' --install_path libdoc="" --install_path bindoc=""';
|
|
Packit Service |
992def |
$MM_ARGS{INSTALLMAN1DIR} = 'none';
|
|
Packit Service |
992def |
$MM_ARGS{INSTALLMAN3DIR} = 'none';
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
if ($bootstrapping) {
|
|
Packit Service |
992def |
my @modules = grep $requires->{$_},
|
|
Packit Service |
992def |
qw(ExtUtils::MakeMaker ExtUtils::Install Module::Build CPAN);
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
{
|
|
Packit Service |
992def |
no warnings 'once';
|
|
Packit Service |
992def |
package MY;
|
|
Packit Service |
992def |
*init_PERL = sub {
|
|
Packit Service |
992def |
my $self = shift;
|
|
Packit Service |
992def |
$self->SUPER::init_PERL(@_);
|
|
Packit Service |
992def |
$self->{PERL} .= ' "-I$(INSTALLPRIVLIB)"';
|
|
Packit Service |
992def |
$self->{FULLPERL} .= ' "-I$(INSTALLPRIVLIB)"';
|
|
Packit Service |
992def |
};
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
local $ENV{PERL_AUTOINSTALL_PREFER_CPAN} = 1;
|
|
Packit Service |
992def |
local $ENV{PERL_MM_USE_DEFAULT} = 1;
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
if (@modules || $disable_manpages) {
|
|
Packit Service |
992def |
system($^X, '-Iinc', '-MCPANBootstrapper=init_config');
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
if (@modules) {
|
|
Packit Service |
992def |
system($^X, '-Iinc', '-MCPANBootstrapper=install', '-', $_)
|
|
Packit Service |
992def |
for @modules;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
if (grep { $_ eq 'CPAN' } @modules ) {
|
|
Packit Service |
992def |
system($^X, '-MCPAN', '-e', 'CPAN::Config->load;CPAN::Config->commit;');
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
if ($disable_manpages) {
|
|
Packit Service |
992def |
system($^X, '-Iinc', '-MCPANBootstrapper=disable_manpages');
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
if (!$ENV{PERL5_CPANM_IS_RUNNING}) {
|
|
Packit Service |
992def |
my $status = system $^X, '-Iinc', '-MCPANBootstrapper=check', '-',
|
|
Packit Service |
992def |
$META{prereqs}{runtime}{requires}{CPAN};
|
|
Packit Service |
992def |
exit $status
|
|
Packit Service |
992def |
if $status;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
## BOILERPLATE ###############################################################
|
|
Packit Service |
992def |
require ExtUtils::MakeMaker;
|
|
Packit Service |
992def |
(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
# have to do this since old EUMM dev releases miss the eval $VERSION line
|
|
Packit Service |
992def |
my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
|
|
Packit Service |
992def |
my $mymeta = $eumm_version >= 6.57_02;
|
|
Packit Service |
992def |
my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
|
|
Packit Service |
992def |
($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
|
|
Packit Service |
992def |
$META{license} = [ $META{license} ]
|
|
Packit Service |
992def |
if $META{license} && !ref $META{license};
|
|
Packit Service |
992def |
$MM_ARGS{LICENSE} = $META{license}[0]
|
|
Packit Service |
992def |
if $META{license} && $eumm_version >= 6.30;
|
|
Packit Service |
992def |
$MM_ARGS{NO_MYMETA} = 1
|
|
Packit Service |
992def |
if $mymeta_broken;
|
|
Packit Service |
992def |
$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
|
|
Packit Service |
992def |
unless -f 'META.yml';
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
for (qw(configure build test runtime)) {
|
|
Packit Service |
992def |
my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
|
|
Packit Service |
992def |
my $r = $MM_ARGS{$key} = {
|
|
Packit Service |
992def |
%{$META{prereqs}{$_}{requires} || {}},
|
|
Packit Service |
992def |
%{delete $MM_ARGS{$key} || {}},
|
|
Packit Service |
992def |
};
|
|
Packit Service |
992def |
defined $r->{$_} or delete $r->{$_} for keys %$r;
|
|
Packit Service |
992def |
}
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
delete $MM_ARGS{MIN_PERL_VERSION}
|
|
Packit Service |
992def |
if $eumm_version < 6.47_01;
|
|
Packit Service |
992def |
$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
|
|
Packit Service |
992def |
if $eumm_version < 6.63_03;
|
|
Packit Service |
992def |
$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
|
|
Packit Service |
992def |
if $eumm_version < 6.55_01;
|
|
Packit Service |
992def |
delete $MM_ARGS{CONFIGURE_REQUIRES}
|
|
Packit Service |
992def |
if $eumm_version < 6.51_03;
|
|
Packit Service |
992def |
|
|
Packit Service |
992def |
ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
|
|
Packit Service |
992def |
## END BOILERPLATE ###########################################################
|