diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..58ef5ee
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ doc
+
diff --git a/glib2.changes b/glib2.changes
index 6a9dc68..4066c7b 100644
--- a/glib2.changes
+++ b/glib2.changes
@@ -1,3 +1,13 @@
+-------------------------------------------------------------------
+Mon Feb 28 18:15:50 UTC 2022 - Dirk Müller
+
+- split gtk-docs from -devel package, these are not needed
+ during building projects using glib2
+- use _multibuild as the meson buildprocess is very awkward
+ regarding the documentation - builds single-jobs only and
+ twice (again during %install). This way the rest of distribution
+ waiting for glib2-devel to be available is not blocked by this
+
-------------------------------------------------------------------
Fri Feb 11 13:37:10 UTC 2022 - Bjørn Lie
diff --git a/glib2.spec b/glib2.spec
index 5b11814..00f37c9 100644
--- a/glib2.spec
+++ b/glib2.spec
@@ -1,5 +1,5 @@
#
-# spec file for package glib2
+# spec file
#
# Copyright (c) 2022 SUSE LLC
#
@@ -17,8 +17,19 @@
%bcond_without systemtap
-%bcond_without gtk_doc
-Name: glib2
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "doc"
+%global psuffix -doc
+%else
+%global psuffix %{nil}
+%endif
+%define libver 2_0-0
+%define libgio libgio-%{libver}
+%define libglib libglib-%{libver}
+%define libgmodule libgmodule-%{libver}
+%define libgobject libgobject-%{libver}
+%define libgthread libgthread-%{libver}
+Name: glib2%{psuffix}
Version: 2.70.4
Release: 0
Summary: General-Purpose Utility Library
@@ -47,7 +58,10 @@ Patch2: glib2-suppress-schema-deprecated-path-warning.patch
Patch3: glib2-dbus-socket-path.patch
# PATCH-FIX-OPENSUSE glib2-gdbus-codegen-version.patch olaf@aepfle.de -- Remove version string from files generated by gdbus-codegen
Patch4: glib2-gdbus-codegen-version.patch
-
+%if "%{flavor}" == "doc"
+# Split-provides
+Provides: glib2-devel:%{_datadir}/gtk-doc/html/gobject/index.html
+%endif
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
@@ -65,9 +79,8 @@ BuildRequires: pkgconfig(libffi) >= 3.0.0
BuildRequires: pkgconfig(libpcre) >= 8.31
BuildRequires: pkgconfig(mount) >= 2.28
BuildRequires: pkgconfig(zlib)
-# gtk-doc requires glib2-devel, but we will only be building this here; break up a cycle
-#!BuildIgnore: glib2-devel
-%if %{with gtk_doc}
+%if "%{flavor}" == "doc"
+BuildRequires: glib2-devel
BuildRequires: gtk-doc >= 1.32
%endif
%if %{with systemtap}
@@ -80,12 +93,9 @@ GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
-%define libver 2_0-0
-%define libgio libgio-%{libver}
-%define libglib libglib-%{libver}
-%define libgmodule libgmodule-%{libver}
-%define libgobject libgobject-%{libver}
-%define libgthread libgthread-%{libver}
+%if %{with doc}
+This package provides the documentation for the GLib library.
+%endif
%package tools
Summary: Tools from glib2, a general-purpose utility library
@@ -269,7 +279,7 @@ sed -i "s/1.32.1/1.32/" docs/reference/meson.build
--default-library=both \
-Dselinux=enabled \
-Dman=true \
-%if %{with gtk_doc}
+%if "%{flavor}" == "doc"
-Dgtk_doc=true \
%endif
%if %{with systemtap}
@@ -285,7 +295,9 @@ sed -i "s/1.32.1/1.32/" docs/reference/meson.build
%install
%meson_install
-
+%if "%{flavor}" == "doc"
+find %{buildroot}/%{_prefix} -not -path "*%{_datadir}/gtk-doc/*" -delete || :
+%else
%find_lang glib20 %{?no_lang_C}
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -D -m0644 glib2.sh %{buildroot}%{_sysconfdir}/profile.d/zzz-glib2.sh
@@ -316,7 +328,7 @@ mkdir -p %{buildroot}%{_datadir}/gtk-doc/html
%fdupes %{buildroot}/%{_prefix}
# Too many users complain about schemas compiled with wrong permissions
-# when in fact the system just honours there umask setting
+# when in fact the system just honours their umask setting
# subshell restores umask for paranoia mode
%define compile_schemas \
(umask 022 && %{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas)
@@ -340,6 +352,7 @@ do mimeapps="%{_localstatedir}/cache/gio-2.0/$ENV-mimeapps.list" &&
[Default Applications]
EOF
done
+%endif
%check
### FIXME ### Figure out how to run the "stable tests" only ref info from upstream.
@@ -353,6 +366,13 @@ done
%postun -n %{libgio} -p %{ldconfig}
%postun -n %{libgmodule} -p %{ldconfig}
+%if "%{flavor}" == "doc"
+%files
+%{_datadir}/gtk-doc/html/gio
+%{_datadir}/gtk-doc/html/glib
+%{_datadir}/gtk-doc/html/gobject
+%else
+
%files tools
%license COPYING
%{_bindir}/gapplication
@@ -459,11 +479,6 @@ done
%dir %{_libdir}/glib-2.0/
%{_libdir}/glib-2.0/include/
%{_libdir}/pkgconfig/*.pc
-%if %{with gtk_doc}
-%{_datadir}/gtk-doc/html/gio
-%{_datadir}/gtk-doc/html/glib
-%{_datadir}/gtk-doc/html/gobject
-%endif
%{_datadir}/gdb/auto-load/%{_libdir}/*-gdb.py
%if %{with systemtap}
%dir %{_datadir}/systemtap
@@ -474,15 +489,15 @@ done
%{_datadir}/systemtap/tapset/*/libgobject-*.so.*.stp
%endif
%{_rpmmacrodir}/macros.glib2
-# Own these directories to not avoid breakages throughout the project
-%dir %{_datadir}/gtk-doc
-%dir %{_datadir}/gtk-doc/html
# Own these directories to avoid build requirement on gdb
# only for directories ownership
%dir %{_datadir}/gdb
%dir %{_datadir}/gdb/auto-load
%dir %{_datadir}/gdb/auto-load%{_prefix}
%dir %{_datadir}/gdb/auto-load%{_libdir}
+# Own these directories to not avoid breakages throughout the project
+%dir %{_datadir}/gtk-doc
+%dir %{_datadir}/gtk-doc/html
%files devel-static
%license COPYING
@@ -491,14 +506,13 @@ done
%files lang -f glib20.lang
%license COPYING
-%define testdir %{_libexecdir}/installed-tests/glib
-
%files tests-devel
%license COPYING
%{_libexecdir}/installed-tests
-%attr(0444 - -) %{testdir}/x-content/win32-software/autorun.exe
-%attr(0755 - -) %{testdir}/taptestrunner.py
-%attr(0755 - -) %{testdir}/x-content/unix-software/autorun.sh
+%attr(0444 - -) %{_libexecdir}/installed-tests/glib/x-content/win32-software/autorun.exe
+%attr(0755 - -) %{_libexecdir}/installed-tests/glib/taptestrunner.py
+%attr(0755 - -) %{_libexecdir}/installed-tests/glib/x-content/unix-software/autorun.sh
%{_datadir}/installed-tests
+%endif
%changelog