Skip to content

Commit

Permalink
Adapt Build.PL to the absence of FR/Full.pm
Browse files Browse the repository at this point in the history
Adapt Build.PL to the absence of lib/Number/Phone/FR/Full.pm:
- select author mode if the file is missing
- dist_version_from FR.pm if FR/Full.pm is missing
  • Loading branch information
dolmen committed Apr 29, 2011
1 parent 92c8a9c commit f075add
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ use strict;
use warnings;

use Module::Build;
use File::Spec;

my $build_module = 'Module::Build';

my $FR_Full_pm = File::Spec->catfile qw(lib Number Phone FR Full.pm);

# Use the extended build only in author environment
if (-d '.git') {
if (-d '.git' || ! -f $FR_Full_pm) {
print "Building in author mode\n";
$build_module = 'inc::Build::Author';
require inc::Build::Author;
Expand All @@ -19,6 +22,8 @@ my $builder = $build_module->new(
module_name => 'Number::Phone::FR',
dist_author => 'Olivier Mengué <dolmen@cpan.org>',
dist_abstract => 'Phone number information for France (+33)',
# Defaults to FR.pm if FR/Full.pm has not yet been built
dist_version_from => (grep { -e $_ } ('lib/Number/Phone/FR/Full.pm', 'lib/Number/Phone/FR.pm'))[0],
license => 'perl',
meta_add => {
resources => {
Expand All @@ -33,6 +38,7 @@ my $builder = $build_module->new(
},
configure_requires => {
'Module::Build' => '0.36',
'File::Spec' => 0,
},
build_requires => {
'Test::More' => '0.94',
Expand Down

0 comments on commit f075add

Please sign in to comment.