[arch-commits] CVS update of core/base/klibc-kbd (5 files)
Roman Kyrylych
roman at archlinux.org
Sat Mar 15 20:33:03 UTC 2008
Date: Saturday, March 15, 2008 @ 16:33:03
Author: roman
Path: /home/cvs-core/core/base/klibc-kbd
Added: PKGBUILD (1.1) keymap_hook (1.1) keymap_install (1.1)
no-exit.patch (1.1) no-isatty.patch (1.1)
upgpkg: klibc-kbd 1.15.20080312-1
-----------------+
PKGBUILD | 45 ++++++++++++++++++++++++++++++++++
keymap_hook | 27 ++++++++++++++++++++
keymap_install | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
no-exit.patch | 31 +++++++++++++++++++++++
no-isatty.patch | 58 ++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 232 insertions(+)
Index: core/base/klibc-kbd/PKGBUILD
diff -u /dev/null core/base/klibc-kbd/PKGBUILD:1.1
--- /dev/null Sat Mar 15 16:33:03 2008
+++ core/base/klibc-kbd/PKGBUILD Sat Mar 15 16:33:02 2008
@@ -0,0 +1,45 @@
+# $Id: PKGBUILD,v 1.1 2008/03/15 20:33:02 roman Exp $
+# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
+
+pkgname=klibc-kbd
+pkgver=1.15.20080312
+pkgrel=1
+pkgdesc="Keytable files and keyboard utilities"
+arch=('i686' 'x86_64')
+url="ftp://ftp.altlinux.org/pub/people/legion/kbd/"
+license=('GPL')
+groups=('base')
+depends=('klibc>=1.5-4')
+source=(ftp://ftp.archlinux.org/other/kbd/kbd-$pkgver.tar.gz
+ #ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-${pkgver}.tar.gz
+ no-isatty.patch
+ no-exit.patch
+ keymap_install
+ keymap_hook)
+md5sums=('709b087bb9d6c073bade70eda2da7770'
+ '53e9612ac5fc1b23601f793410742ed3'
+ '8c1bec330e8c98355502ac861561667d'
+ 'f72db8d5ea8d4c1868c7d1da4b8b1c7b'
+ '737f2e59052946283a9e7cdc0f1e2257')
+
+build() {
+ cd ${startdir}/src
+ #cd ${startdir}/src/kbd-${pkgver}
+ patch -Np1 -i ../no-isatty.patch
+ patch -Np1 -i ../no-exit.patch
+
+ aclocal
+ autoconf
+ automake --add-missing
+ ./configure --datadir=/share/kbd --enable-klibc
+
+ cd src/
+ make kbd_mode loadkeys setfont || return 1
+
+ install -D loadkeys ${startdir}/pkg/usr/lib/klibc/bin/loadkeys
+ install -D kbd_mode ${startdir}/pkg/usr/lib/klibc/bin/kbd_mode
+ install -D setfont ${startdir}/pkg/usr/lib/klibc/bin/setfont
+ # install hook
+ install -Dm644 ${startdir}/src/keymap_hook ${startdir}/pkg/lib/initcpio/hooks/keymap
+ install -Dm644 ${startdir}/src/keymap_install ${startdir}/pkg/lib/initcpio/install/keymap
+}
Index: core/base/klibc-kbd/keymap_hook
diff -u /dev/null core/base/klibc-kbd/keymap_hook:1.1
--- /dev/null Sat Mar 15 16:33:03 2008
+++ core/base/klibc-kbd/keymap_hook Sat Mar 15 16:33:02 2008
@@ -0,0 +1,27 @@
+# vim: set ft=sh:
+run_hook ()
+{
+ msg -n ":: Loading keymap..."
+ . /keymap
+ if [ "$UTF8" = "yes" ]; then
+ /bin/kbd_mode -u
+ printf "\033%%G" >> /dev/console
+ [ -n "$KEYMAP" ] && /bin/loadkeys -q -u $KEYMAP
+ else
+ /bin/kbd_mode -a
+ printf "\033%%@" >> /dev/console
+ [ -n "$KEYMAP" ] && /bin/loadkeys -q $KEYMAP
+ fi
+ if [ -n "$CONSOLEFONT" ]; then
+ if [ "$UTF8" = "yes" ]; then
+ CONSOLEMAP=""
+ fi
+ if [ -n "$CONSOLEMAP" ]; then
+ /bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/console
+ else
+ /bin/setfont $CONSOLEFONT -C /dev/console
+ fi
+ printf "\033(K" >> /dev/console
+ fi
+ msg "done."
+}
Index: core/base/klibc-kbd/keymap_install
diff -u /dev/null core/base/klibc-kbd/keymap_install:1.1
--- /dev/null Sat Mar 15 16:33:03 2008
+++ core/base/klibc-kbd/keymap_install Sat Mar 15 16:33:02 2008
@@ -0,0 +1,71 @@
+# vim: set ft=sh:
+
+# this is needed because kbd utilities compiled with klibc cannot use gunzip
+add_ucfile ()
+{
+ temp=$(mktemp)
+ dest=$(echo "$1" | sed 's|/usr||' | sed 's|.gz||')
+ name=$(echo "$1" | sed 's|.*/||')
+
+ if [ $(echo "$1" | grep '.gz$') ]; then
+ gunzip -c $1 > $temp
+ add_file $temp $dest
+ else
+ add_file $1 $dest
+ fi
+}
+
+install ()
+{
+ MODULES=""
+ BINARIES=""
+ FILES=""
+ SCRIPT="keymap"
+ KEYMAP_FILE="$(mktemp /tmp/keymap.XXXXXX)"
+ add_file /usr/lib/klibc/bin/loadkeys /bin/loadkeys
+ add_file /usr/lib/klibc/bin/kbd_mode /bin/kbd_mode
+ add_file /usr/lib/klibc/bin/setfont /bin/setfont
+ . /etc/rc.conf
+ echo "KEYMAP='$KEYMAP'" >> ${KEYMAP_FILE}
+ echo "CONSOLEFONT='$CONSOLEFONT'" >> ${KEYMAP_FILE}
+ echo "CONSOLEMAP='$CONSOLEMAP'" >> ${KEYMAP_FILE}
+ if [ -n "$(echo $LOCALE | grep -i utf)" ]; then
+ echo "UTF8='yes'" >> ${KEYMAP_FILE}
+ fi
+ . ${KEYMAP_FILE}
+ add_file ${KEYMAP_FILE} /keymap
+ if [ -n "$KEYMAP" ]; then
+ for i in $(echo $KEYMAP); do
+ for j in $(find /usr/share/kbd/keymaps -name "$i.map.gz"); do
+ add_ucfile $j
+ done
+ done
+ for i in $(echo /usr/share/kbd/keymaps/include/*); do
+ add_ucfile $i
+ done
+ for i in $(echo /usr/share/kbd/keymaps/*/include/*); do
+ add_ucfile $i
+ done
+ fi
+ if [ -n "$CONSOLEFONT" ]; then
+ for i in $(find /usr/share/kbd/consolefonts -name "$CONSOLEFONT.*gz"); do
+ add_ucfile $i
+ done
+ fi
+ if [ -n "$CONSOLEMAP" ]; then
+ for i in $(find /usr/share/kbd/unimaps -name "$CONSOLEMAP.uni"); do
+ add_ucfile $i
+ done
+ for i in $(find /usr/share/kbd/consoletrans -name "$CONSOLEMAP.trans" -o -name "$CONSOLEMAP"); do
+ add_ucfile $i
+ done
+ fi
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads the specified keymap and consolefont from rc.conf,
+ during early userspace.
+HELPEOF
+}
Index: core/base/klibc-kbd/no-exit.patch
diff -u /dev/null core/base/klibc-kbd/no-exit.patch:1.1
--- /dev/null Sat Mar 15 16:33:03 2008
+++ core/base/klibc-kbd/no-exit.patch Sat Mar 15 16:33:02 2008
@@ -0,0 +1,31 @@
+From 96dc0b9e56da64d2c063d1e74c81034b6b404bc2 Mon Sep 17 00:00:00 2001
+From: Roman Kyrylych <roman at archlinux.org>
+Date: Sat, 15 Mar 2008 21:46:35 +0200
+Subject: [PATCH] Do not exit on ferror during psf font loading when built with klibc
+
+Signed-off-by: Roman Kyrylych <roman at archlinux.org>
+---
+ src/psffontop.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/psffontop.c b/src/psffontop.c
+index 1b99e9b..75a6048 100644
+--- a/src/psffontop.c
++++ b/src/psffontop.c
+@@ -203,9 +203,13 @@ readpsffont(FILE *fontf, char **allbufp, int *allszp,
+ }
+ n += fread(inputbuf+n, 1, inputbuflth-n, fontf);
+ if (ferror(fontf)) {
++ #ifndef __klibc__
+ char *u = _("%s: Error reading input font");
+ fprintf(stderr, u, progname);
+ exit(EX_DATAERR);
++ #else
++ break;
++ #endif
+ }
+ if (feof(fontf))
+ break;
+--
+1.5.3.7
+
Index: core/base/klibc-kbd/no-isatty.patch
diff -u /dev/null core/base/klibc-kbd/no-isatty.patch:1.1
--- /dev/null Sat Mar 15 16:33:03 2008
+++ core/base/klibc-kbd/no-isatty.patch Sat Mar 15 16:33:02 2008
@@ -0,0 +1,58 @@
+From 92dc27dd57c83e9e2c798bda41ec111d26e1e3e2 Mon Sep 17 00:00:00 2001
+From: Roman Kyrylych <roman at archlinux.org>
+Date: Sat, 15 Mar 2008 18:57:04 +0200
+Subject: [PATCH] Do not use isatty() when built with klibc
+
+Signed-off-by: Roman Kyrylych <roman at archlinux.org>
+---
+ src/getfd.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/src/getfd.c b/src/getfd.c
+index 7f6d70e..3cef522 100644
+--- a/src/getfd.c
++++ b/src/getfd.c
+@@ -16,6 +16,7 @@
+ * if someone else used X (which does a chown on /dev/console).
+ */
+
++#ifndef __klibc__
+ static int
+ is_a_console(int fd) {
+ char arg;
+@@ -25,6 +26,7 @@ is_a_console(int fd) {
+ && ioctl(fd, KDGKBTYPE, &arg) == 0
+ && ((arg == KB_101) || (arg == KB_84)));
+ }
++#endif
+
+ static int
+ open_a_console(const char *fnam) {
+@@ -41,10 +43,12 @@ open_a_console(const char *fnam) {
+ fd = open(fnam, O_RDONLY);
+ if (fd < 0)
+ return -1;
++ #ifndef __klibc__
+ if (!is_a_console(fd)) {
+ close(fd);
+ return -1;
+ }
++ #endif
+ return fd;
+ }
+
+@@ -80,9 +84,11 @@ int getfd(const char *fnam) {
+ if (fd >= 0)
+ return fd;
+
++ #ifndef __klibc__
+ for (fd = 0; fd < 3; fd++)
+ if (is_a_console(fd))
+ return fd;
++ #endif
+
+ fprintf(stderr,
+ _("Couldnt get a file descriptor referring to the console\n"));
+--
+1.5.3.7
+
More information about the arch-commits
mailing list