recipe 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Build recipe for bc.
  2. #
  3. # Copyright (c) 2016-2017 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=bc
  17. version=1.07.1
  18. release=1
  19. tarname=${program}-${version}.tar.gz
  20. # Remote source(s)
  21. fetch=http://ftp.gnu.org/gnu/bc/$tarname
  22. description="
  23. An arbitrary precision numeric processing language.
  24. Bc is an arbitrary precision numeric processing language. Syntax is
  25. similar to C, but differs in many substantial areas. It supports
  26. interactive execution of statements.
  27. Bc is a utility included in the POSIX P1003.2/D11 draft standard.
  28. Since the POSIX document does not specify how bc must be implemented,
  29. this version does not use the historical method of having bc be a
  30. compiler for the dc calculator. This version has a single executable
  31. that both compiles the language and runs the resulting 'byte code'.
  32. The byte code is not the dc language.
  33. "
  34. homepage=http://www.gnu.org/software/bc
  35. license="GPLv2+, LGPLv2.1"
  36. # Source documentation
  37. docs="AUTHORS COPYING* ChangeLog FAQ NEWS README Examples/"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --infodir=$infodir \
  48. --mandir=$mandir \
  49. --with-readline \
  50. --build="$(cc -dumpmachine)"
  51. make -j${jobs}
  52. make -j${jobs} DESTDIR="$destdir" install
  53. # Compress info documents deleting index file for the package
  54. if test -d "${destdir}/$infodir"
  55. then
  56. rm -f "${destdir}/${infodir}/dir"
  57. lzip -9 "${destdir}/${infodir}"/*
  58. fi
  59. # Compress and link man pages (if needed)
  60. if test -d "${destdir}/$mandir"
  61. then
  62. (
  63. cd "${destdir}/$mandir"
  64. find . -type f -exec lzip -9 '{}' +
  65. find . -type l | while read -r file
  66. do
  67. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  68. rm -- "$file"
  69. done
  70. )
  71. fi
  72. # Copy documentation
  73. mkdir -p "${destdir}${docsdir}"
  74. for file in $docs
  75. do
  76. cp -p -r $file "${destdir}${docsdir}"
  77. done
  78. }