strip remaining libraries for the distribution size
[dragora.git] / recipes / tools / gettext / recipe
blobc83879eeb486ad033d037650ab89abe244f6abc0
1 # Build recipe for gettext.
3 # Copyright (c) 2016-2017 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=gettext
18 version=0.19.8.1
19 release=1
21 tarname=${program}-${version}.tar.lz
23 # Remote source(s)
24 fetch=http://ftp.gnu.org/pub/gnu/gettext/$tarname
26 description="
27 Utilities for internationalization and localization.
29 The Gettext package contains utilities for internationalization and
30 localization.  These allow programs to be compiled with NLS (Native
31 Language Support), enabling them to output messages in the user's
32 native language.
35 homepage=http://www.gnu.org/software/gettext
36 license="GPLv3+, LGPLv2.1"
38 # Source documentation
39 docsdir="${docdir}/${program}-${version}"
41 build()
43     set -e
45     unpack "${tardir}/$tarname"
47     cd "$srcdir"
49     ./configure \
50      CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
51      $configure_args \
52      --libdir=/usr/lib${libSuffix} \
53      --infodir=$infodir \
54      --mandir=$mandir \
55      --docdir=$docsdir \
56      --with-bzip2 \
57      --without-git \
58      --without-xz \
59      --build="$(cc -dumpmachine)"
61     make -j${jobs} V=1
62     make -j${jobs} DESTDIR="$destdir" install-strip
64     # Fix library permission if needed
65     if test -f "${destdir}/usr/lib${libSuffix}/preloadable_libintl.so"
66     then
67         chmod 755 "${destdir}/usr/lib${libSuffix}/preloadable_libintl.so"
68     fi
70     # Remove generated charset.alias
71     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
73     # Compress info documents deleting index file for the package
74     if test -d "${destdir}/$infodir"
75     then
76         rm -f "${destdir}/${infodir}/dir"
77         lzip -9 "${destdir}/${infodir}"/*
78     fi
80     # Compress and link man pages (if needed)
81     if test -d "${destdir}/$mandir"
82     then
83         (
84             cd "${destdir}/$mandir"
85             find . -type f -exec lzip -9 '{}' +
86             find . -type l | while read -r file
87             do
88                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
89                 rm -- "$file"
90             done
91         )
92     fi