1 # Build recipe for gperf.
3 # Copyright (c) 2016-2018 Matias Fonzo, <selk@dragora.org>.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
30 fetch=https://ftp.gnu.org/pub/gnu/gperf/$tarname
33 Perfect hash function generator.
35 GNU gperf is a perfect hash function generator. For a given list of
36 strings, it produces a hash function and hash table, in form of C or
37 C++ code, for looking up a value depending on the input string.
38 The hash function is perfect, which means that the hash table has no
39 collisions, and the hash table lookup needs a single string comparison
42 GNU gperf is highly customizable. There are options for generating C
43 or C++ code, for emitting switch statements or nested ifs instead of a
44 hash table, and for tuning the algorithm employed by gperf.
47 homepage=https://www.gnu.org/software/gperf
50 # Source documentation
51 docs="AUTHORS COPYING ChangeLog NEWS README"
52 docsdir="${docdir}/${program}-${version}"
56 unpack "${tardir}/$tarname"
60 # Set sane permissions
61 chmod -R u+w,go-w,a+rX-s .
63 ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" \
64 LDFLAGS="$QILDFLAGS -static" \
69 --build="$(gcc -dumpmachine)"
73 make -j${jobs} DESTDIR="$destdir" install
75 # Compress info documents deleting index file for the package
76 if test -d "${destdir}/$infodir"
78 rm -f "${destdir}/${infodir}/dir"
79 lzip -9 "${destdir}/${infodir}"/*
82 # Compress manual page
83 lzip -9 "${destdir}/${mandir}/man1/gperf.1"
86 mkdir -p "${destdir}/$docsdir"
90 cp -p $file "${destdir}/$docsdir"