recipe 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Build recipe for m4.
  2. #
  3. # Copyright (c) 2015-2018 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=m4
  17. version=1.4.18
  18. release=2
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/devel"
  21. tarname=${program}-${version}.tar.bz2
  22. # Remote source(s)
  23. fetch=http://ftp.gnu.org/gnu/m4/$tarname
  24. description="
  25. Traditional Unix macro processor.
  26. GNU M4 is an implementation of the traditional Unix macro processor.
  27. It is mostly SVR4 compatible although it has some extensions (for
  28. example, handling more than 9 positional parameters to macros).
  29. GNU M4 also has built-in functions for including files, running shell
  30. commands, doing arithmetic, etc.
  31. GNU M4 is a macro processor in the sense that it copies its input
  32. to the output expanding macros as it goes.
  33. "
  34. homepage=http://www.gnu.org/software/m4
  35. license=GPLv3+
  36. # Source documentation
  37. docs="AUTHORS BACKLOG COPYING ChangeLog NEWS README THANKS TODO"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Set sane permissions
  45. chmod -R u+w,go-w,a+rX-s .
  46. patch -Np1 -i "${worktree}/patches/m4/update-freadahead"
  47. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  48. $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
  55. make -j${jobs} install DESTDIR="$destdir"
  56. # This look wrong since m4 does not support any encoding translation
  57. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  58. rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
  59. # Compress info documents deleting index file for the package
  60. if test -d "${destdir}/$infodir"
  61. then
  62. rm -f "${destdir}/${infodir}/dir"
  63. lzip -9 "${destdir}/${infodir}"/*
  64. fi
  65. # Compress man pages
  66. lzip -9 "${destdir}/${mandir}/man1/m4.1"
  67. # Copy documentation
  68. mkdir -p "${destdir}${docsdir}"
  69. for file in $docs
  70. do
  71. cp -p $file "${destdir}${docsdir}"
  72. done
  73. }