libtiff: doc: Add Sphinx conversion of all manpages

From 7faec51e2b294bce43570dc426b07b7db34e1668 Mon Sep 17 00:00:00 2001
From: Roger Leigh <[EMAIL REDACTED]>
Date: Sat, 11 Jun 2022 15:51:25 +0100
Subject: [PATCH] doc: Add Sphinx conversion of all manpages

---
 CMakeLists.txt                                |    1 -
 Makefile.am                                   |    4 +-
 cmake/Sphinx.cmake                            |   17 +-
 cmake/list-manpage-dependencies.py            |   19 +-
 cmake/list-manpages.py                        |   20 +-
 configure.ac                                  |   30 +-
 doc/CMakeLists.txt                            |  101 +-
 doc/HtmlDoc.cmake                             |   52 -
 doc/Makefile.am                               |  265 +-
 doc/conf.py                                   |   77 +
 doc/functions.rst                             |   51 +
 doc/functions/TIFFClose.rst                   |   35 +
 doc/functions/TIFFDataWidth.rst               |   44 +
 doc/functions/TIFFError.rst                   |   42 +
 doc/functions/TIFFFieldDataType.rst           |   30 +
 doc/functions/TIFFFieldName.rst               |   30 +
 doc/functions/TIFFFieldPassCount.rst          |   40 +
 doc/functions/TIFFFieldReadCount.rst          |   42 +
 doc/functions/TIFFFieldTag.rst                |   33 +
 doc/functions/TIFFFieldWriteCount.rst         |   48 +
 doc/functions/TIFFFlush.rst                   |   50 +
 doc/functions/TIFFGetField.rst                |  490 +++
 doc/functions/TIFFOpen.rst                    |  250 ++
 doc/functions/TIFFPrintDirectory.rst          |   58 +
 doc/functions/TIFFRGBAImage.rst               |  235 ++
 doc/functions/TIFFReadDirectory.rst           |  143 +
 doc/functions/TIFFReadEncodedStrip.rst        |   56 +
 doc/functions/TIFFReadEncodedTile.rst         |   56 +
 doc/functions/TIFFReadRGBAImage.rst           |  171 +
 doc/functions/TIFFReadRGBAStrip.rst           |  134 +
 doc/functions/TIFFReadRGBATile.rst            |  136 +
 doc/functions/TIFFReadRawStrip.rst            |   43 +
 doc/functions/TIFFReadRawTile.rst             |   45 +
 doc/functions/TIFFReadScanline.rst            |   75 +
 doc/functions/TIFFReadTile.rst                |   58 +
 doc/functions/TIFFSetDirectory.rst            |   58 +
 doc/functions/TIFFSetField.rst                |  397 +++
 doc/functions/TIFFWarning.rst                 |   47 +
 doc/functions/TIFFWriteDirectory.rst          |  121 +
 doc/functions/TIFFWriteEncodedStrip.rst       |   80 +
 doc/functions/TIFFWriteEncodedTile.rst        |   76 +
 doc/functions/TIFFWriteRawStrip.rst           |   75 +
 doc/functions/TIFFWriteRawTile.rst            |   66 +
 doc/functions/TIFFWriteScanline.rst           |  124 +
 doc/functions/TIFFWriteTile.rst               |   52 +
 doc/functions/TIFFbuffer.rst                  |   57 +
 doc/functions/TIFFcodec.rst                   |   56 +
 doc/functions/TIFFcolor.rst                   |  211 ++
 doc/functions/TIFFmemory.rst                  |   53 +
 doc/functions/TIFFquery.rst                   |   95 +
 doc/functions/TIFFsize.rst                    |   39 +
 doc/functions/TIFFstrip.rst                   |   69 +
 doc/functions/TIFFswab.rst                    |   51 +
 doc/functions/TIFFtile.rst                    |   81 +
 doc/functions/libtiff.rst                     |  916 +++++
 doc/index.rst                                 |    2 +-
 doc/manpages.rst                              |   67 -
 doc/static/man/TIFFClose.3tiff.html           |   87 -
 doc/static/man/TIFFDataWidth.3tiff.html       |   96 -
 doc/static/man/TIFFError.3tiff.html           |  107 -
 doc/static/man/TIFFFieldDataType.3tiff.html   |   89 -
 doc/static/man/TIFFFieldName.3tiff.html       |   86 -
 doc/static/man/TIFFFieldPassCount.3tiff.html  |   98 -
 doc/static/man/TIFFFieldReadCount.3tiff.html  |  101 -
 doc/static/man/TIFFFieldTag.3tiff.html        |   88 -
 doc/static/man/TIFFFieldWriteCount.3tiff.html |  108 -
 doc/static/man/TIFFFlush.3tiff.html           |  108 -
 doc/static/man/TIFFGetField.3tiff.html        | 1953 -----------
 doc/static/man/TIFFOpen.3tiff.html            |  452 ---
 doc/static/man/TIFFPrintDirectory.3tiff.html  |  233 --
 doc/static/man/TIFFRGBAImage.3tiff.html       |  319 --
 doc/static/man/TIFFReadDirectory.3tiff.html   |  217 --
 .../man/TIFFReadEncodedStrip.3tiff.html       |  125 -
 doc/static/man/TIFFReadEncodedTile.3tiff.html |  125 -
 doc/static/man/TIFFReadRGBAImage.3tiff.html   |  258 --
 doc/static/man/TIFFReadRGBAStrip.3tiff.html   |  217 --
 doc/static/man/TIFFReadRGBATile.3tiff.html    |  263 --
 doc/static/man/TIFFReadRawStrip.3tiff.html    |  105 -
 doc/static/man/TIFFReadRawTile.3tiff.html     |  107 -
 doc/static/man/TIFFReadScanline.3tiff.html    |  149 -
 doc/static/man/TIFFReadTile.3tiff.html        |  124 -
 doc/static/man/TIFFSetDirectory.3tiff.html    |  120 -
 doc/static/man/TIFFSetField.3tiff.html        | 1865 ----------
 doc/static/man/TIFFWarning.3tiff.html         |  111 -
 doc/static/man/TIFFWriteDirectory.3tiff.html  |  184 -
 .../man/TIFFWriteEncodedStrip.3tiff.html      |  147 -
 .../man/TIFFWriteEncodedTile.3tiff.html       |  142 -
 doc/static/man/TIFFWriteRawStrip.3tiff.html   |  140 -
 doc/static/man/TIFFWriteRawTile.3tiff.html    |  127 -
 doc/static/man/TIFFWriteScanline.3tiff.html   |  203 --
 doc/static/man/TIFFWriteTile.3tiff.html       |  110 -
 doc/static/man/TIFFbuffer.3tiff.html          |  118 -
 doc/static/man/TIFFcodec.3tiff.html           |  118 -
 doc/static/man/TIFFcolor.3tiff.html           |  827 -----
 doc/static/man/TIFFmemory.3tiff.html          |  110 -
 doc/static/man/TIFFquery.3tiff.html           |  160 -
 doc/static/man/TIFFsize.3tiff.html            |   92 -
 doc/static/man/TIFFstrip.3tiff.html           |  136 -
 doc/static/man/TIFFswab.3tiff.html            |  110 -
 doc/static/man/TIFFtile.3tiff.html            |  148 -
 doc/static/man/fax2ps.1.html                  |  224 --
 doc/static/man/fax2tiff.1.html                |  573 ---
 doc/static/man/libtiff.3tiff.html             | 3099 -----------------
 doc/static/man/pal2rgb.1.html                 |  168 -
 doc/static/man/ppm2tiff.1.html                |  142 -
 doc/static/man/raw2tiff.1.html                |  487 ---
 doc/static/man/rgb2ycbcr.1.html               |  155 -
 doc/static/man/thumbnail.1.html               |  148 -
 doc/static/man/tiff2bw.1.html                 |  153 -
 doc/static/man/tiff2pdf.1.html                |  419 ---
 doc/static/man/tiff2ps.1.html                 |  544 ---
 doc/static/man/tiff2rgba.1.html               |  165 -
 doc/static/man/tiffcmp.1.html                 |  144 -
 doc/static/man/tiffcp.1.html                  |  474 ---
 doc/static/man/tiffcrop.1.html                |  868 -----
 doc/static/man/tiffdither.1.html              |  188 -
 doc/static/man/tiffdump.1.html                |  128 -
 doc/static/man/tiffgt.1.html                  |  496 ---
 doc/static/man/tiffinfo.1.html                |  185 -
 doc/static/man/tiffmedian.1.html              |  174 -
 doc/static/man/tiffset.1.html                 |  141 -
 doc/static/man/tiffsplit.1.html               |  134 -
 doc/tools.rst                                 |   71 +-
 doc/tools/fax2ps.rst                          |  129 +
 doc/tools/fax2tiff.rst                        |  246 ++
 doc/tools/pal2rgb.rst                         |   80 +
 doc/tools/ppm2tiff.rst                        |   56 +
 doc/tools/raw2tiff.rst                        |  143 +
 doc/tools/rgb2ycbcr.rst                       |   63 +
 doc/tools/thumbnail.rst                       |   66 +
 doc/tools/tiff2bw.rst                         |   60 +
 doc/tools/tiff2pdf.rst                        |  211 ++
 doc/tools/tiff2ps.rst                         |  251 ++
 doc/tools/tiff2rgba.rst                       |   72 +
 doc/tools/tiffcmp.rst                         |   59 +
 doc/tools/tiffcp.rst                          |  255 ++
 doc/tools/tiffcrop.rst                        |  539 +++
 doc/tools/tiffdither.rst                      |   93 +
 doc/tools/tiffdump.rst                        |   52 +
 doc/tools/tiffgt.rst                          |  186 +
 doc/tools/tiffinfo.rst                        |   65 +
 doc/tools/tiffmedian.rst                      |   73 +
 doc/tools/tiffset.rst                         |   82 +
 doc/tools/tiffsplit.rst                       |   52 +
 man/CMakeLists.txt                            |   95 -
 man/Makefile.am                               |  102 -
 man/TIFFClose.3tiff                           |   52 -
 man/TIFFDataWidth.3tiff                       |   73 -
 man/TIFFError.3tiff                           |   68 -
 man/TIFFFieldDataType.3tiff                   |   52 -
 man/TIFFFieldName.3tiff                       |   51 -
 man/TIFFFieldPassCount.3tiff                  |   72 -
 man/TIFFFieldReadCount.3tiff                  |   76 -
 man/TIFFFieldTag.3tiff                        |   55 -
 man/TIFFFieldWriteCount.3tiff                 |   87 -
 man/TIFFFlush.3tiff                           |   63 -
 man/TIFFGetField.3tiff                        |  228 --
 man/TIFFOpen.3tiff                            |  293 --
 man/TIFFPrintDirectory.3tiff                  |   69 -
 man/TIFFRGBAImage.3tiff                       |  285 --
 man/TIFFReadDirectory.3tiff                   |  163 -
 man/TIFFReadEncodedStrip.3tiff                |   77 -
 man/TIFFReadEncodedTile.3tiff                 |   75 -
 man/TIFFReadRGBAImage.3tiff                   |  217 --
 man/TIFFReadRGBAStrip.3tiff                   |  169 -
 man/TIFFReadRGBATile.3tiff                    |  170 -
 man/TIFFReadRawStrip.3tiff                    |   63 -
 man/TIFFReadRawTile.3tiff                     |   64 -
 man/TIFFReadScanline.3tiff                    |   93 -
 man/TIFFReadTile.3tiff                        |   83 -
 man/TIFFSetDirectory.3tiff                    |   78 -
 man/TIFFSetField.3tiff                        |  216 --
 man/TIFFWarning.3tiff                         |   69 -
 man/TIFFWriteDirectory.3tiff                  |  137 -
 man/TIFFWriteEncodedStrip.3tiff               |  101 -
 man/TIFFWriteEncodedTile.3tiff                |   95 -
 man/TIFFWriteRawStrip.3tiff                   |   95 -
 man/TIFFWriteRawTile.3tiff                    |   83 -
 man/TIFFWriteScanline.3tiff                   |  153 -
 man/TIFFWriteTile.3tiff                       |   76 -
 man/TIFFbuffer.3tiff                          |   76 -
 man/TIFFcodec.3tiff                           |   81 -
 man/TIFFcolor.3tiff                           |  267 --
 man/TIFFmemory.3tiff                          |   89 -
 man/TIFFquery.3tiff                           |  141 -
 man/TIFFsize.3tiff                            |   58 -
 man/TIFFstrip.3tiff                           |   98 -
 man/TIFFswab.3tiff                            |   79 -
 man/TIFFtile.3tiff                            |  130 -
 man/fax2ps.1                                  |  158 -
 man/fax2tiff.1                                |  285 --
 man/libtiff.3tiff                             |  544 ---
 man/pal2rgb.1                                 |  110 -
 man/ppm2tiff.1                                |  104 -
 man/raw2tiff.1                                |  195 --
 man/rgb2ycbcr.1                               |   98 -
 man/thumbnail.1                               |   89 -
 man/tiff2bw.1                                 |   93 -
 man/tiff2pdf.1                                |  256 --
 man/tiff2ps.1                                 |  297 --
 man/tiff2rgba.1                               |  100 -
 man/tiffcmp.1                                 |   86 -
 man/tiffcp.1                                  |  331 --
 man/tiffcrop.1                                |  574 ---
 man/tiffdither.1                              |  134 -
 man/tiffdump.1                                |   80 -
 man/tiffgt.1                                  |  244 --
 man/tiffinfo.1                                |   87 -
 man/tiffmedian.1                              |  111 -
 man/tiffset.1                                 |   98 -
 man/tiffsplit.1                               |   80 -
 211 files changed, 8340 insertions(+), 29301 deletions(-)
 delete mode 100644 doc/HtmlDoc.cmake
 create mode 100644 doc/functions.rst
 create mode 100644 doc/functions/TIFFClose.rst
 create mode 100644 doc/functions/TIFFDataWidth.rst
 create mode 100644 doc/functions/TIFFError.rst
 create mode 100644 doc/functions/TIFFFieldDataType.rst
 create mode 100644 doc/functions/TIFFFieldName.rst
 create mode 100644 doc/functions/TIFFFieldPassCount.rst
 create mode 100644 doc/functions/TIFFFieldReadCount.rst
 create mode 100644 doc/functions/TIFFFieldTag.rst
 create mode 100644 doc/functions/TIFFFieldWriteCount.rst
 create mode 100644 doc/functions/TIFFFlush.rst
 create mode 100644 doc/functions/TIFFGetField.rst
 create mode 100644 doc/functions/TIFFOpen.rst
 create mode 100644 doc/functions/TIFFPrintDirectory.rst
 create mode 100644 doc/functions/TIFFRGBAImage.rst
 create mode 100644 doc/functions/TIFFReadDirectory.rst
 create mode 100644 doc/functions/TIFFReadEncodedStrip.rst
 create mode 100644 doc/functions/TIFFReadEncodedTile.rst
 create mode 100644 doc/functions/TIFFReadRGBAImage.rst
 create mode 100644 doc/functions/TIFFReadRGBAStrip.rst
 create mode 100644 doc/functions/TIFFReadRGBATile.rst
 create mode 100644 doc/functions/TIFFReadRawStrip.rst
 create mode 100644 doc/functions/TIFFReadRawTile.rst
 create mode 100644 doc/functions/TIFFReadScanline.rst
 create mode 100644 doc/functions/TIFFReadTile.rst
 create mode 100644 doc/functions/TIFFSetDirectory.rst
 create mode 100644 doc/functions/TIFFSetField.rst
 create mode 100644 doc/functions/TIFFWarning.rst
 create mode 100644 doc/functions/TIFFWriteDirectory.rst
 create mode 100644 doc/functions/TIFFWriteEncodedStrip.rst
 create mode 100644 doc/functions/TIFFWriteEncodedTile.rst
 create mode 100644 doc/functions/TIFFWriteRawStrip.rst
 create mode 100644 doc/functions/TIFFWriteRawTile.rst
 create mode 100644 doc/functions/TIFFWriteScanline.rst
 create mode 100644 doc/functions/TIFFWriteTile.rst
 create mode 100644 doc/functions/TIFFbuffer.rst
 create mode 100644 doc/functions/TIFFcodec.rst
 create mode 100644 doc/functions/TIFFcolor.rst
 create mode 100644 doc/functions/TIFFmemory.rst
 create mode 100644 doc/functions/TIFFquery.rst
 create mode 100644 doc/functions/TIFFsize.rst
 create mode 100644 doc/functions/TIFFstrip.rst
 create mode 100644 doc/functions/TIFFswab.rst
 create mode 100644 doc/functions/TIFFtile.rst
 create mode 100644 doc/functions/libtiff.rst
 delete mode 100644 doc/manpages.rst
 delete mode 100644 doc/static/man/TIFFClose.3tiff.html
 delete mode 100644 doc/static/man/TIFFDataWidth.3tiff.html
 delete mode 100644 doc/static/man/TIFFError.3tiff.html
 delete mode 100644 doc/static/man/TIFFFieldDataType.3tiff.html
 delete mode 100644 doc/static/man/TIFFFieldName.3tiff.html
 delete mode 100644 doc/static/man/TIFFFieldPassCount.3tiff.html
 delete mode 100644 doc/static/man/TIFFFieldReadCount.3tiff.html
 delete mode 100644 doc/static/man/TIFFFieldTag.3tiff.html
 delete mode 100644 doc/static/man/TIFFFieldWriteCount.3tiff.html
 delete mode 100644 doc/static/man/TIFFFlush.3tiff.html
 delete mode 100644 doc/static/man/TIFFGetField.3tiff.html
 delete mode 100644 doc/static/man/TIFFOpen.3tiff.html
 delete mode 100644 doc/static/man/TIFFPrintDirectory.3tiff.html
 delete mode 100644 doc/static/man/TIFFRGBAImage.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadDirectory.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadEncodedStrip.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadEncodedTile.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadRGBAImage.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadRGBAStrip.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadRGBATile.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadRawStrip.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadRawTile.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadScanline.3tiff.html
 delete mode 100644 doc/static/man/TIFFReadTile.3tiff.html
 delete mode 100644 doc/static/man/TIFFSetDirectory.3tiff.html
 delete mode 100644 doc/static/man/TIFFSetField.3tiff.html
 delete mode 100644 doc/static/man/TIFFWarning.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteDirectory.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteEncodedStrip.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteEncodedTile.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteRawStrip.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteRawTile.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteScanline.3tiff.html
 delete mode 100644 doc/static/man/TIFFWriteTile.3tiff.html
 delete mode 100644 doc/static/man/TIFFbuffer.3tiff.html
 delete mode 100644 doc/static/man/TIFFcodec.3tiff.html
 delete mode 100644 doc/static/man/TIFFcolor.3tiff.html
 delete mode 100644 doc/static/man/TIFFmemory.3tiff.html
 delete mode 100644 doc/static/man/TIFFquery.3tiff.html
 delete mode 100644 doc/static/man/TIFFsize.3tiff.html
 delete mode 100644 doc/static/man/TIFFstrip.3tiff.html
 delete mode 100644 doc/static/man/TIFFswab.3tiff.html
 delete mode 100644 doc/static/man/TIFFtile.3tiff.html
 delete mode 100644 doc/static/man/fax2ps.1.html
 delete mode 100644 doc/static/man/fax2tiff.1.html
 delete mode 100644 doc/static/man/libtiff.3tiff.html
 delete mode 100644 doc/static/man/pal2rgb.1.html
 delete mode 100644 doc/static/man/ppm2tiff.1.html
 delete mode 100644 doc/static/man/raw2tiff.1.html
 delete mode 100644 doc/static/man/rgb2ycbcr.1.html
 delete mode 100644 doc/static/man/thumbnail.1.html
 delete mode 100644 doc/static/man/tiff2bw.1.html
 delete mode 100644 doc/static/man/tiff2pdf.1.html
 delete mode 100644 doc/static/man/tiff2ps.1.html
 delete mode 100644 doc/static/man/tiff2rgba.1.html
 delete mode 100644 doc/static/man/tiffcmp.1.html
 delete mode 100644 doc/static/man/tiffcp.1.html
 delete mode 100644 doc/static/man/tiffcrop.1.html
 delete mode 100644 doc/static/man/tiffdither.1.html
 delete mode 100644 doc/static/man/tiffdump.1.html
 delete mode 100644 doc/static/man/tiffgt.1.html
 delete mode 100644 doc/static/man/tiffinfo.1.html
 delete mode 100644 doc/static/man/tiffmedian.1.html
 delete mode 100644 doc/static/man/tiffset.1.html
 delete mode 100644 doc/static/man/tiffsplit.1.html
 create mode 100644 doc/tools/fax2ps.rst
 create mode 100644 doc/tools/fax2tiff.rst
 create mode 100644 doc/tools/pal2rgb.rst
 create mode 100644 doc/tools/ppm2tiff.rst
 create mode 100644 doc/tools/raw2tiff.rst
 create mode 100644 doc/tools/rgb2ycbcr.rst
 create mode 100644 doc/tools/thumbnail.rst
 create mode 100644 doc/tools/tiff2bw.rst
 create mode 100644 doc/tools/tiff2pdf.rst
 create mode 100644 doc/tools/tiff2ps.rst
 create mode 100644 doc/tools/tiff2rgba.rst
 create mode 100644 doc/tools/tiffcmp.rst
 create mode 100644 doc/tools/tiffcp.rst
 create mode 100644 doc/tools/tiffcrop.rst
 create mode 100644 doc/tools/tiffdither.rst
 create mode 100644 doc/tools/tiffdump.rst
 create mode 100644 doc/tools/tiffgt.rst
 create mode 100644 doc/tools/tiffinfo.rst
 create mode 100644 doc/tools/tiffmedian.rst
 create mode 100644 doc/tools/tiffset.rst
 create mode 100644 doc/tools/tiffsplit.rst
 delete mode 100644 man/CMakeLists.txt
 delete mode 100644 man/Makefile.am
 delete mode 100644 man/TIFFClose.3tiff
 delete mode 100644 man/TIFFDataWidth.3tiff
 delete mode 100644 man/TIFFError.3tiff
 delete mode 100644 man/TIFFFieldDataType.3tiff
 delete mode 100644 man/TIFFFieldName.3tiff
 delete mode 100644 man/TIFFFieldPassCount.3tiff
 delete mode 100644 man/TIFFFieldReadCount.3tiff
 delete mode 100644 man/TIFFFieldTag.3tiff
 delete mode 100644 man/TIFFFieldWriteCount.3tiff
 delete mode 100644 man/TIFFFlush.3tiff
 delete mode 100644 man/TIFFGetField.3tiff
 delete mode 100644 man/TIFFOpen.3tiff
 delete mode 100644 man/TIFFPrintDirectory.3tiff
 delete mode 100644 man/TIFFRGBAImage.3tiff
 delete mode 100644 man/TIFFReadDirectory.3tiff
 delete mode 100644 man/TIFFReadEncodedStrip.3tiff
 delete mode 100644 man/TIFFReadEncodedTile.3tiff
 delete mode 100644 man/TIFFReadRGBAImage.3tiff
 delete mode 100644 man/TIFFReadRGBAStrip.3tiff
 delete mode 100644 man/TIFFReadRGBATile.3tiff
 delete mode 100644 man/TIFFReadRawStrip.3tiff
 delete mode 100644 man/TIFFReadRawTile.3tiff
 delete mode 100644 man/TIFFReadScanline.3tiff
 delete mode 100644 man/TIFFReadTile.3tiff
 delete mode 100644 man/TIFFSetDirectory.3tiff
 delete mode 100644 man/TIFFSetField.3tiff
 delete mode 100644 man/TIFFWarning.3tiff
 delete mode 100644 man/TIFFWriteDirectory.3tiff
 delete mode 100644 man/TIFFWriteEncodedStrip.3tiff
 delete mode 100644 man/TIFFWriteEncodedTile.3tiff
 delete mode 100644 man/TIFFWriteRawStrip.3tiff
 delete mode 100644 man/TIFFWriteRawTile.3tiff
 delete mode 100644 man/TIFFWriteScanline.3tiff
 delete mode 100644 man/TIFFWriteTile.3tiff
 delete mode 100644 man/TIFFbuffer.3tiff
 delete mode 100644 man/TIFFcodec.3tiff
 delete mode 100644 man/TIFFcolor.3tiff
 delete mode 100644 man/TIFFmemory.3tiff
 delete mode 100644 man/TIFFquery.3tiff
 delete mode 100644 man/TIFFsize.3tiff
 delete mode 100644 man/TIFFstrip.3tiff
 delete mode 100644 man/TIFFswab.3tiff
 delete mode 100644 man/TIFFtile.3tiff
 delete mode 100644 man/fax2ps.1
 delete mode 100644 man/fax2tiff.1
 delete mode 100644 man/libtiff.3tiff
 delete mode 100644 man/pal2rgb.1
 delete mode 100644 man/ppm2tiff.1
 delete mode 100644 man/raw2tiff.1
 delete mode 100644 man/rgb2ycbcr.1
 delete mode 100644 man/thumbnail.1
 delete mode 100644 man/tiff2bw.1
 delete mode 100644 man/tiff2pdf.1
 delete mode 100644 man/tiff2ps.1
 delete mode 100644 man/tiff2rgba.1
 delete mode 100644 man/tiffcmp.1
 delete mode 100644 man/tiffcp.1
 delete mode 100644 man/tiffcrop.1
 delete mode 100644 man/tiffdither.1
 delete mode 100644 man/tiffdump.1
 delete mode 100644 man/tiffgt.1
 delete mode 100644 man/tiffinfo.1
 delete mode 100644 man/tiffmedian.1
 delete mode 100644 man/tiffset.1
 delete mode 100644 man/tiffsplit.1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a25d3e9..561a5de4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,7 +156,6 @@ if(tiff-contrib)
 endif()
 add_subdirectory(build)
 if(tiff-docs)
