recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / libs / libdatrie / recipe
blobfce9dbd2f140f614e09454eb78431dc31e8cb173
1 # Build recipe for libdatrie.
3 # Copyright (C) 2019 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 program=libdatrie
18 version=0.2.12
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=libs
24 tarname=${program}-${version}.tar.xz
26 # Remote source(s)
27 fetch=http://github.com/tlwg/libdatrie/releases/download/v${version}/$tarname
29 description="
30 A double-Array Trie library.
32 libdatrie is an implementation of double-array structure for
33 representing trie, as proposed by Junichi Aoe.  Trie is a
34 kind of digital search tree, an efficient indexing method with
35 O(1) time complexity for searching. Comparably as efficient as
36 hashing, trie also provides flexibility on incremental matching
37 and key spelling manipulation.  This makes it ideal for
38 lexical analyzers, as well as spelling dictionaries.
40 See the details of the implementation at:
41 http://linux.thai.net/~thep/datrie/datrie.html
43 Historically, this was first implemented as C++ classes in a
44 library called midatrie, but later simplified and rewritten
45 from scratch in C.
48 homepage=http://linux.thai.net/projects/datrie
49 license=LGPLv2.1
51 # Copy documentation
52 docs="AUTHORS COPYING ChangeLog NEWS README*"
53 docsdir="${docdir}/${program}-${version}"
55 build()
57     set -e
59     unpack "${tardir}/$tarname"
61     cd "$srcdir"
63     # Set sane permissions
64     chmod -R u+w,go-w,a+rX-s .
66     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
67      $configure_args \
68      --libdir=/usr/lib${libSuffix} \
69      --mandir=$mandir \
70      --docdir=$docsdir \
71      --enable-static=yes \
72      --enable-shared=yes \
73      --build="$(cc -dumpmachine)"
75     make -j${jobs} V=1
76     make -j${jobs} DESTDIR="$destdir" install-strip
78     # Copy the rest of the documentation
79     mkdir -p "${destdir}${docsdir}"
80     cp -p -f $docs "${destdir}${docsdir}"
82     # Compress and link man pages (if needed)
83     if test -d "${destdir}/$mandir"
84     then
85         (
86             cd "${destdir}/$mandir"
87             find . -type f -exec lzip -9 '{}' +
88             find . -type l | while read -r file
89             do
90                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
91                 rm -- "$file"
92             done
93         )
94     fi