# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="XingMa tables for SCIM-PYTHON Input Framework" HOMEPAGE="http://code.google.com/p/scim-python" SRC_URI="compose? ( http://scim-python.googlecode.com/files/xingma-compose-${PV}.tar.bz2 ) cangjie? ( http://scim-python.googlecode.com/files/xingma-cangjie5-${PV}.tar.bz2 ) erbi? ( http://scim-python.googlecode.com/files/xingma-erbi-qingsong-${PV}.tar.bz2 ) wubi? ( http://scim-python.googlecode.com/files/xingma-wubi86-${PV}.tar.bz2 ) zhengma? ( http://scim-python.googlecode.com/files/xingma-zhengma-${PV}.tar.bz2 )" LICENSE="LGPL-2" SLOT="0" KEYWORDS="~x86" IUSE="compose cangjie erbi wubi zhengma" DEPEND="app-i18n/scim-python" pkg_setup() { local letdie=0 if ! built_with_use app-i18n/scim-python xingma; then eerror "app-i18n/scim-python doesn't have xingma support!" let letdie+=1 fi if [[ -z $A ]]; then eerror "You must specify more than ONE table to install!" let letdie+=1 fi [[ $letdie != 0 ]] && eerror "Please check your USE flags!" && \ die "Please fix the above issues!" } src_unpack() { unpack ${A} cd "${WORKDIR}" for t in *.bz2; do bunzip2 "${t}" done } src_compile() { einfo "Generate XingMa tables. This may take a few minutes..." for dbfiles in *.txt; do python /usr/share/scim-python/engine/XingMa/XMCreateDB.py -s ${dbfiles} einfo "${dbfiles} done ;-)..." done } src_install() { insinto /usr/share/scim-python/engine/XingMa/tables doins *.db insinto /usr/share/scim/icons doins *.png } pkg_postinst() { elog elog "You may restart X session to make XingMa" elog "works out of the box!" elog }