File fetch-apphelp-translations of Package mingw32-umbrello

#!/bin/sh

#  fetch-apphelp-translations <mode>
#  options:
#       --fetch
#       --pack
#       --unpack <tar ball>
# @author: Ralf Habacker
#

SVNROOTPATH=svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4

fetch_translations () {
	svn co $SVNROOTPATH l10n-kde4
}

pack_translations() {
	DEST=work/doc
	if test -d $DEST; then
		rm -rf $DEST
	fi
	mkdir -p $DEST
	echo "#added by fetch-apphelp-translations" >work/doc/CMakeLists.txt.append
	for i in $(find l10n-kde4 -type d -name apphelp | sed 's,^\./,,g'); do
		lang=$(echo $i | sed 's,l10n-kde4/,,g;s,/.*$,,g')
		out=$DEST/$lang
		mkdir -p $out
		cp -a $i $out
		echo "kde4_create_handbook(index.docbook INSTALL_DESTINATION \${HTML_INSTALL_DIR}/$lang SUBDIR umbrello/apphelp)" > $out/apphelp/CMakeLists.txt
		echo "add_subdirectory($lang/apphelp)" >> work/doc/CMakeLists.txt.append
	done

	cd work
	tar -cJf ../umbrello-apphelp-translations.tar.xz *
}

unpack_translations() {
    tar -xJf $1
    cat doc/CMakeLists.txt.append >> doc/CMakeLists.txt
    rm  doc/CMakeLists.txt.append
}

case $1 in
--fetch)
    fetch_translations
     ;;
--pack)
    pack_translations
     ;;
--unpack)
    unpack_translations $2
     ;;
esac
openSUSE Build Service is sponsored by