recipe 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Build recipe for sgml-common.
  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=sgml-common
  17. version=0.6.3
  18. arch=noarch
  19. release=2
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/docbook"
  22. tarname=${program}-${version}.tgz
  23. # Remote source(s)
  24. fetch=http://sourceware.org/ftp/docbook-tools/new-trials/SOURCES/$tarname
  25. description="
  26. The SGML common package contains install-catalog.
  27. This is useful for creating and maintaining centralized SGML catalogs.
  28. "
  29. homepage=http://www.docbook.org/xml/
  30. license=GPLv3+
  31. # Source documentation
  32. docs="AUTHORS COPYING ChangeLog NEWS README"
  33. docsdir="${docdir}/${program}-${version}"
  34. build()
  35. {
  36. set -e
  37. unpack "${tardir}/$tarname"
  38. cd "$srcdir"
  39. # Apply patches and updates from Fedora
  40. patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-quotes.patch"
  41. patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-umask.patch"
  42. patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-xmldir.patch"
  43. # Apply patch from Beyond Linux From Scratch
  44. patch -Np1 -i "${worktree}/patches/sgml-common/sgml-common-0.6.3-manpage-1.patch"
  45. autoreconf -vif
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. ./configure $configure_args \
  49. --libdir=/usr/lib${libSuffix} \
  50. --infodir=$infodir \
  51. --mandir=$mandir \
  52. --docdir=$docsdir \
  53. --build="$(cc -dumpmachine)"
  54. make -j${jobs} V=1 docdir=$docsdir
  55. make -j${jobs} docdir=$docsdir DESTDIR="$destdir" install
  56. touch "${destdir}/etc/sgml/.graft-config"
  57. mkdir -p "${destdir}/usr/share/sgml/sgml-iso-entities-8879.1986"
  58. # Compress and link man pages (if needed)
  59. if test -d "${destdir}/$mandir"
  60. then
  61. (
  62. cd "${destdir}/$mandir"
  63. find . -type f -exec lzip -9 '{}' +
  64. find . -type l | while read -r file
  65. do
  66. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  67. rm -- "$file"
  68. done
  69. )
  70. fi
  71. # Copy documentation
  72. mkdir -p "${destdir}${docsdir}"
  73. cp -p $docs "${destdir}${docsdir}"
  74. }