recipe 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # Build recipe for openjade.
  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=openjade
  19. version=1.3.2
  20. release=2
  21. # Define a category for the output of the package name
  22. pkgcategory=docbook
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://downloads.sourceforge.net/project/openjade/openjade/${version}/$tarname
  26. description="
  27. An implementation of DSSSL, a language to format SGML or XML documents.
  28. OpenJade contains backends for various formats (RTF, HTML, TeX, MIF,
  29. SGML2SGML, and FOT).
  30. "
  31. homepage=https://openjade.sourceforge.net
  32. license=MIT
  33. # Source documentation
  34. docs="COPYING ChangeLog NEWS README VERSION"
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. # Update using patches from Gentoo
  43. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-deplibs.patch"
  44. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-ldflags.patch"
  45. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-respect-ldflags.patch"
  46. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-msggen.pl.patch"
  47. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-libosp-la.patch"
  48. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-gcc46.patch"
  49. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-no-undefined.patch"
  50. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-wchar_t-uint.patch"
  51. patch -Np1 -i "${worktree}/patches/openjade/openjade-1.3.2-chmod.patch"
  52. # Update for hosts based on musl
  53. cp -f "${worktree}/archive/common/config.guess" config/config.guess
  54. cp -f "${worktree}/archive/common/config.sub" config/config.sub
  55. ./configure CXXFLAGS="$QICXXFLAGS -fno-lifetime-dse" \
  56. LDFLAGS="$QILDFLAGS" \
  57. $configure_args \
  58. --libdir=/usr/lib${libSuffix} \
  59. --mandir=$mandir \
  60. --datadir=/usr/share/sgml/openjade-${version} \
  61. --enable-default-catalog=/etc/sgml/catalog \
  62. --enable-default-search-path=/usr/share/sgml \
  63. --enable-splibdir=/usr/lib${libSuffix} \
  64. --enable-http \
  65. --build="$(gcc -dumpmachine)"
  66. make -j${jobs} V=1
  67. mkdir -p "${destdir}/etc/sgml"
  68. make -j${jobs} DESTDIR="$destdir" install install-man
  69. # Remove libtool .la files
  70. rm -f "${destdir}/usr/lib${libSuffix}"/*.la
  71. # Create Jade equivalents
  72. ln -sf openjade "${destdir}/usr/bin/jade"
  73. ln -sf openjade.1 "${destdir}${mandir}/man1/jade.1"
  74. # Catalogs
  75. cp -p dsssl/catalog "${destdir}/usr/share/sgml/openjade-${version}"
  76. for file in dsssl/*.dtd dsssl/*.dsl dsssl/*.sgm
  77. do
  78. cp -p "$file" "${destdir}/usr/share/sgml/openjade-${version}/${file##*/}"
  79. done
  80. unset -v file
  81. chmod 644 "${destdir}/usr/share/sgml/openjade-${version}"/*
  82. # Compress and link man pages (if needed)
  83. if test -d "${destdir}/$mandir"
  84. then
  85. (
  86. cd "${destdir}/$mandir"
  87. find . -type f -exec lzip -9 {} +
  88. find . -type l | while read -r file
  89. do
  90. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  91. rm -- "$file"
  92. done
  93. )
  94. fi
  95. # Copy documentation
  96. mkdir -p "${destdir}/$docsdir"
  97. cp -p $docs "${destdir}/$docsdir"
  98. # Insert post-install script manually
  99. mkdir -p "${destdir}/var/lib/qi"
  100. cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
  101. echo ""
  102. echo "Updating etc/sgml/catalog ..."
  103. install-catalog --add etc/sgml/openjade-${version}.cat \\
  104. /usr/share/sgml/openjade-${version}/catalog
  105. install-catalog --add etc/sgml/sgml-docbook.cat \\
  106. /etc/sgml/openjade-${version}.cat
  107. EOF
  108. }