Permalink
Browse files

Added locale-gen

  • Loading branch information...
1 parent 9fcc68a commit 36e790a274ff6a604952526400f55870134f34c4 @dimkr committed May 11, 2012
View
@@ -5,6 +5,7 @@ subito|optipng|optipng|exe>dev,dev,doc,nls
subito|dash|dash|exe,dev,doc,nls
subito|ncsplash|ncsplash|exe,dev,doc,nls
subito|syslinux|syslinux|exe,dev,doc,nls
+subito|locale-gen|locale-gen|exe,dev,doc,nls
# ... and others
arch|bash|bash|exe,dev,doc,nls
ubuntu|bc|bc|exe,dev,doc,nls
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+PKG_NAME="locale-gen"
+PKG_VER="svn$(date +%d%m%Y)"
+PKG_REV="1"
+PKG_DESC="A locale generation tool"
+PKG_CAT="BuildingBlock"
+PKG_DEPS=""
+
+download() {
+ [ -f $PKG_NAME-$PKG_VER.tar.xz ] && return 0
+
+ # create a directory for the sources
+ mkdir $PKG_NAME-$PKG_VER
+ [ $? -ne 0 ] && return 1
+
+ cd $PKG_NAME-$PKG_VER
+
+ # download the sources
+ download_file http://projects.archlinux.org/svntogit/packages.git/plain/trunk/locale-gen?h=packages/glibc \
+ locale-gen
+ [ $? -ne 0 ] && return 1
+
+ download_file http://projects.archlinux.org/svntogit/packages.git/plain/trunk/locale.gen.txt?h=packages/glibc \
+ locale.gen
+ [ $? -ne 0 ] && return 1
+
+ cd ..
+
+ # create a sources tarball
+ tar -c $PKG_NAME-$PKG_VER | xz -e -9 > $PKG_NAME-$PKG_VER.tar.xz
+ [ $? -ne 0 ] && return 1
+
+ # clean up
+ rm -rf $PKG_NAME-$PKG_VER
+ [ $? -ne 0 ] && return 1
+
+ return 0
+}
+
+build() {
+ # extract the sources tarball
+ tar -xJvf $PKG_NAME-$PKG_VER.tar.xz
+ [ $? -ne 0 ] && return 1
+
+ cd $PKG_NAME-$PKG_VER
+
+ return 0
+}
+
+package() {
+ # install locale-gen
+ install -D -m755 locale-gen $INSTALL_DIR/$SBIN_DIR/locale-gen
+ [ $? -ne 0 ] && return 1
+
+ # install locale.gen, the configuration file
+ install -D -m644 locale.gen $INSTALL_DIR/$CONF_DIR/locale.gen
+ [ $? -ne 0 ] && return 1
+
+ # add English to the default configuration
+ cat << EOF >> $INSTALL_DIR/$CONF_DIR/locale.gen
+
+en_US.UTF-8 UTF-8
+EOF
+ [ $? -ne 0 ] && return 1
+
+ return 0
+}
@@ -8,6 +8,9 @@
# generate the loader cache
[ ! -f /etc/ld.so.cache ] && ldconfig
+# generate the locale archive
+[ ! -f /usr/lib$suffix/locale/locale-archive ] && locale-gen
+
# update the MIME database
[ ! -f /usr/share/mime/mime.cache ] && update-mime-database /usr/share/mime
@@ -33,16 +36,8 @@ then
fi
# update the GTK+ icon cache
-if [ ! -f /usr/share/icons/hicolor/icon-theme.cache ]
-then
- /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor
-fi
-
-# generate the locale archive
-if [ ! -f /usr/lib$suffix/locale/locale-archive ]
-then
- localedef -i en_US -f UTF-8 en_US.UTF-8
-fi
+[ ! -f /usr/share/icons/hicolor/icon-theme.cache ] && \
+ /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor
# generate the font cache
if [ "/var/cache/fontconfig/*" = "$(echo /var/cache/fontconfig/*)" ]
@@ -56,7 +51,7 @@ then
[ ! -e "$directory" ] && continue
for sub_directory in $(find $directory -type d)
- do
+ do
cd $sub_directory
[ ! -f fonts.scale ] && mkfontscale
[ ! -f fonts.dir ] && mkfontdir

0 comments on commit 36e790a

Please sign in to comment.