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',
53 'Try::Tiny' => '0.04',
54 'namespace::clean' => '0.14',
57 # this is so we can order requires alphabetically
58 # copies are needed for author requires injection
60 build_requires => { %$build_requires },
61 requires => { %$runtime_requires },
62 test_requires => { %$test_requires },
66 # require extra modules for testing if we're in a checkout
67 if ($Module::Install::AUTHOR) {
69 ******************************************************************************
70 ******************************************************************************
72 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
74 ******************************************************************************
75 ******************************************************************************
79 require DBIx::Class::Optional::Dependencies;
80 $reqs->{test_requires} = {
81 %{$reqs->{test_requires}},
82 map { %$_ } (values %{DBIx::Class::Optional::Dependencies->req_group_list}),
86 # compose final req list, for alphabetical ordering
88 for my $rtype (keys %$reqs) {
89 for my $mod (keys %{$reqs->{$rtype}} ) {
91 # sanity check req duplications
92 if ($final_req{$mod}) {
93 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
96 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
101 for my $mod (sort keys %final_req) {
102 my ($rtype, $ver) = @{$final_req{$mod}};
104 $rtype->($mod, $ver);
109 # re-create various autogenerated documentation bits
110 if ($Module::Install::AUTHOR) {
112 print "Regenerating README\n";
113 system('pod2text lib/DBIx/Class.pm > README');
116 print "Removing MANIFEST\n";
120 print "Regenerating Optional/Dependencies.pod\n";
121 require DBIx::Class::Optional::Dependencies;
122 DBIx::Class::Optional::Dependencies->_gen_pod;
124 # FIXME Disabled due to unsolved issues, ask theorbtwo
125 # require Module::Install::Pod::Inherit;
138 ### Mangle makefile - read the comments for more info
142 # This will add an extra dep-spec for the distdir target,
143 # which `make` will fold together in a first-come first-serve
144 # fashion. What we do here is essentially adding extra
145 # commands to execute once the distdir is assembled (via
146 # create_distdir), but before control is returned to a higher
148 distdir : dbicadmin_pod_inject
150 # The pod self-injection code is in fact a hidden option in
152 dbicadmin_pod_inject :
153 \tcd \$(DISTVNAME) && \$(ABSPERL) -Ilib script/dbicadmin --selfinject-pod
155 # Regenerate manifest before running create_distdir.
156 create_distdir : manifest
162 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
163 resources 'license' => 'http://dev.perl.org/licenses/';
164 resources 'repository' => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/';
165 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
167 # Deprecated/internal modules need no exposure
168 no_index directory => $_ for (qw|
170 lib/DBIx/Class/SQLAHacks
171 lib/DBIx/Class/PK/Auto
172 lib/DBIx/Class/CDBICompat
174 no_index package => $_ for (qw/
175 DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks
182 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
183 if ($Module::Install::AUTHOR) {
185 # FIXME test_requires is not yet part of META
186 my %original_build_requires = ( %$build_requires, %$test_requires );
188 print "Regenerating META with author requires excluded\n";
189 Meta->{values}{build_requires} = [ grep
190 { exists $original_build_requires{$_->[0]} }
191 ( @{Meta->{values}{build_requires}} )