From d8255e405a7ba42e9c588705ddf121f67d83c762 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 21 Sep 2020 19:16:05 +0100
Subject: [PATCH] debian: Delete files that were generated by gtk-doc during
 dist

If we `make dist` with gtk-doc-tools 1.28 from Debian 10 'buster' (the
current stable release), it generates a libcapsule-docs.xml in which
generation of tree_index.sgml is mandatory. This is incompatible with
building this non-GObject library with gtk-doc-tools >= 1.30, in which
tree_index.sgml is only generated if the library contains at least one
GObject type.

Most projects treat the libcapsule-docs.xml generated by gtk-doc as
a template and commit it to git, but in this project we don't
particularly want to maintain it and would prefer to keep regenerating
it during build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 debian/clean | 4 ++++
 debian/rules | 4 ++++
 2 files changed, 8 insertions(+)
 create mode 100644 debian/clean

diff --git a/debian/clean b/debian/clean
new file mode 100644
index 000000000..13ce54a46
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,4 @@
+gtk-doc.make
+libcapsule-docs.xml
+libcapsule-overrides.txt
+libcapsule-sections.txt
diff --git a/debian/rules b/debian/rules
index 13b82b02c..82ffe1876 100755
--- a/debian/rules
+++ b/debian/rules
@@ -28,6 +28,10 @@ else
 confflags += --without-glib
 endif
 
+override_dh_clean:
+	rm -fr html
+	dh_clean
+
 override_dh_auto_configure:
 	dh_auto_configure -- $(confflags)
 
-- 
GitLab