From: Jan Tojnar Date: Thu, 11 Feb 2021 05:00:45 +0000 (+0100) Subject: doc: Introduce XML catalog X-Git-Tag: dbus-1.13.22~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ac9a348f0b8421bb1f23db2a9d13b3ecb777af6;p=thirdparty%2Fdbus.git 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). --- diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 6494aab3c..bfc046ace 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 6bbb19b15..605f86664 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 000000000..331df3618 --- /dev/null +++ b/doc/catalog.xml.in @@ -0,0 +1,10 @@ + + + + + + + + + +