wok-current view locale-cs/receipt @ rev 3000
slim: Fix pre_install func to backup config file (Thanks firmit)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 11 21:44:31 2009 +0200 (2009-05-11) |
parents | 37105c976ab8 |
children | b50bab5c00cd |
line source
1 # SliTaz package receipt
3 PACKAGE="locale-cs"
4 VERSION="1.1"
5 CATEGORY="system-tools"
6 SHORT_DESC="Czech locale pack."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="glibc-base"
9 BUILD_DEPENDS="glibc glibc-locale"
10 WEB_SITE="http://www.slitaz.org/"
12 CORE_PKGS="asunder alsaplayer epdfview galculator geany gpicview gparted \
13 glib gtk+ grsync leafpad lxpanel lxtask obconf openbox pcmanfm xpad"
15 LOCALE="cs"
16 LOCALEDEF="cs_CZ"
17 CHARMAP="ISO-8859-2"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 # Ensure packages are built.
23 for pkg in $CORE_PKGS
24 do
25 [ -d $WOK/$pkg/taz ] || tazwok cook $pkg
26 done
27 }
29 # Rules to gen a SliTaz package suitable for Tazpkg.
30 # Genereted locale files are in /usr/lib/locale.
31 genpkg_rules()
32 {
33 mkdir -p $fs/usr/share/locale/$LOCALE $fs/usr/lib/locale
34 PKG_NAME="$PACKAGE"
35 PKG_VERS="$VERSION"
36 # Get the core packages messages.
37 for pkg in $CORE_PKGS
38 do
39 [ -f $WOK/$pkg/receipt ] && . $WOK/$pkg/receipt
40 if [ -d $WOK/$pkg/$PACKAGE-$VERSION/_pkg/usr/share/locale/$LOCALE ]; then
41 cp -a $WOK/$pkg/$PACKAGE-$VERSION/_pkg/usr/share/locale/$LOCALE \
42 $fs/usr/share/locale
43 fi
44 done
45 PACKAGE="$PKG_NAME"
46 VERSION="$PKG_VERS"
47 localedef -i $LOCALEDEF -c -f $CHARMAP $fs/usr/lib/locale/$LOCALEDEF
48 }
50 # Post install to configure default locale.
51 post_install()
52 {
53 local root
54 root=$1
55 # locale.conf
56 if [ -s $root/etc/locale.conf ]; then
57 echo "LANG=\"$LOCALEDEF\"" > $root/etc/locale.conf
58 echo "LC_ALL=\"$LOCALEDEF\"" >> $root/etc/locale.conf
59 fi
60 }
62 # Back to C if it's the last used locale.
63 post_remove()
64 {
65 if grep -q $LOCALEDEF /etc/locale.conf; then
66 echo "LANG=C" > /etc/locale.conf
67 echo "LC_ALL=C" >> /etc/locale.conf
68 fi
69 }