2369dd5253d2df946b8e58146a74847fe6768070
[dbsrgits/DBIx-Class-Historic.git] / Makefile.PL
1 use inc::Module::Install 0.89;
2 use strict;
3 use warnings;
4 use POSIX ();
5
6 use 5.006001; # delete this line if you want to send patches for earlier.
7
8 name     'DBIx-Class';
9 perl_version '5.006001';
10 all_from 'lib/DBIx/Class.pm';
11
12 requires 'DBD::SQLite'              => 1.25;
13 requires 'Data::Page'               => 2.00;
14 requires 'SQL::Abstract'            => 1.56;
15 requires 'SQL::Abstract::Limit'     => 0.13;
16 requires 'Class::C3::Componentised' => 1.0005;
17 requires 'Carp::Clan'               => 6.0;
18 requires 'DBI'                      => 1.605;
19 requires 'Module::Find'             => 0.06;
20 requires 'Class::Inspector'         => 1.24;
21 requires 'Class::Accessor::Grouped' => 0.08003;
22 requires 'JSON::Any'                => 1.18;
23 requires 'Scope::Guard'             => 0.03;
24 requires 'Path::Class'              => 0.16;
25 requires 'Sub::Name'                => 0.04;
26 requires 'MRO::Compat'              => 0.09;
27
28 # Core
29 requires 'List::Util'               => 0;
30 requires 'Scalar::Util'             => 0;
31 requires 'Storable'                 => 0;
32
33 # Perl 5.8.0 doesn't have utf8::is_utf8()
34 requires 'Encode'                   => 0 if ($] <= 5.008000);
35
36 test_requires 'Test::More'          => 0.82;
37 test_requires 'Test::Builder'       => 0.33;
38 test_requires 'Test::Warn'          => 0.11;
39 test_requires 'Test::Exception'     => 0;
40 test_requires 'Test::Deep'          => 0;
41
42 recommends 'SQL::Translator'        => 0.09004;
43
44 install_script (qw|
45     script/dbicadmin
46 |);
47
48 tests_recursive (qw|
49     t
50 |);
51
52 resources 'IRC'         => 'irc://irc.perl.org/#dbix-class';
53 resources 'license'     => 'http://dev.perl.org/licenses/';
54 resources 'repository'  => 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/';
55 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
56
57
58 # re-build README and require extra modules for testing if we're in a checkout
59
60 my %force_requires_if_author = (
61   'Test::Pod::Coverage'       => 1.04,
62   'SQL::Translator'           => 0.09007,
63
64   # CDBI-compat related
65   'DBIx::ContextualFetch'     => 0,
66   'Class::DBI::Plugin::DeepAbstractSearch' => 0,
67   'Class::Trigger'            => 0,
68   'Time::Piece::MySQL'        => 0,
69   'Clone'                     => 0,
70   'Date::Simple'              => 3.03,
71
72   # t/52cycle.t
73   'Test::Memory::Cycle'       => 0,
74   'Devel::Cycle'              => 1.10,
75
76   # t/inflate/datetime*.t
77   # t/72.pg
78   # t/36datetime.t
79   # t/60core.t
80   'DateTime::Format::SQLite'  => 0,
81   'DateTime::Format::MySQL'   => 0,
82   'DateTime::Format::Pg'      => 0,
83
84   # t/73oracle_inflate.t
85   'DateTime::Format::Oracle'  => 0,
86
87   # t/96_is_deteministic_value.t
88   'DateTime::Format::Strptime' => 0,
89
90   # t/72pg.t
91   $ENV{DBICTEST_PG_DSN}
92     ? ('Sys::SigAction'=> 0)
93     : ()
94   ,
95
96   # t/93storage_replication.t
97   'Moose',                        => 0.77,
98   'MooseX::AttributeHelpers'      => 0.12,
99   'MooseX::Types',                => 0.10,
100   'namespace::clean'              => 0.11,
101   'Hash::Merge',                  => 0.11,
102
103 );
104
105 if ($Module::Install::AUTHOR) {
106   warn <<'EOW';
107 ******************************************************************************
108 ******************************************************************************
109 ***                                                                        ***
110 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
111 ***                                                                        ***
112 ******************************************************************************
113 ******************************************************************************
114
115 EOW
116
117   foreach my $module (keys %force_requires_if_author) {
118     build_requires ($module => $force_requires_if_author{$module});
119   }
120
121   print "Regenerating README\n";
122   system('pod2text lib/DBIx/Class.pm > README');
123
124   if (-f 'MANIFEST') {
125     print "Removing MANIFEST\n";
126     unlink 'MANIFEST';
127   }
128 }
129
130 auto_install();
131
132 WriteAll();
133
134 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
135 if ($Module::Install::AUTHOR) {
136
137   Meta->{values}{build_requires} = [ grep 
138     { not exists $force_requires_if_author{$_->[0]} }
139     ( @{Meta->{values}{build_requires}} )
140   ];
141
142   Meta->write;
143 }