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