recipe 3.7 KB

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