wok annotate slitaz-i18n/stuff/locale-pack.functions @ rev 17402
Try to 'arm'-ize tzdata, slitaz-i18n, and locale-* packages
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 28 01:22:40 2014 +0200 (2014-11-28) |
parents | c667db027c32 |
children | ec332cdcdbc1 |
rev | line source |
---|---|
al@14908 | 1 get_locale() |
al@14908 | 2 { |
al@14908 | 3 [ "x$CHARMAP" == x ] && CHARMAP=UTF-8 |
pankso@3087 | 4 |
al@17402 | 5 case "$SLITAZ_ARCH" in |
al@17402 | 6 arm*) ;; |
al@17402 | 7 i?86) |
al@17402 | 8 # Get translated Openbox menu from SliTaz sub project slitaz-configs |
al@17402 | 9 obmenu=$WOK/slitaz-configs/install/etc/xdg/openbox/menu.$LOCALE.xml |
al@17402 | 10 if [ -f $obmenu ]; then |
al@17402 | 11 mkdir -p $fs/etc/xdg/openbox |
al@17402 | 12 echo "* Found $LOCALE translations for: openbox menu" |
al@17402 | 13 cp $obmenu $fs/etc/xdg/openbox |
al@17402 | 14 fi |
al@17402 | 15 ;; |
al@17402 | 16 esac |
gokhlayeh@11389 | 17 |
al@14908 | 18 # Get the core packages messages. |
al@17402 | 19 case "$SLITAZ_ARCH" in |
al@17402 | 20 arm*) CORE_PKGS="$CORE_PKGS_ARM" ;; |
al@17402 | 21 esac |
al@14908 | 22 mkdir -p $fs/usr/share/locale/$LOCALE |
al@14908 | 23 for app in $CORE_PKGS; do |
al@14908 | 24 app_locale=$WOK/$app/install/usr/share/locale/$LOCALE |
al@14908 | 25 if [ -d $app_locale ]; then |
al@14908 | 26 echo "* Found $LOCALE translations for: $app" |
al@14908 | 27 cp -a $app_locale $fs/usr/share/locale |
pankso@3087 | 28 fi |
pankso@3087 | 29 done |
al@14908 | 30 |
al@14908 | 31 # List of available locales |
al@14908 | 32 cd $WOK/glibc/install/usr/share/i18n/locales |
al@14908 | 33 locales=$(ls -1 | sed -n '/^'$LOCALE'$/p; /^'$LOCALE'_.*/p' | sed '/translit/d') |
al@14908 | 34 [ "x$LOCALEDEF" != x ] && locales=$LOCALEDEF |
al@14908 | 35 |
al@14908 | 36 # Get X11 locale |
al@14908 | 37 for def in $locales; do |
al@14908 | 38 x11_locale=$WOK/xorg-libX11/install/usr/share/X11/locale/$def.$CHARMAP |
al@14908 | 39 if [ -d $x11_locale ]; then |
al@14908 | 40 echo "* Found $def.$CHARMAP locale for: X11" |
al@14908 | 41 mkdir -p $fs/usr/share/X11/locale |
al@14908 | 42 cp -a $x11_locale $fs/usr/share/X11/locale |
al@14908 | 43 fi |
al@14908 | 44 done |
al@14908 | 45 |
al@16551 | 46 # Get locale definition files |
al@16433 | 47 usil=usr/share/i18n/locales |
al@16433 | 48 for def in $locales; do |
al@16433 | 49 echo "* Copying $def locale files" |
al@16433 | 50 mkdir -p $fs/$usil |
al@16433 | 51 cp -a $WOK/glibc/install/$usil/$def $fs/$usil |
al@16433 | 52 done |
al@16433 | 53 |
al@16591 | 54 if [ "x$LOCALE_DEPENDS" != x ]; then |
al@16591 | 55 for dep in $LOCALE_DEPENDS; do |
al@16591 | 56 echo "* Copying additional $dep locale files" |
al@16591 | 57 cp -a $WOK/glibc/install/usr/share/i18n/locales/$dep \ |
al@16591 | 58 $fs/usr/share/i18n/locales |
al@16591 | 59 done |
al@16591 | 60 fi |
al@16591 | 61 |
al@16551 | 62 # Get timezones from tzdata |
al@14908 | 63 countries=$(echo $locales | \ |
al@14908 | 64 sed 's|@[^ ]*||g; s|[^ _]*_||g' | tr ' ' '\n' | sort -u) |
al@14908 | 65 echo "* Copy timezone info for countries: "$countries |
al@14908 | 66 locations='' |
al@14908 | 67 for country in $countries; do |
al@14908 | 68 location=$(grep '^'$country \ |
al@16551 | 69 $WOK/tzdata/install/usr/share/zoneinfo/zone.tab | awk '{ print $3}') |
al@14908 | 70 locations="$locations $location" |
al@14908 | 71 done |
al@14908 | 72 for location in $locations; do |
al@16551 | 73 for tz in $location; do |
al@16551 | 74 install -Dm644 $WOK/tzdata/install/usr/share/zoneinfo/$tz \ |
al@14908 | 75 $fs/usr/share/zoneinfo/$tz |
al@14908 | 76 done |
al@14908 | 77 done |
al@16551 | 78 |
al@17402 | 79 case "$SLITAZ_ARCH" in |
al@17402 | 80 arm*) exit 0 ;; |
al@17402 | 81 esac |
al@17402 | 82 |
al@16551 | 83 # Get country flags |
al@16591 | 84 echo "* Copy flag icons for countries: "$countries |
al@16552 | 85 usih=usr/share/icons/hicolor |
al@16591 | 86 for country in $countries; do |
al@16551 | 87 for size in 16x16 48x48; do |
al@16551 | 88 install -Dm644 \ |
al@16552 | 89 $WOK/flag-icons/taz/*/fs/$usih/$size/intl/$country.png \ |
al@16552 | 90 $fs/$usih/$size/intl/$country.png |
al@16551 | 91 done |
al@16551 | 92 done |
al@16551 | 93 # above icons credits |
al@16551 | 94 fusl=$fs/usr/share/licenses |
al@16551 | 95 mkdir -p $fusl |
al@16551 | 96 cp -a $WOK/flag-icons/source/*/LICENSE.txt $fusl/gosquared.txt |
al@16551 | 97 |
al@16591 | 98 # Gconv modules for encodings other than default |
al@16591 | 99 if [ "x$GCONV" != x ]; then |
al@16591 | 100 mkdir -p $fs/usr/lib/gconv |
al@16591 | 101 for enc in $GCONV; do |
al@16591 | 102 echo "* Copying $enc gconv module" |
al@16591 | 103 cp -a $WOK/glibc/install/usr/lib/gconv/$enc.so $fs/usr/lib/gconv |
al@16551 | 104 done |
al@16551 | 105 fi |
al@16551 | 106 |
al@16591 | 107 # Keyboard flags for default lxpanel keyboard applet |
al@16591 | 108 if [ "x$KB_FLAGS" != x ]; then |
al@16591 | 109 uslix=usr/share/lxpanel/images/xkb-flags |
al@16591 | 110 mkdir -p $fs/$uslix |
al@16591 | 111 for i in $KB_FLAGS; do |
al@16591 | 112 install -Dm644 \ |
al@16591 | 113 $WOK/flag-icons/taz/*/fs/$usih/16x16/intl/${i%%:*}.png \ |
al@16591 | 114 $fs/$usih/16x16/intl/${i%%:*}.png |
al@16591 | 115 ln -s /$usih/16x16/intl/${i%%:*}.png $fs/$uslix/${i##*:}.png |
al@16591 | 116 done |
al@16591 | 117 fi |
al@16591 | 118 |
al@16591 | 119 # exit code OK |
al@16551 | 120 echo |
pankso@3087 | 121 } |