recipe 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Build recipe for gperf.
  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=gperf
  17. version=3.1
  18. release=1
  19. tarname=${program}-${version}.tar.gz
  20. # Remote source(s)
  21. fetch=http://ftp.gnu.org/pub/gnu/gperf/$tarname
  22. description="
  23. Perfect hash function generator.
  24. GNU gperf is a perfect hash function generator. For a given list of
  25. strings, it produces a hash function and hash table, in form of C or
  26. C++ code, for looking up a value depending on the input string.
  27. The hash function is perfect, which means that the hash table has no
  28. collisions, and the hash table lookup needs a single string comparison
  29. only.
  30. GNU gperf is highly customizable. There are options for generating C
  31. or C++ code, for emitting switch statements or nested ifs instead of a
  32. hash table, and for tuning the algorithm employed by gperf.
  33. "
  34. homepage=http://www.gnu.org/software/gperf
  35. license=GPLv3+
  36. # Source documentation
  37. docs="AUTHORS COPYING ChangeLog NEWS README"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. ./configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
  45. LDFLAGS="$QILDFLAGS -static" \
  46. $configure_args \
  47. --infodir=$infodir \
  48. --mandir=$mandir \
  49. --docdir=$docsdir \
  50. --build="$(cc -dumpmachine)"
  51. make -j${jobs} V=1
  52. make check
  53. make -j${jobs} DESTDIR="$destdir" install
  54. # Compress info documents deleting index file for the package
  55. if test -d "${destdir}/$infodir"
  56. then
  57. rm -f "${destdir}/${infodir}/dir"
  58. lzip -9 "${destdir}/${infodir}"/*
  59. fi
  60. # Compress manual page
  61. lzip -9 "${destdir}/${mandir}/man1/gperf.1"
  62. # Copy documentation
  63. mkdir -p "${destdir}${docsdir}"
  64. for file in $docs
  65. do
  66. cp -p $file "${destdir}${docsdir}"
  67. done
  68. }