Description: install the examples in a proper /examples subdirectory
 currently they are messily installed within the rest of the thml docs.
Author: Mattia Rizzolo <mattia@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/131
Last-Update: 2021-07-29

--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -22,9 +22,10 @@
 	-cd $(srcdir) && xmllint --valid --noout index.html
 endif
 
+EXAMPLES_DIR=$(docdir)/examples
 install-data-local: 
-	$(MKDIR_P) $(DESTDIR)$(HTML_DIR)
-	-$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
+	$(MKDIR_P) $(DESTDIR)$(HTML_DIR)/examples
+	-$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)/examples/
 
 clean-local:
 	test -f Makefile.am || rm -f test?.xml
--- a/Makefile.am
+++ b/Makefile.am
@@ -1283,8 +1283,10 @@
 	-$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR)
 	-$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR)
 	-$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR)
+	@echo "If the documentation is installed, please also look at html/examples for more." > $(DESTDIR)$(EXAMPLES_DIR)/README
 
 uninstall-local:
+	rm -f $(DESTDIR)$(EXAMPLES_DIR)/README
 	rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c
 	rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c
 	rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c
