1 # Build recipe for opensp.
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
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.gz
31 fetch=https://downloads.sourceforge.net/openjade/$tarname
34 The opensp package contains a C++ library for using SGML/XML files.
36 This is useful for validating, parsing and manipulating
37 SGML and XML documents.
40 homepage=https://openjade.sourceforge.net
43 # Source documentation
44 docs="AUTHORS BUGS COPYING ChangeLog NEWS README"
45 docsdir="${docdir}/${pkgname}-${version}"
49 unpack "${tardir}/$tarname"
53 # Update for hosts based on musl
54 cp -f "${worktree}/archive/common/config.guess" config.guess
55 cp -f "${worktree}/archive/common/config.sub" config.sub
57 # Set sane permissions
58 chmod -R u+w,go-w,a+rX-s .
60 # Disable warnings while running openjade
61 # (Thanks to Beyond of Linux From Scratch)
63 sed -i 's/32,/253,/' lib/Syntax.cxx
64 sed -i 's/LITLEN 240 /LITLEN 8092/' \
65 unicode/gensyntax.pl unicode/unicode.syn
67 ./configure CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
69 --libdir=/usr/lib${libSuffix} \
73 --enable-default-catalog=/etc/sgml/catalog \
74 --enable-default-search-path=/usr/share/sgml \
76 --enable-xml-messages \
77 --build="$(gcc -dumpmachine)"
80 pkgdatadir=/usr/share/sgml/OpenSP-${version} docdir=$docsdir
83 pkgdatadir=/usr/share/sgml/OpenSP-${version} docdir=$docsdir \
84 DESTDIR="$destdir" install
86 # Make symlinks for compatiblity (e.g OpenJade).
87 # (Thanks to Beyond of Linux From Scratch)
89 ln -sf onsgmls "${destdir}"/usr/bin/nsgmls
90 ln -sf osgmlnorm "${destdir}"/usr/bin/sgmlnorm
91 ln -sf ospam "${destdir}"/usr/bin/spam
92 ln -sf ospcat "${destdir}"/usr/bin/spcat
93 ln -sf ospent "${destdir}"/usr/bin/spent
94 ln -sf osx "${destdir}"/usr/bin/sx
95 ln -sf osx "${destdir}"/usr/bin/sgml2xml
97 # Make symlinks for manpages
98 for file in nsgmls sgmlnorm spam spcat spent sx
100 ln -sf o${file}.1 "${destdir}/${mandir}/man1/${file}.1"
104 ln -sf osx.1 "${destdir}/${mandir}/man1/sgml2xml.1"
106 # Compress and link man pages (if needed)
107 if test -d "${destdir}/$mandir"
110 cd "${destdir}/$mandir"
111 find . -type f -exec lzip -9 {} +
112 find . -type l | while read -r file
114 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
121 mkdir -p "${destdir}/$docsdir"
122 cp -p $docs "${destdir}/$docsdir"