Commit c70573de authored by Richard Levitte's avatar Richard Levitte
Browse files

Apparently, there are still chances we have to deal with buggy pod2man versions.

Deal with that by testing any available pod2man and using it if appropriate,
and falling back to util/pod2man.pl if none was found.
parent 6c98ed52
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -733,8 +733,9 @@ install_docs:
		if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
		echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
		(cd `dirname $$i`; \
		pod2man --section=$$sec --center=OpenSSL \
			--release=$(VERSION) `basename $$i`) \
		sh -c "`cd ../../util; ./pod2mantest ignore` \
			--section=$$sec --center=OpenSSL \
			--release=$(VERSION) `basename $$i`") \
			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
	done
	@for i in doc/crypto/*.pod doc/ssl/*.pod; do \
@@ -742,8 +743,9 @@ install_docs:
		if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
		echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
		(cd `dirname $$i`; \
		pod2man --section=$$sec --center=OpenSSL \
			--release=$(VERSION) `basename $$i`) \
		sh -c "`cd ../../util; ./pod2mantest ignore` \
			--section=$$sec --center=OpenSSL \
			--release=$(VERSION) `basename $$i`") \
			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
	done

util/pod2man.pl

0 → 100755
+1183 −0

File added.

Preview size limit exceeded, changes collapsed.

util/pod2mantest

0 → 100755
+53 −0
Original line number Diff line number Diff line
#!/bin/sh

# This script is used by test/Makefile.ssl to check whether a sane 'pod2man'
# is installed.
# ('make install' should not try to run 'pod2man' if it does not exist or if
# it is a broken 'pod2man' version that is known to cause trouble. if we find
# the system 'pod2man' to be broken, we use our own copy instead)
#
# In any case, output an appropriate command line for running (or not
# running) pod2man.


IFS=:
try_without_dir=true
# First we try "pod2man", then "$dir/pod2man" for each item in $PATH.
for dir in dummy:$PATH; do
    if [ "$try_without_dir" = true ]; then
      # first iteration
      pod2man=pod2man
      try_without_dir=false
    else
      # second and later iterations
      pod2man="$dir/pod2man"
      if [ ! -f "$pod2man" ]; then  # '-x' is not available on Ultrix
        pod2man=''
      fi
    fi

    if [ ! "$pod2man" = '' ]; then
        failure=none


	if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | grep '^MARKER - ' >/dev/null 2>&1; then
	    failure=MultilineTest
	fi


        if [ "$failure" = none ]; then
            echo "$pod2man"
            exit 0
        fi

        echo "$pod2man does not work properly ('$failure' failed).  Looking for another pod2man ..." >&2
    fi
done

echo "No working pod2man found.  Consider installing a new version." >&2
if [ "$1" = ignore ]; then
  echo "As a workaround, we'll use a bundled old copy of pod2man.pl." >&2
  echo "util/pod2man.pl"
  exit 0
fi
exit 1

util/pod2mantest.pod

0 → 100644
+15 −0
Original line number Diff line number Diff line
=pod

=head1 NAME

foo, bar,
MARKER - test of multiline name section

=head1 DESCRIPTION

This is a test .pod file to see if we have a buggy pod2man or not.
If we have a buggy implementation, we will get a line matching the
regular expression "^ +MARKER - test of multiline name section *$"
at the end of the resulting document.

=cut