blob: 597536570d31c34bda4693bb914c0ad69b6a84ea [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Base utilities for working with SGML and XML"
2DESCRIPTION = "The sgml-common package gathers very basic \
3stuff necessary to work with SGML and XML, such as xml.dcl, \
4a SGML declaration of XML; iso-entities, a list of the basic \
5SGML ISO entities; and install-catalog, a script used to \
6add entries to (or remove entries from) centralized catalogs \
7whose entries are pointers to SGML open catalogs, \
8as defined by OASIS."
9HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
10LICENSE = "GPLv2+"
11# See the comments in license.patch when upgrading this recipe.
12# This is inteded to be a temporary workaround.
13LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
14SECTION = "base"
15
16PR = "r1"
17
18require sgml-common_${PV}.bb
19inherit native
20
21S = "${WORKDIR}/sgml-common-${PV}"
22
23SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
24SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
25CLEANFUNCS += "sgml_common_sstate_clean"
26
27
28do_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
41sgml_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
50sgml_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
65sgml_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}