recipe 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Build recipe for gperf.
  2. #
  3. # Copyright (c) 2016-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=gperf
  19. version=3.1
  20. release=2
  21. # Define a category for the output of the package name
  22. pkgcategory=devel
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://ftp.gnu.org/pub/gnu/gperf/$tarname
  26. description="
  27. Perfect hash function generator.
  28. GNU gperf is a perfect hash function generator. For a given list of
  29. strings, it produces a hash function and hash table, in form of C or
  30. C++ code, for looking up a value depending on the input string.
  31. The hash function is perfect, which means that the hash table has no
  32. collisions, and the hash table lookup needs a single string comparison
  33. only.
  34. GNU gperf is highly customizable. There are options for generating C
  35. or C++ code, for emitting switch statements or nested ifs instead of a
  36. hash table, and for tuning the algorithm employed by gperf.
  37. "
  38. homepage=https://www.gnu.org/software/gperf
  39. license=GPLv3+
  40. # Source documentation
  41. docs="AUTHORS COPYING ChangeLog NEWS README"
  42. docsdir="${docdir}/${program}-${version}"
  43. build()
  44. {
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
  50. LDFLAGS="$QILDFLAGS -static" \
  51. $configure_args \
  52. --infodir=$infodir \
  53. --mandir=$mandir \
  54. --docdir=$docsdir \
  55. --build="$(gcc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make check
  58. make -j${jobs} DESTDIR="$destdir" install
  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 manual page
  66. lzip -9 "${destdir}/${mandir}/man1/gperf.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. }