summaryrefslogtreecommitdiff
blob: c2dfd3abb9fa71ea6ab8f8cbf2f6ae23ff0422e9 (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/kinput2/kinput2-3.1-r1.ebuild,v 1.15 2006/01/25 07:27:58 spyderous Exp $

inherit eutils

MY_P="${PN}-v${PV}"
DESCRIPTION="A Japanese input server which supports the XIM protocol"
HOMEPAGE="http://www.nec.co.jp/canna/"
SRC_URI="ftp://ftp.sra.co.jp/pub/x11/${PN}/${MY_P}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="x86 ppc sparc amd64 ppc64"
IUSE="canna freewnn"

DEPEND="virtual/libc
	canna? ( >=app-i18n/canna-3.5_beta2-r1 )
	|| ( ( x11-misc/gccmakedep
			x11-misc/imake
			app-text/rman
		)
		virtual/x11
	)
	!amd64? ( freewnn? ( >=app-i18n/freewnn-1.1.1_alpha19 ) )
	!freewnn? ( >=app-i18n/canna-3.5_beta2-r1 )"

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

src_unpack() {
	local mysed=""

	unpack ${A}
	epatch ${FILESDIR}/${PF}-gentoo.diff

	use canna \
		&& mysed="${mysed} -e 's:/\* \(\#define UseCanna\) \*/:\\1:'"
	use freewnn \
		&& mysed="${mysed} -e 's:/\* \(\#define UseWnn\) \*/:\\1:'"

	#use sj3 \
	#	&& mysed="${mysed} -e 's:/\* \(\#Define UseSj3\) \*/:\\1:'"
	#use atok \
	#	&& mysed="${mysed} -e 's:/\* \(\#Define UseAtok\) \*/:\\1:'"
	#use wnn6 \
	#	&& mysed="${mysed} -e 's:/\* \(\#Define UseWnn6\) \*/:\\1:'"

	use canna || use freewnn \
		|| mysed="${mysed} -e 's:/\* \(\#define UseCanna\) \*/:\\1:'"

	cp ${S}/Kinput2.conf ${T}
	eval sed ${mysed} ${T}/Kinput2.conf > ${S}/Kinput2.conf || die
}

src_compile() {
	xmkmf -a || die
	make CDEBUGFLAGS="${CFLAGS}" || die
}

src_install() {
	make DESTDIR=${D} install || die

	dodoc README NEWS doc/*
	newman cmd/${PN}.man ${PN}.1
}