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/) );
17 homepage 'http://www.dbix-class.org/';
18 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
19 resources 'license' => 'http://dev.perl.org/licenses/';
20 resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class';
21 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
22 resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class';
25 perl_version '5.008001';
26 all_from 'lib/DBIx/Class.pm';
27 Meta->{values}{x_authority} = 'cpan:RIBASUSHI';
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.10009',
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.09',
62 'Hash::Merge' => '0.12',
64 'MRO::Compat' => '0.12',
65 'Module::Find' => '0.07',
66 'namespace::clean' => '0.24',
67 'Path::Class' => '0.18',
68 'Scope::Guard' => '0.03',
69 'SQL::Abstract' => '1.73',
70 'Try::Tiny' => '0.07',
73 my $build_requires = {
74 # needed for testing only, not for operation
75 # we will move away from this dep eventually, perhaps to DBD::CSV or something
76 'DBD::SQLite' => '1.29',
80 'File::Temp' => '0.22',
81 'Test::Exception' => '0.31',
82 'Test::Warn' => '0.21',
83 'Test::More' => '0.94',
84 # not sure if this is necessary at all, ask schwern some day
85 'Test::Builder' => '0.94',
87 # this is already a dep of n::c, but just in case - used by t/55namespaces_cleaned.t
88 # remove and do a manual glob-collection if n::c is no longer a dep
89 'Package::Stash' => '0.28',
92 # make strictures.pm happy (DO NOT LIKE, TOO MUCH XS!)
93 # (i.e. what if the .git/.svn is *not* because of DBIC?)
95 # Note - this is added as test_requires *directly*, so it gets properly
96 # excluded on META.yml cleansing
97 if (-e '.git' or -e '.svn') {
98 test_requires 'indirect' => '0.25';
99 test_requires 'multidimensional' => '0.008';
100 test_requires 'bareword::filehandles' => '0.003';
103 # if the user has this env var set and no SQLT installed, tests will fail
104 # same rationale for direct test_requires as the strictures stuff above
105 # (even though no dist will be created from this)
106 # we force this req regarless of author_deps, worst case scenario it will
108 if ($ENV{DBICTEST_SQLT_DEPLOY}) {
109 local @INC = ('lib', @INC);
110 require DBIx::Class::Optional::Dependencies;
111 my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
112 for (keys %$dep_req) {
113 test_requires ($_ => $dep_req->{$_})
117 # this is so we can order requires alphabetically
118 # copies are needed for potential author requires injection
120 build_requires => { %$build_requires },
121 requires => { %$runtime_requires },
122 test_requires => { %$test_requires },
125 # only do author-includes if not part of a `make` run
126 if ($Module::Install::AUTHOR and ! $ENV{MAKELEVEL}) {
127 # get options here, make $args available to all snippets
128 require Getopt::Long;
129 my $getopt = Getopt::Long::Parser->new(
130 config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
133 skip_author_deps => undef,
135 $getopt->getoptions($args, qw/
136 skip_author_deps|skip-author-deps
139 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
143 # string-eval, not do(), because we need to provide the
144 # $reqs and $*_requires lexicals to the included file
145 # (some includes *do* modify $reqs above)
146 for my $inc (sort glob ( File::Spec->catfile('maint', 'Makefile.PL.inc', '*') ) ) {
147 my $src = do { local (@ARGV, $/) = $inc; <> } or die $!;
148 eval "use warnings; use strict; $src" or die sprintf
149 "Failed execution of %s: %s\n",
151 ($@ || $! || 'Unknown error'),
156 # make sure this Makefile can not be used to make a dist
157 # (without the author includes there are no meta cleanup, no sanity checks, etc)
159 create_distdir: nonauthor_stop_distdir_creation
160 nonauthor_stop_distdir_creation:
161 \t\$(NOECHO) \$(ECHO) Creation of dists in non-author mode is not allowed
162 \t\$(NOECHO) \$(FALSE)
166 # compose final req list, for alphabetical ordering
168 for my $rtype (keys %$reqs) {
169 for my $mod (keys %{$reqs->{$rtype}} ) {
171 # sanity check req duplications
172 if ($final_req{$mod}) {
173 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
176 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
181 for my $mod (sort keys %final_req) {
182 my ($rtype, $ver) = @{$final_req{$mod}};
184 $rtype->($mod, $ver);
187 # author-mode or not - this is where we show a list of missing deps
188 # IFF we are running interactively