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