aboutsummaryrefslogtreecommitdiffstats
path: root/lang/jruby/Makefile
blob: d212d4f880d6a1fca3decd276fe0a407f6e0eed4 (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
# New ports collection makefile for:    JRuby
# Date created:         20 September 2001
# Whom:             Akinori MUSHA aka knu <knu@idaemons.org>
#
# $FreeBSD$
#

PORTNAME=   jruby
PORTVERSION=    1.0.1
CATEGORIES= lang ruby java
MASTER_SITES=   http://dist.codehaus.org/jruby/ \
        http://repo2.maven.org/maven/jruby/misc/ \
        http://repo1.maven.org/maven/jruby/misc/ \
        http://dist.codehaus.org/jruby/previous/
DISTNAME=   ${PORTNAME}-bin-${PORTVERSION}

MAINTAINER= nemoliu@FreeBSD.org
COMMENT=    An implementation of Ruby Interpreter in Pure Java

RUN_DEPENDS=    bash:${PORTSDIR}/shells/bash

NO_BUILD=   yes
USE_JAVA=   yes
JAVA_VERSION=   1.3+

WRKDIR?=    ${WRKDIRPREFIX}${.CURDIR}/work
JRUBY_HOME?=    ${PREFIX}/share/${PORTNAME}
WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}
REPLACE_FILES=  ${WRKSRC}/bin/jruby \
        ${WRKSRC}/bin/jrubyc \
        ${WRKSRC}/bin/jrubycli \
        ${WRKSRC}/bin/jrubysrv
REPLACE_LIST=   JRUBY_HOME=${JRUBY_HOME} \
        JAVA_HOME=${JAVA_HOME}
REPLACE_LIST_TEMP=  ${REPLACE_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}

.include <bsd.port.pre.mk>

pre-patch:
    @${ECHO_MSG} "Installation settings:"
    @${ECHO_MSG} "   JRUBY_HOME:    ${JRUBY_HOME}"
    @${ECHO_MSG} "   JAVA_HOME:     ${JAVA_HOME}"

post-patch:
    @${ECHO_MSG} -n ">> Removing unneeded files..."
    @${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'`
    @${ECHO_MSG} " [ DONE ]"
.for file in ${REPLACE_FILES}
    @${ECHO_MSG} -n ">> Customizing `basename ${file}`..."
    @${SED} ${REPLACE_LIST_TEMP} ${file} > ${WRKDIR}/`basename ${file}`
    @${ECHO_MSG} " [ DONE ]"
.endfor

do-install:
    @${ECHO_MSG} -n ">> Installation JRuby files..."
    @${INSTALL_SCRIPT} ${WRKDIR}/jruby ${PREFIX}/bin/jruby
    @${INSTALL_SCRIPT} ${WRKDIR}/jrubyc ${PREFIX}/bin/jrubyc
    @${INSTALL_SCRIPT} ${WRKDIR}/jrubycli ${PREFIX}/bin/jrubycli
    @${INSTALL_SCRIPT} ${WRKDIR}/jrubysrv ${PREFIX}/bin/jrubysrv
    @cd ${WRKSRC}/lib \
      && ${FIND} . -type d -exec ${MKDIR} ${JRUBY_HOME}/lib/{} \; \
      && ${FIND} . -type f -exec ${INSTALL_DATA} {} ${JRUBY_HOME}/lib/{} \;
    @${ECHO_MSG} " [ DONE ]"
.if !defined(NOPORTDOCS)
    @${ECHO_MSG} -n ">> Installation Documents files..."
    @${MKDIR} ${DOCSDIR}
    @(cd ${WRKSRC}/docs \
      && ${COPYTREE_SHARE} \* ${DOCSDIR})
    @${MKDIR} ${EXAMPLESDIR}
    @(cd ${WRKSRC}/samples \
      && ${COPYTREE_SHARE} \* ${EXAMPLESDIR})
    @${ECHO_MSG} " [ DONE ]"
.endif

.include <bsd.port.post.mk>