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" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | |
| 26 | do_install_append() { |
| 27 | # install-catalog script contains hard-coded references to |
| 28 | # {sysconfdir}. Change it to ${D}${sysconfdir}. |
| 29 | sed -i -e "s|${sysconfdir}/sgml|${D}${sysconfdir}/sgml|g" ${D}${bindir}/install-catalog |
| 30 | |
| 31 | ${D}${bindir}/install-catalog \ |
| 32 | --add ${D}${sysconfdir}/sgml/sgml-ent.cat \ |
| 33 | ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog |
| 34 | |
| 35 | # The sgml-docbook.cat will be regenerated by sstate_postinst |
| 36 | rm -f ${D}${sysconfdir}/sgml/sgml-docbook.cat |
| 37 | } |
| 38 | |
| 39 | sgml_common_native_mangle () { |
| 40 | # Revert back to ${sysconfdir} path in install-catalog |
| 41 | sed -i -e "s|${D}${sysconfdir}/sgml|${sysconfdir}/sgml|g" ${SYSROOT_DESTDIR}${STAGING_BINDIR}/install-catalog |
| 42 | # 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 |
| 43 | 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 |
| 44 | # Remove ${D} path from catalog file created by install-catalog script |
| 45 | sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/catalog |
| 46 | } |
| 47 | |
| 48 | sgml_common_sstate_postinst() { |
| 49 | if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] |
| 50 | then |
| 51 | ${bindir}/install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat ${sysconfdir}/sgml/sgml-ent.cat |
| 52 | if [ -e ${sysconfdir}/sgml/sgml-docbook.bak ]; then |
| 53 | for catalog in `awk '{print $2}' ${sysconfdir}/sgml/sgml-docbook.bak`; do |
| 54 | if [ ! `grep $catalog ${sysconfdir}/sgml/sgml-docbook.cat 1> /dev/null 2>&1` ]; then |
| 55 | ${bindir}/install-catalog \ |
| 56 | --add ${sysconfdir}/sgml/sgml-docbook.cat $catalog |
| 57 | fi |
| 58 | done |
| 59 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 60 | cat << EOF > ${SSTATE_INST_POSTRM} |
| 61 | #!/bin/sh |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 62 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame^] | 63 | # Ensure that the catalog file sgml-docbook.cat is properly |
| 64 | # updated when the package is removed from sstate cache. |
| 65 | if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then |
| 66 | sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat |
| 67 | fi |
| 68 | EOF |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | fi |
| 70 | } |