Bizarre fork failure
[dbsrgits/DBIx-Class.git] / Makefile.PL
CommitLineData
4b4f8ae8 1use inc::Module::Install 0.93;
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
97f9f16e 11# adjust ENV for $AUTHOR system() calls
12use Config;
13$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
14
15
4b5544ad 16###
17### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
18### All of them should go to DBIx::Class::Optional::Dependencies
19###
20
ce4c07df 21name 'DBIx-Class';
b50d0dd3 22perl_version '5.008001';
8e0f16f1 23all_from 'lib/DBIx/Class.pm';
ce4c07df 24
8057ed01 25my $build_requires = {
30da8374 26 'DBD::SQLite' => '1.25',
8057ed01 27};
28
29my $test_requires = {
30da8374 30 'File::Temp' => '0.22',
31 'Test::Builder' => '0.33',
30da8374 32 'Test::Exception' => '0',
33 'Test::More' => '0.92',
34 'Test::Warn' => '0.21',
8057ed01 35};
36
37my $runtime_requires = {
8057ed01 38 'Carp::Clan' => '6.0',
b182d87b 39 'Class::Accessor::Grouped' => '0.09003',
8057ed01 40 'Class::C3::Componentised' => '1.0005',
41 'Class::Inspector' => '1.24',
42 'Data::Page' => '2.00',
43 'DBI' => '1.609',
8057ed01 44 'MRO::Compat' => '0.09',
45 'Module::Find' => '0.06',
f4d7449c 46 'Path::Class' => '0.18',
b182d87b 47 'SQL::Abstract' => '1.66',
8057ed01 48 'SQL::Abstract::Limit' => '0.13',
49 'Sub::Name' => '0.04',
50 'Data::Dumper::Concise' => '1.000',
b7b18f32 51 'Scope::Guard' => '0.03',
52 'Context::Preserve' => '0.01',
8057ed01 53};
54
55# this is so we can order requires alphabetically
56# copies are needed for author requires injection
57my $reqs = {
58 build_requires => { %$build_requires },
59 requires => { %$runtime_requires },
60 test_requires => { %$test_requires },
61};
3a4251e2 62
8057ed01 63
92f8f62a 64# require extra modules for testing if we're in a checkout
65if ($Module::Install::AUTHOR) {
8057ed01 66 warn <<'EOW';
67******************************************************************************
68******************************************************************************
69*** ***
70*** AUTHOR MODE: all optional test dependencies converted to hard requires ***
71*** ***
72******************************************************************************
73******************************************************************************
74
75EOW
76
92f8f62a 77 require DBIx::Class::Optional::Dependencies;
8057ed01 78 $reqs->{test_requires} = {
79 %{$reqs->{test_requires}},
e3fc11e1 80 map { %$_ } (values %{DBIx::Class::Optional::Dependencies->req_group_list}),
8057ed01 81 };
82}
83
84# compose final req list, for alphabetical ordering
85my %final_req;
86for my $rtype (keys %$reqs) {
87 for my $mod (keys %{$reqs->{$rtype}} ) {
88
89 # sanity check req duplications
90 if ($final_req{$mod}) {
b718fd0a 91 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
8057ed01 92 }
93
94 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
95 }
96}
97
98# actual require
99for my $mod (sort keys %final_req) {
100 my ($rtype, $ver) = @{$final_req{$mod}};
101 no strict 'refs';
102 $rtype->($mod, $ver);
103}
a410299d 104
92f8f62a 105auto_install();
106
107# re-create various autogenerated documentation bits
108if ($Module::Install::AUTHOR) {
109
110 print "Regenerating README\n";
111 system('pod2text lib/DBIx/Class.pm > README');
112
113 if (-f 'MANIFEST') {
114 print "Removing MANIFEST\n";
115 unlink 'MANIFEST';
116 }
117
92f8f62a 118 print "Regenerating Optional/Dependencies.pod\n";
119 require DBIx::Class::Optional::Dependencies;
120 DBIx::Class::Optional::Dependencies->_gen_pod;
121
122 # FIXME Disabled due to unsolved issues, ask theorbtwo
123 # require Module::Install::Pod::Inherit;
124 # PodInherit();
125}
126
7eaae8db 127tests_recursive (qw|
128 t
129|);
130
a410299d 131install_script (qw|
132 script/dbicadmin
133|);
134
7eaae8db 135
136### Mangle makefile - read the comments for more info
137#
138postamble <<"EOP";
139
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
145# calling rule.
146distdir : dbicadmin_pod_inject
147
148# The pod self-injection code is in fact a hidden option in
149# dbicadmin itself
150dbicadmin_pod_inject :
151\tcd \$(DISTVNAME) && \$(ABSPERL) -Ilib script/dbicadmin --selfinject-pod
152
153# Regenerate manifest before running create_distdir.
154create_distdir : manifest
155
156EOP
157
158
a410299d 159
160resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
161resources 'license' => 'http://dev.perl.org/licenses/';
1d682114 162resources 'repository' => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/';
a410299d 163resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
164
974fe5e8 165# Deprecated/internal modules need no exposure
166no_index directory => $_ for (qw|
bc6f129c 167 lib/DBIx/Class/Admin
974fe5e8 168 lib/DBIx/Class/SQLAHacks
281738a4 169 lib/DBIx/Class/PK/Auto
bc6f129c 170 lib/DBIx/Class/CDBICompat
974fe5e8 171|);
172no_index package => $_ for (qw/
974fe5e8 173 DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks
174/);
a410299d 175
269228af 176
713cc98e 177WriteAll();
09d46657 178
8057ed01 179
80ff5ae0 180# Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
713cc98e 181if ($Module::Install::AUTHOR) {
713cc98e 182
8057ed01 183 # FIXME test_requires is not yet part of META
184 my %original_build_requires = ( %$build_requires, %$test_requires );
185
186 print "Regenerating META with author requires excluded\n";
281738a4 187 Meta->{values}{build_requires} = [ grep
8057ed01 188 { exists $original_build_requires{$_->[0]} }
189 ( @{Meta->{values}{build_requires}} )
80ff5ae0 190 ];
713cc98e 191
713cc98e 192 Meta->write;
09d46657 193}