recipes: compressors/xz: Upgraded to version 5.6.2
[dragora.git] / recipes / tools / kbd / recipe
blobe4019b5101f54fde2a4d348fb1e91b9ef96f10cb
1 # Build recipe for kbd.
3 # Copyright (c) 2016-2021 Matias Fonzo, <selk@dragora.org>.
4 # Copyright (c) 2022 Matias 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=kbd
22 version=2.5.1
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tar.gz
30 # Remote source(s)
31 fetch=https://mirrors.edge.kernel.org/pub/linux/utils/kbd/$tarname
33 description="
34 Keyboard utilities for GNU/Linux.
36 The kbd package contains key-table files and keyboard utilities.
39 homepage=https://kbd-project.org
40 license=GPLv2+
42 # Source documentation
43 docs="AUTHORS COPYING CREDITS ChangeLog NEWS README"
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     unpack "${tardir}/$tarname"
50     cd "$srcdir"
52     # Set sane permissions
53     chmod -R u+w,go-w,a+rX-s .
55     # Use patches from Fedora to improve kbd
56     patch -Np1 -i "${worktree}/patches/kbd/kbd-1.15-keycodes-man.patch"
57     patch -Np1 -i "${worktree}/patches/kbd/kbd-1.15-unicode_start.patch"
58     patch -Np1 -i "${worktree}/patches/kbd/kbd-2.4.0-covscan-fixes.patch"
60     # Fix inconsistent behaviour of Backspace and Delete keys
61     # for i386 keymaps (Thanks to "Linux From Scratch")
62     patch -Np1 -i "${worktree}/patches/kbd/kbd-2.5.1-backspace-1.patch"
64     # Remove the redundant resizecons program (it requires the defunct
65     # svgalib to provide the video mode files - for normal use setfont
66     # sizes the console appropriately) together with its manpage.
67     # (Thanks again to "Linux From Scratch")
68     sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure
69     sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in
71     ./configure CPPFLAGS="$QICPPFLAGS" \
72     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
73      $configure_args \
74      --libdir=/usr/lib${libSuffix} \
75      --mandir=$mandir \
76      --disable-vlock \
77      --enable-optional-progs \
78      --enable-nls \
79      --build="$(gcc -dumpmachine)"
81     make -j${jobs} V=1
82     make -j${jobs} DESTDIR="$destdir" install
84     # Include Dragora's menu-driven tool to configure the keyboard map
86     mkdir -p "${destdir}/usr/sbin"
87     cp -p "${worktree}/archive/dragora-tools/dragora-keymap" \
88           "${destdir}/usr/sbin"
89     chmod 755 "${destdir}/usr/sbin/dragora-keymap"
91     # Compress and link man pages (if needed)
92     if test -d "${destdir}/$mandir"
93     then
94         (
95             cd "${destdir}/$mandir"
96             find . -type f -exec lzip -9 {} +
97             find . -type l | while read -r file
98             do
99                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
100                 rm -- "$file"
101             done
102         )
103     fi
105     # Copy documentation
106     mkdir -p "${destdir}/$docsdir"
107     cp -p $docs "${destdir}/$docsdir"