5 use inc::Module::Install 1.06;
8 ## DO NOT USE THIS HACK IN YOUR DISTS!!! (it makes #toolchain sad)
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
14 $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) );
18 perl_version '5.008001';
19 all_from 'lib/DBIx/Class.pm';
20 Meta->{values}{x_authority} = 'cpan:RIBASUSHI';
30 homepage 'http://www.dbix-class.org/';
31 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
32 resources 'license' => 'http://dev.perl.org/licenses/';
33 resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class';
34 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
35 resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class';
38 ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
39 ### All of them *MUST* go to DBIx::Class::Optional::Dependencies
41 my $runtime_requires = {
42 # FIXME - temporary, needs throwing out for something more efficient
43 'Data::Compare' => '1.22',
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
50 # XS (or XS-dependent) libs
51 'Sub::Name' => '0.04',
53 # pure-perl (FatPack-able) libs
54 'Class::Accessor::Grouped' => '0.10007',
55 'Class::C3::Componentised' => '1.0009',
56 'Class::Inspector' => '1.24',
57 'Config::Any' => '0.20',
58 'Context::Preserve' => '0.01',
59 'Data::Dumper::Concise' => '2.020',
60 'Data::Page' => '2.00',
61 'Devel::GlobalDestruction' => '0',
62 'Hash::Merge' => '0.12',
64 'MRO::Compat' => '0.09',
65 'Module::Find' => '0.06',
66 'namespace::clean' => '0.20',
67 'Path::Class' => '0.18',
68 'Scope::Guard' => '0.03',
69 'SQL::Abstract' => '1.73',
70 'Try::Tiny' => '0.04',
72 # dual-life corelibs needing a specific bugfixed version
73 'File::Path' => '2.07',
76 my $build_requires = {
77 # needed for testing only, not for operation
78 # we will move away from this dep eventually, perhaps to DBD::CSV or something
79 'DBD::SQLite' => '1.29',
83 'File::Temp' => '0.22',
84 'Test::Exception' => '0.31',
85 'Test::Warn' => '0.21',
86 'Test::More' => '0.94',
87 # not sure if this is necessary at all, ask schwern some day
88 'Test::Builder' => '0.94',
90 # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t
91 # remove and do a manual glob-collection if n::c is no longer a dep
92 'Package::Stash' => '0.28',
95 # make strictures.pm happy (DO NOT LIKE, TOO MUCH XS!)
96 # (i.e. what if the .git/.svn is *not* because of DBIC?)
98 # Note - this is added as test_requires *directly*, so it gets properly
99 # excluded on META.yml cleansing
100 if (-e '.git' or -e '.svn') {
101 test_requires 'indirect' => '0.25';
102 test_requires 'multidimensional' => '0.008';
103 test_requires 'bareword::filehandles' => '0.003';
106 # if the user has this env var set and no SQLT installed, tests will fail
107 # same rationale for direct test_requires as the strictures stuff above
108 # (even though no dist will be created from this)
109 # we force this req regarless of author_deps, worst case scenario it will
111 if ($ENV{DBICTEST_SQLT_DEPLOY}) {
112 local @INC = ('lib', @INC);
113 require DBIx::Class::Optional::Dependencies;
114 my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
115 for (keys %$dep_req) {
116 test_requires ($_ => $dep_req->{$_})
120 # this is so we can order requires alphabetically
121 # copies are needed for potential author requires injection
123 build_requires => { %$build_requires },
124 requires => { %$runtime_requires },
125 test_requires => { %$test_requires },
128 # only do author-includes if not part of a `make` run
129 if ($Module::Install::AUTHOR and ! $ENV{MAKELEVEL}) {
130 # get options here, make $args available to all snippets
131 require Getopt::Long;
132 my $getopt = Getopt::Long::Parser->new(
133 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
136 skip_author_deps => undef,
138 $getopt->getoptions($args, qw/
139 skip_author_deps|skip-author-deps
142 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
146 # string-eval, not do(), because we need to provide the
147 # $reqs and $*_requires lexicals to the included file
148 # (some includes *do* modify $reqs above)
149 for my $inc (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) {
150 my $src = do { local (@ARGV, $/) = $inc; <> } or die $!;
151 eval "use warnings; use strict; $src" or die sprintf
152 "Failed execution of %s: %s\n",
154 ($@ || $! || 'Unknown error'),
159 # make sure this Makefile can not be used to make a dist
160 # (without the author includes there are no meta cleanup, no sanity checks, etc)
162 .PHONY: nonauthor_stop_distdir_creation
163 create_distdir: nonauthor_stop_distdir_creation
164 nonauthor_stop_distdir_creation:
165 \t\$(NOECHO) \$(ECHO) Creation of dists in non-author mode is not allowed
166 \t\$(NOECHO) \$(FALSE)
170 # compose final req list, for alphabetical ordering
172 for my $rtype (keys %$reqs) {
173 for my $mod (keys %{$reqs->{$rtype}} ) {
175 # sanity check req duplications
176 if ($final_req{$mod}) {
177 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
180 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
185 for my $mod (sort keys %final_req) {
186 my ($rtype, $ver) = @{$final_req{$mod}};
188 $rtype->($mod, $ver);
191 # author-mode or not - this is where we show a list of missing deps
192 # IFF we are running interactively