X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=ed58c3d25241bad1e4236148c235ec024d03a810;hb=38a64290c6c15538795ff18e6bc6c1ddcb67aab3;hp=71460bc8165a97043eb48bf180b4b651a82a2ec1;hpb=b1e43108db28b5a04a41dc5d2565ca2feb1a5e16;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/Makefile.PL b/Makefile.PL index 71460bc..ed58c3d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,108 +1,119 @@ +use warnings; +use strict; -use inc::Module::Install 0.71; +use 5.008001; +use ExtUtils::MakeMaker; +my ($dev_requires) = (do './maint/Makefile.PL.include' or die $@) + unless -f 'META.yml'; -name 'DBIx-Class-Schema-Loader'; -all_from 'lib/DBIx/Class/Schema/Loader.pm'; - -test_requires 'Test::More' => '0.47'; -test_requires 'DBI' => '1.56'; -test_requires 'DBD::SQLite' => '1.12'; -test_requires 'File::Path' => 0; -test_requires 'IPC::Open3' => 0; - -requires 'File::Spec' => 0; -requires 'Scalar::Util' => 0; -requires 'Data::Dump' => '1.06'; -requires 'Lingua::EN::Inflect::Number' => '1.1'; -requires 'Text::Balanced' => 0; -requires 'Digest::MD5' => '2.36'; -requires 'Class::Accessor::Fast' => '0.30'; -requires 'Class::Data::Accessor' => '0.03'; -requires 'Class::C3' => '0.18'; -requires 'Class::C3::Componentised' => '1.0005'; -requires 'Carp::Clan' => 0; -requires 'Class::Inspector' => 0; -requires 'DBIx::Class' => '0.08109'; -requires 'Class::Unload' => 0; - -install_script 'script/dbicdump'; - -# This is my manual hack for better feature control -# If you want to change the default answer for a feature, -# set the appropriate environment variable, like -# DBIC_FEATURE_MYSQL. If you want the defaults to -# apply automatically without asking any questions, -# set DBIC_FEATURE_NOQUESTIONS. Hopefully this will -# save someone some pain when trying to automate -# the installation of this software. - -# Maintainer shouldn't set these, as they would affect -# the META.yml shipped to CPAN. - -my $_features = [ - SQLITE => { - label => 'SQLite Support', - def => $ENV{DBIC_FEATURE_SQLITE} || 0, - deps => [ - 'DBI' => '1.56', - 'DBD::SQLite' => '1.12', - ], +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; +my %eumm_args = ( + NAME => 'DBIx::Class::Schema::Loader', + VERSION_FROM => 'lib/DBIx/Class/Schema/Loader.pm', + LICENSE => 'perl', + MIN_PERL_VERSION => '5.008001', + CONFIGURE_REQUIRES => { + 'ExtUtils::MakeMaker' => '0', }, - MYSQL => { - label => 'MySQL Support', - def => $ENV{DBIC_FEATURE_MYSQL} || 0, - deps => [ - 'DBI' => '1.56', - 'DBD::mysql' => '4.004', - ], + TEST_REQUIRES => { + 'DBD::SQLite' => '1.29', + 'Test::Exception' => '0.31', + 'Test::More' => '0.94', + 'Test::Warn' => '0.21', + 'Test::Deep' => '0.107', + 'Test::Differences' => '0.60', + # core, but specific versions not available on older perls + 'File::Temp' => '0.16', + 'File::Path' => '2.07', }, - PG => { - label => 'PostgreSQL Support', - def => $ENV{DBIC_FEATURE_PG} || 0, - deps => [ - 'DBI' => '1.56', - 'DBD::Pg' => '1.49', # Soon to be 1.50 - ], + test => {TESTS => 't/*.t t/*/*.t t/*/*/*.t'}, + PREREQ_PM => { + 'Carp::Clan' => 0, + 'Class::Accessor::Grouped' => '0.10008', + 'Class::C3::Componentised' => '1.0008', + 'Class::Inspector' => '1.27', + 'Class::Unload' => '0.07', + 'curry' => '1.000000', + 'Data::Dump' => '1.06', + 'DBIx::Class' => '0.08127', + 'Hash::Merge' => '0.12', + 'Lingua::EN::Inflect::Number' => '1.1', + 'Lingua::EN::Tagger' => '0.23', + 'Lingua::EN::Inflect::Phrase' => '0.15', + 'List::Util' => '1.33', + 'MRO::Compat' => '0.09', + 'namespace::clean' => '0.23', + 'Scope::Guard' => '0.20', + 'String::ToIdentifier::EN' => '0.05', + 'Sub::Util' => '1.40', + 'Try::Tiny' => 0, + # core, but specific versions not available on older perls + 'Digest::MD5' => '2.36', + 'Exporter' => '5.63', }, - DB2 => { - label => 'DB2 Support', - def => $ENV{DBIC_FEATURE_DB2} || 0, - deps => [ - 'DBI' => '1.56', - 'DBD::DB2' => '1.0', - ], + realclean => { + FILES => 'lib/DBIx/Class/Schema/Loader/Optional/Dependencies.pod' }, - ORACLE => { - label => 'Oracle Support (experimental)', - def => $ENV{DBIC_FEATURE_ORACLE} || 0, - deps => [ - 'DBI' => '1.56', - 'DBD::Oracle' => '0.19', - ], + EXE_FILES => [ qw(script/dbicdump) ], + META_MERGE => { + "meta-spec" => { version => 2 }, + dynamic_config => 0, + resources => { + repository => { + type => 'git', + url => 'git@github.com/dbsrgits/dbix-class-schema-loader.git', + web => 'https://github.com/dbsrgits/dbix-class-schema-loader', + }, + x_IRC => 'irc://irc.perl.org/#dbix-class', + license => [ 'http://dev.perl.org/licenses/' ], + x_MailingList => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class', + }, + no_index => { + directory => [qw(maint xt)], + }, + prereqs => { + develop => { requires => $dev_requires || +{} }, + }, }, -]; - -for(my $i = 0; $i <= $#$_features - 1; $i += 2) { - my $name = $_features->[$i]; - my $attrs = $_features->[$i+1]; +); - if($ENV{DBIC_FEATURE_NOQUESTIONS}) { - if($attrs->{def}) { - requires @{$attrs->{deps}}; - } - } - else { - feature $attrs->{label} => - -default => $attrs->{def}, - @{$attrs->{deps}}; - } +sub _move_to { + my ($hash, $fromkey, $tokey) = @_; + $hash->{$tokey} = { + %{ $hash->{$tokey} || {} }, + %{ delete($hash->{$fromkey}) || {} }, + }; } +delete $eumm_args{META_MERGE} if $eumm_version < 6.45_01; +delete $eumm_args{CONFIGURE_REQUIRES} + if $eumm_version < 6.51_03; # too late to use so just delete +_move_to(\%eumm_args, 'TEST_REQUIRES', 'BUILD_REQUIRES') + if $eumm_version < 6.63_03; +_move_to(\%eumm_args, 'BUILD_REQUIRES', 'PREREQ_PM') + if $eumm_version < 6.55_01; +$eumm_args{NO_MYMETA} = 1 + if $eumm_version >= 6.57_02 and $eumm_version < 6.57_07; +WriteMakefile(%eumm_args); -# Rebuild README for maintainers -if(-e 'MANIFEST.SKIP') { - system("pod2text lib/DBIx/Class/Schema/Loader.pm > README"); -} +print <<"EOF"; +******************* DBIx::Class::Schema::Loader WARNING *********************** +The default attributes for belongs_to relationships for foreign keys with no +rules has been changed for most databases, and is soon changing for the rest, +as ON DELETE/UPDATE and DEFERRABLE clauses for foreign keys are now being +introspected. + +THIS MAY AFFECT YOUR DDL DIFFS WHEN DEPLOYING + +YOUR GENERATED CODE WILL ALMOST CERTAINLY CHANGE + +Read more about the changes in "relationship_attrs" in: + +perldoc DBIx::Class::Schema::Loader::Base + +https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#relationship_attrs + +See also the "Changes" file for the last few revisions. +******************************************************************************* +EOF -auto_provides; -auto_install; -WriteAll; +# vim:et sts=4 sw=4 tw=0: