1 use inc::Module::Install 0.93;
9 use lib "$FindBin::Bin/lib";
11 # adjust ENV for $AUTHOR system() calls
13 $ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
15 use Getopt::Long qw/:config gnu_getopt bundling_override no_ignore_case pass_through/;
17 skip_author_deps => undef,
19 GetOptions ($args, 'skip_author_deps');
21 warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
25 ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends()
26 ### All of them should go to DBIx::Class::Optional::Dependencies
30 perl_version '5.008001';
31 all_from 'lib/DBIx/Class.pm';
33 my $build_requires = {
34 'DBD::SQLite' => '1.25',
38 'File::Temp' => '0.22',
39 'Test::Builder' => '0.33',
40 'Test::Exception' => '0',
41 'Test::More' => '0.92',
42 'Test::Warn' => '0.21',
45 my $runtime_requires = {
46 'Carp::Clan' => '6.0',
47 'Class::Accessor::Grouped' => '0.09003',
48 'Class::C3::Componentised' => '1.0005',
49 'Class::Inspector' => '1.24',
50 'Data::Page' => '2.00',
52 'MRO::Compat' => '0.09',
53 'Module::Find' => '0.06',
54 'Path::Class' => '0.18',
55 'SQL::Abstract' => '1.67',
56 'SQL::Abstract::Limit' => '0.13',
57 'Sub::Name' => '0.04',
58 'Data::Dumper::Concise' => '1.000',
59 'Scope::Guard' => '0.03',
60 'Context::Preserve' => '0.01',
61 'Try::Tiny' => '0.04',
62 'namespace::clean' => '0.14',
65 # this is so we can order requires alphabetically
66 # copies are needed for author requires injection
68 build_requires => { %$build_requires },
69 requires => { %$runtime_requires },
70 test_requires => { %$test_requires },
74 # require extra modules for testing if we're in a checkout
76 if ($Module::Install::AUTHOR) {
77 if ($args->{skip_author_deps}) {
78 $optdep_msg = <<'EOW';
80 ******************************************************************************
81 ******************************************************************************
83 *** IGNORING AUTHOR MODE: no optional test dependencies will be forced. ***
85 *** If you are using this checkout with the intention of submitting a DBIC ***
86 *** patch, you are *STRONGLY ENCOURAGED* to install all dependencies, so ***
87 *** that every possible unit-test will run. ***
89 ******************************************************************************
90 ******************************************************************************
95 $optdep_msg = <<'EOW';
97 ******************************************************************************
98 ******************************************************************************
100 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
101 *** ( to disabled re-run Makefile.PL with --skip_author_deps ) ***
103 ******************************************************************************
104 ******************************************************************************
108 require DBIx::Class::Optional::Dependencies;
109 $reqs->{test_requires} = {
110 %{$reqs->{test_requires}},
111 map { %$_ } (values %{DBIx::Class::Optional::Dependencies->req_group_list}),
116 # compose final req list, for alphabetical ordering
118 for my $rtype (keys %$reqs) {
119 for my $mod (keys %{$reqs->{$rtype}} ) {
121 # sanity check req duplications
122 if ($final_req{$mod}) {
123 die "$mod specified as both a '$rtype' and a '$final_req{$mod}[0]'\n";
126 $final_req{$mod} = [ $rtype, $reqs->{$rtype}{$mod}||0 ],
131 for my $mod (sort keys %final_req) {
132 my ($rtype, $ver) = @{$final_req{$mod}};
134 $rtype->($mod, $ver);
137 # output twice since the deplist is > 70 lines
142 # re-create various autogenerated documentation bits
143 if ($Module::Install::AUTHOR) {
145 print "Regenerating README\n";
146 system('pod2text lib/DBIx/Class.pm > README');
149 print "Removing MANIFEST\n";
153 print "Regenerating Optional/Dependencies.pod\n";
154 require DBIx::Class::Optional::Dependencies;
155 DBIx::Class::Optional::Dependencies->_gen_pod;
157 # FIXME Disabled due to unsolved issues, ask theorbtwo
158 # require Module::Install::Pod::Inherit;
171 ### Mangle makefile - read the comments for more info
175 # This will add an extra dep-spec for the distdir target,
176 # which `make` will fold together in a first-come first-serve
177 # fashion. What we do here is essentially adding extra
178 # commands to execute once the distdir is assembled (via
179 # create_distdir), but before control is returned to a higher
181 distdir : dbicadmin_pod_inject
183 # The pod self-injection code is in fact a hidden option in
185 dbicadmin_pod_inject :
186 \tcd \$(DISTVNAME) && \$(ABSPERL) -Ilib script/dbicadmin --selfinject-pod
188 # Regenerate manifest before running create_distdir.
189 create_distdir : manifest
195 resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
196 resources 'license' => 'http://dev.perl.org/licenses/';
197 resources 'repository' => 'git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git';
198 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
200 # Deprecated/internal modules need no exposure
201 no_index directory => $_ for (qw|
203 lib/DBIx/Class/SQLAHacks
204 lib/DBIx/Class/PK/Auto
205 lib/DBIx/Class/CDBICompat
207 no_index package => $_ for (qw/
208 DBIx::Class::SQLAHacks DBIx::Class::Storage::DBIHacks
215 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
216 if ($Module::Install::AUTHOR && ! $args->{skip_author_deps} ) {
218 # FIXME test_requires is not yet part of META
219 my %original_build_requires = ( %$build_requires, %$test_requires );
221 print "Regenerating META with author requires excluded\n";
222 Meta->{values}{build_requires} = [ grep
223 { exists $original_build_requires{$_->[0]} }
224 ( @{Meta->{values}{build_requires}} )