aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/rskkserv/Makefile
blob: 6730370b98d913baf5901a81a4072e909c9ddbdb (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# New ports collection makefile for:    rskkserv
# Date created:     18 Aug 2000
# Whom:                 Akinori MUSHA aka knu <knu@idaemons.org>
#
# $FreeBSD$
#

PORTNAME=   rskkserv
PORTVERSION=    2.95.4
PORTREVISION=   0
CATEGORIES= japanese ruby
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= rskkserv/15241
DIST_SUBDIR=    ruby

MAINTAINER= ports@FreeBSD.org
COMMENT=    An alternative implementation of skkserv written in Ruby

RUN_DEPENDS=    ${RUBY_SITEARCHLIBDIR}/tcpwrap.so:${PORTSDIR}/security/ruby-tcpwrap \
        ${SKKJISYO_BASE}/${SKKJISYO}:${SKK_MASTERDIR}

.if defined(WITH_RUBY_CDB)
RUN_DEPENDS+=   ${RUBY_SITEARCHLIBDIR}/cdb.so:${PORTSDIR}/databases/ruby-cdb
.endif

.if defined(WITH_RUBY_EB)
RUN_DEPENDS+=   ${RUBY_SITEARCHLIBDIR}/eb.so:${PORTSDIR}/japanese/ruby-eb
.endif

USE_RUBY=   yes
USE_AUTOTOOLS=  autoconf:213
USE_GMAKE=  yes
USE_RC_SUBR=    rskkserv.sh

CONFIGURE_ARGS= --with-ruby="${RUBY}" \
        --with-dicfile="${SKKJISYO_BASE}/${SKKJISYO}" \
        --with-cachedir="${SKKJISYO_BASE}" \
        --with-logdir="/var/log" \
        --with-piddir="/var/run"
MAKE_ARGS=  SKKSERV=rskkserv

SKKJISYO_SIZE?= L
SKKJISYO_BASE=  ${LOCALBASE}/share/skk
SKKJISYO=   SKK-JISYO.${SKKJISYO_SIZE}
SKK_MASTERDIR=  ${PORTSDIR}/japanese/skk-jisyo

MAN1=       rskkserv.1
MANLANG=    "" ja

DOCS_EN=    ChangeLog
DOCS_JA=    TODO

post-extract:
    ${LN} -s ${WRKSRC}/skkserv.rb.in ${WRKSRC}/rskkserv.in

post-patch:
    ${RUBY} -i -ne 'if $$. == 1 then puts "#!@RUBY@" else puts $$_ end' ${WRKSRC}/skkserv.rb.in
    ${RUBY} -i -p \
        -e 'gsub %r:/usr/share/skk:, %q:${SKKJISYO_BASE}:' \
        -e 'gsub %r:/opt/epwing/(\w+):, %q:${LOCALBASE}/share/dict/\\1-fpw:' \
        -e 'gsub %r:SKK-JISYO\\.L:, %q:${SKKJISYO}:' \
        -e 'sub %r%(CACHEDIR\s*=\s*")[^"]*(")%, \
                         %q%\\1${SKKJISYO_BASE}\\2%' \
        ${WRKSRC}/doc/rskkserv.conf.sample
    ${RUBY} -i -p \
        -e 'sub %r%/usr/bin/ruby%, %q%${RUBY}% ' \
        ${WRKSRC}/doc/conf-o2n.rb

post-install:
.if !defined(NOPORTDOCS)
    ${MKDIR} ${RUBY_MODDOCDIR}/ja
.for f in ${DOCS_EN}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/
.endfor
.for f in ${DOCS_JA}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/ja/
.endfor
    ${INSTALL_MAN} ${WRKSRC}/doc/rskkserv.1 ${PREFIX}/man/man1/rskkserv.1
    ${INSTALL_MAN} ${WRKSRC}/doc/rskkserv.1.ja_JP.eucJP ${PREFIX}/man/ja/man1/rskkserv.1
.endif
    ${MKDIR} ${EXAMPLESDIR}
    ${INSTALL_SCRIPT} ${WRKSRC}/doc/conf-o2n.rb ${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/rskkserv.conf ${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/rskkserv.conf.sample ${EXAMPLESDIR}

.include <bsd.port.mk>