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( File::Glob::bsd_glob('.generated_pod'), { verbose => 0 } )
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/*"), { verbose => 0 } );
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";
25 # this should always succeed - hence no error checking
26 # if someone breaks OptDeps - travis should catch it
27 require DBIx::Class::Optional::Dependencies;
28 DBIx::Class::Optional::Dependencies->_gen_pod ($ver, "$pod_dir/lib");
32 clonedir_generate_files : dbic_clonedir_gen_optdeps_pod
34 dbic_clonedir_gen_optdeps_pod :
36 $mm_proto->oneliner("DBIx::Class::Optional::Dependencies->_gen_pod(q($ver), q($pod_dir/lib))", [qw/-Ilib -MDBIx::Class::Optional::Dependencies/])
43 # generate the script/dbicadmin pod
45 print "Regenerating script/dbicadmin.pod\n";
47 # generating it in the root of $pod_dir
48 # it will *not* be copied over due to not being listed at the top
49 # of MANIFEST.SKIP - this is a *good* thing
50 # we only want to ship a script/dbicadmin, with the POD appended
51 # (see inject_dbicadmin_pod.pl), but still want to spellcheck and
52 # whatnot the intermediate step
53 my $pod_fn = "$pod_dir/dbicadmin.pod";
55 # if the author doesn't have the prereqs, don't fail the initial "perl Makefile.pl" step
58 local @ARGV = ('--documentation-as-pod', $pod_fn);
59 local $0 = 'dbicadmin';
60 local *CORE::GLOBAL::exit = sub { $great_success++; die; };
61 do 'script/dbicadmin';
63 if (!$great_success and ($@ || $!) ) {
64 printf ("FAILED!!! Subsequent `make dist` will fail. %s\n",
66 ? 'Full error: ' . ($@ || $!)
67 : 'Re-run with $ENV{DBICDIST_DEBUG} set for more info'
73 clonedir_generate_files : dbic_clonedir_gen_dbicadmin_pod
75 dbic_clonedir_gen_dbicadmin_pod :
76 \t\$(ABSPERLRUN) -Ilib -- script/dbicadmin --documentation-as-pod @{[ $mm_proto->quote_literal($pod_fn) ]}
82 # generate the inherit pods only during distbuilding phase
83 # it is too slow to do at regular Makefile.PL
87 clonedir_generate_files : dbic_clonedir_gen_inherit_pods
89 dbic_clonedir_gen_inherit_pods :
90 \t\$(ABSPERLRUN) -Ilib maint/gen_pod_inherit
96 # generate the DBIx/Class.pod only during distdir
98 my $dist_pod_fn = File::Spec->catfile($pod_dir, qw(lib DBIx Class.pod));
102 clonedir_generate_files : dbic_distdir_gen_dbic_pod
104 dbic_distdir_gen_dbic_pod :
106 \tperldoc -u lib/DBIx/Class.pm > $dist_pod_fn
107 \t@{[ $mm_proto->oneliner(
108 "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",
112 create_distdir : dbic_distdir_defang_authors
114 # Remove the maintainer-only warning (be nice ;)
115 dbic_distdir_defang_authors :
116 \t@{[ $mm_proto->oneliner('s/ ^ \s* \# \s* \*\*\* .+ \n ( ^ \s* \# \s*? \n )? //xmg', [qw( -0777 -p -i )] ) ]} \$(DISTVNAME)/AUTHORS
122 # on some OSes generated files may have an incorrect \n - fix it
123 # so that the xt tests pass on a fresh checkout (also shipping a
124 # dist with CRLFs is beyond obnoxious)
125 if ($^O eq 'MSWin32' or $^O eq 'cygwin') {
127 local $ENV{PERLIO} = 'unix';
128 system( $^X, qw( -MExtUtils::Command -e dos2unix -- ), $pod_dir );
133 clonedir_post_generate_files : pod_crlf_fixup
136 @{[ $crlf_fixup->($pod_dir) ]}
144 clonedir_post_generate_files : dbic_clonedir_copy_generated_pod
146 dbic_clonedir_copy_generated_pod :
147 \t\$(RM_F) $pod_dir.packlist
149 $mm_proto->oneliner("install([ from_to => {q($pod_dir) => File::Spec->curdir(), write => q($pod_dir.packlist)}, verbose => 0, uninstall_shadows => 0, skip => [] ])", ['-MExtUtils::Install'])
156 # everything that came from $pod_dir, needs to be removed from the workdir
160 clonedir_cleanup_generated_files : dbic_clonedir_cleanup_generated_pod_copies
162 dbic_clonedir_cleanup_generated_pod_copies :
163 \t@{[ $mm_proto->oneliner('chomp && unlink || die', ['-n']) ]} $pod_dir.packlist
164 \t\$(RM_F) $pod_dir.packlist
169 # keep the Makefile.PL eval happy