change repository in meta to point to real svn url rather than svnweb
[dbsrgits/DBIx-Class.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 # ****** DO NOT ADD OPTIONAL DEPENDENCIES. EVER. --mst ******
9
10 name     'DBIx-Class';
11 perl_version '5.006001';
12 all_from 'lib/DBIx/Class.pm';
13
14
15 test_requires 'Test::Builder'       => '0.33';
16 test_requires 'Test::Deep'          => '0';
17 test_requires 'Test::Exception'     => '0';
18 test_requires 'Test::More'          => '0.92';
19 test_requires 'Test::Warn'          => '0.21';
20
21 test_requires 'File::Temp'          => '0.22';
22
23
24 # Core
25 requires 'List::Util'               => '0';
26 requires 'Scalar::Util'             => '0';
27 requires 'Storable'                 => '0';
28
29 # Perl 5.8.0 doesn't have utf8::is_utf8()
30 requires 'Encode'                   => '0' if ($] <= 5.008000);
31
32 # Dependencies (keep in alphabetical order)
33 requires 'Carp::Clan'               => '6.0';
34 requires 'Class::Accessor::Grouped' => '0.09000';
35 requires 'Class::C3::Componentised' => '1.0005';
36 requires 'Class::Inspector'         => '1.24';
37 requires 'Data::Page'               => '2.00';
38 requires 'DBD::SQLite'              => '1.25';
39 requires 'DBI'                      => '1.605';
40 requires 'JSON::Any'                => '1.18';
41 requires 'MRO::Compat'              => '0.09';
42 requires 'Module::Find'             => '0.06';
43 requires 'Path::Class'              => '0.16';
44 requires 'Scope::Guard'             => '0.03';
45 requires 'SQL::Abstract'            => '1.60';
46 requires 'SQL::Abstract::Limit'     => '0.13';
47 requires 'Sub::Name'                => '0.04';
48 requires 'Data::Dumper::Concise'    => '1.000';
49
50 my %replication_requires = (
51   'Moose',                    => '0.87',
52   'MooseX::AttributeHelpers'  => '0.21',
53   'MooseX::Types',            => '0.16',
54   'namespace::clean'          => '0.11',
55   'Hash::Merge',              => '0.11',
56 );
57
58 #************************************************************************#
59 # Make *ABSOLUTELY SURE* that nothing on this list is a real require,    #
60 # since every module listed in %force_requires_if_author is deleted      #
61 # from the final META.yml (thus will never make it as a CPAN dependency) #
62 #************************************************************************#
63 my %force_requires_if_author = (
64   %replication_requires,
65
66   # when changing also adjust $DBIx::Class::Storage::DBI::minimum_sqlt_version
67   'SQL::Translator'           => '0.11002',
68
69 #  'Module::Install::Pod::Inherit' => '0.01',
70
71   # when changing also adjust version in t/02pod.t
72   'Test::Pod'                 => '1.26',
73
74   # when changing also adjust version in t/03podcoverage.t
75   'Test::Pod::Coverage'       => '1.08',
76   'Pod::Coverage'             => '0.20',
77
78   # CDBI-compat related
79   'DBIx::ContextualFetch'     => '0',
80   'Class::DBI::Plugin::DeepAbstractSearch' => '0',
81   'Class::Trigger'            => '0',
82   'Time::Piece::MySQL'        => '0',
83   'Clone'                     => '0',
84   'Date::Simple'              => '3.03',
85
86   # t/52cycle.t
87   'Test::Memory::Cycle'       => '0',
88   'Devel::Cycle'              => '1.10',
89
90   # t/36datetime.t
91   # t/60core.t
92   'DateTime::Format::SQLite'  => '0',
93
94   # t/96_is_deteministic_value.t
95   'DateTime::Format::Strptime'=> '0',
96
97   # database-dependent reqs
98   #
99   $ENV{DBICTEST_PG_DSN}
100     ? (
101       'Sys::SigAction' => '0',
102       'DBD::Pg' => '2.009002',
103       'DateTime::Format::Pg' => '0',
104     ) : ()
105   ,
106
107   $ENV{DBICTEST_MYSQL_DSN}
108     ? (
109       'DateTime::Format::MySQL' => '0',
110     ) : ()
111   ,
112
113   $ENV{DBICTEST_ORACLE_DSN}
114     ? (
115       'DateTime::Format::Oracle' => '0',
116     ) : ()
117   ,
118
119   $ENV{DBICTEST_SYBASE_DSN}
120     ? (
121       'DateTime::Format::Sybase' => 0,
122     ) : ()
123   ,
124 );
125 #************************************************************************#
126 # Make ABSOLUTELY SURE that nothing on the list above is a real require, #
127 # since every module listed in %force_requires_if_author is deleted      #
128 # from the final META.yml (thus will never make it as a CPAN dependency) #
129 #************************************************************************#
130
131
132 install_script (qw|
133     script/dbicadmin
134 |);
135
136 tests_recursive (qw|
137     t
138 |);
139
140 resources 'IRC'         => 'irc://irc.perl.org/#dbix-class';
141 resources 'license'     => 'http://dev.perl.org/licenses/';
142 resources 'repository'  => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/';
143 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
144
145 no_index 'DBIx::Class::Storage::DBI::Sybase::Common';
146 no_index 'DBIx::Class::SQLAHacks';
147 no_index 'DBIx::Class::SQLAHacks::MSSQL';
148 no_index 'DBIx::Class::Storage::DBI::AmbiguousGlob';
149 no_index 'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server';
150 no_index 'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars';
151
152 # re-build README and require extra modules for testing if we're in a checkout
153
154 if ($Module::Install::AUTHOR) {
155   warn <<'EOW';
156 ******************************************************************************
157 ******************************************************************************
158 ***                                                                        ***
159 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
160 ***                                                                        ***
161 ******************************************************************************
162 ******************************************************************************
163
164 EOW
165
166   foreach my $module (sort keys %force_requires_if_author) {
167     build_requires ($module => $force_requires_if_author{$module});
168   }
169
170   print "Regenerating README\n";
171   system('pod2text lib/DBIx/Class.pm > README');
172
173   if (-f 'MANIFEST') {
174     print "Removing MANIFEST\n";
175     unlink 'MANIFEST';
176   }
177
178 #  require Module::Install::Pod::Inherit;
179 #  PodInherit();
180 }
181
182 auto_install();
183
184 WriteAll();
185
186 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
187 if ($Module::Install::AUTHOR) {
188
189   Meta->{values}{build_requires} = [ grep 
190     { not exists $force_requires_if_author{$_->[0]} }
191     ( @{Meta->{values}{build_requires}} )
192   ];
193
194   Meta->write;
195 }