recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # Build recipe for opensp.
  2. #
  3. # Copyright (c) 2019, 2021 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. # Exit immediately on any error
  17. set -e
  18. program=OpenSP
  19. pkgname=opensp
  20. version=1.5.2
  21. release=2
  22. # Define a category for the output of the package name
  23. pkgcategory=docbook
  24. tarname=${program}-${version}.tar.gz
  25. # Remote source(s)
  26. fetch=https://downloads.sourceforge.net/openjade/$tarname
  27. description="
  28. The opensp package contains a C++ library for using SGML/XML files.
  29. This is useful for validating, parsing and manipulating
  30. SGML and XML documents.
  31. "
  32. homepage=https://openjade.sourceforge.net
  33. license=MIT
  34. # Source documentation
  35. docs="AUTHORS BUGS COPYING ChangeLog NEWS README"
  36. docsdir="${docdir}/${pkgname}-${version}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Update for hosts based on musl
  42. cp -f "${worktree}/archive/common/config.guess" config.guess
  43. cp -f "${worktree}/archive/common/config.sub" config.sub
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. # Disable warnings while running openjade
  47. # (Thanks to Beyond of Linux From Scratch)
  48. sed -i 's/32,/253,/' lib/Syntax.cxx
  49. sed -i 's/LITLEN 240 /LITLEN 8092/' \
  50. unicode/gensyntax.pl unicode/unicode.syn
  51. ./configure CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  52. $configure_args \
  53. --libdir=/usr/lib${libSuffix} \
  54. --mandir=$mandir \
  55. --enable-static=no \
  56. --enable-shared=yes \
  57. --enable-default-catalog=/etc/sgml/catalog \
  58. --enable-default-search-path=/usr/share/sgml \
  59. --enable-http \
  60. --enable-xml-messages \
  61. --build="$(gcc -dumpmachine)"
  62. make -j${jobs} V=1 \
  63. pkgdatadir=/usr/share/sgml/OpenSP-${version} docdir=$docsdir
  64. make -j${jobs} \
  65. pkgdatadir=/usr/share/sgml/OpenSP-${version} docdir=$docsdir \
  66. DESTDIR="$destdir" install
  67. # Make symlinks for compatiblity (e.g OpenJade).
  68. # (Thanks to Beyond of Linux From Scratch)
  69. ln -sf onsgmls "${destdir}"/usr/bin/nsgmls
  70. ln -sf osgmlnorm "${destdir}"/usr/bin/sgmlnorm
  71. ln -sf ospam "${destdir}"/usr/bin/spam
  72. ln -sf ospcat "${destdir}"/usr/bin/spcat
  73. ln -sf ospent "${destdir}"/usr/bin/spent
  74. ln -sf osx "${destdir}"/usr/bin/sx
  75. ln -sf osx "${destdir}"/usr/bin/sgml2xml
  76. # Make symlinks for manpages
  77. for file in nsgmls sgmlnorm spam spcat spent sx
  78. do
  79. ln -sf o${file}.1 "${destdir}/${mandir}/man1/${file}.1"
  80. done
  81. unset -v file
  82. ln -sf osx.1 "${destdir}/${mandir}/man1/sgml2xml.1"
  83. # Compress and link man pages (if needed)
  84. if test -d "${destdir}/$mandir"
  85. then
  86. (
  87. cd "${destdir}/$mandir"
  88. find . -type f -exec lzip -9 {} +
  89. find . -type l | while read -r file
  90. do
  91. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  92. rm -- "$file"
  93. done
  94. )
  95. fi
  96. # Copy documentation
  97. mkdir -p "${destdir}/$docsdir"
  98. cp -p $docs "${destdir}/$docsdir"
  99. }