Use rst2man.py for man page generation when available
authorDmitry Zhlobo <dima.zhlobo@gmail.com>
Thu, 22 Aug 2019 17:52:15 +0000 (20:52 +0300)
committerSean Whitton <spwhitton@spwhitton.name>
Sat, 26 Oct 2019 17:58:56 +0000 (10:58 -0700)
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 <dima.zhlobo@gmail.com>
install.sh

index d84f31ec116721915d2e054faafee67dbf3a0e27..7fc1cfcf4cb4440d0da8c30e5cc593cd7ed675eb 100755 (executable)
@@ -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