doc: Allow rst2man.py as an alternative to rst2man
authorW. Trevor King <wking@tremily.us>
Sat, 5 Apr 2014 17:04:22 +0000 (10:04 -0700)
committerW. Trevor King <wking@tremily.us>
Sat, 10 May 2014 16:49:23 +0000 (09:49 -0700)
commitc8b019cf95243e4b47780a19d0bfca5b65c79ecb
tree6dfb07f60c1c88801504b231edd8c0565d52f530
parent7d81d700426a76a1ccec107ea2c95d8c47d31465
doc: Allow rst2man.py as an alternative to rst2man

Gentoo's dev-python/docutils-0.10 installs Docutils scripts with a
*.py extension, so I have /usr/bin/rst2man.py and no rst2man script.
This patch supports users with both types of systems by checking for
rst2man, falling back on rst2man.py, and giving up only if neither is
found.  Users can also set the new RST2MAN path variable explicitly
when they call Make:

  make RST2MAN=/my/custom/rst_to_man_converter build-man

I use POSIX's 'command -v' [1] to find the path to rst2man or
rst2man.py, and save that as RST2MAN in Makefile.config.  Then pass
the configured RST2MAN path through to prerst2man.py to use in its
system call.

We can use a non-empty RST2MAN to check for the availability of an
rst2man program, so there's no need for a separate HAVE_RST2MAN.
However, we keep the existing HAVE_RST2MAN for consistency with
HAVE_SPHINX.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
configure
doc/Makefile.local
doc/prerst2man.py