diff options
Diffstat (limited to 'packaging/locales-init.spec')
-rw-r--r-- | packaging/locales-init.spec | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/packaging/locales-init.spec b/packaging/locales-init.spec new file mode 100644 index 0000000..bd4a358 --- /dev/null +++ b/packaging/locales-init.spec @@ -0,0 +1,43 @@ +Name: locales-init +Summary: Locales selection for Tizen platforms +Version: 0.8 +Release: 3 +Group: System/Libraries +License: Apache License, Version 2.0 + +%description +Locales selection for Tizen platforms + +%build +echo "generating locales.." + +%post +TMP="`tempfile`" +LOCALE_REGEXP="(de_DE|el_GR|en_US|es_ES|fr_FR|it_IT|ja_JP|ko_KR|nl_NL|pt_PT|ru_RU|tr_TR|zh_CN|zh_HK|zh_TW).*UTF-8" + +egrep -v '^(#|$)' /etc/locale.gen | +egrep -v "^ *$LOCALE_REGEXP" | +while read line + do + echo Disabling locale `echo $line | cut -d' ' -f1` 1>&2 + echo "-e 's|^$line\$|# $line|'" + done | +xargs sed /etc/locale.gen -r -e '' >"$TMP" +cat "$TMP" >/etc/locale.gen + +egrep "^# *$LOCALE_REGEXP" /etc/locale.gen | +sed 's/^# *//' | +while read line + do + echo Enabling locale `echo $line | cut -d' ' -f1` 1>&2 + echo "-e 's|^# *$line\$|$line|'" + done | +xargs sed /etc/locale.gen -r -e '' >"$TMP" +cat "$TMP" >/etc/locale.gen +rm "$TMP" + +locale-gen + +%files + + |