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