-  add_subdirectory(man)
   add_subdirectory(doc)
 endif()
 
diff --git a/Makefile.am b/Makefile.am
index 9f06c10b..254ab7d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,7 +52,7 @@ distcheck-hook:
 	if [ -x "$(CMAKE)" ]; then \
 	  mkdir $(distdir)/_build/cmake \
 	  && cd $(distdir)/_build/cmake \
-	  && cmake ../.. \
+	  && cmake -Dsphinx=OFF ../.. \
 	  && $(MAKE) \
 	  && ctest -V \
 	  && $(MAKE) DESTDIR=../../_inst/cmake install ; \
@@ -60,7 +60,7 @@ distcheck-hook:
 	rm -rf $(distdir)/_build/cmake
 	rm -rf $(distdir)/_inst/cmake
 
-SUBDIRS = port libtiff tools build contrib test doc man
+SUBDIRS = port libtiff tools build contrib test doc
 
 release:
 	(rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE)
diff --git a/cmake/Sphinx.cmake b/cmake/Sphinx.cmake
index 8b78d41c..bef3bf55 100644
--- a/cmake/Sphinx.cmake
+++ b/cmake/Sphinx.cmake
@@ -52,12 +52,11 @@ option(sphinx "Enable sphinx manual page and HTML documentation" ${SPHINX_DEFAUL
 option(sphinx-linkcheck "Check sphinx documentation links by default" OFF)
 
 set(BUILD_SPHINX ${sphinx})
+set(SPHINX_LIST_DIR ${CMAKE_CURRENT_LIST_DIR})
 
-set(_ome_sphinx_list_dir "${CMAKE_CURRENT_LIST_DIR}")
-
-function(sphinx_manpages srcdir confdir mandir manvar)
-  execute_process(COMMAND "${Python3_EXECUTABLE}" -B ${_ome_sphinx_list_dir}/list-manpages.py
-                          "${confdir}" "${srcdir}" "${mandir}"
+function(sphinx_manpages srcdir builddir manvar)
+  execute_process(COMMAND "${Python3_EXECUTABLE}" -B ${SPHINX_LIST_DIR}/list-manpages.py
+                          "${srcdir}" "${builddir}"
                   RESULT_VARIABLE sphinx_man_fail
                   OUTPUT_VARIABLE MAN_PAGES)
   if (sphinx_man_fail)
@@ -65,11 +64,12 @@ function(sphinx_manpages srcdir confdir mandir manvar)
   endif()
   string(REPLACE "\n" ";" MAN_PAGES "${MAN_PAGES}")
   set(${manvar} "${MAN_PAGES}" PARENT_SCOPE)
+
+    message(STATUS "Sphinx manual pages: ${MAN_PAGES}")
 endfunction(sphinx_manpages)
 
-function(sphinx_manpage_dependencies srcdir confdir depvar)
-  execute_process(COMMAND "${Python3_EXECUTABLE}" -B ${_ome_sphinx_list_dir}/list-manpage-dependencies.py
-                          "${confdir}"
+function(sphinx_manpage_dependencies srcdir depvar)
+  execute_process(COMMAND "${Python3_EXECUTABLE}" -B ${SPHINX_LIST_DIR}/list-manpage-dependencies.py
                           "${srcdir}"
                   RESULT_VARIABLE sphinx_dep_fail
                   OUTPUT_VARIABLE SPHINX_MAN_DEPENDENCIES)
@@ -77,6 +77,7 @@ function(sphinx_manpage_dependencies srcdir confdir depvar)
     message(WARNING "Failed to get Sphinx dependencies from ${confdir}")
   endif()
   string(REPLACE "\n" ";" SPHINX_MAN_DEPENDENCIES "${SPHINX_MAN_DEPENDENCIES}")
+
   set(${depvar} "${SPHINX_MAN_DEPENDENCIES}" PARENT_SCOPE)
 endfunction(sphinx_manpage_dependencies)
 
diff --git a/cmake/list-manpage-dependencies.py b/cmake/list-manpage-dependencies.py
index 186507d1..67e79ad5 100644
--- a/cmake/list-manpage-dependencies.py
+++ b/cmake/list-manpage-dependencies.py
@@ -5,19 +5,24 @@
 
 import importlib.util
 import os.path
+import pathlib
 import sys
 
 if __name__ == "__main__":
 
-    if len(sys.argv) != 3:
-        sys.exit("Usage: %s sphinx-confdir sphinx-srcdir" % (sys.argv[0]))
+    if len(sys.argv) != 2:
+        sys.exit("Usage: %s sphinx-srcdir" % (sys.argv[0]))
 
-    dir = os.path.abspath(sys.argv[1])
-    spec = importlib.util.spec_from_file_location('conf', os.path.join(dir, 'conf.py'))
+    conf_dir = os.path.abspath(sys.argv[1])
+    conf_path = os.path.join(conf_dir, 'conf.py')
+    spec = importlib.util.spec_from_file_location('conf', conf_path)
     conf = importlib.util.module_from_spec(spec)
+    spec.loader.exec_module(conf)
 
     if hasattr(conf, 'man_pages'):
         for man in conf.man_pages:
-            print(os.path.join(sys.argv[2], "%s%s" %
-                               (man[0], conf.source_suffix)))
-    print(os.path.join(dir, 'conf.py'))
+            man_path = os.path.join(sys.argv[1], "{}{}".format(man[0], '.rst'))
+            man_path_posix = pathlib.PureWindowsPath(man_path).as_posix()
+            print(man_path_posix)
+
+    print(pathlib.PureWindowsPath(conf_path).as_posix())
diff --git a/cmake/list-manpages.py b/cmake/list-manpages.py
index 8087d297..42bf0d83 100644
--- a/cmake/list-manpages.py
+++ b/cmake/list-manpages.py
@@ -6,18 +6,26 @@
 
 import importlib.util
 import os.path
+import pathlib
 import sys
 
 if __name__ == "__main__":
 
-    if len(sys.argv) != 4:
-        sys.exit("Usage: %s sphinx-confdir sphinx-srcdir manpage-dir" %
-                 (sys.argv[0]))
+    if len(sys.argv) != 3:
+        print("Usage: {} sphinx-srcdir sphinx-builddir".format(sys.argv[0]), file=sys.stderr)
+        sys.exit(2)
 
-    dir = os.path.abspath(sys.argv[1])
-    spec = importlib.util.spec_from_file_location('conf', os.path.join(dir, 'conf.py'))
+    conf_dir = os.path.abspath(sys.argv[1])
+    conf_path = os.path.join(conf_dir, 'conf.py')
+    spec = importlib.util.spec_from_file_location('conf', conf_path)
     conf = importlib.util.module_from_spec(spec)
+    spec.loader.exec_module(conf)
 
     if hasattr(conf, 'man_pages'):
         for man in conf.man_pages:
-            print(os.path.join(sys.argv[3], "%s.%s" % (man[1], man[4])))
+            man_path = os.path.join(sys.argv[2], "%s.%s" % (man[1], man[4]))
+            man_path_posix = pathlib.PureWindowsPath(man_path).as_posix()
+            print(man_path_posix)
+    else:
+        print("No man_pages array in {}".format(conf_path), file=sys.stderr)
+        sys.exit(3)
diff --git a/configure.ac b/configure.ac
index 9a039228..a0c50b52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1135,6 +1135,13 @@ if test "$CHECK_JPEG_YCBCR_SUBSAMPLING" = "yes" ; then
 fi
 
 
+for python in python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python; do
+  AC_CHECK_PROGS(PYTHON_BIN, [$python])
+  if test "x$PYTHON_BIN" != "x"; then
+    break
+  fi
+done
+
 AC_ARG_ENABLE(sphinx,
               AS_HELP_STRING([--disable-sphinx],
                              [disable building of the sphinx documentation]),
@@ -1145,8 +1152,28 @@ AC_ARG_ENABLE(sphinx,
 
 AC_PATH_PROG(SPHINX_BUILD, [sphinx-build], [no])
 
-AM_CONDITIONAL([SPHINX], [test "$BUILD_SPHINX" = yes -a "$SPHINX_BUILD" != no])
+AM_CONDITIONAL([SPHINX], [test "$BUILD_SPHINX" = yes -a "$SPHINX_BUILD" != no -a "x$PYTHON_BIN" != "x"])
+
+if test "x$PYTHON_BIN" != "x"; then
+  AC_MSG_CHECKING([generated manual pages])
+  TIFF_MAN1_GEN=$(echo $("$PYTHON_BIN" "${srcdir}/cmake/list-manpages.py" "${srcdir}/doc" man | grep "\.1$"))
+  TIFF_MAN3_GEN=$(echo $("$PYTHON_BIN" "${srcdir}/cmake/list-manpages.py" "${srcdir}/doc" man | grep "\.3tiff$"))
+  TIFF_MAN_RULES=$("$PYTHON_BIN" "${srcdir}/cmake/list-manpages.py" "${srcdir}/doc" man | sed -e 's;$;: all-local;')
+  AC_SUBST([TIFF_MAN1_GEN])
+  AC_SUBST([TIFF_MAN3_GEN])
+  AC_SUBST([TIFF_MAN_RULES])
+  AM_SUBST_NOTMAKE([TIFF_MAN_RULES])
+  AC_MSG_RESULT([done])
+fi
 
+if test -d "${srcdir}/doc/man-prebuilt"; then
+  AC_MSG_CHECKING([prebuilt manual pages])
+  TIFF_MAN1_PREBUILT=$(echo $(cd "${srcdir}/doc" && ls -1 man-prebuilt/*.1))
+  TIFF_MAN3_PREBUILT=$(echo $(cd "${srcdir}/doc" && ls -1 man-prebuilt/*.3tiff))
+  AC_SUBST([TIFF_MAN1_PREBUILT])
+  AC_SUBST([TIFF_MAN3_PREBUILT])
+  AC_MSG_RESULT([done])
+fi
 
 dnl ---------------------------------------------------------------------------
 
@@ -1171,7 +1198,6 @@ AC_CONFIG_FILES([Makefile \
 		 doc/Makefile \
 		 libtiff-4.pc \
 		 libtiff/Makefile \
-		 man/Makefile \
 		 port/Makefile \
 		 test/Makefile \
 		 tools/Makefile])
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 14a00d8f..6cc3d2e4 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -29,6 +29,9 @@ cmake_minimum_required(VERSION 3.2.0)
 include(Sphinx)
 
 if (BUILD_SPHINX AND SPHINX_BUILD)
+  # Re-run CMake when the Sphinx configuration is updated
+  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/conf.py")
+
   message(STATUS "Checking manual page dependencies")
 
   # Create build directory and conf.py
@@ -36,10 +39,8 @@ if (BUILD_SPHINX AND SPHINX_BUILD)
   set(sphinx_builddir "${CMAKE_CURRENT_BINARY_DIR}")
   file(MAKE_DIRECTORY "${sphinx_builddir}")
 
-  sphinx_manpages("${sphinx_srcdir}" "${sphinx_builddir}"
-                  "${PROJECT_BINARY_DIR}/man" MAN_PAGES)
-  sphinx_manpage_dependencies("${sphinx_srcdir}" "${sphinx_builddir}"
-                              MAN_PAGE_DEPENDENCIES)
+  sphinx_manpages("${sphinx_srcdir}" "${sphinx_builddir}/man" MAN_PAGES)
+  sphinx_manpage_dependencies("${sphinx_srcdir}" MAN_PAGE_DEPENDENCIES)
   sphinx_dependencies("${sphinx_srcdir}" SPHINX_DEPENDENCIES)
 
   # Generate and install man pages
@@ -52,22 +53,21 @@ if (BUILD_SPHINX AND SPHINX_BUILD)
                        COMMAND ${SPHINX_BUILD}
                                -D "release=${LIBTIFF_VERSION_FULL}"
                                -D "version=${tiff_VERSION_MAJOR}.${tiff_VERSION_MINOR}"
-                               -c "${sphinx_builddir}"
                                -d "${sphinx_builddir}/cache"
                                -b man
-                               "${sphinx_srcdir}" "${PROJECT_BINARY_DIR}/man"
+                               "${sphinx_srcdir}" "${sphinx_builddir}/man"
                        WORKING_DIRECTORY "${sphinx_s

(Patch may be truncated, please check the link at the top of this post.)