Privatize the full list method
[dbsrgits/DBIx-Class.git] / Makefile.PL
CommitLineData
89b5b1c5 1use inc::Module::Install 0.89;
fe650234 2use strict;
3use warnings;
76607ac8 4use POSIX ();
fe650234 5
55087b99 6use 5.008001;
ce4c07df 7
8057ed01 8use FindBin;
9use lib "$FindBin::Bin/lib";
93c50889 10
ce4c07df 11name 'DBIx-Class';
b50d0dd3 12perl_version '5.008001';
8e0f16f1 13all_from 'lib/DBIx/Class.pm';
ce4c07df 14
8057ed01 15my $build_requires = {
30da8374 16 'DBD::SQLite' => '1.25',
8057ed01 17};
18
19my $test_requires = {
30da8374 20 'File::Temp' => '0.22',
21 'Test::Builder' => '0.33',
22 'Test::Deep' => '0',
23 'Test::Exception' => '0',
24 'Test::More' => '0.92',
25 'Test::Warn' => '0.21',
8057ed01 26};
27
28my $runtime_requires = {
29 # Core
30 'List::Util' => '0',
31 'Scalar::Util' => '0',
32 'Storable' => '0',
33
34 # Dependencies
35 'Carp::Clan' => '6.0',
36 'Class::Accessor::Grouped' => '0.09002',
37 'Class::C3::Componentised' => '1.0005',
38 'Class::Inspector' => '1.24',
39 'Data::Page' => '2.00',
40 'DBI' => '1.609',
41 'JSON::Any' => '1.18',
42 'MRO::Compat' => '0.09',
43 'Module::Find' => '0.06',
44 'Path::Class' => '0.16',
45 'Scope::Guard' => '0.03',
46 'SQL::Abstract' => '1.61',
47 'SQL::Abstract::Limit' => '0.13',
48 'Sub::Name' => '0.04',
49 'Data::Dumper::Concise' => '1.000',
50};
51
52# this is so we can order requires alphabetically
53# copies are needed for author requires injection
54my $reqs = {
55 build_requires => { %$build_requires },
56 requires => { %$runtime_requires },
57 test_requires => { %$test_requires },
58};
3a4251e2 59
8057ed01 60# re-build README and require extra modules for testing if we're in a checkout
61if ($Module::Install::AUTHOR) {
62
63 print "Regenerating README\n";
64 system('pod2text lib/DBIx/Class.pm > README');
65
66 if (-f 'MANIFEST') {
67 print "Removing MANIFEST\n";
68 unlink 'MANIFEST';
69 }
fe650234 70
f6b26571 71 print "Regenerating Optional/Dependencies.pod\n";
72 require DBIx::Class::Optional::Dependencies;
73 DBIx::Class::Optional::Dependencies->_gen_pod;
74
8057ed01 75# FIXME Disabled due to unsolved issues, ask theorbtwo
76# require Module::Install::Pod::Inherit;
77# PodInherit();
78
79 warn <<'EOW';
80******************************************************************************
81******************************************************************************
82*** ***
83*** AUTHOR MODE: all optional test dependencies converted to hard requires ***
84*** ***
85******************************************************************************
86******************************************************************************
87
88EOW
89
8057ed01 90 $reqs->{test_requires} = {
91 %{$reqs->{test_requires}},
0d4740b3 92 %{DBIx::Class::Optional::Dependencies->_all_optional_requirements},
8057ed01 93 };
94}
95
96# compose final req list, for alphabetical ordering
97my %final_req;
98for my $rtype (keys %$reqs) {
99 for my $mod (keys %{$reqs->{$rtype}} ) {
100
101 # sanity check req duplications
102 if ($final_req{$mod}) {
103 die "$mod specified as both a $rtype and a $final_req{$mod}[1]\n";
104 }
105
106 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
107 }
108}
109
110# actual require
111for my $mod (sort keys %final_req) {
112 my ($rtype, $ver) = @{$final_req{$mod}};
113 no strict 'refs';
114 $rtype->($mod, $ver);
115}
a410299d 116
117install_script (qw|
118 script/dbicadmin
119|);
120
121tests_recursive (qw|
122 t
123|);
124
125resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
126resources 'license' => 'http://dev.perl.org/licenses/';
1d682114 127resources 'repository' => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/';
a410299d 128resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
129
974fe5e8 130# Deprecated/internal modules need no exposure
131no_index directory => $_ for (qw|
132 lib/DBIx/Class/SQLAHacks
281738a4 133 lib/DBIx/Class/PK/Auto
974fe5e8 134|);
135no_index package => $_ for (qw/
136 DBIx::Class::Storage::DBI::AmbiguousGlob
137 DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks
138/);
a410299d 139
269228af 140
7ff18dbd 141auto_install();
09d46657 142
713cc98e 143WriteAll();
09d46657 144
8057ed01 145
80ff5ae0 146# Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
713cc98e 147if ($Module::Install::AUTHOR) {
713cc98e 148
8057ed01 149 # FIXME test_requires is not yet part of META
150 my %original_build_requires = ( %$build_requires, %$test_requires );
151
152 print "Regenerating META with author requires excluded\n";
281738a4 153 Meta->{values}{build_requires} = [ grep
8057ed01 154 { exists $original_build_requires{$_->[0]} }
155 ( @{Meta->{values}{build_requires}} )
80ff5ae0 156 ];
713cc98e 157
713cc98e 158 Meta->write;
09d46657 159}