recipes: Honor CPPFLAGS (through QICPPFLAGS) whenever is possible
[dragora.git] / recipes / dict / aspell / recipe
blobcdee4175ec014fcc667d77649b60093b3ac0c7ec
1 # Build recipe for aspell.
3 # Copyright (c) 2018-2019, 2021 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=aspell
21 version=0.60.8
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=dict
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=ftp://ftp.gnu.org/gnu/aspell/$tarname
32 description="
33 A spell checker.
35 GNU Aspell is a Free and Open Source spell checker designed to
36 eventually replace Ispell.  It can either be used as a library or as an
37 independent spell checker.  Its main feature is that it does a superior
38 job of suggesting possible replacements for a misspelled word than just
39 about any other spell checker out there for the English language.
41 Unlike Ispell, Aspell can also easily check documents in UTF-8 without
42 having to use a special dictionary.  Aspell will also do its best to
43 respect the current locale setting.  Other advantages over Ispell
44 include support for using multiple dictionaries at once and
45 intelligently handling personal dictionaries when more than one Aspell
46 process is open at once.
49 homepage=http://www.aspell.net
50 license=LGPLv2.1
52 # Source documentation
53 docs="COPYING README TODO"
54 docsdir="${docdir}/${program}-${version}"
56 build()
58     unpack "${tardir}/$tarname"
60     cd "$srcdir"
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
65     ./configure \
66     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
67      $configure_args \
68      --libdir=/usr/lib${libSuffix} \
69      --infodir=$infodir \
70      --mandir=$mandir \
71      --docdir=$docsdir \
72      --enable-pkgdatadir=/usr/lib${libSuffix}/aspell \
73      --enable-pkglibdir=/usr/lib${libSuffix}/aspell \
74      --enable-dict-dir=/usr/lib${libSuffix}/aspell \
75      --build="$(gcc -dumpmachine)"
77     make -j${jobs} V=1
78     make -j${jobs} DESTDIR="$destdir" install-strip
80     # Compress info documents deleting index file for the package
81     rm -f "${destdir}/${infodir}/dir"
82     lzip -9 "${destdir}/${infodir}"/*
84     # Compress and link man pages (if needed)
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     )
95     # Copy documentation
96     mkdir -p "${destdir}${docsdir}"
97     cp -p $docs "${destdir}${docsdir}"