Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 1 | DEPENDS = "libxml2-native" |
| 2 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 3 | # A whitespace-separated list of XML catalogs to be registered, for example |
| 4 | # "${sysconfdir}/xml/docbook-xml.xml". |
| 5 | XMLCATALOGS ?= "" |
| 6 | |
| 7 | SYSROOT_PREPROCESS_FUNCS_append = " xmlcatalog_sstate_postinst" |
| 8 | |
| 9 | xmlcatalog_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 | |
| 20 | xmlcatalog_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 | } |