aboutsummaryrefslogtreecommitdiffstats
path: root/main/kbd/APKBUILD
blob: 9ecd61cc6c59abaf1949905ec7cb86dd19fe4e12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kbd
pkgver=2.0.1
pkgrel=1
pkgdesc="Tools for configuring the console (keyboard, virtual terminals, etc.)"
url="http://ftp.altlinux.org/pub/people/legion/kbd"
arch="all"
license="GPL2+"
depends="kbd-misc"
makedepends="bison flex autoconf automake linux-pam-dev check-dev"
install=""
subpackages="$pkgname-misc $pkgname-doc"
source="ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-$pkgver.tar.gz"

_builddir="$srcdir"/kbd-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	aclocal -I m4 && automake --add-missing && autoreconf || return 1
	sed -i '1i#include <stdarg.h>' src/libkeymap/keymap/common.h

	# fixes from fedora
	# 7-bit maps are obsolete; so are non-euro maps
	cd "$_builddir"/data/keymaps/i386
	mv qwerty/fi.map qwerty/fi-old.map
	cp qwerty/fi-latin9.map qwerty/fi.map
	cp qwerty/pt-latin9.map qwerty/pt.map
	cp qwerty/sv-latin1.map qwerty/se-latin1.map

	mv azerty/fr.map azerty/fr-old.map
	cp azerty/fr-latin9.map azerty/fr.map

	cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias

	# Rename conflicting keymaps
	mv dvorak/no.map dvorak/no-dvorak.map
	mv fgGIod/trf.map fgGIod/trf-fgGIod.map
	mv olpc/es.map olpc/es-olpc.map
	mv olpc/pt.map olpc/pt-olpc.map
	mv qwerty/cz.map qwerty/cz-qwerty.map
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--datadir=/lib/kbd \
		--localedir=/usr/share/locale \
		--disable-nls \
		--mandir=/usr/share/man \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/lib/*.la

	# ro_win.map.gz is useless
	rm -f "$pkgdir"/lib/kbd/keymaps/i386/qwerty/ro_win.map.gz

	# Create additional name for Serbian latin keyboard
	ln -s sr-cy.map.gz "$pkgdir"/lib/kbd/keymaps/i386/qwerty/sr-latin.map.gz

	# The rhpl keyboard layout table is indexed by kbd layout names,
	# so we need a Korean keyboard
	ln -s us.map.gz "$pkgdir"/lib/kbd/keymaps/i386/qwerty/ko.map.gz

	# Move binaries which we use before /usr is mounted to /bin.
	mkdir -p "$pkgdir"/bin
	for binary in setfont dumpkeys kbd_mode unicode_start unicode_stop loadkeys ; do
		mv "$pkgdir"/usr/bin/$binary "$pkgdir"/bin/ || return 1
	done

	# Link open to openvt
	ln -s openvt "$pkgdir"/usr/bin/open
}

misc() {
	pkgdesc="Data for kbd package"
	arch="noarch"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/kbd "$subpkgdir"/lib/
}

md5sums="cc0ee9f2537d8636cae85a8c6541ed2e  kbd-2.0.1.tar.gz"
sha256sums="75e78834e60adc1e95a479f9946a836f8a4f1e05bc0332660d3582c44bbc3019  kbd-2.0.1.tar.gz"
sha512sums="666b5ad251036a69ae32dcac6d436602aa0c8da9adf8babb56ff4489fe61757d3ce10fc749694fbb5d1a5192da0999694ac7643a562fb88ab2a58897e0090dc2  kbd-2.0.1.tar.gz"