diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..29c47e2
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ man
+
diff --git a/tiff.changes b/tiff.changes
index bcad8e6..d1eea4c 100644
--- a/tiff.changes
+++ b/tiff.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Mon Nov 11 17:34:34 UTC 2024 - Marcus Rueckert
+
+- In the previous change to enable the cmake based build
+ we also needed python3-Sphinx to build the man pages, as unlike
+ the autotools based build, the cmake based build does not fall
+ back to the pre-built man pages.
+
+ This causes build cycle. Split out the documentation building to
+ break the cycle. The Tumbleweed release managers preferred this
+ solution over a mini package.
+
-------------------------------------------------------------------
Sat Nov 9 22:56:55 UTC 2024 - Marcus Rueckert
diff --git a/tiff.spec b/tiff.spec
index f457114..4674986 100644
--- a/tiff.spec
+++ b/tiff.spec
@@ -16,8 +16,17 @@
#
+%global build_flavor @BUILD_FLAVOR@%{nil}
+
+%if "%{?build_flavor}" == "man"
+%bcond_without tiff_manpages
+%else
+%bcond_with tiff_manpages
+%endif
+
%define asan_build 0
%define debug_build 0
+
Name: tiff
Version: 4.7.0
Release: 0
@@ -31,7 +40,9 @@ Source2: README.SUSE
Source3: baselibs.conf
Source99: tiff.keyring
Patch0: tiff-4.0.3-seek.patch
+%if %{with tiff_manpages}
BuildRequires: %{primary_python}-Sphinx
+%endif
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libjbig-devel
@@ -41,6 +52,7 @@ BuildRequires: lzma-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(zlib)
+Recommends: tiff-docs = %{versiong}
%description
This package contains the library and support programs for the TIFF
@@ -62,12 +74,40 @@ Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libstdc++-devel
Requires: libtiff6 = %{version}
+Recommends: libtiff-devel-docs = %{version}
%description -n libtiff-devel
This package contains the header files and static libraries for
developing programs which will manipulate TIFF format image files using
the libtiff library.
+%if %{with tiff_manpages}
+
+%package -n tiff-docs
+Summary: Development Tools for Programs which will use the libtiff Library
+Group: Productivity/Graphics/Convertors
+Requires: tiff = %{version}
+
+%description -n tiff-docs
+This package contains the header files and static libraries for
+developing programs which will manipulate TIFF format image files using
+the libtiff library.
+
+This package holds the man pages for the command lint tools.
+
+%package -n libtiff-devel-docs
+Summary: Development Documentation for Programs which will use the libtiff Library
+Group: Development/Libraries/C and C++
+Requires: libtiff-devel = %{version}
+
+%description -n libtiff-devel-docs
+This package contains the header files and static libraries for
+developing programs which will manipulate TIFF format image files using
+the libtiff library.
+
+This package holds the development man pages.
+%endif
+
%prep
%autosetup -p1
@@ -89,6 +129,19 @@ find -name Makefile | xargs sed -i 's/\(^CFLAGS.*\)/\1 -fsanitize=address/'
cp %{SOURCE2} .
rm -rf %{buildroot}%{_datadir}/doc/{,packages/}tiff*
find %{buildroot} -type f -name "*.la" -delete -print
+%if %{with tiff_manpages}
+rm -rv \
+ %{buildroot}%{_bindir} \
+ %{buildroot}%{_libdir} \
+ %{buildroot}%{_includedir}
+
+%files -n tiff-docs
+%{_mandir}/man1/*
+
+%files -n libtiff-devel-docs
+%{_mandir}/man3/*
+
+%else
%check
%if %{asan_build}
@@ -102,7 +155,6 @@ exit 0
%files
%{_bindir}/*
%doc README.md VERSION ChangeLog TODO RELEASE-DATE
-%{_mandir}/man1/*
%files -n libtiff6
%license LICENSE.md
@@ -113,7 +165,7 @@ exit 0
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
-%{_mandir}/man3/*
%{_libdir}/cmake/tiff/
+%endif
%changelog