recipe 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Build recipe for GNU bash.
  2. #
  3. # Copyright (c) 2016-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=bash
  17. version=5.0
  18. release=3
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/shells"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=ftp://ftp.gnu.org/gnu/bash/$tarname
  24. description="
  25. The Bourne Again SHell.
  26. Bash is an sh-compatible shell that incorporates useful features from
  27. the Korn shell (ksh) and C shell (csh). It is intended to conform to
  28. the IEEE POSIX P1003.2/ISO 9945.2 shell and tools standard.
  29. It offers functional improvements over sh for both programming and
  30. interactive use.
  31. "
  32. homepage=http://www.gnu.org/software/bash
  33. license=GPLv3+
  34. # Limit package name to the program name
  35. full_pkgname=$program
  36. # Source documentation
  37. docsdir="${docdir}/${program}"
  38. build()
  39. {
  40. set -e
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. # Apply patches from upstream
  46. for file in "${worktree}"/patches/bash/bash50-???*
  47. do
  48. if test -f "$file"
  49. then
  50. patch -Np0 -i "$file"
  51. fi
  52. done
  53. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  54. LIBS="-lncursesw" \
  55. $configure_args \
  56. --libdir=/usr/lib${libSuffix} \
  57. --infodir=$infodir \
  58. --mandir=$mandir \
  59. --docdir=$docsdir \
  60. --enable-static-link \
  61. --enable-multibyte \
  62. --with-curses \
  63. --with-installed-readline \
  64. --without-bash-malloc \
  65. --build="$(cc -dumpmachine)"
  66. make -j${jobs} V=1
  67. make -j${jobs} DESTDIR="$destdir" install
  68. # Compress info documents deleting index file for the package
  69. if test -d "${destdir}/$infodir"
  70. then
  71. rm -f "${destdir}/${infodir}/dir"
  72. lzip -9 "${destdir}/${infodir}"/*
  73. fi
  74. # Compress and link man pages (if needed)
  75. if test -d "${destdir}/$mandir"
  76. then
  77. (
  78. cd "${destdir}/$mandir"
  79. find . -type f -exec lzip -9 '{}' +
  80. find . -type l | while read -r file
  81. do
  82. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  83. rm -- "$file"
  84. done
  85. )
  86. fi
  87. }