Alien-ROOT

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

#!/usr/bin/perl
use 5.008;
use strict;
use warnings;
use inc::latest 'Module::Build';

use lib 'inc';
use Alien::ROOT::Builder;

use Env '@PATH';

use Getopt::Long qw/GetOptions/;
Getopt::Long::Configure('pass_through', 'permute', 'no_require_order');

our $USER_CONFIG = {
  archive             => 'root_v5.34.36.source.tar.gz',
  parallel_processes  => 1,
  force_recompile     => 0,
};

GetOptions(
  'j|parallel=i'  => \($USER_CONFIG->{parallel_processes}),
  'archive=s'     => \($USER_CONFIG->{archive}),
  'recompile'     => \($USER_CONFIG->{force_recompile}),
);


my $builder = Alien::ROOT::Builder->new(
  module_name           => 'Alien::ROOT',
  license               => 'gpl',
  dist_author           => 'Steffen Mueller <smueller@cpan.org>',
  dist_version_from     => 'lib/Alien/ROOT.pm',
  dynamic_config        => 1,
  create_readme         => 1,

  # Maintain compatibility with ExtUtils::MakeMaker installations
  create_makefile_pl    => 'passthrough',

  requires => {
    'perl'                => 5.008,
    'ExtUtils::MakeMaker' => 0, # core
    'File::Spec'          => 0, # core
    'File::Path'          => 0, # core
    'IPC::Open3'          => 0, # core
  },
  build_requires => {
    'Test::More'              => 0, # core
    'ExtUtils::CBuilder'      => 0, # core, but might need newer one?
    'File::Fetch'             => 0,
    'Archive::Extract'        => 0,
  },

  add_to_cleanup => [ 'Alien-ROOT-*' ],
  script_files => [],

  meta_merge => {
    resources => {
      Ratings      => 'http://cpanratings.perl.org/d/Alien-ROOT',
      repository   => 'git://github.com/tsee/SOOT.git',
      bugtracker   => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-ROOT',
      license      => 'http://www.opensource.org/licenses/gpl-2.0.php',
    },
    no_index => {
      directory => [
        qw(buildtools t xt inc examples)
      ],
    },

  },
);

my $build_data = {%$USER_CONFIG};

$build_data->{url} = 'https://root.cern.ch/download/' . $build_data->{archive};
$build_data->{directory} = 'root'; # this is pretty retarded :(

$builder->notes('build_data' => $build_data);

# Use Alien::ROOT to see if it's already installed
use lib 'lib';
use Alien::ROOT;



( run in 0.452 second using v1.01-cache-2.11-cpan-97f6503c9c8 )