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
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2004-10-14 06:37:41 +00:00
|
|
|
PORTNAME= resin
|
2005-08-29 14:56:50 +00:00
|
|
|
PORTVERSION= 3.0.14
|
2004-10-14 06:37:41 +00:00
|
|
|
CATEGORIES= www java
|
|
|
|
MASTER_SITES= http://www.caucho.com/download/
|
2003-09-29 12:57:59 +00:00
|
|
|
|
2004-10-14 06:37:41 +00:00
|
|
|
MAINTAINER= jb.quenot@caraldi.com
|
|
|
|
COMMENT= Resin, a Java-based Application Server, 3.x branch
|
2003-09-29 12:57:59 +00:00
|
|
|
|
2005-02-24 22:50:29 +00:00
|
|
|
USE_JAVA= yes
|
|
|
|
JAVA_VERSION= 1.2+
|
2004-10-14 06:37:41 +00:00
|
|
|
HAS_CONFIGURE= yes
|
2005-02-24 22:50:29 +00:00
|
|
|
USE_PYTHON= yes
|
2004-10-14 06:37:41 +00:00
|
|
|
USE_REINPLACE= yes
|
2005-04-25 22:13:54 +00:00
|
|
|
USE_OPENSSL= yes
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
# Customizable settings
|
2004-10-14 06:37:41 +00:00
|
|
|
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/\..*$//}
|
2004-10-14 06:37:41 +00:00
|
|
|
APP_NAME?= ${PORTNAME}${APP_NAME_SUFFIX}
|
|
|
|
LATEST_LINK= ${APP_NAME}
|
|
|
|
APP_HOME?= ${PREFIX}/${APP_NAME}
|
|
|
|
WITH_APACHE?= NO
|
|
|
|
WITH_APACHE2?= NO
|
2005-02-24 22:50:29 +00:00
|
|
|
PID_FILE?= ${APP_HOME}/${APP_NAME}.pid
|
|
|
|
LOG_FILE?= ${APP_HOME}/${APP_NAME}.log
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
# Other settings
|
2004-10-14 06:37:41 +00:00
|
|
|
APXS?= ${LOCALBASE}/sbin/apxs
|
|
|
|
PKGINSTALL= ${WRKDIR}/pkg-install
|
|
|
|
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
|
|
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
2005-05-16 20:33:47 +00:00
|
|
|
REINPLACE_FILES= ${WRKSRC}/modules/c/src/apache1/Makefile.in \
|
|
|
|
${WRKSRC}/modules/c/src/apache2/Makefile.in
|
2004-10-14 06:37:41 +00:00
|
|
|
REPLACE_FILES= ${FILESDIR}/pkg-install \
|
|
|
|
${FILESDIR}/pkg-deinstall \
|
|
|
|
${FILESDIR}/install.sh \
|
|
|
|
${FILESDIR}/pkg-message.in \
|
|
|
|
${WRKSRC}/conf/resin.conf \
|
2005-02-24 22:50:29 +00:00
|
|
|
${FILESDIR}/resinctl \
|
2004-10-14 06:37:41 +00:00
|
|
|
${FILESDIR}/resin.sh.in
|
2005-02-24 22:50:29 +00:00
|
|
|
COPYDIRS= lib libexec webapps
|
2003-09-29 12:57:59 +00:00
|
|
|
|
2004-06-24 07:43:27 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2003-09-29 12:57:59 +00:00
|
|
|
# Pass JAVA_HOME as determined by bsd.java.mk
|
2005-04-25 22:13:54 +00:00
|
|
|
CONFIGURE_ARGS+= --with-java-home=${JAVA_HOME} \
|
|
|
|
--with-openssl-lib=${OPENSSLLIB} \
|
|
|
|
--with-openssl-include=${OPENSSLINC}
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
#
|
2004-10-14 06:37:41 +00:00
|
|
|
BUILD_DEPENDS+= ${APXS}:${PORTSDIR}/www/apache13
|
2003-09-29 12:57:59 +00:00
|
|
|
CONFIGURE_ARGS+= --with-apxs=${APXS}
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= MOD_DIR=libexec/apache
|
2003-11-20 21:44:14 +00:00
|
|
|
# Allow apxs invocations
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= APACHE=""
|
2003-11-20 21:44:14 +00:00
|
|
|
.elif defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES)
|
2003-09-29 12:57:59 +00:00
|
|
|
#
|
|
|
|
# Apache 2
|
|
|
|
#
|
2004-10-14 06:37:41 +00:00
|
|
|
BUILD_DEPENDS+= ${APXS}:${PORTSDIR}/www/apache2
|
2003-09-29 12:57:59 +00:00
|
|
|
CONFIGURE_ARGS+= --with-apxs=${APXS}
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= MOD_DIR=libexec/apache2
|
2003-11-20 21:44:14 +00:00
|
|
|
# Allow apxs invocations
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= APACHE=""
|
2003-09-29 12:57:59 +00:00
|
|
|
.else
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= MOD_DIR="@comment "
|
2003-11-20 21:44:14 +00:00
|
|
|
# Prevent apxs invocations
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= APACHE="@comment "
|
2003-09-29 12:57:59 +00:00
|
|
|
.endif
|
|
|
|
|
2004-10-14 06:37:41 +00:00
|
|
|
PLIST_SUB+= APP_NAME=${APP_NAME}
|
|
|
|
PLIST_SUB+= APXS=${APXS}
|
2003-11-20 21:44:14 +00:00
|
|
|
|
2004-10-14 06:37:41 +00:00
|
|
|
SUBSTITUTIONS= -e "s|%%APP_HOME%%|${APP_HOME}|g" \
|
|
|
|
-e "s|%%APP_NAME%%|${APP_NAME}|g" \
|
|
|
|
-e "s|%%APXS%%|${APXS}|g" \
|
|
|
|
-e "s|%%COPYDIRS%%|${COPYDIRS}|g" \
|
|
|
|
-e "s|%%FILESDIR%%|${FILESDIR}|g" \
|
|
|
|
-e "s|%%GROUP%%|${GROUP}|g" \
|
|
|
|
-e "s|%%GID%%|${GID}|g" \
|
|
|
|
-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \
|
2005-02-24 22:50:29 +00:00
|
|
|
-e "s|%%JAVA%%|${JAVA}|g" \
|
|
|
|
-e "s|%%LOG_FILE%%|${LOG_FILE}|g" \
|
|
|
|
-e "s|%%PYTHON_CMD%%|${PYTHON_CMD}|g" \
|
2004-10-14 06:37:41 +00:00
|
|
|
-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-11-20 21:44:14 +00:00
|
|
|
|
|
|
|
post-patch:
|
2005-04-20 14:47:35 +00:00
|
|
|
@${REINPLACE_CMD} ${SUBSTITUTIONS} ${REINPLACE_FILES}
|
|
|
|
@for FILE in ${REPLACE_FILES} ; do \
|
|
|
|
${SED} ${SUBSTITUTIONS} $${FILE} > ${WRKDIR}/`basename $${FILE}` ; \
|
|
|
|
done
|
2005-02-24 22:50:29 +00:00
|
|
|
@${FMT} -w 80 < ${WRKDIR}/pkg-message.in > ${PKGMESSAGE}
|
2003-11-20 21:44:14 +00:00
|
|
|
.if (defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES) || \
|
|
|
|
defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES))
|
2005-02-24 22:50:29 +00:00
|
|
|
@${ECHO_CMD} >> ${PKGMESSAGE}
|
|
|
|
@${ECHO_CMD} The Resin Apache module mod_caucho has been activated \
|
|
|
|
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}
|
|
|
|
@${ECHO_CMD} >> ${PKGMESSAGE}
|
|
|
|
@${ECHO_CMD} "<IfModule mod_caucho.c>" >> ${PKGMESSAGE}
|
|
|
|
@${ECHO_CMD} " ResinConfigServer localhost 6802" >> ${PKGMESSAGE}
|
2005-04-20 14:47:35 +00:00
|
|
|
@${ECHO_CMD} "</IfModule>" >> ${PKGMESSAGE}
|
2003-11-20 21:44:14 +00:00
|
|
|
.endif
|
2003-09-29 12:57:59 +00:00
|
|
|
|
2005-08-29 14:56:50 +00:00
|
|
|
post-build:
|
|
|
|
cd ${WRKSRC}/modules/c/src && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} install
|
|
|
|
|
|
|
|
do-install:
|
2005-02-24 22:50:29 +00:00
|
|
|
@${SETENV} RUNASUSER=${RUNASUSER} GROUP=${GROUP} ${SH} ${WRKDIR}/install.sh
|
2005-09-01 14:26:39 +00:00
|
|
|
.if (defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES))
|
|
|
|
${APXS} -i -n caucho -a ${WRKSRC}/modules/c/src/apache2/.libs/mod_caucho.so
|
|
|
|
.endif
|
|
|
|
.if (defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES))
|
|
|
|
${APXS} -i -n caucho -a ${WRKSRC}/modules/c/src/apache1/.libs/mod_caucho.so
|
|
|
|
.endif
|
2005-02-24 22:50:29 +00:00
|
|
|
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
2005-04-20 14:47:35 +00:00
|
|
|
@${ECHO_MSG}
|
|
|
|
@${ECHO_MSG} "********************************************************************************"
|
2005-02-24 22:50:29 +00:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
2005-04-20 14:47:35 +00:00
|
|
|
@${ECHO_MSG} "********************************************************************************"
|
|
|
|
@${ECHO_MSG}
|
2003-09-29 12:57:59 +00:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|