recipe 3.4 KB

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