diff options
author | Rong-En Fan <rafan@FreeBSD.org> | 2006-12-16 02:14:26 +0000 |
---|---|---|
committer | Rong-En Fan <rafan@FreeBSD.org> | 2006-12-16 02:14:26 +0000 |
commit | 35a967da9984fa2fd62ef395dfabc7e1cd8bbfdd (patch) | |
tree | 83969bd7a07d0dfa50a246de5e21a6042398b617 /www/resin2 | |
parent | dc55152eac2d55dc5fe7909a482a906ac38b6ef1 (diff) | |
download | ports-35a967da9984fa2fd62ef395dfabc7e1cd8bbfdd.tar.gz ports-35a967da9984fa2fd62ef395dfabc7e1cd8bbfdd.zip |
- Fix build on 64-bit arch
Keep sync with www/resin3:
- A new option can be set in rc.conf to specify Java version to be used:
resin2_java_version
- Set REQUIRE and KEYWORD in rc.d script
- Fix faststart in rc.d script
- Update maintainer's email
PR: ports/106793
Submitted by: Jean-Baptiste Quenot <jb.quenot at caraldi.com> (maintainer)
Notes
Notes:
svn path=/head/; revision=179887
Diffstat (limited to 'www/resin2')
-rw-r--r-- | www/resin2/Makefile | 12 | ||||
-rw-r--r-- | www/resin2/files/pkg-message.in | 15 | ||||
-rw-r--r-- | www/resin2/files/resin.sh.in | 18 | ||||
-rw-r--r-- | www/resin2/files/resinctl | 4 |
4 files changed, 27 insertions, 22 deletions
diff --git a/www/resin2/Makefile b/www/resin2/Makefile index 7d6d0e39976c..acbf88fca255 100644 --- a/www/resin2/Makefile +++ b/www/resin2/Makefile @@ -7,11 +7,11 @@ PORTNAME= resin PORTVERSION= 2.1.17 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www java MASTER_SITES= http://www.caucho.com/download/ -MAINTAINER= jb.quenot@caraldi.com +MAINTAINER= jbq@caraldi.com COMMENT= Resin, a Java-based Application Server, 2.x branch USE_JAVA= yes @@ -48,6 +48,7 @@ REPLACE_FILES= ${FILESDIR}/pkg-install \ ${FILESDIR}/pkg-deinstall \ ${FILESDIR}/install.sh \ ${FILESDIR}/pkg-message.in \ + ${FILESDIR}/pkg-message-advanced.in \ ${WRKSRC}/conf/resin.conf \ ${FILESDIR}/resinctl \ ${FILESDIR}/resin.sh.in @@ -101,6 +102,7 @@ SUBSTITUTIONS= -e "s|%%APP_HOME%%|${APP_HOME}|g" \ -e "s|%%GROUP%%|${GROUP}|g" \ -e "s|%%JAVA%%|${JAVA}|g" \ -e "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \ + -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \ -e "s|%%LOG_FILE%%|${LOG_FILE}|g" \ -e "s|%%PID_FILE%%|${PID_FILE}|g" \ -e "s|%%PORT%%|${PORT}|g" \ @@ -112,12 +114,18 @@ SUBSTITUTIONS= -e "s|%%APP_HOME%%|${APP_HOME}|g" \ -e "s|%%WRKDIR%%|${WRKDIR}|g" \ -e "s|%%WRKSRC%%|${WRKSRC}|g" +# Avoid build error on 64-bit architectures +.if (${ARCH} == "amd64") || (${ARCH} == "ia64") || (${ARCH} == "sparc64") +CFLAGS+= -fPIC +.endif + post-patch: @${REINPLACE_CMD} ${SUBSTITUTIONS} ${REINPLACE_FILES} @for FILE in ${REPLACE_FILES} ; do \ ${SED} ${SUBSTITUTIONS} $${FILE} > ${WRKDIR}/`basename $${FILE}` ; \ done @${FMT} -w 80 < ${WRKDIR}/pkg-message.in > ${PKGMESSAGE} + @${CAT} < ${WRKDIR}/pkg-message-advanced.in >> ${PKGMESSAGE} .if (defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES) || \ defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES)) @${ECHO_CMD} >> ${PKGMESSAGE} diff --git a/www/resin2/files/pkg-message.in b/www/resin2/files/pkg-message.in index 490862390511..5eb713703dbd 100644 --- a/www/resin2/files/pkg-message.in +++ b/www/resin2/files/pkg-message.in @@ -30,18 +30,3 @@ Resin configuration is located at %%PREFIX%%/etc/%%APP_NAME%%.xml Enjoy! - --------------------------------------------------------------------------------- -ADVANCED USAGE - -If you need to pass special options to Java, please set the -%%APP_NAME%%_flags option in /etc/rc.conf, see examples below: - - # Prevent Java from opening an X11 display - %%APP_NAME%%_flags="-Djava.awt.headless=true" - - # Increase memory limit of the Java virtual machine - %%APP_NAME%%_flags="-Xms32m -Xmx256m" - - # Run Java with remote debugging turned on on port 8000 - %%APP_NAME%%_flags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000" diff --git a/www/resin2/files/resin.sh.in b/www/resin2/files/resin.sh.in index a60b51bbcf68..fcbb91485593 100644 --- a/www/resin2/files/resin.sh.in +++ b/www/resin2/files/resin.sh.in @@ -4,6 +4,8 @@ # # PROVIDE: %%APP_NAME%% +# REQUIRE: LOGIN +# KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable %%APP_NAME%%: @@ -16,10 +18,9 @@ name=%%APP_NAME%% rcvar=`set_rcvar` -command=%%PREFIX%%/sbin/%%APP_NAME%%ctl -command_args="$1" +command="%%PREFIX%%/sbin/%%APP_NAME%%ctl" +command_args="start" pidfile=%%PID_FILE%% -procname=%%JAVA%% # set defaults @@ -28,4 +29,15 @@ procname=%%JAVA%% %%APP_NAME%%_group=${%%APP_NAME%%_group:-"www"} load_rc_config ${name} + +if test -n "${%%APP_NAME%%_java_version}" ; then + JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) + procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) +else + JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) + procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) +fi + +export JAVA_HOME + run_rc_command "$1" diff --git a/www/resin2/files/resinctl b/www/resin2/files/resinctl index f193a4c95d26..886ea3495fa4 100644 --- a/www/resin2/files/resinctl +++ b/www/resin2/files/resinctl @@ -154,7 +154,7 @@ if __name__ == '__main__': APP_NAME = "%%APP_NAME%%" APP_HOME = "%%APP_HOME%%" PID_FILE = "%%PID_FILE%%" - COMMAND = "%%JAVA%%" + COMMAND = "%%PREFIX%%/bin/java" ARGS = [COMMAND] ARGS += sys.argv[1:-1] @@ -165,8 +165,8 @@ if __name__ == '__main__': "-conf", "%%PREFIX%%/etc/%%APP_NAME%%.xml" ] - os.environ['JAVA_HOME'] = "%%JAVA_HOME%%" os.environ['CLASSPATH'] = classpath() + os.environ['PATH'] = "%%LOCALBASE%%/bin:/usr/bin:/bin" if len(sys.argv) < 2: usage() |