Home | History | Annotate | Line # | Download | only in doc
      1  1.1  christos SUBDIRS = man1
      2  1.1  christos 
      3  1.1  christos {-
      4  1.1  christos  use File::Spec::Functions qw(:DEFAULT abs2rel rel2abs);
      5  1.1  christos  use File::Basename;
      6  1.1  christos 
      7  1.1  christos  my $sourcedir = catdir($config{sourcedir}, 'doc');
      8  1.1  christos 
      9  1.1  christos  foreach my $section ((1, 3, 5, 7)) {
     10  1.1  christos      my @imagefiles = ();
     11  1.1  christos      my @htmlfiles = ();
     12  1.1  christos      my @manfiles = ();
     13  1.1  christos      my %pngfiles =
     14  1.1  christos          map { $_ => 1 } glob catfile($sourcedir, "man$section", "img", "*.png");
     15  1.1  christos      my %podfiles =
     16  1.1  christos          map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod");
     17  1.1  christos      my %podinfiles =
     18  1.1  christos          map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod.in");
     19  1.1  christos 
     20  1.1  christos      foreach (keys %podinfiles) {
     21  1.1  christos          (my $p = $_) =~ s|\.in$||i;
     22  1.1  christos          $podfiles{$p} = 1;
     23  1.1  christos      }
     24  1.1  christos 
     25  1.1  christos      foreach my $p (sort keys %podfiles) {
     26  1.1  christos          my $podfile = abs2rel($p, $sourcedir);
     27  1.1  christos          my $podname = basename($podfile, '.pod');
     28  1.1  christos          my $podinfile = $podinfiles{"$p.in"} ? "$podfile.in" : undef;
     29  1.1  christos 
     30  1.1  christos          my $podname = basename($podfile, ".pod");
     31  1.1  christos 
     32  1.1  christos          my $htmlfile = abs2rel(catfile($buildtop, "doc", "html", "man$section",
     33  1.1  christos                                         "$podname.html"),
     34  1.1  christos                                 catdir($buildtop, "doc"));
     35  1.1  christos          my $manfile = abs2rel(catfile($buildtop, "doc", "man", "man$section",
     36  1.1  christos                                        "$podname.$section"),
     37  1.1  christos                                catdir($buildtop, "doc"));
     38  1.1  christos 
     39  1.1  christos          # The build.info format requires file specs to be in Unix format.
     40  1.1  christos          # Especially, since VMS file specs use [ and ], the build.info parser
     41  1.1  christos          # will otherwise get terribly confused.
     42  1.1  christos          if ($^O eq 'VMS') {
     43  1.1  christos              $htmlfile = VMS::Filespec::unixify($htmlfile);
     44  1.1  christos              $manfile = VMS::Filespec::unixify($manfile);
     45  1.1  christos              $podfile = VMS::Filespec::unixify($podfile);
     46  1.1  christos              $podinfile = VMS::Filespec::unixify($podinfile)
     47  1.1  christos                  if defined $podinfile;
     48  1.1  christos          } elsif ($^O eq 'MSWin32') {
     49  1.1  christos              $htmlfile =~ s|\\|/|g;
     50  1.1  christos              $manfile =~ s|\\|/|g;
     51  1.1  christos              $podfile =~ s|\\|/|g;
     52  1.1  christos              $podinfile =~ s|\\|/|g
     53  1.1  christos                  if defined $podinfile;
     54  1.1  christos          }
     55  1.1  christos          push @htmlfiles, $htmlfile;
     56  1.1  christos          push @manfiles, $manfile;
     57  1.1  christos          $OUT .= << "_____";
     58  1.1  christos DEPEND[$htmlfile]=$podfile
     59  1.1  christos GENERATE[$htmlfile]=$podfile
     60  1.1  christos DEPEND[$manfile]=$podfile
     61  1.1  christos GENERATE[$manfile]=$podfile
     62  1.1  christos _____
     63  1.1  christos          $OUT .= << "_____" if $podinfile;
     64  1.1  christos DEPEND[$podfile]{pod}=$podinfile
     65  1.1  christos GENERATE[$podfile]=$podinfile
     66  1.1  christos _____
     67  1.1  christos      }
     68  1.1  christos 
     69  1.1  christos      foreach my $p (sort keys %pngfiles) {
     70  1.1  christos          my $relpath = abs2rel($p, $sourcedir);
     71  1.1  christos          my $imagefile = abs2rel(catfile($buildtop, "doc", "$relpath"),
     72  1.1  christos                                  catdir($buildtop, "doc"));
     73  1.1  christos          push @imagefiles, $imagefile;
     74  1.1  christos      }
     75  1.1  christos 
     76  1.1  christos      $OUT .= "IMAGEDOCS[man$section]=" . join(" \\\n", @imagefiles) . "\n";
     77  1.1  christos      $OUT .= "HTMLDOCS[man$section]=" . join(" \\\n", @htmlfiles) . "\n";
     78  1.1  christos      $OUT .= "MANDOCS[man$section]=" . join(" \\\n", @manfiles) . "\n";
     79  1.1  christos  }
     80  1.1  christos  -}
     81