diff options
author | Bo Yang <boyang@suse.de> | 2008-10-30 17:53:52 +0800 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-11-13 12:43:58 +0100 |
commit | a8722a190b65ddd4e6e958c6e8b28b268531d130 (patch) | |
tree | e6ab1d49079ab5182de95ceb163f2c5db6b8b4ea /source3/script | |
parent | 5e25f5f4f2b5b8dfd31206ebdc295c00870effe9 (diff) | |
download | samba-a8722a190b65ddd4e6e958c6e8b28b268531d130.tar.gz samba-a8722a190b65ddd4e6e958c6e8b28b268531d130.tar.bz2 samba-a8722a190b65ddd4e6e958c6e8b28b268531d130.zip |
i18n/l10n pam_winbind
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/script')
-rw-r--r-- | source3/script/installmo.sh | 83 | ||||
-rw-r--r-- | source3/script/uninstallmo.sh | 1 |
2 files changed, 84 insertions, 0 deletions
diff --git a/source3/script/installmo.sh b/source3/script/installmo.sh new file mode 100644 index 0000000000..a1f9c58e27 --- /dev/null +++ b/source3/script/installmo.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +DESTDIR=$1 +LOCALEDIR=`echo $2 | sed 's/\/\//\//g'` +SRCDIR=$3/ +MSGFMT=msgfmt + +case $0 in + *uninstall*) + if test ! -d "$DESTDIR/$LOCALEDIR"; then + echo "Directory $DESTDIR/$LOCALEDIR doesn't exist!" + echo "Do a \"make installmo\" or \"make install\" first." + exit 1 + fi + mode='uninstall' + ;; + *) + mode='install' + ;; +esac + +for dir in $SRCDIR/locale/*; do + MODULE=`basename $dir` + for f in $SRCDIR/locale/$MODULE/*.po; do + BASE=`basename $f` + LANGUAGE=`echo $BASE | sed 's/\.po//g'` + FNAME="$DESTDIR/$LOCALEDIR/$LANGUAGE/LC_MESSAGES/$MODULE.mo" + if test ! -d "$DESTDIR/$LOCALEDIR/$LANGUAGE/LC_MESSAGES/"; then + mkdir -p "$DESTDIR/$LOCALEDIR/$LANGUAGE/LC_MESSAGES/" + fi + if test "$mode" = 'install'; then + echo "Installing $f as $FNAME" + touch "$FNAME" + $MSGFMT "$f" -f -o "$FNAME" + if test ! -f "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges?" + exit 1 + fi + chmod 0644 "$FNAME" + elif test "$mode" = 'uninstall'; then + echo "removing $FNAME" + rm -f "$FNAME" + if test -f "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges?" + exit 1 + fi + else + echo "Unknown mode $mode. script called as $0." + exit 1 + fi + done + if test "$mode" = 'install'; then + cat << EOF +============================================================== +MO files for $MODULE are installed. +============================================================== +EOF + else + cat << EOF +============================================================== +MO files for $MODULE are removed. +============================================================== +EOF + fi +done + +if test "$mode" = 'install'; then + cat << EOF +============================================================== +All MO files for Samba are installed. You can use "make uninstall" +or "make uninstallmo" to remove them. +============================================================== +EOF +else + cat << EOF +============================================================== +All MO files for Samba are removed. you can use "make install" +or "make installmo" to install them. +============================================================== +EOF +fi + +exit 0 diff --git a/source3/script/uninstallmo.sh b/source3/script/uninstallmo.sh new file mode 100644 index 0000000000..5b4475f5c2 --- /dev/null +++ b/source3/script/uninstallmo.sh @@ -0,0 +1 @@ +installmo.sh |