blob: fa7aa62eb3f3948f3b1314fa0a2c7494112cab01 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Tools for working with DSSSL stylesheets for SGML and XML documents"
2DESCRIPTION = "OpenJade is a suite of tools for validating, \
3processing, and applying DSSSL (Document Style Semantics and \
4Specification Language) stylesheets to SGML and XML documents."
5HOMEPAGE = "http://openjade.sourceforge.net"
6SECTION = "base"
7LICENSE = "BSD"
8LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
9
10PR = "r5"
11
12DEPENDS = "opensp-native sgml-common-native"
13RDEPENDS_${PN} = "sgml-common-native"
14
15SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/openjade-${PV}.tar.gz \
16 file://makefile.patch \
17 file://msggen.pl.patch \
18 file://reautoconf.patch \
19 file://user-declared-default-constructor.patch \
20 file://fix-regex.patch"
21
22SRC_URI[md5sum] = "7df692e3186109cc00db6825b777201e"
23SRC_URI[sha256sum] = "1d2d7996cc94f9b87d0c51cf0e028070ac177c4123ecbfd7ac1cb8d0b7d322d1"
24
25inherit autotools-brokensep native
26
27EXTRA_OECONF = "--enable-spincludedir=${STAGING_INCDIR}/OpenSP \
28 --enable-splibdir=${STAGING_LIBDIR}"
29
30# We need to set datadir explicitly, but adding it to EXTRA_OECONF
31# results in it being specified twice when configure is run.
32CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--datadir=${datadir}', '--datadir=${STAGING_DATADIR}/sgml/openjade-${PV}')}"
33
34# CONFIGUREOPTS has hard coded paths so we need to ignore it's vardeps
35# there are other bits in there too but they are picked up by other variable
36# dependencies so it all works out
37oe_runconf[vardepsexclude] += "CONFIGUREOPTS"
38
39CFLAGS =+ "-I${S}/include"
40
41SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
42SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
43CLEANFUNCS += "openjade_sstate_clean"
44
45# configure.in needs to be reloacted to trigger reautoconf
46do_extraunpack () {
47 cp ${S}/config/configure.in ${S}/
48}
49addtask extraunpack after do_patch before do_configure
50
51# We need to do this else the source interdependencies aren't generated and
52# build failures can result (e.g. zero size style/Makefile.dep file)
53do_compile_prepend () {
54 oe_runmake depend
55}
56
57do_install() {
58 # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/openjade.html
59 # for details.
60 install -d ${D}${bindir}
61 install -m 0755 ${S}/jade/.libs/openjade ${D}${bindir}/openjade
62 ln -sf openjade ${D}${bindir}/jade
63
64 oe_libinstall -a -so -C style libostyle ${D}${libdir}
65 oe_libinstall -a -so -C spgrove libospgrove ${D}${libdir}
66 oe_libinstall -a -so -C grove libogrove ${D}${libdir}
67
68 install -d ${D}${datadir}/sgml/openjade-${PV}
69 install -m 644 dsssl/catalog ${D}${datadir}/sgml/openjade-${PV}
70 install -m 644 dsssl/*.dtd ${D}${datadir}/sgml/openjade-${PV}
71 install -m 644 dsssl/*.dsl ${D}${datadir}/sgml/openjade-${PV}
72 install -m 644 dsssl/*.sgm ${D}${datadir}/sgml/openjade-${PV}
73
74 install -d ${datadir}/sgml/openjade-${PV}
75 install -m 644 dsssl/catalog ${datadir}/sgml/openjade-${PV}/catalog
76
77 install -d ${D}${sysconfdir}/sgml
78 echo "CATALOG ${datadir}/sgml/openjade-${PV}/catalog" > \
79 ${D}${sysconfdir}/sgml/openjade-${PV}.cat
80}
81
82openjade_sstate_postinst() {
83 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
84 then
85 # Ensure that the catalog file sgml-docbook.cat is properly
86 # updated when the package is installed from sstate cache.
87 ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
88 --add ${sysconfdir}/sgml/sgml-docbook.bak \
89 ${sysconfdir}/sgml/openjade-${PV}.cat
90 ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
91 --add ${sysconfdir}/sgml/sgml-docbook.cat \
92 ${sysconfdir}/sgml/openjade-${PV}.cat
93 fi
94}
95
96openjade_sysroot_preprocess () {
97 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
98 install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade
99}
100
101openjade_sstate_clean () {
102 # Ensure that the catalog file sgml-docbook.cat is properly
103 # updated when the package is removed from sstate cache.
104 files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
105 for f in $files; do
106 [ ! -f $f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' $f
107 done
108}