aboutsummaryrefslogtreecommitdiffstats
path: root/main/kbd/APKBUILD
blob: 171f05a7fc809614fa8eef7bda2b8ee4a50bd274 (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
99
100
101
102
103
104
105
106
107
108
109
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kbd
pkgver=2.0.4
pkgrel=0
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="linux-headers bison flex autoconf automake linux-pam-dev check-dev"
install=""
subpackages="$pkgname-misc::noarch $pkgname-doc $pkgname-vlock"
source="http://kbd-project.org/download/kbd-$pkgver.tar.gz
	error.h
	"

_builddir="$srcdir"/kbd-$pkgver
prepare() {
	# apply patches (if any)
	default_prepare || return 1

	# install our error.h
	cp "$srcdir"/error.h . || return 1

	# fixes from fedora
	# 7-bit maps are obsolete; so are non-euro maps
	cd "$_builddir"/data/keymaps/i386
	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
}

_datadir=/usr/share
build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--disable-nls \
		--prefix=/usr \
		--datadir=${_datadir} \
		--htmldir=/usr/share/html/$pkgname \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	# ro_win.map.gz is useless
	rm -f "$pkgdir"${_datadir}/keymaps/i386/qwerty/ro_win.map.gz

	# Create additional name for Serbian latin keyboard
	ln -s sr-cy.map.gz "$pkgdir"${_datadir}/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"${_datadir}/keymaps/i386/qwerty/ko.map.gz

	# Install html documentation
	mkdir -p "$pkgdir"/usr/share/html/$pkgname
	mv docs/doc/*.html "$pkgdir"/usr/share/html/$pkgname/ || return 1

	# Replace busybox setfont utility.
	mkdir -p "$pkgdir"/usr/sbin
	mv "$pkgdir"/usr/bin/setfont "$pkgdir"/usr/sbin/ || return 1

	# 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 moving this to a
	# subpackage reduce the amount of depencies of the kbd package.

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/vlock \
		"$subpkgdir"/usr/bin/ || return 1
}

misc() {
	pkgdesc="Data for kbd package"
	depends=

	mkdir -p "$subpkgdir"${_datadir}
	for dir in consolefonts consoletrans keymaps unimaps; do
		mv "$pkgdir"${_datadir}/${dir} "$subpkgdir"/${_datadir}/ \
			|| return 1
	done
}

sha512sums="e37bc661c75a8363e9a5ba903310fa7f7ded4f381c2c77aa7edc0b1aca5a63224933fd113cddcf180e7fb85f55407e0d1f47be1cdf69dcf2787e83ac996bbf03  kbd-2.0.4.tar.gz
c66f6b0d8c8b8d285c740bdbe7130dee272ac01cd5e73b35a58cedf1a77fe8d9e062631b804fb58014d8eb9861c8f28aed07bc022ef31662bcc61b5c85a21752  error.h"