summaryrefslogtreecommitdiff
blob: 956d46d602190aed02f4bcba4086ddd5df2acbb0 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# 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.8 2004/05/24 22:56:10 avenj 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"
IUSE="canna freewnn"

DEPEND="virtual/glibc
	canna? ( >=app-i18n/canna-3.5_beta2-r1 )
	!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
}