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 | |
ce4c07df |
21 | name 'DBIx-Class'; |
b50d0dd3 |
22 | perl_version '5.008001'; |
8e0f16f1 |
23 | all_from 'lib/DBIx/Class.pm'; |
ce4c07df |
24 | |
8057ed01 |
25 | my $build_requires = { |
30da8374 |
26 | 'DBD::SQLite' => '1.25', |
8057ed01 |
27 | }; |
28 | |
29 | my $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 | |
37 | my $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', |
887d8da0 |
47 | 'SQL::Abstract' => '1.67', |
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', |
20674fcd |
53 | 'Try::Tiny' => '0.04', |
ecb68746 |
54 | 'namespace::clean' => '0.14', |
8057ed01 |
55 | }; |
56 | |
57 | # this is so we can order requires alphabetically |
58 | # copies are needed for author requires injection |
59 | my $reqs = { |
60 | build_requires => { %$build_requires }, |
61 | requires => { %$runtime_requires }, |
62 | test_requires => { %$test_requires }, |
63 | }; |
3a4251e2 |
64 | |
8057ed01 |
65 | |
92f8f62a |
66 | # require extra modules for testing if we're in a checkout |
67 | if ($Module::Install::AUTHOR) { |
8057ed01 |
68 | warn <<'EOW'; |
69 | ****************************************************************************** |
70 | ****************************************************************************** |
71 | *** *** |
72 | *** AUTHOR MODE: all optional test dependencies converted to hard requires *** |
73 | *** *** |
74 | ****************************************************************************** |
75 | ****************************************************************************** |
76 | |
77 | EOW |
78 | |
92f8f62a |
79 | require DBIx::Class::Optional::Dependencies; |
8057ed01 |
80 | $reqs->{test_requires} = { |
81 | %{$reqs->{test_requires}}, |
e3fc11e1 |
82 | map { %$_ } (values %{DBIx::Class::Optional::Dependencies->req_group_list}), |
8057ed01 |
83 | }; |
84 | } |
85 | |
86 | # compose final req list, for alphabetical ordering |
87 | my %final_req; |
88 | for my $rtype (keys %$reqs) { |
89 | for my $mod (keys %{$reqs->{$rtype}} ) { |
90 | |
91 | # sanity check req duplications |
92 | if ($final_req{$mod}) { |
b718fd0a |
93 | die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n"; |
8057ed01 |
94 | } |
95 | |
96 | $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ], |
97 | } |
98 | } |
99 | |
100 | # actual require |
101 | for my $mod (sort keys %final_req) { |
102 | my ($rtype, $ver) = @{$final_req{$mod}}; |
103 | no strict 'refs'; |
104 | $rtype->($mod, $ver); |
105 | } |
a410299d |
106 | |
92f8f62a |
107 | auto_install(); |
108 | |
109 | # re-create various autogenerated documentation bits |
110 | if ($Module::Install::AUTHOR) { |
111 | |
112 | print "Regenerating README\n"; |
113 | system('pod2text lib/DBIx/Class.pm > README'); |
114 | |
115 | if (-f 'MANIFEST') { |
116 | print "Removing MANIFEST\n"; |
117 | unlink 'MANIFEST'; |
118 | } |
119 | |
92f8f62a |
120 | print "Regenerating Optional/Dependencies.pod\n"; |
121 | require DBIx::Class::Optional::Dependencies; |
122 | DBIx::Class::Optional::Dependencies->_gen_pod; |
123 | |
124 | # FIXME Disabled due to unsolved issues, ask theorbtwo |
125 | # require Module::Install::Pod::Inherit; |
126 | # PodInherit(); |
127 | } |
128 | |
7eaae8db |
129 | tests_recursive (qw| |
130 | t |
131 | |); |
132 | |
a410299d |
133 | install_script (qw| |
134 | script/dbicadmin |
135 | |); |
136 | |
7eaae8db |
137 | |
138 | ### Mangle makefile - read the comments for more info |
139 | # |
140 | postamble <<"EOP"; |
141 | |
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 |
147 | # calling rule. |
148 | distdir : dbicadmin_pod_inject |
149 | |
150 | # The pod self-injection code is in fact a hidden option in |
151 | # dbicadmin itself |
152 | dbicadmin_pod_inject : |
153 | \tcd \$(DISTVNAME) && \$(ABSPERL) -Ilib script/dbicadmin --selfinject-pod |
154 | |
155 | # Regenerate manifest before running create_distdir. |
156 | create_distdir : manifest |
157 | |
158 | EOP |
159 | |
160 | |
a410299d |
161 | |
162 | resources 'IRC' => 'irc://irc.perl.org/#dbix-class'; |
163 | resources 'license' => 'http://dev.perl.org/licenses/'; |
1d682114 |
164 | resources 'repository' => 'http://dev.catalyst.perl.org/repos/bast/DBIx-Class/'; |
a410299d |
165 | resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class'; |
166 | |
974fe5e8 |
167 | # Deprecated/internal modules need no exposure |
168 | no_index directory => $_ for (qw| |
bc6f129c |
169 | lib/DBIx/Class/Admin |
974fe5e8 |
170 | lib/DBIx/Class/SQLAHacks |
281738a4 |
171 | lib/DBIx/Class/PK/Auto |
bc6f129c |
172 | lib/DBIx/Class/CDBICompat |
974fe5e8 |
173 | |); |
174 | no_index package => $_ for (qw/ |
974fe5e8 |
175 | DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks |
176 | /); |
a410299d |
177 | |
269228af |
178 | |
713cc98e |
179 | WriteAll(); |
09d46657 |
180 | |
8057ed01 |
181 | |
80ff5ae0 |
182 | # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this) |
713cc98e |
183 | if ($Module::Install::AUTHOR) { |
713cc98e |
184 | |
8057ed01 |
185 | # FIXME test_requires is not yet part of META |
186 | my %original_build_requires = ( %$build_requires, %$test_requires ); |
187 | |
188 | print "Regenerating META with author requires excluded\n"; |
281738a4 |
189 | Meta->{values}{build_requires} = [ grep |
8057ed01 |
190 | { exists $original_build_requires{$_->[0]} } |
191 | ( @{Meta->{values}{build_requires}} ) |
80ff5ae0 |
192 | ]; |
713cc98e |
193 | |
713cc98e |
194 | Meta->write; |
09d46657 |
195 | } |