From 1941e9126b45dcbc6d0f058f451d49834b3f50b9 Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Wed, 22 Nov 2023 15:54:56 +0100
Subject: [PATCH] distribute sphinx Makefiles as package data

Distribute these Makefiles in share/swh-docs and move the
glossary.rst in share/swh-docs/docs/devel to keep the directory hierarchy
of the source repo.
---
 setup.py                | 6 +++++-
 swh/docs/sphinx/conf.py | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 6c2540ff..ef4d3558 100644
--- a/setup.py
+++ b/setup.py
@@ -44,5 +44,9 @@ setup(
         "building": parse_requirements("swh"),
     },
     include_package_data=True,
-    data_files=[("share/swh-docs", ["docs/devel/glossary.rst"])],
+    data_files=[
+        ("share/swh-docs/docs/devel", ["docs/devel/glossary.rst"]),
+        ("share/swh-docs/docs/", ["docs/Makefile"]),
+        ("share/swh-docs/", ["Makefile.sphinx"]),
+    ],
 )
diff --git a/swh/docs/sphinx/conf.py b/swh/docs/sphinx/conf.py
index bf46b5b3..b3bd938c 100644
--- a/swh/docs/sphinx/conf.py
+++ b/swh/docs/sphinx/conf.py
@@ -317,8 +317,8 @@ def set_django_settings(app, env, docname):
 def add_glossary_to_index(app, docname, source):
     if docname == "index":
         lookup = (
-            Path(sys.prefix) / "share/swh-docs/glossary.rst",
-            Path(sys.prefix) / "local/share/swh-docs/glossary.rst",
+            Path(sys.prefix) / "share/swh-docs/docs/devel/glossary.rst",
+            Path(sys.prefix) / "local/share/swh-docs/docs/devel/glossary.rst",
             Path(__file__).parents[3] / "docs/devel/glossary.rst",
             Path(__file__).parents[4] / "docs/devel/glossary.rst",
             Path(__file__).parents[5] / "docs/devel/glossary.rst",
-- 
GitLab