App-MtAws

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

# APP-MTAWS-ROOT-DIR (marker for scripts to check root dir)

use 5.008008; # minumum perl version is 5.8.8, ancient cpan clients will ignore 'requires/perl' below
use strict;
use warnings;
use Config;
use Module::Build;

use lib qw(lib);


die "OS unsupported\n" if ($^O eq 'MSWin32');

our $MB_VERSION = '0.36';

#https://github.com/Perl-Toolchain-Gang/Module-Build/issues/40
our $MB_BROKEN_RECOMMENDS = ($Module::Build::VERSION ge '0.42') && ($Module::Build::VERSION lt '0.4203');


sub test_jobs
{
	return 2 if $^O eq 'openbsd';  # openBSD has low default ulimits.
	return 2 if $Config{archname} =~ /arm/i; # ARM systems have small memory
	return 2 if $Config{osvers} =~ /qnap/i; # NAS. small memory amount
	return 4 if $Config{longsize} < 8; # 32bit system. not too much memory
	return 8; # default 8;
}


my $build = Module::Build->new(
	module_name => 'App::MtAws',
	author => 'Victor Efimov <vs@vs-dev.com>',
	dist_author => 'Victor Efimov <vs@vs-dev.com>',
	dynamic_config => 1,
	recursive_test_files=>1,
	dist_abstract=>'mt-aws/glacier - Perl Multithreaded Multipart sync to Amazon Glacier',
	license     =>'gpl3',

	# this is a special version of 'mtglacier' script with different shebang and without FindBin
	# http://blogs.perl.org/users/randy_stauner/2011/09/shebangs-with-perlbrew-aliases-and-eumm-and-without-locallib.html
	script_files => ['bin/mtglacier'], # script_files directive since M::B 0.18

	meta_merge => {
		resources => {
			repository => 'https://github.com/vsespb/mt-aws-glacier',
			bugtracker => 'https://github.com/vsespb/mt-aws-glacier/issues',
			homepage => 'http://mt-aws.com/'
		},
	},
	requires => {
		'perl' => 5.008008, # 5.8.8
		'Config' => 0,

		'LWP' => '5.803', # ancient CentOS 5.x version
		'URI' => '1.10', # even ancient LWP versions require at least 1.10, so we use it too
		'HTTP::Request' => 0, # either shipped with LWP, or prereq by LWP, does not contain correct version, sometimes
		'JSON::XS' => '1',


		# core modules for Perl > 5.8.x
		'Digest::SHA' => 0,

		#
		# CORE MODULES OR DUAL-LIFE MODULES
		#
		'Carp' => 0,
		'Encode' => 0,
		'Exporter' => '5.58', # min. tested version
		'File::Basename' => 0,
		'File::Find' => 0,
		'File::Path' => 0,


		 # for EXLOCK need 0.19
		 # for compatibility with forking 0.19
		 # perl 5.8.8 ships 0.16, 5.8.9 ships 0.20, but 5.9.0 ships 0.14
		 # use 0.16 as we have workarounds for above problems
		'File::Temp' => '0.16',

		'File::Spec' => '3.12',
		'Cwd' => 0,
		'File::stat' => 0,
		'Getopt::Long' => '2.24',


		# distribution 'IO' v 1.22 released with perl 5.8.8, however it does contains IO::{Hnadle|Pipe|Select} versions lower than 1.22
		'IO::Handle' => 0,
		'IO::Pipe' => 0,
		'IO::Select' => 0,

		'List::Util' => '1.11', # needed for Test::Spec, however 1.19 is released with perl 5.8.9 and 1.13 with perl 5.9
		'POSIX' => 0,
		'PerlIO::encoding' => 0,
		'I18N::Langinfo' => 0,
		'Time::Local' => 0,
		'Time::localtime' => 0,
		'bytes' => 0,
		'constant' => 0,
		'lib' => 0,
		'strict' => 0,
		'integer' => 0,
		'utf8' => 0,
		'warnings' => 0,
		'FindBin' => 0,
		#
		# / CORE MODULES OR DUAL-LIFE MODULES
		#
	},
	build_requires => {
		$ENV{MT_NO_HARNESS} ? () : ('TAP::Harness' => 0),

		# Test::Deep
		# Does not work with 0.090, 0.091 (due to bug in Test::Deep)
		# issue fixed here fixed https://metacpan.org/diff/release/FDALY/Test-Deep-0.091/FDALY/Test-Deep-0.092
		#
		# However I cannot specify version as '!= 0.090, != 0.091' because some CPAN testers (yet) failed to recognize it
		# http://www.cpantesters.org/cpan/report/75a8f356-e307-11e2-bb8b-c8f40b763136



( run in 0.578 second using v1.01-cache-2.11-cpan-39bf76dae61 )