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
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.gz
31 fetch=https://mirrors.edge.kernel.org/pub/linux/utils/kbd/$tarname
34 Keyboard utilities for GNU/Linux.
36 The kbd package contains key-table files and keyboard utilities.
39 homepage=https://kbd-project.org
42 # Source documentation
43 docs="AUTHORS COPYING CREDITS ChangeLog NEWS README"
44 docsdir="${docdir}/${program}-${version}"
48 unpack "${tardir}/$tarname"
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" \
74 --libdir=/usr/lib${libSuffix} \
77 --enable-optional-progs \
79 --build="$(gcc -dumpmachine)"
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" \
89 chmod 755 "${destdir}/usr/sbin/dragora-keymap"
91 # Compress and link man pages (if needed)
92 if test -d "${destdir}/$mandir"
95 cd "${destdir}/$mandir"
96 find . -type f -exec lzip -9 {} +
97 find . -type l | while read -r file
99 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106 mkdir -p "${destdir}/$docsdir"
107 cp -p $docs "${destdir}/$docsdir"