recipe 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for flex.
  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. # Exit immediately on any error
  17. set -e
  18. program=flex
  19. version=2.6.4
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=devel
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch=https://github.com/westes/flex/releases/download/v${version}/$tarname
  26. description="
  27. The fast lexical analyser generator.
  28. Flex is a fast lexical analyser generator. It is a tool for
  29. generating programs that perform pattern-matching on text.
  30. "
  31. homepage=https://flex.sourceforge.net
  32. license=Custom
  33. # Source documentation.
  34. #
  35. # The documentation files are installed by Flex.
  36. #
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --infodir=$infodir \
  48. --mandir=$mandir \
  49. --docdir=$docsdir \
  50. --enable-static \
  51. --enable-shared \
  52. --enable-nls \
  53. --build="$(gcc -dumpmachine)"
  54. make -j${jobs}
  55. make -j${jobs} DESTDIR="$destdir" install-strip
  56. # Compress info documents deleting index file for the package
  57. if test -d "${destdir}/$infodir"
  58. then
  59. rm -f "${destdir}/${infodir}/dir"
  60. lzip -9 "${destdir}/${infodir}"/*
  61. fi
  62. # Compress man pages
  63. lzip -9 "${destdir}/${mandir}"/man?/*
  64. # Provide compatibility with flex's predecessor, lex
  65. if test -f "${worktree}/archive/flex/usr/bin/lex"
  66. then
  67. cp -p "${worktree}/archive/flex/usr/bin/lex" \
  68. "${destdir}/usr/bin"
  69. chmod 755 "${destdir}/usr/bin/lex"
  70. ln -sf libfl.a "${destdir}/usr/lib${libSuffix}/libl.a"
  71. fi
  72. }