1 use inc::Module::Install 0.97;
9 use lib "$FindBin::Bin/lib";
11 # adjust ENV for $AUTHOR system() calls
13 $ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
15 use Getopt::Long qw/:config gnu_getopt bundling_override no_ignore_case pass_through/;
17 skip_author_deps => undef,
19 GetOptions ($args, 'skip_author_deps');
21 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
25 ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
26 ### All of them should go to DBIx::Class::Optional::Dependencies
30 perl_version '5.008001';
31 all_from 'lib/DBIx/Class.pm';
33 my $build_requires = {
34 'DBD::SQLite' => '1.25',
38 'File::Temp' => '0.22',
39 'Test::Builder' => '0.33',
40 'Test::Exception' => '0',
41 'Test::More' => '0.92',
42 'Test::Warn' => '0.21',
45 my $runtime_requires = {
46 'Carp::Clan' => '6.0',
47 'Class::Accessor::Grouped' => '0.09003',
48 'Class::C3::Componentised' => '1.0005',
49 'Class::Inspector' => '1.24',
50 'Data::Page' => '2.00',
52 'File::Path' => '2.07',
53 'MRO::Compat' => '0.09',
54 'Module::Find' => '0.06',
55 'Path::Class' => '0.18',
56 'SQL::Abstract' => '1.67',
57 'SQL::Abstract::Limit' => '0.13',
58 'Sub::Name' => '0.04',
59 'Data::Dumper::Concise' => '1.000',
60 'Scope::Guard' => '0.03',
61 'Context::Preserve' => '0.01',
62 'Try::Tiny' => '0.04',
63 'namespace::clean' => '0.14',
64 'Math::Base36' => '0.07',
67 # this is so we can order requires alphabetically
68 # copies are needed for author requires injection
70 build_requires => { %$build_requires },
71 requires => { %$runtime_requires },
72 test_requires => { %$test_requires },
76 # require extra modules for testing if we're in a checkout
78 if ($Module::Install::AUTHOR) {
79 if ($args->{skip_author_deps}) {
80 $optdep_msg = <<'EOW';
82 ******************************************************************************
83 ******************************************************************************
85 *** IGNORING AUTHOR MODE: no optional test dependencies will be forced. ***
87 *** If you are using this checkout with the intention of submitting a DBIC ***
88 *** patch, you are *STRONGLY ENCOURAGED* to install all dependencies, so ***
89 *** that every possible unit-test will run. ***
91 ******************************************************************************
92 ******************************************************************************
97 $optdep_msg = <<'EOW';
99 ******************************************************************************
100 ******************************************************************************
102 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
103 *** ( to disabled re-run Makefile.PL with --skip_author_deps ) ***
105 ******************************************************************************
106 ******************************************************************************
110 require DBIx::Class::Optional::Dependencies;
111 $reqs->{test_requires} = {
112 %{$reqs->{test_requires}},
113 map { %$_ } (values %{DBIx::Class::Optional::Dependencies->req_group_list}),
118 # compose final req list, for alphabetical ordering
120 for my $rtype (keys %$reqs) {
121 for my $mod (keys %{$reqs->{$rtype}} ) {
123 # sanity check req duplications
124 if ($final_req{$mod}) {
125 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
128 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
133 for my $mod (sort keys %final_req) {
134 my ($rtype, $ver) = @{$final_req{$mod}};
136 $rtype->($mod, $ver);
139 # output twice since the deplist is > 70 lines
140 warn $optdep_msg if $Module::Install::AUTHOR;
142 warn $optdep_msg if $Module::Install::AUTHOR;
144 # re-create various autogenerated documentation bits
145 if ($Module::Install::AUTHOR) {
147 print "Regenerating README\n";
148 system('pod2text lib/DBIx/Class.pm > README');
151 print "Removing MANIFEST\n";
155 print "Regenerating Optional/Dependencies.pod\n";
156 require DBIx::Class::Optional::Dependencies;
157 DBIx::Class::Optional::Dependencies->_gen_pod;
159 # FIXME Disabled due to unsolved issues, ask theorbtwo
160 # require Module::Install::Pod::Inherit;
169 # temporary(?) until I get around to fix M::I wrt xt/
170 # needs Module::Install::AuthorTests
172 recursive_author_tests (qw/xt/);
175 unless ($args->{skip_author_deps}) {
177 eval { require Module::Install::AuthorTests }
178 || die "\nYou need Module::Install::AuthorTests installed to run this Makefile.PL:\n\n$@\n";
189 ### Mangle makefile - read the comments for more info
193 # This will add an extra dep-spec for the distdir target,
194 # which `make` will fold together in a first-come first-serve
195 # fashion. What we do here is essentially adding extra
196 # commands to execute once the distdir is assembled (via
197 # create_distdir), but before control is returned to a higher
199 distdir : dbicadmin_pod_inject
201 # The pod self-injection code is in fact a hidden option in
203 dbicadmin_pod_inject :
204 \tcd \$(DISTVNAME) && \$(ABSPERL) -Ilib script/dbicadmin --selfinject-pod
206 # Regenerate manifest before running create_distdir.
207 create_distdir : manifest
211 homepage 'http://www.dbix-class.org/';
212 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
213 resources 'license' => 'http://dev.perl.org/licenses/';
214 resources 'repository' => 'git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git';
215 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
217 # Deprecated/internal modules need no exposure
218 no_index directory => $_ for (qw|
220 lib/DBIx/Class/SQLAHacks
221 lib/DBIx/Class/PK/Auto
222 lib/DBIx/Class/CDBICompat
224 no_index package => $_ for (qw/
225 DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks
232 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
233 if ($Module::Install::AUTHOR && ! $args->{skip_author_deps} ) {
235 # FIXME test_requires is not yet part of META
236 my %original_build_requires = ( %$build_requires, %$test_requires );
238 print "Regenerating META with author requires excluded\n";
239 Meta->{values}{build_requires} = [ grep
240 { exists $original_build_requires{$_->[0]} }
241 ( @{Meta->{values}{build_requires}} )