summaryrefslogtreecommitdiff
path: root/chinese/zhcon/Makefile
blob: 56dc42318837733ce0a95b181114521933323985 (plain) (blame)
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
# Ports collection makefile for:  zhcon
# Date created:                   Sun Sep 9, 2001
# Whom:                           statue@freebsd.sinica.edu.tw
#
# $FreeBSD$
#

PORTNAME=	zhcon
PORTVERSION=	0.14f
PORTREVISION=	3
CATEGORIES=	chinese
MASTER_SITES=	http://freebsd.sinica.edu.tw/~statue/ \
		ftp://ftp.gnuchina.org/pub/linux/chinese/inputmethod/console/zhcon/BSDPort/ \
		http://www.cis.nctu.edu.tw/~gis89501/zhcon/
DISTFILES=	${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} zhb5-ime-1.tgz

MAINTAINER=	statue@freebsd.sinica.edu.tw

HAS_CONFIGURE=	yes
USE_GMAKE=	yes

MAN1=		zhcon.1

.include <bsd.port.pre.mk>

.if defined(WITH_BIG5)
PLIST_SUB+=		BIG5IME=""
.else
PLIST_SUB+=		BIG5IME="@comment "
.endif

.if !defined(WITH_BIG5)
pre-everything::
	@${ECHO_MSG}
	@${ECHO_MSG} "If you want to compile with Big5 IME support,"
	@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BIG5=yes\""
	@${ECHO_MSG}
.endif

post-patch:
.if ${OSVERSION} > 500012
	@${PERL} -pi -e 's,machine/console.h>,sys/consio.h>\n#include <sys/fbio.h>\n#include <sys/kbio.h>\n,' ${WRKSRC}/${PORTNAME}/*.cpp
.endif
.if defined(WITH_BIG5)
.for file in zhcon-0.14-big5-bar.diff.gz zhcon-0.14-big5-dirty-ime.diff.gz
	@${GZCAT} ${WRKDIR}/zh-big5-ime/${file} | ${PATCH} ${PATCH_DIST_ARGS:S/p0/p1/}
.endfor
.endif

post-build:
.if defined(WITH_BIG5)
.for file in make.sh make-mb.sh
	@cd ${WRKDIR}/zh-big5-ime; ${SH} ${file}
.endfor
.endif

post-install:
.if defined(WITH_BIG5)
.for file in big5-ary30.mb big5-cj.mb big5-liu5.mb big5-phone.mb
	@${INSTALL_DATA} ${WRKDIR}/zh-big5-ime/mb/${file} ${PREFIX}/lib/zhcon
.endfor
	@${INSTALL_DATA} ${WRKDIR}/zh-big5-ime/zhcon.cfg.big5 ${PREFIX}/lib/zhcon/zhcon.cfg
.endif

.include <bsd.port.post.mk>