recipe 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. # Build recipe for docbook-xml.
  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-xml
  17. version=4.5
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/docbook"
  21. tarname=${program}-${version}.zip
  22. # Remote source(s)
  23. fetch="
  24. http://docbook.org/xml/${version}/$tarname
  25. http://docbook.org/xml/4.4/${program}-4.4.zip
  26. http://docbook.org/xml/4.3/${program}-4.3.zip
  27. http://docbook.org/xml/4.2/${program}-4.2.zip
  28. http://docbook.org/xml/4.1.2/docbkx412.zip
  29. "
  30. description="
  31. The DocBook XML DTD.
  32. The DocBook XML DTD package contains document type definitions
  33. for verification of XML data files against the DocBook rule set.
  34. These are useful for structuring books and software documentation
  35. to a standard allowing you to utilize transformations already
  36. written for that standard.
  37. "
  38. homepage=http://www.docbook.org
  39. license=Custom
  40. # Source documentation
  41. docs="ChangeLog README"
  42. docsdir="${docdir}/${program}-${version}"
  43. build()
  44. {
  45. set -e
  46. # Unzip the sources in an own directory
  47. for _version in $version 4.4 4.3 4.2 4.1.2
  48. do
  49. mkdir -p "${srcdir}/${_version}" \
  50. "${destdir}/usr/share/xml/docbook/xml-dtd-${_version}"
  51. if test $_version = 4.1.2
  52. then
  53. cd "${srcdir}/${_version}"
  54. unpack "${tardir}/docbkx412.zip"
  55. else
  56. cd "${srcdir}/${_version}"
  57. unpack "${tardir}/docbook-xml-${_version}.zip"
  58. fi
  59. # Set sane permissions
  60. chmod -R u+w,go-w,a+rX-s .
  61. # Populate package
  62. cp -R -p -f docbook.cat *.dtd ent/ *.mod \
  63. "${destdir}/usr/share/xml/docbook/xml-dtd-${_version}"
  64. done
  65. unset _version
  66. # Switch back to the current 'version'
  67. cd "${TMPDIR}/${srcdir}/${version}"
  68. # Copy documentation
  69. mkdir -p "${destdir}${docsdir}"
  70. cp -p $docs "${destdir}${docsdir}"/
  71. # Create config directory
  72. mkdir -p "${destdir}/etc/xml"
  73. # Insert post-install script manually
  74. mkdir -p "${destdir}/var/lib/qi"
  75. cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
  76. # XML docbook
  77. if test ! -e etc/xml/docbook
  78. then
  79. echo "Creating etc/xml/docbook (version: $version) ..."
  80. xmlcatalog --noout --create etc/xml/docbook
  81. fi
  82. echo ""
  83. echo "Updating etc/xml/docbook ..."
  84. xmlcatalog --noout --add "public" \\
  85. "-//OASIS//DTD DocBook XML V4.5//EN" \\
  86. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \\
  87. etc/xml/docbook
  88. xmlcatalog --noout --add "public" \\
  89. "-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \\
  90. "file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \\
  91. etc/xml/docbook
  92. xmlcatalog --noout --add "public" \\
  93. "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \\
  94. "file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \\
  95. etc/xml/docbook
  96. xmlcatalog --noout --add "public" \\
  97. "-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \\
  98. "file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \\
  99. etc/xml/docbook
  100. xmlcatalog --noout --add "public" \\
  101. "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \\
  102. "file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \\
  103. etc/xml/docbook
  104. xmlcatalog --noout --add "public" \\
  105. "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \\
  106. "file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \\
  107. etc/xml/docbook
  108. xmlcatalog --noout --add "public" \\
  109. "-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \\
  110. "file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \\
  111. etc/xml/docbook
  112. xmlcatalog --noout --add "public" \\
  113. "-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \\
  114. "file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \\
  115. etc/xml/docbook
  116. xmlcatalog --noout --add "public" \\
  117. "-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \\
  118. "file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \\
  119. etc/xml/docbook
  120. xmlcatalog --noout --add "rewriteSystem" \\
  121. "http://www.oasis-open.org/docbook/xml/4.5" \\
  122. "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
  123. etc/xml/docbook
  124. xmlcatalog --noout --add "rewriteURI" \\
  125. "http://www.oasis-open.org/docbook/xml/4.5" \\
  126. "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
  127. etc/xml/docbook
  128. # XML catalog
  129. if test ! -e etc/xml/catalog
  130. then
  131. echo "Creating etc/xml/catalog (version: $version) ..."
  132. xmlcatalog --noout --create etc/xml/catalog
  133. fi
  134. echo ""
  135. echo "Updating etc/xml/catalog ..."
  136. xmlcatalog --noout --add "delegatePublic" \\
  137. "-//OASIS//ENTITIES DocBook XML" \\
  138. "file:///etc/xml/docbook" \\
  139. etc/xml/catalog
  140. xmlcatalog --noout --add "delegatePublic" \\
  141. "-//OASIS//DTD DocBook XML" \\
  142. "file:///etc/xml/docbook" \\
  143. etc/xml/catalog
  144. xmlcatalog --noout --add "delegateSystem" \\
  145. "http://www.oasis-open.org/docbook/" \\
  146. "file:///etc/xml/docbook" \\
  147. etc/xml/catalog
  148. xmlcatalog --noout --add "delegateURI" \\
  149. "http://www.oasis-open.org/docbook/" \\
  150. "file:///etc/xml/docbook" \\
  151. etc/xml/catalog
  152. echo ""
  153. printf "%s" "Adding identifiers from previous version:"
  154. for DTDVERSION in 4.4 4.3 4.2 4.1.2
  155. do
  156. printf "%s" " v\${DTDVERSION}"
  157. # etc/xml/docbook
  158. xmlcatalog --noout --add "public" \\
  159. "-//OASIS//DTD DocBook XML V\${DTDVERSION}//EN" \\
  160. "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}/docbookx.dtd" \\
  161. etc/xml/docbook
  162. xmlcatalog --noout --add "rewriteSystem" \\
  163. "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}" \\
  164. "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
  165. etc/xml/docbook
  166. xmlcatalog --noout --add "rewriteURI" \\
  167. "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}" \\
  168. "file:///usr/share/xml/docbook/xml-dtd-4.5" \\
  169. etc/xml/docbook
  170. # etc/xml/catalog
  171. xmlcatalog --noout --add "delegateSystem" \\
  172. "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}/" \\
  173. "file:///etc/xml/docbook" \\
  174. etc/xml/catalog
  175. xmlcatalog --noout --add "delegateURI" \\
  176. "http://www.oasis-open.org/docbook/xml/\${DTDVERSION}/" \\
  177. "file:///etc/xml/docbook" \\
  178. etc/xml/catalog
  179. done
  180. EOF
  181. }