Install curry in Travis
[dbsrgits/DBIx-Class-Schema-Loader.git] / Makefile.PL
CommitLineData
2a72f15d 1use warnings;
2use strict;
ef8e9c69 3
4use 5.008001;
b97f3990 5BEGIN { unshift @INC, '.' unless $INC[-1] eq '.'; }
2a72f15d 6use inc::Module::Install 1.00;
ef8e9c69 7
509e7821 8use Getopt::Long();
9
10my $getopt = Getopt::Long::Parser->new(
494e0205 11 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
509e7821 12);
13my $args = {
494e0205 14 skip_author_deps => undef,
509e7821 15};
16$getopt->getoptions($args, 'skip_author_deps');
17if (@ARGV) {
494e0205 18 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
509e7821 19}
20
ef8e9c69 21use FindBin;
22use lib "$FindBin::Bin/lib";
23
2a72f15d 24perl_version '5.008001';
3fe9c5d9 25name 'DBIx-Class-Schema-Loader';
26all_from 'lib/DBIx/Class/Schema/Loader.pm';
27
65f78d29 28# temporary, needs to be thrown out
eaf23084 29test_requires 'DBIx::Class::IntrospectableM2M' => 0;
3fe9c5d9 30
65f78d29 31# core, but specific versions not available on older perls
32test_requires 'File::Temp' => '0.16';
33test_requires 'File::Path' => '2.07';
34
35test_requires 'DBD::SQLite' => '1.29';
36test_requires 'Test::Exception' => '0.31';
37test_requires 'Test::More' => '0.94';
38test_requires 'Test::Warn' => '0.21';
239fa6bc 39test_requires 'Test::Deep' => '0.107';
a2e5cee3 40test_requires 'Test::Differences' => '0.60';
65f78d29 41
42requires 'Carp::Clan' => 0;
43requires 'Class::Accessor::Grouped' => '0.10008';
44requires 'Class::C3::Componentised' => '1.0008';
45requires 'Class::Inspector' => '1.27';
46requires 'Class::Unload' => '0.07';
f3bed1f1 47requires 'curry' => '1.000000',
3fe9c5d9 48requires 'Data::Dump' => '1.06';
65f78d29 49requires 'DBIx::Class' => '0.08127';
50requires 'Hash::Merge' => '0.12';
3fe9c5d9 51requires 'Lingua::EN::Inflect::Number' => '1.1';
4f7692f0 52requires 'Lingua::EN::Tagger' => '0.23';
53requires 'Lingua::EN::Inflect::Phrase' => '0.15';
ecf22f0a 54requires 'List::Util' => '1.33';
942bd5e0 55requires 'MRO::Compat' => '0.09';
65f78d29 56requires 'namespace::clean' => '0.23';
57requires 'Scope::Guard' => '0.20';
f9daf711 58requires 'String::ToIdentifier::EN' => '0.05';
ea3b8f03 59requires 'String::CamelCase' => '0.02';
ecf22f0a 60requires 'Sub::Util' => '1.40';
65f78d29 61requires 'Try::Tiny' => 0;
62
63# core, but specific versions not available on older perls
64requires 'Digest::MD5' => '2.36';
65requires 'Exporter' => '5.63';
3fe9c5d9 66
10b0a36e 67print <<"EOF";
68******************* DBIx::Class::Schema::Loader WARNING ***********************
69The default attributes for belongs_to relationships for foreign keys with no
70rules has been changed for most databases, and is soon changing for the rest,
71as ON DELETE/UPDATE and DEFERRABLE clauses for foreign keys are now being
72introspected.
73
74THIS MAY AFFECT YOUR DDL DIFFS WHEN DEPLOYING
75
76YOUR GENERATED CODE WILL ALMOST CERTAINLY CHANGE
77
78Read more about the changes in "relationship_attrs" in:
79
80perldoc DBIx::Class::Schema::Loader::Base
81
82https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#relationship_attrs
83
84See also the "Changes" file for the last few revisions.
85*******************************************************************************
86EOF
87
509e7821 88if ($Module::Install::AUTHOR && ! $args->{skip_author_deps}) {
30ede608 89 my @missing_plugins;
90 for my $plugin (qw(ReadmeFromPod AuthorTests)) {
91 eval "require Module::Install::$plugin" and next;
93c51ef2 92 push @missing_plugins, "Module::Install::$plugin";
30ede608 93 chomp(my $err = $@);
94 $missing_plugins[-1] .= " ($err)"
95 unless $err =~ m{^Can't locate Module/Install/$plugin.pm in \@INC};
96 }
97 die "\nYou need to install the following modules to run this Makefile.PL in author mode:\n\n", join("\n", @missing_plugins), "\n\n"
98 if @missing_plugins;
2a72f15d 99
100 warn "\n*** AUTHOR MODE: some optional dependencies converted to hard requires.\n\n";
ff746964 101
ef8e9c69 102 require DBIx::Class::Schema::Loader::Optional::Dependencies;
01012543 103
406a97c2 104 test_requires %{DBIx::Class::Schema::Loader::Optional::Dependencies
105 ->modreq_list_for([
106 grep { !/rdbms/ }
107 keys %{ DBIx::Class::Schema::Loader::Optional::Dependencies
108 ->req_group_list
109 }
110 ])};
111
112 DBIx::Class::Schema::Loader::Optional::Dependencies->_gen_pod(undef, 'lib');
2a72f15d 113
605be787 114 author_tests( 'xt' );
2a72f15d 115 readme_from( 'lib/DBIx/Class/Schema/Loader.pm' );
116 realclean_files( qw[README MANIFEST lib/DBIx/Class/Schema/Loader/Optional/Dependencies.pod] );
1fb9f509 117 postamble <<EOP;
118create_distdir: author_stop_distdir_creation
119author_stop_distdir_creation:
120\t\$(NOECHO) \$(ECHO) Creation of dist with author mode deps not allowed
121\t\$(NOECHO) \$(ECHO) Please re-run Makefile.PL with --skip_author_deps
122\t\$(NOECHO) \$(FALSE)
123EOP
124
3fe9c5d9 125}
126
ef8e9c69 127tests_recursive;
128
129install_script 'script/dbicdump';
130
64b844d0 131resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
132resources 'license' => 'http://dev.perl.org/licenses/';
5fa622c2 133resources 'repository' => 'https://github.com/dbsrgits/dbix-class-schema-loader';
64b844d0 134resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
135
3fe9c5d9 136auto_install;
137WriteAll;
ef8e9c69 138
139# vim:et sts=4 sw=4 tw=0: