recipe 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Build recipe for docbook-xsl.
  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. # Exit immediately on any error
  17. set -e
  18. program=docbook-xsl-nons
  19. pkgname=docbook-xsl
  20. version=1.79.2
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=docbook
  24. tarname=${program}-${version}.tar.bz2
  25. # Remote source(s)
  26. fetch=https://github.com/docbook/xslt10-stylesheets/releases/download/release/${version}/$tarname
  27. description="
  28. The DocBook XSL Stylesheets.
  29. The DocBook XSL Stylesheets package contains XSL stylesheets.
  30. These are useful for performing transformations on XML DocBook files.
  31. "
  32. homepage=https://www.docbook.org
  33. license=Custom
  34. # Source documentation
  35. docs="AUTHORS BUGS COPYING NEWS README RELEASE-NOTES.txt TODO VERSION"
  36. docsdir="${docdir}/${pkgname}-${version}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Apply a patch from "Beyond Linux From Scratch"
  42. patch -Np1 -i "${worktree}/patches/docbook-xsl/docbook-xsl-nons-1.79.2-stack_fix-1.patch"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. mkdir -p "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
  46. cp -R VERSION assembly common eclipse epub epub3 extensions fo \
  47. highlighting html htmlhelp images javahelp lib manpages params \
  48. profiling roundtrip slides template tests tools webhelp website \
  49. xhtml xhtml-1_1 xhtml5 \
  50. "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
  51. (
  52. cd "${destdir}/usr/share/xml/docbook/xsl-stylesheets-nons-${version}"
  53. ln -s VERSION VERSION.xsl
  54. )
  55. # Copy documentation
  56. mkdir -p "${destdir}/$docsdir"
  57. cp -p $docs "${destdir}/$docsdir"
  58. # Create config directory
  59. mkdir -p "${destdir}/etc/xml"
  60. # Insert post-install script manually
  61. mkdir -p "${destdir}/var/lib/qi"
  62. cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
  63. # XML catalog
  64. if test ! -e etc/xml/catalog
  65. then
  66. echo "Creating etc/xml/catalog (from docbook-xsl-${version}) ..."
  67. xmlcatalog --noout --create etc/xml/catalog
  68. fi
  69. echo "Adding XML (XSL) definitions to etc/xml/catalog ..."
  70. xmlcatalog --noout --add "rewriteSystem" \\
  71. "http://cdn.docbook.org/release/xsl-nons/${version}" \\
  72. "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
  73. etc/xml/catalog
  74. xmlcatalog --noout --add "rewriteURI" \\
  75. "http://cdn.docbook.org/release/xsl-nons/${version}" \\
  76. "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
  77. etc/xml/catalog
  78. xmlcatalog --noout --add "rewriteSystem" \\
  79. "http://cdn.docbook.org/release/xsl-nons/current" \\
  80. "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
  81. etc/xml/catalog
  82. xmlcatalog --noout --add "rewriteURI" \\
  83. "http://cdn.docbook.org/release/xsl-nons/current" \\
  84. "file://usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
  85. etc/xml/catalog
  86. # Sourceforge URIs
  87. xmlcatalog --noout --add "rewriteSystem" \\
  88. "http://docbook.sourceforge.net/release/xsl/current" \\
  89. "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
  90. etc/xml/catalog
  91. xmlcatalog --noout --add "rewriteURI" \\
  92. "http://docbook.sourceforge.net/release/xsl/current" \\
  93. "/usr/share/xml/docbook/xsl-stylesheets-nons-${version}" \\
  94. etc/xml/catalog
  95. EOF
  96. }