~ubuntu-branches/ubuntu/saucy/libnamespace-clean-perl/saucy

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt
  • Date: 2011-08-05 11:12:15 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110805111215-3mvgb4b3dbdgp0tt
Tags: 0.21-1
* New upstream release.
* Remove patch fix-pod-spelling.patch (applied upstream).
* Add NAME section to POD documentation.
  + new patch: pod-whatis.diff
* Remove (build-)dep on libsub-name-perl, libsub-identify-perl (>= 0.04).
* Bump (build-)dep on libpackage-stash-perl to >= 0.23.
* debian/control: Convert Vcs-* fields to Git.
* Bump Standards-Version to 3.9.2 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
1
use strict;
3
2
use warnings;
4
 
 
5
 
 
6
 
 
7
 
use ExtUtils::MakeMaker 6.31;
8
 
 
9
 
 
 
3
use 5.008001;
 
4
 
 
5
use ExtUtils::MakeMaker;
 
6
 
 
7
my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 };
 
8
my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 };
 
9
 
 
10
my %BUILD_DEPS = (
 
11
  'Test::More' => '0.88',
 
12
);
 
13
 
 
14
my %RUN_DEPS = (
 
15
  'Package::Stash' => '0.23',
 
16
);
 
17
 
 
18
my %OPT_RUN_DEPS = (can_cc() ? (
 
19
  'B::Hooks::EndOfScope' => '0.07', # when changing, also change version in namespace/clean.pm
 
20
  is_smoker() ? ( 'Devel::Hide' => 0 ) : (),  # make sure we smoke the pure-perl version
 
21
) : () );
 
22
 
 
23
my %META_BITS = (
 
24
  resources => {
 
25
    homepage => 'http://search.cpan.org/dist/namespace-clean',
 
26
 
 
27
    # EUMM not supporting nested meta :(
 
28
    #repository => {
 
29
    #  type => 'git',
 
30
    #  url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
 
31
    #  web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/namespace-clean.git',
 
32
    #}
 
33
    #bugtracker => {
 
34
    #  mailto => 'bug-namespace-clean@rt.cpan.org',
 
35
    #  web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
 
36
    #},
 
37
 
 
38
    repository => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
 
39
    bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
 
40
  },
 
41
);
10
42
 
11
43
my %WriteMakefileArgs = (
 
44
  'NAME' => 'namespace::clean',
 
45
  'VERSION_FROM' => 'lib/namespace/clean.pm',
12
46
  'ABSTRACT' => 'Keep imports and functions out of your namespace',
13
47
  'AUTHOR' => 'Robert \'phaylon\' Sedlacek <rs@474.at>, Florian Ragwitz <rafl@debian.org>, Jesse Luehrs <doy@tozt.net>',
14
 
  'BUILD_REQUIRES' => {
15
 
    'Exporter' => '0',
16
 
    'FindBin' => '0',
17
 
    'Test::More' => '0.88',
18
 
    'constant' => '0'
19
 
  },
20
 
  'CONFIGURE_REQUIRES' => {
21
 
    'ExtUtils::MakeMaker' => '6.31'
22
 
  },
23
 
  'DISTNAME' => 'namespace-clean',
24
 
  'EXE_FILES' => [],
 
48
 
 
49
  'PREREQ_PM' => {
 
50
    %RUN_DEPS, %OPT_RUN_DEPS,
 
51
    $mymeta_works ? () : (%BUILD_DEPS),
 
52
  },
 
53
 
 
54
  $mymeta_works
 
55
    ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
 
56
      'BUILD_REQUIRES' => \%BUILD_DEPS,
 
57
      'META_ADD' => {
 
58
        %META_BITS,
 
59
        requires => \%RUN_DEPS,
 
60
      },
 
61
    )
 
62
    : ( # META_ADD both to get META right - only Makefile written
 
63
      'META_ADD' => {
 
64
        %META_BITS,
 
65
        requires => \%RUN_DEPS,
 
66
        build_requires => \%BUILD_DEPS,
 
67
      },
 
68
    )
 
69
  ,
 
70
 
 
71
  ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (),
 
72
 
25
73
  'LICENSE' => 'perl',
26
 
  'NAME' => 'namespace::clean',
27
 
  'PREREQ_PM' => {
28
 
    'B::Hooks::EndOfScope' => '0.07',
29
 
    'Package::Stash' => '0.22',
30
 
    'Sub::Identify' => '0.04',
31
 
    'Sub::Name' => '0.04',
32
 
    'vars' => '0'
33
 
  },
34
 
  'VERSION' => '0.20',
35
 
  'test' => {
36
 
    'TESTS' => 't/*.t'
37
 
  }
38
74
);
39
75
 
40
76
 
41
 
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
 
77
unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) {
42
78
  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
43
79
  my $pp = $WriteMakefileArgs{PREREQ_PM};
44
80
  for my $mod ( keys %$br ) {
52
88
}
53
89
 
54
90
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
55
 
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
 
91
  unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
56
92
 
57
93
WriteMakefile(%WriteMakefileArgs);
58
94
 
59
95
 
60
 
 
 
96
# can we locate a (the) C compiler
 
97
sub can_cc {
 
98
  my @chunks = split(/ /, $Config::Config{cc}) or return;
 
99
 
 
100
  # $Config{cc} may contain args; try to find out the program part
 
101
  while (@chunks) {
 
102
    return can_run("@chunks") || (pop(@chunks), next);
 
103
  }
 
104
 
 
105
  return;
 
106
}
 
107
 
 
108
# check if we can run some command
 
109
sub can_run {
 
110
  my ($cmd) = @_;
 
111
 
 
112
  return $cmd if -x $cmd;
 
113
  if (my $found_cmd = MM->maybe_command($cmd)) {
 
114
    return $found_cmd;
 
115
  }
 
116
 
 
117
  for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
 
118
    next if $dir eq '';
 
119
    my $abs = File::Spec->catfile($dir, $cmd);
 
120
    return $abs if (-x $abs or $abs = MM->maybe_command($abs));
 
121
  }
 
122
 
 
123
  return;
 
124
}
 
125
 
 
126
sub is_smoker {
 
127
  return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )
 
128
}