Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Base utilities for working with SGML and XML" |
| 2 | DESCRIPTION = "The sgml-common package gathers very basic \ |
| 3 | stuff necessary to work with SGML and XML, such as xml.dcl, \ |
| 4 | a SGML declaration of XML; iso-entities, a list of the basic \ |
| 5 | SGML ISO entities; and install-catalog, a script used to \ |
| 6 | add entries to (or remove entries from) centralized catalogs \ |
| 7 | whose entries are pointers to SGML open catalogs, \ |
| 8 | as defined by OASIS." |
| 9 | HOMEPAGE = "http://sources.redhat.com/docbook-tools/" |
| 10 | LICENSE = "GPLv2+" |
| 11 | # See the comments in license.patch when upgrading this recipe. |
| 12 | # This is inteded to be a temporary workaround. |
| 13 | LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b" |
| 14 | SECTION = "base" |
| 15 | |
| 16 | PR = "r1" |
| 17 | |
| 18 | require sgml-common_${PV}.bb |
| 19 | inherit native |
| 20 | |
| 21 | S = "${WORKDIR}/sgml-common-${PV}" |
| 22 | |
| 23 | SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle" |
| 24 | SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst" |
| 25 | CLEANFUNCS += "sgml_common_sstate_clean" |
| 26 | |
| 27 | |
| 28 | do_install_append() { |
| 29 | # install-catalog script contains hard-coded references to |
| 30 | # {sysconfdir}. Change it to ${D}${sysconfdir}. |
| 31 | sed -i -e "s|${sysconfdir}/sgml|${D}${sysconfdir}/sgml|g" ${D}${bindir}/install-catalog |
| 32 | |
| 33 | ${D}${bindir}/install-catalog \ |
| 34 | --add ${D}${sysconfdir}/sgml/sgml-ent.cat \ |
| 35 | ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog |
| 36 | |
| 37 | # The sgml-docbook.cat will be regenerated by sstate_postinst |
| 38 | rm -f ${D}${sysconfdir}/sgml/sgml-docbook.cat |
| 39 | } |
| 40 | |
| 41 | sgml_common_native_mangle () { |
| 42 | # Revert back to ${sysconfdir} path in install-catalog |
| 43 | sed -i -e "s|${D}${sysconfdir}/sgml|${sysconfdir}/sgml|g" ${SYSROOT_DESTDIR}${STAGING_BINDIR}/install-catalog |
| 44 | # Change path from ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog to ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog in sgml-ent.cat |
| 45 | sed -i -e "s|${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-ent.cat |
| 46 | # Remove ${D} path from catalog file created by install-catalog script |
| 47 | sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/catalog |
| 48 | } |
| 49 | |
| 50 | sgml_common_sstate_postinst() { |
| 51 | if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] |
| 52 | then |
| 53 | ${bindir}/install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat ${sysconfdir}/sgml/sgml-ent.cat |
| 54 | if [ -e ${sysconfdir}/sgml/sgml-docbook.bak ]; then |
| 55 | for catalog in `awk '{print $2}' ${sysconfdir}/sgml/sgml-docbook.bak`; do |
| 56 | if [ ! `grep $catalog ${sysconfdir}/sgml/sgml-docbook.cat 1> /dev/null 2>&1` ]; then |
| 57 | ${bindir}/install-catalog \ |
| 58 | --add ${sysconfdir}/sgml/sgml-docbook.cat $catalog |
| 59 | fi |
| 60 | done |
| 61 | fi |
| 62 | fi |
| 63 | } |
| 64 | |
| 65 | sgml_common_sstate_clean () { |
| 66 | # Ensure that the catalog file sgml-docbook.cat is properly |
| 67 | # updated when the package is removed from sstate cache. |
| 68 | if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then |
| 69 | sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat |
| 70 | fi |
| 71 | } |