aboutsummaryrefslogtreecommitdiffstats
path: root/www/pruby/Makefile
blob: 5e4c0339a125f04099f8f4190f02a2a11f698382 (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
# New ports collection makefile for:    pRuby
# Date created:     24 February 2001
# Whom:         Akinori MUSHA aka knu <knu@idaemons.org>
#
# $FreeBSD$
#

PORTNAME=   pruby
PORTVERSION=    0.20
CATEGORIES= www lang ruby
MASTER_SITES=   http://www.inf.bme.hu/~pts/
DIST_SUBDIR=    ruby

MAINTAINER= knu@FreeBSD.org

BUILD_DEPENDS=  php:${PHP4_PORTDIR} \
        ${NONEXISTENT}:${MOD_PHP4_PORTDIR}:configure
RUN_DEPENDS=    ${LOCALBASE}/libexec/apache/libphp4.so:${MOD_PHP4_PORTDIR}

USE_GMAKE=  yes
USE_RUBY=   yes

.include <bsd.port.pre.mk>

PHP4_PORTDIR=       ${.CURDIR}/../../lang/php4
MOD_PHP4_PORTDIR=   ${.CURDIR}/../mod_php4
MOD_PHP4_WRKSRC_CMD=    cd ${MOD_PHP4_PORTDIR} && ${MAKE} -V WRKSRC

DOCS_EN=    README  contrib/_htaccess

pre-everything:
    dir=`${MOD_PHP4_WRKSRC_CMD}`; \
    ${MKDIR} $${dir}; \
    ${TOUCH} $${dir}/../../Makefile.inc

do-configure:
    cd ${WRKSRC} && ( \
        dir=`${MOD_PHP4_WRKSRC_CMD}`; \
        php contrib/phpinfo.php > phpinfo.out; \
        ( \
        ${ECHO} "PHP4_SRC=$${dir}"; \
        ${ECHO} "PHP4_CONFIGURED=yes"; \
        ${ECHO} "RUBY_SRC="; \
        ${ECHO} "RUBY=${RUBY}"; \
        ${ECHO} "PHPINFO_OUT=phpinfo.out"; \
        ${ECHO} "LIBRUBYS_SO=${LOCALBASE}/lib/libruby.so"; \
        ) > Configuration; \
    )

pre-install:
    dir=`. ${WRKSRC}/phpinfo.sd; ${ECHO} $${PI_EXTENSION_DIR}`; \
    ${MKDIR} $${dir}

post-install:
    dir=`. ${WRKSRC}/phpinfo.sd; ${ECHO} $${PI_EXTENSION_DIR}`; \
    ${INSTALL_DATA} ${WRKSRC}/ext_pruby_src/pruby_*.rb $${dir}/; \
    ${PERL} -i -pe "s,%%EXTENSION_DIR%%,$${dir#${PREFIX}/},g" ${TMPPLIST}
.if !defined(NOPORTDOCS)
    ${MKDIR} ${RUBY_DOCDIR}/${PORTNAME}
.for f in ${DOCS_EN}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_DOCDIR}/${PORTNAME}/
.endfor
.endif

.include <bsd.port.post.mk>