1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # Author : Alastair Tse <liquidx@gentoo.org>
7 # Convienence class to do stardict dictionary installations.
10 # - Variables to set :
11 # * FROM_LANG - From this language
12 # * TO_LANG - To this language
13 # * DICT_PREFIX - SRC_URI prefix, like "dictd_www.mova.org_"
14 # * DICT_SUFFIX - SRC_URI after the prefix.
18 [ -z "${DICT_SUFFIX}" ] && DICT_SUFFIX=${PN#stardict-[[:lower:]]*-}
19 [ -z "${DICT_P}" ] && DICT_P=stardict-${DICT_PREFIX}${DICT_SUFFIX}-${PV}
21 if [ -n "${FROM_LANG}" -a -n "${TO_LANG}" ]; then
22 DESCRIPTION="Stardict Dictionary ${FROM_LANG} to ${TO_LANG}"
23 elif [ -z "${DESCRIPTION}" ]; then
24 DESCRIPTION="Another Stardict Dictionary"
27 HOMEPAGE="http://stardict.sourceforge.net/"
28 SRC_URI="mirror://sourceforge/stardict/${DICT_P}.tar.bz2"
34 DEPEND="|| ( >=app-text/stardict-2.4.2
40 S=${WORKDIR}/${DICT_P}
42 stardict_src_compile() {
45 [[ -f $file ]] && gzip ${file}
47 for file in *.dict; do
48 [[ -f $file ]] && dictzip ${file}
53 stardict_src_install() {
54 insinto /usr/share/stardict/dic
60 EXPORT_FUNCTIONS src_compile src_install