# $NetBSD: Makefile.common,v 1.15 2008/08/15 02:43:50 obache Exp $ # DISTNAME= FreeWnn-1.10 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP:=freewnn/11067/} \ ftp://ftp.st.ryukoku.ac.jp/pub/japanese-im/FreeWnn/ PATCH_SITES= ${MASTER_SITE_SOURCEFORGE_JP:=freewnn/11075/} \ ftp://ftp.st.ryukoku.ac.jp/pub/japanese-im/FreeWnn/ PATCHFILES= patch-1.1.0-a01.gz PATCH_DIST_STRIP= -p2 DIST_SUBDIR= freewnn WRKSRC= ${WRKDIR}/Xsi INSTALL_TARGET= install install.man .include "../../mk/bsd.prefs.mk" WNNOWNER?= ${FREEWNN_USER} SEDSCRIPT+= -e 's|\(WNNOWNER = \).*|\1${WNNOWNER}|' SEDSCRIPT+= -e 's|\([JCKT]\)\(WNNDICDIR = \).*|\1\2${IMDICTDIR}/wnn/$$(\1WNNLANG)|' PKG_USERS_VARS+= WNNOWNER FREEWNN_USER .if defined(WNN_TARGET) && (${WNN_TARGET} == "SERVER") MAKE_ENV+= "WNN_TARGET=SERVER" SEDSCRIPT+= -e 's|$$([CK]*WNNJLIBSRC)/lib\([ck]*wnn\).a|-l\1|' SEDSCRIPT+= -e 's|\(:.*\)$$(WNNJLIB)|\1|' .elif defined(WNN_TARGET) && (${WNN_TARGET} == "DICT") MAKE_ENV+= "WNN_TARGET=DICT" .else MAKE_ENV+= "WNN_TARGET=LIBRARY" .endif .if defined(WNNDIR) MAKE_ENV+= "WNNDIR=${WNNDIR}" .endif .if defined(CWNNDIR) MAKE_ENV+= "CWNNDIR=${CWNNDIR}" .endif .if defined(KWNNDIR) MAKE_ENV+= "KWNNDIR=${KWNNDIR}" .endif GNU_CONFIGURE= YES post-patch: @for file in `${FIND} ${WRKSRC} -name Makefile.in -print`; do \ ${MV} $$file $$file.orig; \ ${SED} -e '/PREFIX = /d' \ -e 's|\(WNNBINDIR = $${PREFIX}/\)\(bin\)|\1s\2|' \ -e 's|\([CK]*WNNBINDIR = $$(WNNBINDIR)\)/[ck]*Wnn4|\1|'\ -e 's|\(WNNWNNDIR = $${PREFIX}/\)lib\(/wnn\)|\1share\2|'\ -e 's|\(MANPATH = .*/\)man|\1$${PKGMANDIR}|'\ -e '/(COMPRESSMANCMD) /d' \ -e 's|\/usr\/X11R6|$${PREFIX}|' \ ${SEDSCRIPT} \ $$file.orig > $$file; \ done @for file in `${FIND} ${WRKSRC}/Wnn/man -name Makefile.in -print`; do\ ${MV} $$file $$file.orig2; \ ${SED} -e 's|\(MANPATH = .*\)|\1/ja_JP.EUC|' \ $$file.orig2 > $$file; \ done @(cd ${WRKSRC}/Wnn/include; \ ${MV} config.h config.h.orig; \ ${SED} -e 's|^\(\#define LIBDIR "\)/usr/local/lib\(/wnn"\)|\1${PREFIX}/share\2|' \ config.h.orig > config.h) .if defined(WNN_TARGET) && (${WNN_TARGET} == "SERVER") post-build: @${MV} ${WRKSRC}/Wnn/jd/jserverrc ${WRKSRC}/Wnn/jd/jserverrc.orig @${SED} -e 's|^\(jserver_dir\).*|\1 ${IMDICTDIR}/wnn/${WNN_LANG}|' \ ${WRKSRC}/Wnn/jd/jserverrc.orig > ${WRKSRC}/Wnn/jd/jserverrc .endif .if defined(WNN_TARGET) && (${WNN_TARGET} == "DICT") EVAL_PREFIX+= WNNSERVERBINDIR=ja-FreeWnn-server-bin pre-build: @for file in `${FIND} ${WRKSRC}/Wnn/pubdic ${WRKSRC}/Wnn/wnncons -name Makefile -print`; do \ ${MV} $$file $$file.orig2; \ ${SED} -e 's|\(ATOD = \).*|\1${WNNSERVERBINDIR}/sbin/atod|' \ -e 's|\(ATOF = \).*|\1${WNNSERVERBINDIR}/sbin/atof|' \ -e 's|\(WNNTOUCH = \).*|\1${WNNSERVERBINDIR}/sbin/wnntouch|' \ $$file.orig2 > $$file; \ done; @${MV} ${WRKSRC}/Wnn/Makefile ${WRKSRC}/Wnn/Makefile.orig2 @${SED} -e 's|\(MKDIRHIER.*=\).*|\1 ${TRUE}|' \ ${WRKSRC}/Wnn/Makefile.orig2 > ${WRKSRC}/Wnn/Makefile .endif .include "../../mk/bsd.pkg.mk"