recipe 2.9 KB

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