Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2007 01:29:59 +0900 (JST)
From:      TAOKA Fumiyoshi <fmysh@iijmio-mail.jp>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        TAOKA Fumiyoshi <fmysh@iijmio-mail.jp>
Subject:   ports/112039: japanese/p5-Text-MeCab: add ENCODING knob
Message-ID:  <20070423162959.7FC43153450@xeon.quad.dyndns.org>
Resent-Message-ID: <200704231630.l3NGU5fD016588@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         112039
>Category:       ports
>Synopsis:       japanese/p5-Text-MeCab: add ENCODING knob
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 23 16:30:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     TAOKA Fumiyoshi
>Release:        
>Organization:
>Environment:
>Description:

Add ENCODING knob.
Text::MeCab needs to know dictionary encoding at compiling.
Available encodings are euc-jp (default), shift_jis or utf8.

>How-To-Repeat:
>Fix:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/japanese/p5-Text-MeCab/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	10 Feb 2007 08:49:33 -0000	1.4
+++ Makefile	19 Apr 2007 06:50:23 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=		Text-MeCab
 PORTVERSION=		0.15
+PORTREVISION=		1
 CATEGORIES=		japanese textproc perl5
 MASTER_SITES=		${MASTER_SITE_PERL_CPAN}
 MASTER_SITE_SUBDIR=	Text
@@ -22,10 +23,21 @@
 PERL_CONFIGURE=	yes
 CONFIGURE_ARGS=	</dev/null
 
+# dictionary encoding (euc-jp, shift_jis, utf8)
+ENCODING?=	euc-jp
+
 post-patch:
-	# To prevent CCFLAGS value from being overwritten by the ports system
+# To prevent CCFLAGS value from being overwritten by the ports system
 	@${REINPLACE_CMD} -e 's|CCFLAGS|DEFINE|g' ${WRKSRC}/Makefile.PL
 
+.if ${ENCODING} == "shift_jis"
+	@${REINPLACE_CMD} -e '/my \$$encoding = /s/euc-jp/shift_jis/' \
+		${WRKSRC}/tools/probe_mecab.pl
+.elif ${ENCODING} == "utf8"
+	@${REINPLACE_CMD} -e '/my \$$encoding = /s/euc-jp/utf8/' \
+		${WRKSRC}/tools/probe_mecab.pl
+.endif
+
 .include <bsd.port.pre.mk>
 
 PKGNAMEPREFIX:=	${PKGNAMEPREFIX}p5-

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070423162959.7FC43153450>