1 use inc::Module::Install 0.93;
9 use lib "$FindBin::Bin/lib";
11 # adjust ENV for $AUTHOR system() calls
13 $ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
17 ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
18 ### All of them should go to DBIx::Class::Optional::Dependencies
22 perl_version '5.008001';
23 all_from 'lib/DBIx/Class.pm';
25 my $build_requires = {
26 'DBD::SQLite' => '1.25',
30 'File::Temp' => '0.22',
31 'Test::Builder' => '0.33',
32 'Test::Exception' => '0',
33 'Test::More' => '0.92',
34 'Test::Warn' => '0.21',
37 my $runtime_requires = {
38 'Carp::Clan' => '6.0',
39 'Class::Accessor::Grouped' => '0.09003',
40 'Class::C3::Componentised' => '1.0005',
41 'Class::Inspector' => '1.24',
42 'Data::Page' => '2.00',
44 'MRO::Compat' => '0.09',
45 'Module::Find' => '0.06',
46 'Path::Class' => '0.18',
47 'SQL::Abstract' => '1.66',
48 'SQL::Abstract::Limit' => '0.13',
49 'Sub::Name' => '0.04',
50 'Data::Dumper::Concise' => '1.000',
51 'Scope::Guard' => '0.03',
52 'Context::Preserve' => '0.01',
55 # this is so we can order requires alphabetically
56 # copies are needed for author requires injection
58 build_requires => { %$build_requires },
59 requires => { %$runtime_requires },
60 test_requires => { %$test_requires },
64 # require extra modules for testing if we're in a checkout
65 if ($Module::Install::AUTHOR) {
67 ******************************************************************************
68 ******************************************************************************
70 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
72 ******************************************************************************
73 ******************************************************************************
77 require DBIx::Class::Optional::Dependencies;
78 $reqs->{test_requires} = {
79 %{$reqs->{test_requires}},
80 map { %$_ } (values %{DBIx::Class::Optional::Dependencies->req_group_list}),
84 # compose final req list, for alphabetical ordering
86 for my $rtype (keys %$reqs) {
87 for my $mod (keys %{$reqs->{$rtype}} ) {
89 # sanity check req duplications
90 if ($final_req{$mod}) {
91 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
94 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
99 for my $mod (sort keys %final_req) {
100 my ($rtype, $ver) = @{$final_req{$mod}};
102 $rtype->($mod, $ver);
107 # re-create various autogenerated documentation bits
108 if ($Module::Install::AUTHOR) {
110 print "Regenerating README\n";
111 system('pod2text lib/DBIx/Class.pm > README');
114 print "Removing MANIFEST\n";
118 print "Regenerating Optional/Dependencies.pod\n";
119 require DBIx::Class::Optional::Dependencies;
120 DBIx::Class::Optional::Dependencies->_gen_pod;
122 # FIXME Disabled due to unsolved issues, ask theorbtwo
123 # require Module::Install::Pod::Inherit;
136 ### Mangle makefile - read the comments for more info
140 # This will add an extra dep-spec for the distdir target,
141 # which `make` will fold together in a first-come first-serve
142 # fashion. What we do here is essentially adding extra
143 # commands to execute once the distdir is assembled (via
144 # create_distdir), but before control is returned to a higher
146 distdir : dbicadmin_pod_inject
148 # The pod self-injection code is in fact a hidden option in
150 dbicadmin_pod_inject :
151 \tcd \$(DISTVNAME) && \$(ABSPERL) -Ilib script/dbicadmin --selfinject-pod
153 # Regenerate manifest before running create_distdir.
154 create_distdir : manifest
160 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
161 resources 'license' => 'http://dev.perl.org/licenses/';
162 resources 'repository' => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/';
163 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
165 # Deprecated/internal modules need no exposure
166 no_index directory => $_ for (qw|
168 lib/DBIx/Class/SQLAHacks
169 lib/DBIx/Class/PK/Auto
170 lib/DBIx/Class/CDBICompat
172 no_index package => $_ for (qw/
173 DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks
180 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
181 if ($Module::Install::AUTHOR) {
183 # FIXME test_requires is not yet part of META
184 my %original_build_requires = ( %$build_requires, %$test_requires );
186 print "Regenerating META with author requires excluded\n";
187 Meta->{values}{build_requires} = [ grep
188 { exists $original_build_requires{$_->[0]} }
189 ( @{Meta->{values}{build_requires}} )