summaryrefslogtreecommitdiff
blob: f23a5a69c8d613a339c33a0f90a75b45fbbc3681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils multilib

MY_PV=${PV/_rc/rc}
MY_P=${PN}-voikko-${MY_PV}

DESCRIPTION="An interface between ispell and Voikko Finnish spellcheckers."
SRC_URI="mirror://sourceforge/voikko/${MY_P}.tar.gz"
HOMEPAGE="http://voikko.sf.net/"
IUSE="nls"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~amd64"

DEPEND=">=app-text/ispell-3.3.02-r90
	!app-dicts/ispell-fi
	>=app-text/voikko-1.0
	>=dev-libs/glib-2.0.0
	>=dev-libs/glibmm-2.4
	sys-apps/miscfiles
	dev-util/pkgconfig
	app-admin/eselect-ispell"
RDEPEND=">=app-text/ispell-3.3.02-r90
	>=app-text/voikko-1.0
	>=dev-libs/glib-2.0.0
	>=dev-libs/glibmm-2.4"

S="${WORKDIR}/${MY_P/rc?/}"

pkg_setup() {
	if [[ -d "${ROOT}/usr/$(get_libdir)/ispell" ]] ; then
		ISPELL_DIR=/usr/$(get_libdir)/ispell
	elif [[ -d "${ROOT}/usr/share/ispell" ]] ; then
		ISPELL_DIR=/usr/share/ispell
	else
		die "Couldn’t find ispell data directory from root ${ROOT}"
	fi
	einfo "Using ${ISPELL_DIR} for ispell data"
}

src_compile() {
	# unconditional disable-enchant: provider is included in enchant-1.4
	econf --disable-enchant || die "econf failed"
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "install failed"
	dodoc AUTHORS ChangeLog README.fi NEWS README tmispell.conf.example ||\
		die "docs missing"
	insinto /etc/
	newins "${FILESDIR}/tmispell.conf.gentoo" tmispell.conf
	dodir ${ISPELL_DIR}
	touch "${D}/${ISPELL_DIR}/"{suomi,finnish}.{hash,aff}
}

pkg_postinst() {
	elog "Use “eselect ispell set tmispell” to get legacy applications"
	elog "which want ispell working with tmispell"
	eselect ispell update --if-unset
}