File: Build.PL

package info (click to toggle)
libgenome-perl 0.06-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 328 kB
  • sloc: perl: 848; makefile: 20
file content (84 lines) | stat: -rw-r--r-- 2,074 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/perl
# Use local perl, not some perl on an application server!

use Config;
use Module::Build;

BEGIN {
  unshift @INC, "$ENV{PWD}/blib/lib";
}

my $class = Module::Build->subclass (
    class => 'Pod::Builder',
    code => <<'EOS',

      sub ACTION_clean {
        # FIXME: is this safe?
        use File::Path qw/rmtree/;
        rmtree "./_build";
        rmtree "./blib";
        rmtree "./gmt-bindoc";
        rmtree "./genome-bindoc";
        unlink "./Build";
        unlink "./MYMETA.yml";
      }

      sub ACTION_ur_docs {
        use File::Copy qw/copy/;
        $ENV{ANSI_COLORS_DISABLED} = 1;
        eval {
          local @INC = @INC;
          unshift @INC, 'blib/lib';
          die $@ if $@;
          eval "use Genome::Model::Tools";
          die $@ if $@;

          foreach my $exec ('genome','gmt') {
            UR::Namespace::Command::Update::Pod->execute(
                class_name => 'Genome::Model::Tools',
                executable_name => $exec,
                targets => ['Genome::Model::Tools'],
                output_path => 'cmd-bindoc'
            );
          }
        };
        die "failed to extract pod: $!: $@" if ($@);
      }

      sub ACTION_docs {
        my $self = shift;
        $self->depends_on('code');
        $self->depends_on('ur_docs');
        $self->depends_on('manpages', 'html');
      }
       
      sub man1page_name {
        my ($self, $file) = @_;
        $file =~ s/.pod$//;
        return $self->SUPER::man1page_name($file);
      }

EOS
);

my $build = $class->new(
  module_name => 'Genome',
  license => 'lgpl',
  requires => {
    'perl' => 'v5.8.7',
    'Carp' => '',
    'File::Basename' => '',
    'File::Temp' => '',
    'IO::File' => '',
    'IO::String' => '',
    'Sys::Hostname' => '',
    'UR' => '0.29',
    'Getopt::Complete' => '',
  },
  cpan_client => 'cpanm',
  #test_files => [qw|t/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t|],
  #tap_harness_args => { jobs => 8 },
  bindoc_dirs => ['cmd-bindoc'],
  script_files => [ 'bin/genome', 'bin/gmt' ]
);
$build->create_build_script;