recipe 4.2 KB

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