Back out frivolous loading of threads.pm
[dbsrgits/DBIx-Class.git] / Makefile.PL
CommitLineData
fe650234 1use strict;
2use warnings;
3
55087b99 4use 5.008001;
6c96d73f 5use inc::Module::Install 1.06;
ce4c07df 6
d1dc7a98 7##
8## DO NOT USE THIS HACK IN YOUR DISTS!!! (it makes #toolchain sad)
9##
fc4b0448 10# get cpanX --installdeps . to behave in a checkout (most users do not expect
11# the deps for a full test suite run, and if they do - there's MI::AutoInstall
12# for that)
13BEGIN {
14 $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) );
15}
4b5544ad 16
ce4c07df 17name 'DBIx-Class';
b50d0dd3 18perl_version '5.008001';
8e0f16f1 19all_from 'lib/DBIx/Class.pm';
294c1f51 20Meta->{values}{x_authority} = 'cpan:RIBASUSHI';
ce4c07df 21
fc4b0448 22tests_recursive (qw|
23 t
24|);
8057ed01 25
fc4b0448 26install_script (qw|
27 script/dbicadmin
28|);
90cfe42b 29
fc4b0448 30homepage 'http://www.dbix-class.org/';
31resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
32resources 'license' => 'http://dev.perl.org/licenses/';
86a23587 33resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class';
fc4b0448 34resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
35resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class';
8057ed01 36
fc4b0448 37###
38### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
39### All of them *MUST* go to DBIx::Class::Optional::Dependencies
40###
8057ed01 41my $runtime_requires = {
fc4b0448 42 # FIXME - temporary, needs throwing out for something more efficient
43 'Data::Compare' => '1.22',
44
45 # DBI itself should be capable of installation and execution in pure-perl
46 # mode. However it has never been tested yet, so consider XS for the time
47 # being
48 'DBI' => '1.57',
49
50 # XS (or XS-dependent) libs
51 'Sub::Name' => '0.04',
52
53 # pure-perl (FatPack-able) libs
08a3ec72 54 'Class::Accessor::Grouped' => '0.10007',
9c1700e3 55 'Class::C3::Componentised' => '1.0009',
8057ed01 56 'Class::Inspector' => '1.24',
a4367b26 57 'Class::Method::Modifiers' => '1.06',
79680fc0 58 'Config::Any' => '0.20',
59 'Context::Preserve' => '0.01',
2b8cc2f2 60 'Data::Dumper::Concise' => '2.020',
8057ed01 61 'Data::Page' => '2.00',
d6b39e46 62 'Devel::GlobalDestruction' => '0',
b8d22f13 63 'Hash::Merge' => '0.12',
dfd722ef 64 'Moo' => '1.000006',
8057ed01 65 'MRO::Compat' => '0.09',
66 'Module::Find' => '0.06',
cd122820 67 'namespace::clean' => '0.20',
f4d7449c 68 'Path::Class' => '0.18',
b7b18f32 69 'Scope::Guard' => '0.03',
6612e610 70 'SQL::Abstract' => '1.73',
20674fcd 71 'Try::Tiny' => '0.04',
79680fc0 72
c7d50a7d 73 # dual-life corelibs needing a specific bugfixed version
79680fc0 74 'File::Path' => '2.07',
fc4b0448 75};
cd122820 76
fc4b0448 77my $build_requires = {
78 # needed for testing only, not for operation
79 # we will move away from this dep eventually, perhaps to DBD::CSV or something
80 'DBD::SQLite' => '1.29',
8057ed01 81};
82
fc4b0448 83my $test_requires = {
84 'File::Temp' => '0.22',
85 'Test::Exception' => '0.31',
86 'Test::Warn' => '0.21',
87 'Test::More' => '0.94',
88 # not sure if this is necessary at all, ask schwern some day
89 'Test::Builder' => '0.94',
90
91 # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t
92 # remove and do a manual glob-collection if n::c is no longer a dep
93 'Package::Stash' => '0.28',
94};
bb7950c0 95
9345b14c 96# make strictures.pm happy (DO NOT LIKE, TOO MUCH XS!)
97# (i.e. what if the .git/.svn is *not* because of DBIC?)
98#
99# Note - this is added as test_requires *directly*, so it gets properly
100# excluded on META.yml cleansing
101if (-e '.git' or -e '.svn') {
102 test_requires 'indirect' => '0.25';
103 test_requires 'multidimensional' => '0.008';
104 test_requires 'bareword::filehandles' => '0.003';
105}
106
20beaf5f 107# if the user has this env var set and no SQLT installed, tests will fail
108# same rationale for direct test_requires as the strictures stuff above
109# (even though no dist will be created from this)
110# we force this req regarless of author_deps, worst case scenario it will
111# be specified twice
112if ($ENV{DBICTEST_SQLT_DEPLOY}) {
113 local @INC = ('lib', @INC);
114 require DBIx::Class::Optional::Dependencies;
115 my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
116 for (keys %$dep_req) {
117 test_requires ($_ => $dep_req->{$_})
118 }
119}
120
8057ed01 121# this is so we can order requires alphabetically
fc4b0448 122# copies are needed for potential author requires injection
8057ed01 123my $reqs = {
124 build_requires => { %$build_requires },
125 requires => { %$runtime_requires },
126 test_requires => { %$test_requires },
127};
3a4251e2 128
c78f9f5b 129# only do author-includes if not part of a `make` run
130if ($Module::Install::AUTHOR and ! $ENV{MAKELEVEL}) {
fc4b0448 131 # get options here, make $args available to all snippets
132 require Getopt::Long;
133 my $getopt = Getopt::Long::Parser->new(
134 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
135 );
136 my $args = {
137 skip_author_deps => undef,
138 };
df65d4da 139 $getopt->getoptions($args, qw/
140 skip_author_deps|skip-author-deps
141 /);
fc4b0448 142 if (@ARGV) {
143 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
0424d17a 144 }
8057ed01 145
fc4b0448 146 require File::Spec;
147 # string-eval, not do(), because we need to provide the
148 # $reqs and $*_requires lexicals to the included file
149 # (some includes *do* modify $reqs above)
8baa2122 150 for my $inc (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) {
151 my $src = do { local (@ARGV, $/) = $inc; <> } or die $!;
152 eval "use warnings; use strict; $src" or die sprintf
153 "Failed execution of %s: %s\n",
154 $inc,
155 ($@ || $! || 'Unknown error'),
156 ;
0424d17a 157 }
8057ed01 158}
fc4b0448 159else {
160 # make sure this Makefile can not be used to make a dist
0e016219 161 # (without the author includes there are no meta cleanup, no sanity checks, etc)
fc4b0448 162 postamble <<EOP;
163.PHONY: nonauthor_stop_distdir_creation
164create_distdir: nonauthor_stop_distdir_creation
165nonauthor_stop_distdir_creation:
166\t\$(NOECHO) \$(ECHO) Creation of dists in non-author mode is not allowed
167\t\$(NOECHO) \$(FALSE)
168EOP
169}
8057ed01 170
171# compose final req list, for alphabetical ordering
172my %final_req;
173for my $rtype (keys %$reqs) {
174 for my $mod (keys %{$reqs->{$rtype}} ) {
175
176 # sanity check req duplications
177 if ($final_req{$mod}) {
b718fd0a 178 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
8057ed01 179 }
180
181 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
182 }
183}
184
185# actual require
186for my $mod (sort keys %final_req) {
187 my ($rtype, $ver) = @{$final_req{$mod}};
188 no strict 'refs';
189 $rtype->($mod, $ver);
190}
a410299d 191
fc4b0448 192# author-mode or not - this is where we show a list of missing deps
193# IFF we are running interactively
92f8f62a 194auto_install();
a410299d 195
713cc98e 196WriteAll();