wok annotate locale-pt/receipt @ rev 3043
locale-*: Keep current config when on upgrade or install
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue May 12 23:24:55 2009 +0200 (2009-05-12) |
parents | 94147f719bb9 |
children | a51ace1961b2 |
rev | line source |
---|---|
pankso@3035 | 1 # SliTaz package receipt |
pankso@3035 | 2 |
pankso@3035 | 3 PACKAGE="locale-pt" |
pankso@3035 | 4 VERSION="2.0" |
pankso@3035 | 5 CATEGORY="system-tools" |
pankso@3035 | 6 SHORT_DESC="Portuguese/Brazilian locale pack." |
pankso@3035 | 7 MAINTAINER="pankso@slitaz.org" |
pankso@3035 | 8 DEPENDS="glibc-base" |
pankso@3035 | 9 BUILD_DEPENDS="glibc glibc-locale" |
pankso@3035 | 10 WEB_SITE="http://www.slitaz.org/" |
pankso@3035 | 11 |
pankso@3035 | 12 CORE_PKGS="asunder alsaplayer epdfview galculator geany gpicview gparted \ |
pankso@3035 | 13 glib gtk+ grsync leafpad lxpanel lxtask obconf openbox pcmanfm xpad" |
pankso@3035 | 14 |
pankso@3035 | 15 LOCALE="pt_BR" |
pankso@3035 | 16 LOCALEDEF="pt_BR" |
pankso@3035 | 17 CHARMAP="ISO-8859-1" |
pankso@3035 | 18 |
pankso@3035 | 19 # Rules to configure and make the package. |
pankso@3035 | 20 compile_rules() |
pankso@3035 | 21 { |
pankso@3035 | 22 # Ensure packages are built. |
pankso@3035 | 23 for pkg in $CORE_PKGS |
pankso@3035 | 24 do |
pankso@3035 | 25 [ -d $WOK/$pkg/taz ] || tazwok cook $pkg |
pankso@3035 | 26 done |
pankso@3035 | 27 } |
pankso@3035 | 28 |
pankso@3035 | 29 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@3035 | 30 # Genereted locale files are in /usr/lib/locale. |
pankso@3035 | 31 genpkg_rules() |
pankso@3035 | 32 { |
pankso@3035 | 33 mkdir -p $fs/usr/share/locale/$LOCALE \ |
pankso@3035 | 34 $fs/usr/lib/locale $fs/etc/xdg \ |
pankso@3035 | 35 $fs/usr/share/slitaz/messages |
pankso@3035 | 36 cp -a stuff/doc $fs/usr/share |
pankso@3035 | 37 cp -a stuff/messages $fs/usr/share/slitaz/messages/pt |
pankso@3035 | 38 cp -a stuff/openbox $fs/etc/xdg |
pankso@3035 | 39 PKG_NAME="$PACKAGE" |
pankso@3035 | 40 PKG_VERS="$VERSION" |
pankso@3035 | 41 # Get the core packages messages. |
pankso@3035 | 42 for pkg in $CORE_PKGS |
pankso@3035 | 43 do |
pankso@3035 | 44 [ -f $WOK/$pkg/receipt ] && . $WOK/$pkg/receipt |
pankso@3035 | 45 if [ -d $WOK/$pkg/$PACKAGE-$VERSION/_pkg/usr/share/locale/$LOCALE ]; then |
pankso@3035 | 46 cp -a $WOK/$pkg/$PACKAGE-$VERSION/_pkg/usr/share/locale/$LOCALE \ |
pankso@3035 | 47 $fs/usr/share/locale |
pankso@3035 | 48 fi |
pankso@3035 | 49 done |
pankso@3035 | 50 PACKAGE="$PKG_NAME" |
pankso@3035 | 51 VERSION="$PKG_VERS" |
pankso@3035 | 52 localedef -i $LOCALEDEF -c -f $CHARMAP $fs/usr/lib/locale/$LOCALEDEF |
pankso@3035 | 53 } |
pankso@3035 | 54 |
pankso@3043 | 55 # Post install to remove old locale-pt_BR. |
pankso@3035 | 56 post_install() |
pankso@3035 | 57 { |
pankso@3035 | 58 if [ -d /var/lib/tazpkg/installed/locale-pt_BR ]; then |
pankso@3035 | 59 echo "y" | tazpkg remove locale-pt_BR |
pankso@3035 | 60 fi |
pankso@3035 | 61 } |
pankso@3035 | 62 |
pankso@3035 | 63 # Back to C if it's the last used locale. |
pankso@3035 | 64 post_remove() |
pankso@3035 | 65 { |
pankso@3035 | 66 if grep -q $LOCALEDEF /etc/locale.conf; then |
pankso@3035 | 67 echo "LANG=C" > /etc/locale.conf |
pankso@3035 | 68 echo "LC_ALL=C" >> /etc/locale.conf |
pankso@3035 | 69 fi |
pankso@3035 | 70 } |