strip remaining libraries for the distribution size
[dragora.git] / recipes / libs / mtdev / recipe
blob00adacb00fb8fcb80da9790ab8b67ae6c2359bd0
1 # Build recipe for mtdev.
3 # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@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=mtdev
18 version=1.1.5
19 release=1
21 tarname=${program}-${version}.tar.bz2
23 # Remote source(s)
24 fetch=http://bitmath.org/code/mtdev/$tarname
26 description="
27 The mtdev is a stand-alone library which transforms all variants of kernel MT
28 events to the slotted type B protocol. The events put into mtdev may be from
29 any MT device, specifically type A without contact tracking, type A with
30 contact tracking, or type B with contact tracking. See the kernel documentation
31 for further details.
34 homepage=http://bitmath.org/code/mtdev/
35 license=MIT
37 # Source documentation
38 docs="COPYING ChangeLog README"
39 docsdir="${docdir}/${pkgname}-${version}"
41 build()
43     set -e
45     unpack "${tardir}/$tarname"
47     cd "$srcdir"
49     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
50      $configure_args \
51      --libdir=/usr/lib${libSuffix} \
52      --docdir=$docsdir \
53      --infodir=$infodir \
54      --mandir=$mandir \
56     make -j${jobs} V=1
57     make -j${jobs} DESTDIR="$destdir" install-strip
59     # Compress info documents deleting index file for the package
60     if test -d "${destdir}/$infodir"
61     then
62         rm -f "${destdir}/${infodir}/dir"
63         lzip -9 "${destdir}/${infodir}"/*
64     fi
66     # Compress and link man pages (if needed)
67     if test -d "${destdir}/$mandir"
68     then
69         (
70             cd "${destdir}/$mandir"
71             find . -type f -exec lzip -9 '{}' +
72             find . -type l | while read -r file
73             do
74                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
75                 rm -- "$file"
76             done
77         )
78     fi
80     # Copy documentation
81     mkdir -p "${destdir}${docsdir}"
83     for file in $docs
84     do
85         cp -p $file "${destdir}${docsdir}"
86     done