# SliTaz package receipt. PACKED_SIZE="288.0K" UNPACKED_SIZE="1.6M" PACKAGE="keyboard" VERSION="1.0" CATEGORY="base-system" SHORT_DESC="keyboard, locales and timezone settings" MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" WEB_SITE="http://tiny.slitaz.org/" DEPENDS="base-tiny" BUILD_DEPENDS="advancecomp" # Rules to configure and make the package. compile_rules() { mkdir -p $DESTDIR/usr/share/i18n $stuff cd $stuff for i in kbd-busybox glibc-base glibc-locale ; do tazpkg get $i tazpkg extract $i* done cp -a kbd-busybox*/fs/usr/share/kmap $DESTDIR/usr/share cp -a glibc-*/fs/usr/share/i18n/locales $DESTDIR/usr/share/i18n cp -a glibc-*/fs/usr/share/zoneinfo $DESTDIR/usr/share cd $DESTDIR/usr/share for i in i18n/locales zoneinfo ; do ( cd $i; find * -type f | while read f; do grep -q $f $stuff/../receipt || rm -f $f; done ) find $i -type d | tac | while read d; do rmdir $d 2> /dev/null done done find kmap/*.kmap i18n/locales zoneinfo | cpio -o -H newc | \ gzip -9 > data.cpio.gz advdef -z4 data.cpio.gz cd $stuff/.. rm -rf $stuff } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { cp -a $install/. $fs/ } config_form() { cat < var locale = [], timezone = []; function setdefault(kbd) { if (locale[kbd] != 'undefined') { document.getElementById("locale").value = locale[kbd]; } if (timezone[kbd] != 'undefined') { document.getElementById("timezone").value = timezone[kbd]; } } EOT awk 'BEGIN { n=0 } { print "locale[\"" $1 "\"] = \"" $2 "\";" if ($3 != "-") print "timezone[\"" $1 "\"] = \"" $3 "\";" gsub("_"," ",$4) name[n] = $4 kbd[n++] = $1 } END { print "" print "" print "" print "
Keyboard
Locale
Timezone
Use the kernel command line arguments kmap=, lang= and tz= (+200Kb). EOT } post_install() { if [ "$USECMDLINE" = "yes" ]; then mkdir $1/bin cat > $1/bin/loadkmap < /etc/locale.conf ;; tz=*) d=zoneinfo echo "\$j" > /etc/TZ ;; *) continue esac rm -rf \$d zcat data.cpio.gz | cpio -id \$d/\$j 2>/dev/null done cat kmap/* | busybox loadkmap rm -f /bin/loadkmap data.cpio.gz EOT chmod +x $1/bin/loadkmap else rm -f $1/usr/share/data.cpio.gz fi for i in $1/usr/share/i18n/locales/* ; do [ $i = $1/usr/share/i18n/locales/$LOCALE ] || rm $i done [ -n "$LOCALE" ] && cat > $1/etc/locale.conf < /dev/null [ -n "$TIMEZONE" ] && echo "$TIMEZONE" > $1/etc/TZ for i in $1/usr/share/kmap/*.kmap ; do [ $i = $1/usr/share/kmap/$KEYBOARD.kmap ] || rm $i done }