Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "DSSSL stylesheets used to transform SGML and XML DocBook files" |
| 2 | HOMEPAGE = "http://docbook.sourceforge.net" |
| 3 | # Simple persmissive |
| 4 | LICENSE = "DSSSL" |
| 5 | LIC_FILES_CHKSUM = "file://README;beginline=41;endline=74;md5=875385159b2ee76ecf56136ae7f542d6" |
| 6 | |
| 7 | DEPENDS = "sgml-common-native" |
| 8 | |
| 9 | PR = "r4" |
| 10 | |
| 11 | SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-dsssl-${PV}.tar.bz2" |
| 12 | |
| 13 | SRC_URI[md5sum] = "bc192d23266b9a664ca0aba4a7794c7c" |
| 14 | SRC_URI[sha256sum] = "2f329e120bee9ef42fbdd74ddd60e05e49786c5a7953a0ff4c680ae6bdf0e2bc" |
| 15 | |
| 16 | S = "${WORKDIR}/docbook-dsssl-${PV}" |
| 17 | |
| 18 | inherit native |
| 19 | |
| 20 | SSTATEPOSTINSTFUNCS += "docbook_dsssl_stylesheets_sstate_postinst" |
| 21 | SYSROOT_PREPROCESS_FUNCS += "docbook_dsssl_sysroot_preprocess" |
| 22 | CLEANFUNCS += "docbook_dsssl_stylesheets_sstate_clean" |
| 23 | |
| 24 | |
| 25 | do_install () { |
| 26 | # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-dsssl.html |
| 27 | # for details. |
| 28 | install -d ${D}${bindir} |
| 29 | install -m 0755 bin/collateindex.pl ${D}${bindir} |
| 30 | |
| 31 | install -d ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV} |
| 32 | install -m 0644 catalog ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV} |
| 33 | cp -v -R * ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV} |
| 34 | |
| 35 | install -d ${D}${sysconfdir}/sgml |
| 36 | echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/catalog" > \ |
| 37 | ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat |
| 38 | echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/common/catalog" >> \ |
| 39 | ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat |
| 40 | } |
| 41 | |
| 42 | docbook_dsssl_stylesheets_sstate_postinst () { |
| 43 | if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] |
| 44 | then |
| 45 | # Ensure that the catalog file sgml-docbook.cat is properly |
| 46 | # updated when the package is installed from sstate cache. |
| 47 | ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \ |
| 48 | --add ${sysconfdir}/sgml/sgml-docbook.bak \ |
| 49 | ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat |
| 50 | ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \ |
| 51 | --add ${sysconfdir}/sgml/sgml-docbook.cat \ |
| 52 | ${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat |
| 53 | fi |
| 54 | } |
| 55 | |
| 56 | docbook_dsssl_sysroot_preprocess () { |
| 57 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ |
| 58 | install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl |
| 59 | } |
| 60 | |
| 61 | docbook_dsssl_stylesheets_sstate_clean () { |
| 62 | # Ensure that the catalog file sgml-docbook.cat is properly |
| 63 | # updated when the package is removed from sstate cache. |
| 64 | files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat" |
| 65 | for f in $files; do |
| 66 | [ ! -f $f ] || sed -i '/\/sgml\/dsssl-docbook-stylesheets.cat/d' $f |
| 67 | done |
| 68 | } |