Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Nov 2003 01:37:55 +0200 (EET)
From:      ve <ve@hardcore.lt>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/59571: improvements of www/jakarta-tomcat4[1] Makefile and control program
Message-ID:  <20031121233755.599071A8741@mlogika.elnet.lt>
Resent-Message-ID: <200311212340.hALNeDUI031198@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59571
>Category:       ports
>Synopsis:       improvements of www/jakarta-tomcat4[1] Makefile and control program
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 21 15:40:12 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     ve
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Megalogika Ltd.
>Environment:
System: FreeBSD mlogika.elnet.lt 4.8-STABLE FreeBSD 4.8-STABLE #3: Tue Aug 12 18:40:43 EEST 2003 ve@mlogika.elnet.lt:/usr/obj/usr/src/sys/MEGA i386

>Description:
>How-To-Repeat:
>Fix:
www/jakarta-tomcat4 and www/jakarta-tomcat41 Makefiles detect if JDK1.4.x built on FreeBSD is used and allow to use WITH_SERVER_VM port flag to add -server to Java VM command line. also, JAVA_HEAP_MS and JAVA_HEAP_MX parameters allow to set initial and maximum Java heap size. all these values are places into port server control program, daemonctl.c

--- www/jakarta-tomcat4/Makefile patch ---
--- Makefile.orig       Sat Nov 15 03:40:20 2003
+++ Makefile    Fri Nov 21 12:44:07 2003
@@ -50,9 +50,22 @@
                ${WRKSRC}/conf/server.xml
 JAR_FILE=      bin/bootstrap.jar
 WRKDIR?=       ${WRKDIRPREFIX}${.CURDIR}/work
+JAVA_VM_ARGS=
 
 .include <bsd.port.pre.mk>
 
+.   if defined(WITH_SERVER_VM)
+.       if defined(JAVA_PORT) && ${JAVA_PORT} == ${_JAVA_PORT_FREEBSD_1_4}
+JAVA_VM_ARGS+=-server
+.       endif
+.   endif
+.   if defined(JAVA_HEAP_MS)
+JAVA_VM_ARGS+=-Xms${JAVA_HEAP_MS}
+.   endif
+.   if defined(JAVA_HEAP_MX)
+JAVA_VM_ARGS+=-Xmx${JAVA_HEAP_MX}
+.   endif
+
 pre-patch:
        @${ECHO_CMD} "Installation settings:"
        @${ECHO_CMD} "   Destination directory:    ${APP_HOME}"
@@ -60,6 +73,9 @@
        @${ECHO_CMD} "   Startup script location:  ${STARTUP_SCRIPT}"
        @${ECHO_CMD} "   Location of JDK:          ${JAVA_HOME}"
        @${ECHO_CMD} "   Location of Java port:    ${JAVA_PORT}"
+       @${ECHO_CMD} "   Java VM args:             ${JAVA_VM_ARGS}"
+       @${ECHO_CMD} "   Initial Java heap size:   ${JAVA_HEAP_MS}"
+       @${ECHO_CMD} "   Maximum Java heap size:   ${JAVA_HEAP_MX}"
        @${ECHO_CMD} "   Running as (user/group):  ${USER}/${GROUP}"
        @${ECHO_CMD} "   HTTP port:                ${HTTP_PORT}"
        @${ECHO_CMD} "   Shutdown listener port:   ${SHUTDOWN_PORT}"
@@ -104,6 +120,7 @@
        -e "/%%STOP_TIMEOUT%%/s//${STOP_TIMEOUT}/g" \
        -e "/%%USER%%/s//${USER}/g" \
        -e "/%%WARP_PORT%%/s//${WARP_PORT}/g" \
+       -e "/%%VM_ARGS%%/s//\"${JAVA_VM_ARGS}\",/g" \
        $f > ${WRKDIR}/`basename $f`
        @${ECHO_CMD} " [ DONE ]"
 .endfor
--- www/jakarta-tomcat4/Makefile patch end ---

--- www/jakarta-tomcat4/files/daemonctl.c patch ---
--- files/daemonctl.c.orig      Thu Oct 10 01:10:32 2002
+++ files/daemonctl.c   Fri Nov 21 11:55:39 2003
@@ -425,7 +425,7 @@
                         file using pipe(2) */
 
                /* Execute the command */
-               execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);
+               execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", %%VM_ARGS%% "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);
 
                fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% %%PORTVERSION%% since '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: ");
                perror(NULL);
--- www/jakarta-tomcat4/files/daemonctl.c patch end ---

--- www/jakarta-tomcat41/Makefile patch ---
--- Makefile.orig       Sat Nov 22 01:34:31 2003
+++ Makefile    Sat Nov 22 01:37:17 2003
@@ -51,9 +51,22 @@
                ${WRKSRC}/conf/server.xml
 JAR_FILE=      bin/bootstrap.jar
 WRKDIR?=       ${WRKDIRPREFIX}${.CURDIR}/work
+JAVA_VM_ARGS=
 
 .include <bsd.port.pre.mk>

+.     if defined(WITH_SERVER_VM)
+.             if defined(JAVA_PORT) && ${JAVA_PORT} == ${_JAVA_PORT_FREEBSD_1_4}
+JAVA_VM_ARGS+=-server
+.             endif
+.     endif
+.     if defined(JAVA_HEAP_MS)
+JAVA_VM_ARGS+=-Xms${JAVA_HEAP_MS}
+.     endif
+.     if defined(JAVA_HEAP_MX)
+JAVA_VM_ARGS+=-Xmx${JAVA_HEAP_MX}
+.     endif
+
 pre-patch:
        @${ECHO_CMD} "Installation settings:"
        @${ECHO_CMD} "   Destination directory:    ${APP_HOME}"
@@ -61,6 +74,9 @@
        @${ECHO_CMD} "   Startup script location:  ${STARTUP_SCRIPT}"
        @${ECHO_CMD} "   Location of JDK:          ${JAVA_HOME}"
        @${ECHO_CMD} "   Location of Java port:    ${JAVA_PORT}"
+       @${ECHO_CMD} "   Java VM args:             ${JAVA_VM_ARGS}"
+       @${ECHO_CMD} "   Initial Java heap size:   ${JAVA_HEAP_MS}"
+       @${ECHO_CMD} "   Maximum Java heap size:   ${JAVA_HEAP_MX}"
        @${ECHO_CMD} "   Running as (user/group):  ${USER}/${GROUP}"
        @${ECHO_CMD} "   HTTP port:                ${HTTP_PORT}"
        @${ECHO_CMD} "   Shutdown listener port:   ${SHUTDOWN_PORT}"
@@ -105,6 +121,7 @@
        -e "/%%STOP_TIMEOUT%%/s//${STOP_TIMEOUT}/g" \
        -e "/%%USER%%/s//${USER}/g" \
        -e "/%%WARP_PORT%%/s//${WARP_PORT}/g" \
+       -e "/%%VM_ARGS%%/s//\"${JAVA_VM_ARGS}\",/g" \
        $f > ${WRKDIR}/`basename $f`
        @${ECHO_CMD} " [ DONE ]"
 .endfor
--- www/jakarta-tomcat41/Makefile patch end---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031121233755.599071A8741>