As stas pointed out in todo/release, since glue_pods is kinda broken right now,
why not simply use ExtUtils::MakeMaker to manify and install all pods in docs/api ?

--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.153
diff -u -I$Id -r1.153 Makefile.PL
--- Makefile.PL	6 Aug 2004 19:35:34 -0000	1.153
+++ Makefile.PL	10 Aug 2004 19:44:37 -0000
@@ -28,6 +28,7 @@
 use File::Spec::Functions;
 use DirHandle ();
 use File::Copy 'cp';
+use File::Find ();
 use File::Basename 'basename';
 
 use Apache::Build ();
@@ -70,6 +71,7 @@
     NO_META       => 1,
     ABSTRACT_FROM => 'lib/mod_perl.pm',
     EXE_FILES     => [EMAIL PROTECTED],
+    MAN1PODS      => find_pods(),
     DEFINE        => get_DEFINE(),
     macro         => {
         MODPERL_SRC        => $code->path,
@@ -109,6 +111,24 @@
         map { (/^DEFINE=(.*)/ && ($opt_define .= " $1")) ? undef : $_ } @ARGV;
 
     return $opt_define;
+}
+
+my $pods;
+#Find pods to manify under docs/api
+sub find_pods {
+    File::Find::find ( \&wanted_pods, catdir 'docs','api');
+    return $pods;
+
+    sub wanted_pods {
+        my $ext = qr/\.pod$/;
+        if (/$ext/) {
+            my ($filename, $path) = File::Basename::fileparse($File::Find::name, $ext);
+            my (undef, undef, @dirs) = File::Spec->splitdir($path); pop @dirs;
+            my $name = join '::', (@dirs, $filename);
+            my $man = catdir('blib','man3', $name.'.pm3');
+            $pods->{$File::Find::name} = $man;
+        }
+    }
 }
 
 sub configure {
Index: lib/ModPerl/BuildMM.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildMM.pm,v
retrieving revision 1.18
diff -u -I$Id -r1.18 BuildMM.pm
--- lib/ModPerl/BuildMM.pm	1 Aug 2004 19:44:00 -0000	1.18
+++ lib/ModPerl/BuildMM.pm	10 Aug 2004 19:44:37 -0000
@@ -121,7 +121,7 @@
 
     my $clean_files = (exists $args{clean} && exists $args{clean}{FILES}) ?
         $args{clean}{FILES} : '';
-    $clean_files .= " glue_pods"; # cleanup the dependency target
+
     $args{clean}{FILES} = $clean_files;
 
     ExtUtils::MakeMaker::WriteMakefile(@opts, %args);
@@ -170,73 +170,15 @@
     my $self = shift;
     my $string = $self->MM::top_targets;
 
-    ModPerl::MM::add_dep_after(\$string, "pure_all", pm_to_blib => 'glue_pods');
-
     return $string;
 }
 
 sub ModPerl::BuildMM::MY::postamble {
     my $self = shift;
+    my $string = $self->MM::postamble;
 
-    my $doc_root = catdir Cwd::getcwd(), "docs", "api";
-
-    my @targets = ();
-
-    # add the code to glue the existing pods to the .pm files in blib
-    my @target = ('glue_pods:');
-
-    if (-d $doc_root) {
-        while (my ($pm, $blib) = each %{$self->{PM}}) {
-            my $pod = catdir(
-                (splitdir($blib))[-2 .. -1]);
-            $pod =~ s/\.pm/\.pod/;
-            my $podpath = catfile $doc_root, $pod;
-            next unless -r $podpath;
-
-            push @target, 
-                '$(FULLPERL) -I$(INST_LIB) ' .
-                "-I$apache_test_dir -MModPerl::BuildMM " .
-                "-e ModPerl::BuildMM::glue_pod $pm $podpath $blib";
-        }
-
-        push @target, $self->{NOECHO} . '$(TOUCH) $@';
-    }
-    else {
-        # we don't have the docs sub-cvs repository extracted, skip
-        # the docs gluing
-        push @target, $self->{NOECHO} . '$(NOOP)';
-    }
-    push @targets, join "\n\t", @target;
-
-#    # next target: cleanup the dependency file
-#    @target = ('glue_pods_clean:');
-#    push @target, '$(RM_F) glue_pods';
-#    push @targets, join "\n\t", @target;
-
-    return join "\n\n", @targets, '';
-}
-
-sub glue_pod {
-
-    die "expecting 3 arguments: pm, pod, dst" unless @ARGV == 3;
-    my($pm, $pod, $dst) = @ARGV;
-
-    # have we already glued the doc?
-    exit 0 unless -s $pm == -s $dst;
+    return $string;
 
-    # ExtUtils::Install::pm_to_blib removes the 'w' perms, so we can't
-    # just append the doc there
-    my $orig_mode = (stat $dst)[2];
-    my $rw_mode   = 0666;
-
-    chmod $rw_mode, $dst      or die "Can't chmod $rw_mode $dst: $!";
-    open my $pod_fh, "<$pod"  or die "Can't open $pod: $!";
-    open my $dst_fh, ">>$dst" or die "Can't open $dst: $!";
-    print $dst_fh (<$pod_fh>);
-    close $pod_fh;
-    close $dst_fh;
-    # restore the perms
-    chmod $orig_mode, $dst    or die "Can't chmod $orig_mode $dst: $!";
 }
 
 sub ModPerl::BuildMM::MY::post_initialize {

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to