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