]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
doc: Introduce XML catalog
authorJan Tojnar <jtojnar@gmail.com>
Thu, 11 Feb 2021 05:00:45 +0000 (06:00 +0100)
committerSimon McVittie <smcv@collabora.com>
Mon, 21 Feb 2022 14:01:20 +0000 (14:01 +0000)
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).

doc/CMakeLists.txt
doc/Makefile.am
doc/catalog.xml.in [new file with mode: 0644]

index 6494aab3c5900bb57231124cf226e19f04a4fc29..bfc046acebdfc56f74fa63f5e4c131b960591652 100644 (file)
@@ -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()
index 6bbb19b1592f911d6cff834a9c7d6ea7970e6ba3..605f86664b5220d483f7708c634f0a8105bd9870 100644 (file)
@@ -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 (file)
index 0000000..331df36
--- /dev/null
@@ -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>