summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-02-11 06:00:45 +0100
committerSimon McVittie <smcv@collabora.com>2022-02-21 14:01:20 +0000
commit2ac9a348f0b8421bb1f23db2a9d13b3ecb777af6 (patch)
treed49b5e4af27d0ba56db985df2af6cac213a2c353 /doc
parent7488756a0ccbb58c0b32351a7e833f70770e1163 (diff)
downloaddbus-2ac9a348f0b8421bb1f23db2a9d13b3ecb777af6.tar.gz
doc: Introduce XML catalog
This adds a nice way of loading the DTD files based on the identifier in the DOCTYPE declaration, no matter where the DTDs are installed. See also ‘XML catalog’ Wikipedia entry and update-xmlcatalog(8).
Diffstat (limited to 'doc')
-rw-r--r--doc/CMakeLists.txt12
-rw-r--r--doc/Makefile.am9
-rw-r--r--doc/catalog.xml.in10
3 files changed, 30 insertions, 1 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 6494aab3..bfc046ac 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -224,12 +224,22 @@ set(DOC_DATA
install(FILES ${DOC_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus)
+set(DBUS_DTD_DIR "${CMAKE_INSTALL_DATADIR}/xml/dbus-1" CACHE STRING "Directory for installing DTD files")
+set(DBUS_XML_CATALOG_DIR "${DBUS_DTD_DIR}" CACHE STRING "Directory for installing XML catalog file")
+
set(EXTRA_DIST
busconfig.dtd
introspect.dtd
introspect.xsl
)
-install(FILES ${EXTRA_DIST} DESTINATION ${CMAKE_INSTALL_DATADIR}/xml/dbus-1)
+install(FILES ${EXTRA_DIST} DESTINATION ${DBUS_DTD_DIR})
+
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/catalog.xml.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/catalog.xml"
+ @ONLY)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/catalog.xml" DESTINATION ${DBUS_XML_CATALOG_DIR})
endif()
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 6bbb19b1..605f8666 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -25,6 +25,14 @@ dist_dtd_DATA = \
busconfig.dtd \
introspect.dtd
+xmlcatalogdir = $(dtddir)
+
+catalog.xml: catalog.xml.in
+ $(SED) "s|@DBUS_DTD_DIR@|$(dtddir)|" $< >$@
+
+dist_xmlcatalog_DATA = \
+ catalog.xml
+
dist_doc_DATA = system-activation.txt
# uploaded and distributed, but not installed
@@ -38,6 +46,7 @@ STATIC_DOCS = \
introspect.xsl
EXTRA_DIST = \
+ catalog.xml.in \
file-boilerplate.c \
doxygen_to_devhelp.xsl \
$(STATIC_DOCS)
diff --git a/doc/catalog.xml.in b/doc/catalog.xml.in
new file mode 100644
index 00000000..331df361
--- /dev/null
+++ b/doc/catalog.xml.in
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+ <public publicId="-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" uri="@DBUS_DTD_DIR@/introspect.dtd"/>
+
+ <system systemId="http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" uri="@DBUS_DTD_DIR@/introspect.dtd"/>
+
+ <public publicId="-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" uri="@DBUS_DTD_DIR@/busconfig.dtd"/>
+
+ <system systemId="http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd" uri="@DBUS_DTD_DIR@/busconfig.dtd"/>
+</catalog>