Skip to content

Commit

Permalink
Use rst2man.py for man page generation when available
Browse files Browse the repository at this point in the history
When docutils is installed on macos via pip or via homebrew there is no
`rst2man` binary but there is `rst2man.py` instead.

Signed-off-by: Dmitry Zhlobo <[email protected]>
  • Loading branch information
dzhlobo authored and spwhitton committed Oct 26, 2019
1 parent fcbe5f1 commit e89e09e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ install_v()
install_v git-remote-gcrypt "$DESTDIR$prefix/bin" 755

if command -v rst2man >/dev/null
then
rst2man='rst2man'
elif command -v rst2man.py >/dev/null # it is installed as rst2man.py on macOS
then
rst2man='rst2man.py'
fi

if [ -n "$rst2man" ]
then
trap 'rm -f git-remote-gcrypt.1.gz' EXIT
verbose rst2man ./README.rst | gzip -9 > git-remote-gcrypt.1.gz
verbose $rst2man ./README.rst | gzip -9 > git-remote-gcrypt.1.gz
install_v git-remote-gcrypt.1.gz "$DESTDIR$prefix/share/man/man1" 644
else
echo "'rst2man' not found, man page not installed" >&2
Expand Down

0 comments on commit e89e09e

Please sign in to comment.