Pull in the podToHtml.pl script and rules from 3.15

This lets src/cap5 build with Perl installations that lack Perl's
podchecker and pod2html scripts (e.g. Fedora 27).
This commit is contained in:
Andrew Johnson
2018-03-14 14:12:12 -05:00
parent ac4d5c95ac
commit ceaff61c09
5 changed files with 64 additions and 4 deletions

View File

@@ -301,6 +301,20 @@ $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file))))
.PRECIOUS: $(COMMON_DBDS) $(COMMON_DIR)/%Include.dbd
##################################################### HTML files
$(COMMON_DIR)/%.html: %.pm $(TOOLS)/podToHtml.pl
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.html: ../%.pm $(TOOLS)/podToHtml.pl
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
.PRECIOUS: $(COMMON_DIR)/%.html %.html
##################################################### DB files
$(COMMON_DIR)/%.db$(RAW): $(COMMON_DIR)/%.edf

View File

@@ -500,6 +500,10 @@ $(INSTALL_HTML)/$(HTMLS_DIR)/%: ../%
$(ECHO) "Installing html $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_HTML)/$(HTMLS_DIR)/%: $(COMMON_DIR)/%
$(ECHO) "Installing generated html $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_TEMPLATES_SUBDIR)/%: ../%
$(ECHO) "Installing $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)

View File

@@ -66,10 +66,6 @@ ifdef T_A
$(RM) $@ $@_new
$(PERL) $(XSUBPP) -typemap $(EXTUTILS)/typemap $< > $@_new && $(MV) $@_new $@
%.html: ../%.pm
$(RM) $@
podchecker $< && pod2html --infile=$< --outfile=$@
$(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH)/%: %
$(ECHO) "Installing loadable shared library $@"
@$(INSTALL_LIBRARY) -d -m $(LIB_PERMISSIONS) $< $(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH)

View File

@@ -28,6 +28,7 @@ PERL_SCRIPTS += makeMakefile.pl
PERL_SCRIPTS += makeTestfile.pl
PERL_SCRIPTS += mkmf.pl
PERL_SCRIPTS += munch.pl
PERL_SCRIPTS += podToHtml.pl
PERL_SCRIPTS += replaceVAR.pl
PERL_SCRIPTS += tap-to-junit-xml.pl
PERL_SCRIPTS += useManifestTool.pl

45
src/tools/podToHtml.pl Normal file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
use strict;
use warnings;
use Getopt::Std;
use Pod::Simple::HTML;
our ($opt_o);
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
&HELP_MESSAGE if !getopts('o:') || @ARGV != 1;
my $infile = shift @ARGV;
if (!$opt_o) {
($opt_o = $infile) =~ s/\. \w+ $/.html/x;
$opt_o =~ s/^.*\///;
}
open my $out, '>', $opt_o or
die "Can't create $opt_o: $!\n";
my $podHtml = Pod::Simple::HTML->new();
$podHtml->html_css('style.css');
$podHtml->perldoc_url_prefix('');
$podHtml->perldoc_url_postfix('.html');
$podHtml->set_source($infile);
$podHtml->output_string(\my $html);
$podHtml->run;
print $out $html;
close $out;
sub HELP_MESSAGE {
print STDERR "Usage: podToHtml.pl [-o file.html] file.pod\n";
exit 2;
}