1 # Build recipe for openjade.
3 # Copyright (c) 2019, 2021 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
30 fetch=https://downloads.sourceforge.net/project/openjade/openjade/${version}/$tarname
33 An implementation of DSSSL, a language to format SGML or XML documents.
35 OpenJade contains backends for various formats (RTF, HTML, TeX, MIF,
39 homepage=https://openjade.sourceforge.net
42 # Source documentation
43 docs="COPYING ChangeLog NEWS README VERSION"
44 docsdir="${docdir}/${program}-${version}"
48 unpack "${tardir}/$tarname"
52 # Set sane permissions
53 chmod -R u+w,go-w,a+rX-s .
55 # Update using patches from Gentoo
56 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-deplibs.patch"
57 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-ldflags.patch"
58 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-respect-ldflags.patch"
59 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-msggen.pl.patch"
60 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-libosp-la.patch"
61 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-gcc46.patch"
62 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-no-undefined.patch"
63 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-wchar_t-uint.patch"
64 patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-chmod.patch"
66 # Update for hosts based on musl
67 cp -f "${worktree}/archive/common/config.guess" config/config.guess
68 cp -f "${worktree}/archive/common/config.sub" config/config.sub
70 ./configure CXXFLAGS="$QICXXFLAGS -fno-lifetime-dse" \
71 LDFLAGS="$QILDFLAGS" \
73 --libdir=/usr/lib${libSuffix} \
75 --datadir=/usr/share/sgml/openjade-${version} \
76 --enable-default-catalog=/etc/sgml/catalog \
77 --enable-default-search-path=/usr/share/sgml \
78 --enable-splibdir=/usr/lib${libSuffix} \
80 --build="$(gcc -dumpmachine)"
83 mkdir -p "${destdir}/etc/sgml"
84 make -j${jobs} DESTDIR="$destdir" install install-man
86 # Remove libtool .la files
87 rm -f "${destdir}/usr/lib${libSuffix}"/*.la
89 # Create Jade equivalents
91 ln -sf openjade "${destdir}/usr/bin/jade"
92 ln -sf openjade.1 "${destdir}${mandir}/man1/jade.1"
96 cp -p dsssl/catalog "${destdir}/usr/share/sgml/openjade-${version}"
97 for file in dsssl/*.dtd dsssl/*.dsl dsssl/*.sgm
99 cp -p "$file" "${destdir}/usr/share/sgml/openjade-${version}/${file##*/}"
102 chmod 644 "${destdir}/usr/share/sgml/openjade-${version}"/*
104 # Compress and link man pages (if needed)
105 if test -d "${destdir}/$mandir"
108 cd "${destdir}/$mandir"
109 find . -type f -exec lzip -9 {} +
110 find . -type l | while read -r file
112 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
119 mkdir -p "${destdir}${docsdir}"
120 cp -p $docs "${destdir}${docsdir}"
122 # Insert post-install script manually
124 mkdir -p "${destdir}/var/lib/qi"
125 cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
128 echo "Updating etc/sgml/catalog ..."
130 install-catalog --add etc/sgml/openjade-${version}.cat \\
131 /usr/share/sgml/openjade-${version}/catalog
133 install-catalog --add etc/sgml/sgml-docbook.cat \\
134 /etc/sgml/openjade-${version}.cat