blob: be155b7bc280c57db2d192ddd4e1db7986eddb6c [file] [log] [blame]
Brad Bishop96ff1982019-08-19 13:50:42 -04001DEPENDS = "libxml2-native"
2
Brad Bishop19323692019-04-05 15:28:33 -04003# A whitespace-separated list of XML catalogs to be registered, for example
4# "${sysconfdir}/xml/docbook-xml.xml".
5XMLCATALOGS ?= ""
6
Patrick Williams213cb262021-08-07 19:21:33 -05007SYSROOT_PREPROCESS_FUNCS:append = " xmlcatalog_sstate_postinst"
Brad Bishop19323692019-04-05 15:28:33 -04008
9xmlcatalog_complete() {
10 ROOTCATALOG="${STAGING_ETCDIR_NATIVE}/xml/catalog"
11 if [ ! -f $ROOTCATALOG ]; then
12 mkdir --parents $(dirname $ROOTCATALOG)
13 xmlcatalog --noout --create $ROOTCATALOG
14 fi
15 for CATALOG in ${XMLCATALOGS}; do
16 xmlcatalog --noout --add nextCatalog unused file://$CATALOG $ROOTCATALOG
17 done
18}
19
20xmlcatalog_sstate_postinst() {
21 mkdir -p ${SYSROOT_DESTDIR}${bindir}
22 dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}-xmlcatalog
23 echo '#!/bin/sh' > $dest
24 echo '${xmlcatalog_complete}' >> $dest
25 chmod 0755 $dest
26}