wok-6.x annotate locale-cs/receipt @ rev 529
Add glibc-locale + locale pack: es, cs, ru
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed Apr 09 16:08:07 2008 +0200 (2008-04-09) |
parents | |
children | 73016cb6e50c |
rev | line source |
---|---|
pankso@529 | 1 # SliTaz package receipt |
pankso@529 | 2 |
pankso@529 | 3 PACKAGE="locale-cs" |
pankso@529 | 4 VERSION="1.0" |
pankso@529 | 5 CATEGORY="system-tools" |
pankso@529 | 6 SHORT_DESC="Czech locale pack." |
pankso@529 | 7 MAINTAINER="pankso@slitaz.org" |
pankso@529 | 8 DEPENDS="glibc-base" |
pankso@529 | 9 BUILD_DEPENDS="glibc" |
pankso@529 | 10 WEB_SITE="http://www.slitaz.org/" |
pankso@529 | 11 SOURCES="glibc" |
pankso@529 | 12 |
pankso@529 | 13 LOCALE="cs" |
pankso@529 | 14 LOCALEDEF="cs_CZ" |
pankso@529 | 15 CHARMAP="ISO-8859-2" |
pankso@529 | 16 #CORE_PKGS="geany leafpad" |
pankso@529 | 17 CORE_PKGS="" |
pankso@529 | 18 |
pankso@529 | 19 GLIBC_FILES=$WOK/glibc/glibc-2.7/_pkg |
pankso@529 | 20 PKG_NAME="$PACKAGE" |
pankso@529 | 21 PKG_VERS="$VERSION" |
pankso@529 | 22 |
pankso@529 | 23 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@529 | 24 # Install files in /usr/lib/locale. UTF-8: |
pankso@529 | 25 # localedef -i $LOCALEDEF -f UTF-8 $root/usr/lib/locale/$LOCALEDEF.utf8 |
pankso@529 | 26 # |
pankso@529 | 27 genpkg_rules() |
pankso@529 | 28 { |
pankso@529 | 29 mkdir -p $fs/usr/share/locale/$LOCALE $fs/usr/share/i18n/locales |
pankso@529 | 30 |
pankso@529 | 31 # Get the core apps messages. |
pankso@529 | 32 for pkg in $CORE_PKGS |
pankso@529 | 33 do |
pankso@529 | 34 . $WOK/$pkg/receipt |
pankso@529 | 35 if [ -d $WOK/$pkg/$PACKAGE-$VERSION/_pkg/usr/share/locale/$LOCALE ]; then |
pankso@529 | 36 cp -a $WOK/$pkg/$PACKAGE-$VERSION/_pkg/usr/share/locale/$LOCALE \ |
pankso@529 | 37 $fs/usr/share/locale |
pankso@529 | 38 fi |
pankso@529 | 39 done |
pankso@529 | 40 |
pankso@529 | 41 # Glibc locale. |
pankso@529 | 42 cp -a $GLIBC_FILES/usr/share/i18n/locales/$LOCALEDEF \ |
pankso@529 | 43 $fs/usr/share/i18n/locales |
pankso@529 | 44 cp -a $GLIBC_FILES/usr/share/locale/$LOCALE $fs/usr/share/locale |
pankso@529 | 45 |
pankso@529 | 46 PACKAGE="$PKG_NAME" |
pankso@529 | 47 VERSION="$PKG_VERS" |
pankso@529 | 48 |
pankso@529 | 49 # Gen locale files. |
pankso@529 | 50 mkdir -p $fs/usr/lib/locale |
pankso@529 | 51 localedef -i $LOCALEDEF -c -f $CHARMAP $fs/usr/lib/locale/$LOCALEDEF |
pankso@529 | 52 } |
pankso@529 | 53 |
pankso@529 | 54 # Post install to configure default locale. |
pankso@529 | 55 post_install() |
pankso@529 | 56 { |
pankso@529 | 57 local root |
pankso@529 | 58 root=$1 |
pankso@529 | 59 # locale.conf |
pankso@529 | 60 if [ -f $root/etc/locale.conf ]; then |
pankso@529 | 61 echo "LANG=\"$LOCALEDEF\"" > $root/etc/locale.conf |
pankso@529 | 62 echo "LC_ALL=\"$LOCALEDEF\"" >> $root/etc/locale.conf |
pankso@529 | 63 fi |
pankso@529 | 64 } |
pankso@529 | 65 |
pankso@529 | 66 # Back to C if it's the last used locale. |
pankso@529 | 67 post_remove() |
pankso@529 | 68 { |
pankso@529 | 69 if grep -q $LOCALEDEF /etc/locale.conf; then |
pankso@529 | 70 echo "LANG=C" > /etc/locale.conf |
pankso@529 | 71 echo "LC_ALL=C" >> /etc/locale.conf |
pankso@529 | 72 fi |
pankso@529 | 73 } |