net-wireless/gnss-sdr: add 9999, drop 0.0.17
[booboo.git] / eclass / stardict.eclass
blob361442f823794d79087e28bb72a6ef4a3baf4936
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.
8 # Usage:
9 #   - Variables to set :
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.
15 RESTRICT="strip"
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"
29 IUSE="gzip"
30 SLOT="0"
31 LICENSE="GPL-2"
33 DEPEND="|| ( >=app-text/stardict-2.4.2
34                 app-text/sdcv
35                 app-text/goldendict )
36         gzip? ( app-arch/gzip
37                 app-text/dictd )"
39 S="${WORKDIR}/${DICT_P}"
41 stardict_src_compile() {
42         if use gzip; then
43                 for file in *.idx; do
44                         [[ -f "$file" ]] && gzip "${file}"
45                 done
46                 for file in *.dict; do
47                         [[ -f "$file" ]] && dictzip "${file}"
48                 done
49         fi
52 stardict_src_install() {
53         insinto /usr/share/stardict/dic
54         doins *.dict.dz*
55         doins *.idx*
56         doins *.ifo
59 EXPORT_FUNCTIONS src_compile src_install