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