recipes: compressors/xz: Upgraded to version 5.6.2
[dragora.git] / recipes / devel / gperf / recipe
blob94ef3c87e3d3290522aa39e878f6db825c656b15
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
18 set -e
20 program=gperf
21 version=3.1
22 release=2
24 # Define a category for the output of the package name
25 pkgcategory=devel
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://ftp.gnu.org/pub/gnu/gperf/$tarname
32 description="
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
40 only.
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
48 license=GPLv3+
50 # Source documentation
51 docs="AUTHORS COPYING ChangeLog NEWS README"
52 docsdir="${docdir}/${program}-${version}"
54 build()
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
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" \
65      $configure_args \
66      --infodir=$infodir \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --build="$(gcc -dumpmachine)"
71     make -j${jobs} V=1
72     make check
73     make -j${jobs} DESTDIR="$destdir" install
75     # Compress info documents deleting index file for the package
76     if test -d "${destdir}/$infodir"
77     then
78         rm -f "${destdir}/${infodir}/dir"
79         lzip -9 "${destdir}/${infodir}"/*
80     fi
82     # Compress manual page
83     lzip -9 "${destdir}/${mandir}/man1/gperf.1"
85     # Copy documentation
86     mkdir -p "${destdir}/$docsdir"
88     for file in $docs
89     do
90         cp -p $file "${destdir}/$docsdir"
91     done