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/python-rdflib.changes b/python-rdflib.changes
index 77366ea..7cff12a 100644
--- a/python-rdflib.changes
+++ b/python-rdflib.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Wed Jul 3 11:44:54 UTC 2024 - Daniel Garcia
+
+- Create doc subpackage with _multibuild to move
+ python3-sphnix-autodoc-typehints build requirement out of ring1
+
-------------------------------------------------------------------
Tue Feb 27 06:23:55 UTC 2024 - Steve Kowalik
diff --git a/python-rdflib.spec b/python-rdflib.spec
index e3709bb..28e0812 100644
--- a/python-rdflib.spec
+++ b/python-rdflib.spec
@@ -16,8 +16,17 @@
#
-# Tests don't work and cause a dependency loop with python-SPARQLWrapper
%bcond_with tests
+
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "doc"
+%bcond_without doc
+%bcond_with tests
+%else
+%bcond_with doc
+%bcond_with tests
+%endif
+
Name: python-rdflib
Version: 7.0.0
Release: 0
@@ -29,7 +38,7 @@ BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module html5lib}
BuildRequires: %{python_module isodate}
BuildRequires: %{python_module pip}
-BuildRequires: %{python_module poetry}
+BuildRequires: %{python_module poetry-core}
BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module xml}
@@ -37,7 +46,6 @@ BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx
BuildRequires: python3-myst-parser
-BuildRequires: python3-sphinx-autodoc-typehints
BuildRequires: python3-sphinxcontrib-apidoc
Requires: python-html5lib
Requires: python-isodate
@@ -50,6 +58,9 @@ BuildRequires: %{python_module SPARQLWrapper}
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module pytest}
%endif
+%if %{with doc}
+BuildRequires: python3-sphinx-autodoc-typehints
+%endif
%python_subpackages
%description
@@ -61,6 +72,7 @@ The library also contains both in-memory and persistent Graph backends.
%package -n %{name}-doc
Summary: A Python library for working with RDF
Provides: %{python_module rdflib-doc = %{version}}
+BuildRequires: %{python_module rdflib = %{version}}
%description -n %{name}-doc
RDFLib is a Python library for working with RDF, a simple yet powerful
@@ -73,27 +85,33 @@ The library also contains both in-memory and persistent Graph backends.
# remove unwanted shebang
find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }'
+%if %{without doc}
%build
%pyproject_wheel
+%endif
%install
-%pyproject_install
+%if %{with doc}
# Build the docs, we need the module queryable
pushd docs
PYTHONPATH=%{buildroot}%{python3_sitelib} %make_build html
+
# Remove hidden file
rm -r _build/html/.buildinfo
popd
+%fdupes docs/_build/html
+exit 1
+%else
+%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/rdfs2dot
%python_clone -a %{buildroot}%{_bindir}/rdfpipe
%python_clone -a %{buildroot}%{_bindir}/rdfgraphisomorphism
%python_clone -a %{buildroot}%{_bindir}/rdf2dot
%python_clone -a %{buildroot}%{_bindir}/csv2rdf
%python_expand %fdupes %{buildroot}%{$python_sitelib}
-
-%fdupes docs/_build/html
+%endif
%if %{with tests}
%check
@@ -114,6 +132,12 @@ popd
%python_uninstall_alternative rdf2dot
%python_uninstall_alternative csv2rdf
+%if %{with doc}
+%files -n %{name}-doc
+%doc docs/_build/html
+
+%else
+
%files %{python_files}
%license LICENSE
%doc README.md
@@ -124,8 +148,6 @@ popd
%python_alternative %{_bindir}/rdfs2dot
%{python_sitelib}/rdflib
%{python_sitelib}/rdflib-%{version}.dist-info
-
-%files -n %{name}-doc
-%doc docs/_build/html
+%endif
%changelog