2003-09-29 12:57:59 +00:00
|
|
|
# New ports collection makefile for: resin3
|
|
|
|
# Whom: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
|
|
|
|
# Date Created: 2003-09-29 14:17:14
|
|
|
|
#
|
2003-11-20 21:44:14 +00:00
|
|
|
# ex:ts=20:sw=20
|
|
|
|
#
|
2003-09-29 12:57:59 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= resin
|
2004-03-29 16:40:23 +00:00
|
|
|
PORTVERSION= 3.0.7
|
2003-09-29 12:57:59 +00:00
|
|
|
CATEGORIES= www java
|
|
|
|
MASTER_SITES= http://www.caucho.com/download/
|
|
|
|
|
|
|
|
MAINTAINER= jb.quenot@caraldi.com
|
|
|
|
COMMENT= Resin, a Java-based Application Server, 3.x branch
|
|
|
|
|
|
|
|
USE_JAVA= 1.2+
|
|
|
|
HAS_CONFIGURE= yes
|
2004-03-29 16:40:23 +00:00
|
|
|
USE_GMAKE= yes
|
2003-09-29 12:57:59 +00:00
|
|
|
USE_PERL5= yes
|
2004-03-29 16:40:23 +00:00
|
|
|
USE_REINPLACE= yes
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
# Customizable settings
|
|
|
|
RUNASUSER?= www
|
|
|
|
RUNASUID?= 80
|
|
|
|
GROUP?= ${RUNASUSER}
|
|
|
|
GID?= ${RUNASUID}
|
|
|
|
PORT?= 8080
|
2003-11-20 21:44:14 +00:00
|
|
|
# Do not use PKGNAMESUFFIX here because version info is already in PORTVERSION
|
|
|
|
# If we used PKGNAMESUFFIX, the package name would be resin2-2.1.11
|
|
|
|
APP_NAME_SUFFIX= ${PORTVERSION:C/\..*$//}
|
|
|
|
APP_NAME?= ${PORTNAME}${APP_NAME_SUFFIX}
|
2004-02-19 23:19:29 +00:00
|
|
|
LATEST_LINK= ${APP_NAME}
|
2003-11-20 21:44:14 +00:00
|
|
|
APP_HOME?= ${PREFIX}/${APP_NAME}
|
2003-09-29 12:57:59 +00:00
|
|
|
WITH_APACHE?= NO
|
|
|
|
WITH_APACHE2?= NO
|
2003-11-20 21:44:14 +00:00
|
|
|
PID_FILE?= /var/run/${APP_NAME}.pid
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
# Other settings
|
|
|
|
APXS?= ${LOCALBASE}/sbin/apxs
|
|
|
|
MOD_DIR?= `${APXS} -q LIBEXECDIR`
|
2003-11-20 21:44:14 +00:00
|
|
|
PKGINSTALL= ${WRKDIR}/pkg-install
|
|
|
|
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
|
|
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
|
|
|
# We need WRKSRC and WRKDIR right now so define them "manually"
|
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
|
|
|
WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
|
|
|
|
REINPLACE_FILES= ${WRKSRC}/src/c/plugin/apache/Makefile.in \
|
|
|
|
${WRKSRC}/src/c/plugin/apache2/Makefile.in
|
|
|
|
REPLACE_FILES= ${FILESDIR}/pkg-install \
|
|
|
|
${FILESDIR}/pkg-deinstall \
|
|
|
|
${FILESDIR}/install.sh \
|
|
|
|
${FILESDIR}/pkg-message.in \
|
|
|
|
${WRKSRC}/conf/resin.conf \
|
|
|
|
${WRKSRC}/bin/wrapper.pl.in \
|
|
|
|
${FILESDIR}/resin.sh.in
|
2004-03-29 16:40:23 +00:00
|
|
|
COPYDIRS= doc lib libexec webapps
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
# Pass JAVA_HOME as determined by bsd.java.mk
|
|
|
|
CONFIGURE_ARGS+= --with-java-home=${JAVA_HOME}
|
|
|
|
|
|
|
|
# Install the Apache plugin if needed
|
2003-11-20 21:44:14 +00:00
|
|
|
.if defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES)
|
2003-09-29 12:57:59 +00:00
|
|
|
#
|
|
|
|
# Apache 1.3
|
|
|
|
#
|
|
|
|
BUILD_DEPENDS+= ${APXS}:${PORTSDIR}/www/apache13
|
|
|
|
CONFIGURE_ARGS+= --with-apxs=${APXS}
|
|
|
|
PLIST_SUB+= MOD_DIR=libexec/apache
|
2003-11-20 21:44:14 +00:00
|
|
|
# Allow apxs invocations
|
|
|
|
PLIST_SUB+= APACHE=""
|
|
|
|
.elif defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES)
|
2003-09-29 12:57:59 +00:00
|
|
|
#
|
|
|
|
# Apache 2
|
|
|
|
#
|
|
|
|
BUILD_DEPENDS+= ${APXS}:${PORTSDIR}/www/apache2
|
|
|
|
CONFIGURE_ARGS+= --with-apxs=${APXS}
|
|
|
|
PLIST_SUB+= MOD_DIR=libexec/apache2
|
2003-11-20 21:44:14 +00:00
|
|
|
# Allow apxs invocations
|
|
|
|
PLIST_SUB+= APACHE=""
|
2003-09-29 12:57:59 +00:00
|
|
|
.else
|
|
|
|
PLIST_SUB+= MOD_DIR="@comment "
|
2003-11-20 21:44:14 +00:00
|
|
|
# Prevent apxs invocations
|
|
|
|
PLIST_SUB+= APACHE="@comment "
|
2003-09-29 12:57:59 +00:00
|
|
|
.endif
|
|
|
|
|
2003-11-20 21:44:14 +00:00
|
|
|
PLIST_SUB+= APP_NAME=${APP_NAME}
|
|
|
|
PLIST_SUB+= APXS=${APXS}
|
|
|
|
|
|
|
|
SUBSTITUTIONS= -e "s|%%APP_HOME%%|${APP_HOME}|g" \
|
|
|
|
-e "s|%%APP_NAME%%|${APP_NAME}|g" \
|
|
|
|
-e "s|%%APXS%%|${APXS}|g" \
|
2004-01-26 10:23:38 +00:00
|
|
|
-e "s|%%COPYDIRS%%|${COPYDIRS}|g" \
|
2003-11-20 21:44:14 +00:00
|
|
|
-e "s|%%FILESDIR%%|${FILESDIR}|g" \
|
|
|
|
-e "s|%%GROUP%%|${GROUP}|g" \
|
|
|
|
-e "s|%%GID%%|${GID}|g" \
|
|
|
|
-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \
|
|
|
|
-e "s|%%PERL%%|${PERL}|g" \
|
|
|
|
-e "s|%%PID_FILE%%|${PID_FILE}|g" \
|
|
|
|
-e "s|%%PORT%%|${PORT}|g" \
|
|
|
|
-e "s|%%PORTNAME%%|${PORTNAME}|g" \
|
|
|
|
-e "s|%%PREFIX%%|${PREFIX}|g" \
|
|
|
|
-e "s|%%RUNASUID%%|${RUNASUID}|g" \
|
|
|
|
-e "s|%%RUNASUSER%%|${RUNASUSER}|g" \
|
|
|
|
-e "s|%%WRKDIR%%|${WRKDIR}|g" \
|
|
|
|
-e "s|%%WRKSRC%%|${WRKSRC}|g"
|
|
|
|
|
2003-09-29 12:57:59 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2003-11-20 21:44:14 +00:00
|
|
|
post-patch:
|
|
|
|
.for FILE in ${REINPLACE_FILES}
|
2004-03-29 16:40:23 +00:00
|
|
|
@${REINPLACE_CMD} ${SUBSTITUTIONS} ${FILE}
|
2003-11-20 21:44:14 +00:00
|
|
|
.endfor
|
|
|
|
.for FILE in ${REPLACE_FILES}
|
|
|
|
@${SED} ${SUBSTITUTIONS} ${FILE} > ${WRKDIR}/`basename ${FILE}`
|
|
|
|
.endfor
|
|
|
|
@fmt -w 80 < ${WRKDIR}/pkg-message.in > ${PKGMESSAGE}
|
|
|
|
.if (defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES) || \
|
|
|
|
defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES))
|
|
|
|
@${ECHO_CMD} >> ${PKGMESSAGE}
|
|
|
|
@${ECHO_CMD} The Resin Apache module mod_caucho has been activated \
|
2004-01-26 10:23:38 +00:00
|
|
|
in the Apache configuration file, where you should also \
|
|
|
|
add a line to specify the location of the Resin configuration \
|
|
|
|
server, for example: | fmt -w 80 >> ${PKGMESSAGE}
|
2004-03-29 16:40:23 +00:00
|
|
|
@${ECHO_CMD} >> ${PKGMESSAGE}
|
|
|
|
@${ECHO_CMD} "<IfModule mod_caucho.c>" >> ${PKGMESSAGE}
|
|
|
|
.if (defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES))
|
|
|
|
@${ECHO_CMD} " ResinConfigServer localhost 6802" >> ${PKGMESSAGE}
|
|
|
|
.endif
|
|
|
|
.if (defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES))
|
|
|
|
@${ECHO_CMD} " CauchoConfigFile ${PREFIX}/etc/${APP_NAME}/resin.xml" >> ${PKGMESSAGE}
|
|
|
|
.endif
|
|
|
|
@${ECHO_CMD} "</IfModule>" >> ${PKGMESSAGE}
|
2003-11-20 21:44:14 +00:00
|
|
|
.endif
|
|
|
|
@${MV} ${WRKDIR}/wrapper.pl.in ${WRKSRC}/bin/wrapper.pl.in
|
2003-09-29 12:57:59 +00:00
|
|
|
|
2003-11-20 21:44:14 +00:00
|
|
|
# Resin does not handle installation, so proceed now
|
2003-09-29 12:57:59 +00:00
|
|
|
post-install:
|
2003-11-20 21:44:14 +00:00
|
|
|
@${SH} ${WRKDIR}/install.sh
|
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
|
|
|
@${ECHO_CMD}
|
|
|
|
@${ECHO_CMD} "********************************************************************************"
|
|
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
@${ECHO_CMD} "********************************************************************************"
|
|
|
|
@${ECHO_CMD}
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|