recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / libs / mtdev / recipe
blob647fd048dd0a032e247311116f31f9990803839f
1 # Build recipe for mtdev.
3 # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
4 # Copyright (c) 2021 Matias A. Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=mtdev
22 version=1.1.6
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=libs
28 tarname=${program}-${version}.tar.bz2
30 # Remote source(s)
31 fetch=https://bitmath.org/code/mtdev/$tarname
33 description="
34 Multitouch Protocol Translation Library.
36 The mtdev is a stand-alone library which transforms all variants of
37 kernel MT events to the slotted type B protocol.  The events put into
38 mtdev may be from any MT device, specifically type A without contact
39 tracking, type A with contact tracking, or type B with contact
40 tracking.  See the kernel documentation for further details.
43 homepage=https://bitmath.org/code/mtdev/
44 license=MIT
46 # Source documentation
47 docs="COPYING ChangeLog README"
48 docsdir="${docdir}/${pkgname}-${version}"
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Update for several hosts (including Musl)
57     cp -f "${worktree}/archive/common/config.guess" config-aux/config.guess
58     cp -f "${worktree}/archive/common/config.sub" config-aux/config.sub
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --docdir=$docsdir \
67      --infodir=$infodir \
68      --mandir=$mandir \
69      --build="$(gcc -dumpmachine)"
71     make -j${jobs} V=1
72     make -j${jobs} DESTDIR="$destdir" install-strip
74     # Compress info documents deleting index file for the package
75     if test -d "${destdir}/$infodir"
76     then
77         rm -f "${destdir}/${infodir}/dir"
78         lzip -9 "${destdir}/${infodir}"/*
79     fi
81     # Compress and link man pages (if needed)
82     if test -d "${destdir}/$mandir"
83     then
84         (
85             cd "${destdir}/$mandir"
86             find . -type f -exec lzip -9 {} +
87             find . -type l | while read -r file
88             do
89                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
90                 rm -- "$file"
91             done
92         )
93     fi
95     # Copy documentation
96     mkdir -p "${destdir}/$docsdir"
97     cp -p $docs "${destdir}/$docsdir"