website: move footer.t2t to the section that belongs (according to language)
[dragora.git] / recipes / libs / libunistring / recipe
blobb429ffdffc07a582dcc83312ce1144911d605e02
1 # Build recipe for libunistring.
3 # Copyright (c) 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 program=libunistring
18 version=0.9.10
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/libs"
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://ftp.gnu.org/gnu/libunistring/$tarname
29 description="
30 A library that provides functions for manipulating Unicode strings.
32 Text files are nowadays usually encoded in Unicode, and may consist of
33 very different scripts from Latin letters to Chinese Hanzi, with many
34 kinds of special characters accents, right-to-left writing marks,
35 hyphens, Roman numbers, and much more.  But the POSIX platform APIs for
36 text do not contain adequate functions for dealing with particular
37 properties of many Unicode characters.  In fact, the POSIX APIs for
38 text have several assumptions at their base which don't hold for
39 Unicode text.
41 This library provides functions for manipulating Unicode strings and
42 for manipulating C strings according to the Unicode standard.
45 homepage=http://www.gnu.org/software/libunistring/
46 license="GPLv3+, LGPLv3+"
48 # Source documentation
49 docs="AUTHORS BUGS COPYING* HACKING NEWS README THANKS"
50 docsdir="${docdir}/${program}-${version}"
52 build()
54     set -e
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --infodir=$infodir \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --enable-static=no \
70      --enable-shared=yes \
71      --enable-threads=posix \
72      --build="$(cc -dumpmachine)"
74     make -j${jobs} V=1
75     make -j${jobs} DESTDIR="$destdir" install-strip
77     # Delete generated charset.alias
78     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
79     rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
81     # Compress info documents deleting index file for the package
82     if test -d "${destdir}/$infodir"
83     then
84         rm -f "${destdir}/${infodir}/dir"
85         lzip -9 "${destdir}/${infodir}"/*
86     fi
88     # Compress and link man pages (if needed)
89     if test -d "${destdir}/$mandir"
90     then
91         (
92             cd "${destdir}/$mandir"
93             find . -type f -exec lzip -9 '{}' +
94             find . -type l | while read -r file
95             do
96                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
97                 rm -- "$file"
98             done
99         )
100     fi
102     # Copy documentation
103     mkdir -p "${destdir}${docsdir}"
104     cp -p $docs "${destdir}${docsdir}"/