summaryrefslogtreecommitdiff
path: root/japanese/sj3-server/Makefile
blob: 1448cc02165b878207112043dd6c58c13e823467 (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
# $NetBSD: Makefile,v 1.7 2001/03/11 16:19:46 tron Exp $
#

DISTNAME=	sj3-2.0.1.20
PKGNAME=	sj3-server-2.0.1.20
CATEGORIES=	japanese
MASTER_SITES=	ftp://ftp.sony.co.jp/pub/unsupported/src/	\
		ftp://ftp.cs.titech.ac.jp/pub/japanese/sj3/

MAINTAINER=	tech-pkg-ja@jp.netbsd.org
COMMENT=	Japanese input method (server)

DEPENDS+=	sj3-lib-2.0.1.20:../../japanese/sj3-lib

MASTERDIR=	${.CURDIR}/../../japanese/sj3-lib
FILESDIR=	${MASTERDIR}/files
PATCHDIR=	${MASTERDIR}/patches

.include "../../mk/bsd.prefs.mk"
SJ3OWNER?=	daemon
SJ3GROUP?=	daemon
DICT_DIR?=	/var/dict
MAKE_ENV+=	SJ3OWNER=${SJ3OWNER} SJ3GROUP=${SJ3GROUP} DICT_DIR=${DICT_DIR} \
		LOCAL_LDFLAGS="${LDFLAGS}"
PLIST_SUBST=	SJ3OWNER=${SJ3OWNER} SJ3GROUP=${SJ3GROUP} DICT_DIR=${DICT_DIR} \
		PREFIX=${PREFIX}

INSTALL_SRC=	${PKGDIR}/INSTALL
INSTALL_FILE=	${WRKDIR}/INSTALL

STARTUP_SCRIPT=	etc/rc.d/sj3
STARTUP_SCRIPT_SRC=${WRKDIR}/STARTUP

pre-configure:
	@${MV} ${WRKSRC}/Imakefile ${WRKSRC}/Imakefile.orig
	@${SED} -e 's|\(SUBDIRS = .*\)sj3lib \(.*\)|\1\2|'	\
		${WRKSRC}/Imakefile.orig > ${WRKSRC}/Imakefile
	@for file in `${FIND} ${WRKSRC} -name Imakefile`; do	\
		${MV} -f $$file $$file.orig;			\
		${SED} -e 's|\(= \).*/lib\(sj3lib\).a|\1-l\2|'	\
			$$file.orig > $$file;			\
	 done

do-configure:
	@(cd ${WRKSRC}; ${X11BASE}/bin/xmkmf; ${MAKE} Makefiles)

post-build:
	@${ECHO} '#!/bin/sh'				 > ${STARTUP_SCRIPT_SRC}
	@${ECHO} 'sj3=${PREFIX}/bin/sj3serv'		>> ${STARTUP_SCRIPT_SRC}
	@${ECHO} 'if [ -f $$sj3 ]; then'		>> ${STARTUP_SCRIPT_SRC}
	@${ECHO} "    echo -n ' sj3'"			>> ${STARTUP_SCRIPT_SRC}
	@${ECHO} '	$$sj3'				>> ${STARTUP_SCRIPT_SRC}
	@${ECHO} 'fi'					>> ${STARTUP_SCRIPT_SRC}
	@${SED} -e 's|$${SJ3OWNER}|${SJ3OWNER}|'	\
		-e 's|$${SJ3GROUP}|${SJ3GROUP}|'	\
		-e 's|$${DICT_DIR}|${DICT_DIR}|'	\
		-e 's|$${PREFIX}|${PREFIX}|'		\
		${INSTALL_SRC} > ${INSTALL_FILE}

post-install:
	@${INSTALL_SCRIPT} ${STARTUP_SCRIPT_SRC} ${PREFIX}/${STARTUP_SCRIPT}

.include "../../mk/bsd.pkg.mk"