mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 20:06:41 +02:00
179 lines
4.8 KiB
Text
179 lines
4.8 KiB
Text
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
pkgname=kbd
|
|
pkgver=2.7.1
|
|
pkgrel=0
|
|
pkgdesc="Tools for configuring the console (keyboard, virtual terminals, etc.)"
|
|
url="https://kbd-project.org/"
|
|
arch="all"
|
|
license="GPL-2.0-or-later"
|
|
depends="kbd-misc"
|
|
makedepends="
|
|
autoconf
|
|
automake
|
|
check-dev
|
|
ckbcomp
|
|
linux-headers
|
|
linux-pam-dev
|
|
musl-legacy-error
|
|
xkeyboard-config-dev
|
|
"
|
|
checkdepends="coreutils"
|
|
subpackages="$pkgname-bkeymaps::noarch $pkgname-legacy::noarch
|
|
$pkgname-misc::noarch $pkgname-doc $pkgname-openrc $pkgname-vlock"
|
|
source="https://www.kernel.org/pub/linux/utils/kbd/kbd-$pkgver.tar.gz
|
|
|
|
loadkeys.initd
|
|
loadkeys.confd
|
|
|
|
ppc-keycode0-test.patch
|
|
"
|
|
|
|
_datadir=/usr/share
|
|
_xmapdir="$_datadir"/keymaps/xkb
|
|
_bmapdir="$_datadir"/bkeymaps
|
|
_badmaps="pk-ara"
|
|
|
|
build() {
|
|
./configure \
|
|
--build=$CBUILD \
|
|
--host=$CHOST \
|
|
--disable-nls \
|
|
--prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--datadir="$_datadir" \
|
|
--htmldir=/usr/share/html/$pkgname \
|
|
--disable-static
|
|
make
|
|
}
|
|
|
|
check() {
|
|
# dumpkeys-bkeymap fails
|
|
[ "$CARCH" = s390x ] && return 0
|
|
make check
|
|
}
|
|
|
|
_listxmaps() {
|
|
local invariant line; invariant=false
|
|
grep -v '^$' /usr/share/X11/xkb/rules/base.lst | while read -r line; do
|
|
case "$line" in
|
|
'! variant') invariant=true ;;
|
|
'!'*) invariant=false ;;
|
|
*) if $invariant; then
|
|
echo "$line" | cut -d: -f1
|
|
fi ;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
package() {
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
install -Dm755 "$srcdir"/loadkeys.initd \
|
|
"$pkgdir"/etc/init.d/loadkeys
|
|
install -Dm644 "$srcdir"/loadkeys.confd \
|
|
"$pkgdir"/etc/conf.d/loadkeys
|
|
|
|
# Move and fixup legacy keymaps
|
|
mkdir legacy
|
|
mv "$pkgdir"/usr/share/keymaps/* legacy
|
|
mv legacy "$pkgdir"/usr/share/keymaps
|
|
|
|
cd "$pkgdir"/usr/share/keymaps/legacy/i386
|
|
# Make ISO-8815-9 maps the default, instead of 7-bit ones
|
|
ln -s pt-latin9.map.gz qwerty/pt.map.gz
|
|
mv azerty/fr.map.gz azerty/fr-old.map.gz
|
|
ln -s fr-latin9.map.gz azerty/fr.map.gz
|
|
|
|
# Add some legacy aliases
|
|
ln -s fr-latin9.map.gz azerty/fr-latin0.map.gz
|
|
ln -s sv-latin1.map.gz qwerty/se-latin1.map.gz
|
|
ln -s sr-cy.map.gz qwerty/sr-latin.map.gz
|
|
|
|
# Rename conflicting keymaps
|
|
mv fgGIod/trf.map.gz fgGIod/trf-fgGIod.map.gz
|
|
mv olpc/es.map.gz olpc/es-olpc.map.gz
|
|
mv olpc/pt.map.gz olpc/pt-olpc.map.gz
|
|
mv qwerty/cz.map.gz qwerty/cz-qwerty.map.gz
|
|
|
|
# Remove useless layouts
|
|
rm -f i386/qwerty/ro_win.map.gz
|
|
|
|
cd "$builddir"
|
|
|
|
# Compile keymaps from X.org layouts
|
|
mkdir -p "$pkgdir$_xmapdir"
|
|
local layout variant
|
|
_listxmaps | while read -r variant layout; do
|
|
if ! test -f "$pkgdir$_xmapdir"/"$layout".map.gz; then
|
|
echo "Generating keymap $layout..."
|
|
ckbcomp "$layout" | gzip > "$pkgdir$_xmapdir"/"$layout".map.gz
|
|
fi
|
|
echo "Generating keymap $layout-$variant..."
|
|
ckbcomp "$layout" "$variant" | gzip > "$pkgdir$_xmapdir"/"$layout"-"$variant".map.gz
|
|
done
|
|
|
|
# Do some fix-ups on X.org keymaps
|
|
mv "$pkgdir$_xmapdir"/fi.map.gz "$pkgdir$_xmapdir"/fi-kotoistus.map.gz
|
|
|
|
# Replace busybox setfont utility.
|
|
mkdir -p "$pkgdir"/usr/sbin
|
|
mv "$pkgdir"/usr/bin/setfont "$pkgdir"/usr/sbin
|
|
|
|
# Link open to openvt
|
|
ln -s openvt "$pkgdir"/usr/bin/open
|
|
}
|
|
|
|
vlock() {
|
|
pkgdesc="$pkgname vlock implemantation"
|
|
depends=
|
|
|
|
# This is the only binary needing linux-pam so moving this to a
|
|
# subpackage reduces the amount of depencies of the kbd package.
|
|
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/vlock "$subpkgdir"/usr/bin
|
|
}
|
|
|
|
bkeymaps() {
|
|
pkgdesc="X.org-derived binary keymaps"
|
|
depends=
|
|
replaces="bkeymaps"
|
|
provides="bkeymaps"
|
|
|
|
mkdir -p "$subpkgdir$_bmapdir"
|
|
local map variant layout; for map in "$pkgdir$_xmapdir"/*.map.gz; do
|
|
variant="$(basename "$map" | cut -d. -f1)"
|
|
# shellcheck disable=2254
|
|
case "$variant" in $_badmaps) continue ;; esac
|
|
|
|
layout="${variant%%-*}"
|
|
mkdir -p "$subpkgdir$_bmapdir"/$layout
|
|
echo "Generating binary keymap $variant..."
|
|
"$pkgdir"/usr/bin/loadkeys -ub "$map" | gzip > "$subpkgdir$_bmapdir"/$layout/$variant.bmap.gz
|
|
done
|
|
}
|
|
|
|
legacy() {
|
|
pkgdesc="kbd legacy keymaps"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir$_datadir"/keymaps
|
|
mv "$pkgdir$_datadir"/keymaps/legacy "$subpkgdir$_datadir"/keymaps
|
|
}
|
|
|
|
misc() {
|
|
pkgdesc="kbd keymaps and console data"
|
|
depends=
|
|
|
|
mkdir -p "$subpkgdir$_datadir"
|
|
local dir; for dir in consolefonts consoletrans keymaps unimaps; do
|
|
mv "$pkgdir$_datadir"/$dir "$subpkgdir$_datadir"
|
|
done
|
|
}
|
|
|
|
sha512sums="
|
|
5e822cf3871c3ddec9439b93e550c70eeb1297094925097fd7ea31291bf32cbc8ffb3cf0db7a4c8558bea930571ca2a741c3a3c1c2e0ae3cd6d924517b9f28b5 kbd-2.7.1.tar.gz
|
|
64b5ab4c362350521da8f507d22c0b77784da99bbe1b32f0c001cd826f63c607e3f9cd6af01f06a61af8bd709760bbf2bb3cfe2010c33925f2987a1af6ef4998 loadkeys.initd
|
|
12028796552a5ffed1d5cb19d37fc6a73fb4f2e2bf34d837a81171c7ebee98d6c3f557715bf79706d79ce053b9b2450cd8cf1c4ea045428fb7d8a5915ae3ed78 loadkeys.confd
|
|
a2326d82a41c8ed377e0d3d48dd0e83febfc4e323d50c4ae30c69f8c9ce11208ca97cb567cad657b1bf157ca3b25b1531a8ac0dc73014bde819b51524e58a46a ppc-keycode0-test.patch
|
|
"
|