4 # leftovers in old checkouts
5 unlink 'lib/DBIx/Class/Optional/Dependencies.pod'
6 if -f 'lib/DBIx/Class/Optional/Dependencies.pod';
7 File::Path::rmtree([ '.generated_pod' ])
8 if -d '.generated_pod';
10 my $pod_dir = 'maint/.Generated_Pod';
11 my $ver = Meta->version;
13 # cleanup the generated pod dir (again - kill leftovers from old checkouts)
15 File::Path::rmtree([ File::Glob::bsd_glob("$pod_dir/*") ]);
18 mkdir $pod_dir or die "Unable to create $pod_dir: $!";
21 # generate the OptDeps pod both in the clone-dir and during the makefile distdir
23 print "Regenerating Optional/Dependencies.pod\n";
26 require DBIx::Class::Optional::Dependencies;
27 DBIx::Class::Optional::Dependencies->_gen_pod ($ver, "$pod_dir/lib");
31 printf ("FAILED!!! Subsequent `make dist` will fail. %s\n",
34 : 'Re-run with $ENV{DBICDIST_DEBUG} set for more info'
39 clonedir_generate_files : dbic_clonedir_gen_optdeps_pod
41 dbic_clonedir_gen_optdeps_pod :
43 $mm_proto->oneliner("DBIx::Class::Optional::Dependencies->_gen_pod(q($ver), q($pod_dir/lib))", [qw/-Ilib -MDBIx::Class::Optional::Dependencies/])
50 # generate the script/dbicadmin pod
52 print "Regenerating script/dbicadmin.pod\n";
54 # generating it in the root of $pod_dir
55 # it will *not* be copied over due to not being listed at the top
56 # of MANIFEST.SKIP - this is a *good* thing
57 # we only want to ship a script/dbicadmin, with the POD appended
58 # (see inject_dbicadmin_pod.pl), but still want to spellcheck and
59 # whatnot the intermediate step
60 my $pod_fn = "$pod_dir/dbicadmin.pod";
62 # if the author doesn't have the prereqs, don't fail the initial "perl Makefile.pl" step
65 local @ARGV = ('--documentation-as-pod', $pod_fn);
66 local $0 = 'dbicadmin';
67 local *CORE::GLOBAL::exit = sub { $great_success++; die; };
68 do 'script/dbicadmin';
70 if (!$great_success and ($@ || $!) ) {
71 printf ("FAILED!!! Subsequent `make dist` will fail. %s\n",
73 ? 'Full error: ' . ($@ || $!)
74 : 'Re-run with $ENV{DBICDIST_DEBUG} set for more info'
80 clonedir_generate_files : dbic_clonedir_gen_dbicadmin_pod
82 dbic_clonedir_gen_dbicadmin_pod :
83 \t\$(ABSPERLRUN) -Ilib -- script/dbicadmin --documentation-as-pod @{[ $mm_proto->quote_literal($pod_fn) ]}
89 # generate the inherit pods only during distbuilding phase
90 # it is too slow to do at regular Makefile.PL
94 clonedir_generate_files : dbic_clonedir_gen_inherit_pods
96 dbic_clonedir_gen_inherit_pods :
97 \t\$(ABSPERLRUN) -Ilib maint/gen_pod_inherit
103 # generate the DBIx/Class.pod only during distdir
105 my $dist_pod_fn = "$pod_dir/lib/DBIx/Class.pod";
109 clonedir_generate_files : dbic_distdir_gen_dbic_pod
111 dbic_distdir_gen_dbic_pod :
113 \tperldoc -u lib/DBIx/Class.pm > $dist_pod_fn
114 \t@{[ $mm_proto->oneliner(
115 "s!^.*?this line is replaced with the author list.*! qq{List of the awesome contributors who made DBIC v$ver possible\\n\\n} . qx(\$^X -Ilib maint/gen_pod_authors)!me",
116 [qw( -0777 -p -i.arghwin32 )]
118 \t\$(RM_F) $dist_pod_fn.arghwin32
120 create_distdir : dbic_distdir_defang_authors
122 # Remove the maintainer-only warning (be nice ;)
123 dbic_distdir_defang_authors :
124 \t@{[ $mm_proto->oneliner('s/ ^ \s* \# \s* \*\*\* .+ \n ( ^ \s* \# \s*? \n )? //xmg', [qw( -0777 -p -i.arghwin32 )] ) ]} \$(DISTVNAME)/AUTHORS
125 @{[ $crlf_fixup->( '$(DISTVNAME)/AUTHORS' ) ]}
126 \t\$(RM_F) \$(DISTVNAME)/AUTHORS.arghwin32
132 # on some OSes generated files may have an incorrect \n - fix it
133 # so that the xt tests pass on a fresh checkout (also shipping a
134 # dist with CRLFs is beyond obnoxious)
135 if ($^O eq 'MSWin32' or $^O eq 'cygwin') {
137 local $ENV{PERLIO} = 'unix';
138 system( $^X, qw( -MExtUtils::Command -e dos2unix -- ), $pod_dir );
143 clonedir_post_generate_files : pod_crlf_fixup
146 @{[ $crlf_fixup->($pod_dir) ]}
154 clonedir_post_generate_files : dbic_clonedir_copy_generated_pod
156 dbic_clonedir_copy_generated_pod :
157 \t\$(RM_F) $pod_dir.packlist
159 $mm_proto->oneliner("install([ from_to => {q($pod_dir) => './', write => q($pod_dir.packlist)}, verbose => 0, uninstall_shadows => 0, skip => [] ])", ['-MExtUtils::Install'])
166 # everything that came from $pod_dir, needs to be removed from the workdir
170 clonedir_cleanup_generated_files : dbic_clonedir_cleanup_generated_pod_copies
172 dbic_clonedir_cleanup_generated_pod_copies :
173 \t@{[ $mm_proto->oneliner('chomp && unlink || die', ['-n']) ]} $pod_dir.packlist
174 \t\$(RM_F) $pod_dir.packlist
179 # keep the Makefile.PL eval happy