aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnst de Haan <znerd@FreeBSD.org>2002-04-03 19:49:27 +0000
committerErnst de Haan <znerd@FreeBSD.org>2002-04-03 19:49:27 +0000
commit144c6b62cab091d6b9d52b220896b1dd94da63c4 (patch)
treea9ffbfbeff31501e8c77156341c60b5fddbc1c94
parent5bd7dbcac5ee19fa6c2c91462241f7d12e41a4ff (diff)
downloadports-144c6b62cab091d6b9d52b220896b1dd94da63c4.tar.gz
ports-144c6b62cab091d6b9d52b220896b1dd94da63c4.zip
Little generalization and cleanup. Nothing
spectacular. Not bumped PORTREVISION.
Notes
Notes: svn path=/head/; revision=57268
-rw-r--r--www/jakarta-tomcat/Makefile36
-rw-r--r--www/jakarta-tomcat/files/daemonctl.c18
-rw-r--r--www/jakarta-tomcat4/Makefile36
-rw-r--r--www/jakarta-tomcat4/files/daemonctl.c18
-rw-r--r--www/jakarta-tomcat41/Makefile36
-rw-r--r--www/jakarta-tomcat41/files/daemonctl.c18
-rw-r--r--www/tomcat41/Makefile36
-rw-r--r--www/tomcat41/files/daemonctl.c18
8 files changed, 84 insertions, 132 deletions
diff --git a/www/jakarta-tomcat/Makefile b/www/jakarta-tomcat/Makefile
index 1d4f3bd8821b..c68de1e366fb 100644
--- a/www/jakarta-tomcat/Makefile
+++ b/www/jakarta-tomcat/Makefile
@@ -45,8 +45,6 @@ REPLACE_FILES= ${FILESDIR}/daemonctl.c \
${FILESDIR}/jakarta-tomcat.sh \
${WRKSRC}/conf/server.xml
JAR_FILE= bin/bootstrap.jar
-JAVA_ARGS= '"-Dcatalina.home=${APP_HOME}"'
-JAR_ARGS= '"start"'
CONTROL_SCRIPT_MANPAGE_TITLE= TOMCAT4CTL
WRKDIR?= work
@@ -54,19 +52,19 @@ WRKDIR?= work
pre-install:
@${ECHO_CMD} "Installation settings:"
- @${ECHO_CMD} " Destination directory: ${APP_HOME}"
- @${ECHO_CMD} " Control script location: ${CONTROL_SCRIPT}"
- @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
- @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
- @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
- @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
- @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
- @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
- @${ECHO_CMD} " WARP port: ${WARP_PORT}"
- @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
- @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
- @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
- @${ECHO_CMD} " Starting after install: ${AUTO_START}"
+ @${ECHO_CMD} " Destination directory: ${APP_HOME}"
+ @${ECHO_CMD} " Control program location: ${CONTROL_SCRIPT}"
+ @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
+ @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
+ @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
+ @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
+ @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
+ @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
+ @${ECHO_CMD} " WARP port: ${WARP_PORT}"
+ @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
+ @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
+ @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
+ @${ECHO_CMD} " Starting after install: ${AUTO_START}"
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@@ -115,8 +113,12 @@ do-install:
@${CP} ${WRKDIR}/server.xml ${APP_HOME}/conf/
@${ECHO_CMD} " [ DONE ]"
- @${ECHO_CMD} -n ">> Compiling and installing control script..."
- @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl.c
+ @${ECHO_CMD} -n ">> Compiling and installing control program..."
+ @${SED} \
+ -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \
+ -e "/%%JAR_ARGS%%/s//\"start\",/g" \
+ ${WRKDIR}/daemonctl.c > ${WRKDIR}/daemonctl_.c
+ @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl_.c
@${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT}
@${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT}
@${CHMOD} 6754 ${CONTROL_SCRIPT}
diff --git a/www/jakarta-tomcat/files/daemonctl.c b/www/jakarta-tomcat/files/daemonctl.c
index b1d8df8f866d..1c6b0ede2ee5 100644
--- a/www/jakarta-tomcat/files/daemonctl.c
+++ b/www/jakarta-tomcat/files/daemonctl.c
@@ -4,7 +4,7 @@
*
* Daemon control program.
*
- * $FreeBSD: /tmp/pcvs/ports/www/jakarta-tomcat/files/Attic/daemonctl.c,v 1.1 2002-03-30 14:51:12 znerd Exp $
+ * $FreeBSD: /tmp/pcvs/ports/www/jakarta-tomcat/files/Attic/daemonctl.c,v 1.2 2002-04-03 19:49:27 znerd Exp $
*/
#include <assert.h>
@@ -34,20 +34,6 @@
#define ERR_STDERR_LOGFILE_OPEN 10
#define ERR_FORK_FAILED 11
-#if defined JAVA_ARGS
-#define JAVA_ARGS_COMMA ,
-#else
-#define JAVA_ARGS
-#define JAVA_ARGS_COMMA
-#endif
-
-#if defined JAR_ARGS
-#define JAR_ARGS_COMMA ,
-#else
-#define JAR_ARGS
-#define JAR_ARGS_COMMA
-#endif
-
#define private static
private void printUsage(void);
@@ -323,7 +309,7 @@ void start(void) {
file using pipe(2) */
/* Execute the command */
- execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", JAVA_ARGS JAVA_ARGS_COMMA "%%JAR_FILE%%", JAR_ARGS JAR_ARGS_COMMA NULL);
+ execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);
fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% as '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: ");
perror(NULL);
diff --git a/www/jakarta-tomcat4/Makefile b/www/jakarta-tomcat4/Makefile
index 1d4f3bd8821b..c68de1e366fb 100644
--- a/www/jakarta-tomcat4/Makefile
+++ b/www/jakarta-tomcat4/Makefile
@@ -45,8 +45,6 @@ REPLACE_FILES= ${FILESDIR}/daemonctl.c \
${FILESDIR}/jakarta-tomcat.sh \
${WRKSRC}/conf/server.xml
JAR_FILE= bin/bootstrap.jar
-JAVA_ARGS= '"-Dcatalina.home=${APP_HOME}"'
-JAR_ARGS= '"start"'
CONTROL_SCRIPT_MANPAGE_TITLE= TOMCAT4CTL
WRKDIR?= work
@@ -54,19 +52,19 @@ WRKDIR?= work
pre-install:
@${ECHO_CMD} "Installation settings:"
- @${ECHO_CMD} " Destination directory: ${APP_HOME}"
- @${ECHO_CMD} " Control script location: ${CONTROL_SCRIPT}"
- @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
- @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
- @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
- @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
- @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
- @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
- @${ECHO_CMD} " WARP port: ${WARP_PORT}"
- @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
- @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
- @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
- @${ECHO_CMD} " Starting after install: ${AUTO_START}"
+ @${ECHO_CMD} " Destination directory: ${APP_HOME}"
+ @${ECHO_CMD} " Control program location: ${CONTROL_SCRIPT}"
+ @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
+ @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
+ @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
+ @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
+ @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
+ @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
+ @${ECHO_CMD} " WARP port: ${WARP_PORT}"
+ @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
+ @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
+ @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
+ @${ECHO_CMD} " Starting after install: ${AUTO_START}"
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@@ -115,8 +113,12 @@ do-install:
@${CP} ${WRKDIR}/server.xml ${APP_HOME}/conf/
@${ECHO_CMD} " [ DONE ]"
- @${ECHO_CMD} -n ">> Compiling and installing control script..."
- @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl.c
+ @${ECHO_CMD} -n ">> Compiling and installing control program..."
+ @${SED} \
+ -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \
+ -e "/%%JAR_ARGS%%/s//\"start\",/g" \
+ ${WRKDIR}/daemonctl.c > ${WRKDIR}/daemonctl_.c
+ @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl_.c
@${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT}
@${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT}
@${CHMOD} 6754 ${CONTROL_SCRIPT}
diff --git a/www/jakarta-tomcat4/files/daemonctl.c b/www/jakarta-tomcat4/files/daemonctl.c
index 265b7dfaf3cc..3ced2dab79db 100644
--- a/www/jakarta-tomcat4/files/daemonctl.c
+++ b/www/jakarta-tomcat4/files/daemonctl.c
@@ -4,7 +4,7 @@
*
* Daemon control program.
*
- * $FreeBSD: /tmp/pcvs/ports/www/jakarta-tomcat4/files/Attic/daemonctl.c,v 1.1 2002-03-30 14:51:12 znerd Exp $
+ * $FreeBSD: /tmp/pcvs/ports/www/jakarta-tomcat4/files/Attic/daemonctl.c,v 1.2 2002-04-03 19:49:27 znerd Exp $
*/
#include <assert.h>
@@ -34,20 +34,6 @@
#define ERR_STDERR_LOGFILE_OPEN 10
#define ERR_FORK_FAILED 11
-#if defined JAVA_ARGS
-#define JAVA_ARGS_COMMA ,
-#else
-#define JAVA_ARGS
-#define JAVA_ARGS_COMMA
-#endif
-
-#if defined JAR_ARGS
-#define JAR_ARGS_COMMA ,
-#else
-#define JAR_ARGS
-#define JAR_ARGS_COMMA
-#endif
-
#define private static
private void printUsage(void);
@@ -323,7 +309,7 @@ void start(void) {
file using pipe(2) */
/* Execute the command */
- execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", JAVA_ARGS JAVA_ARGS_COMMA "%%JAR_FILE%%", JAR_ARGS JAR_ARGS_COMMA NULL);
+ execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);
fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% as '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: ");
perror(NULL);
diff --git a/www/jakarta-tomcat41/Makefile b/www/jakarta-tomcat41/Makefile
index 1d4f3bd8821b..c68de1e366fb 100644
--- a/www/jakarta-tomcat41/Makefile
+++ b/www/jakarta-tomcat41/Makefile
@@ -45,8 +45,6 @@ REPLACE_FILES= ${FILESDIR}/daemonctl.c \
${FILESDIR}/jakarta-tomcat.sh \
${WRKSRC}/conf/server.xml
JAR_FILE= bin/bootstrap.jar
-JAVA_ARGS= '"-Dcatalina.home=${APP_HOME}"'
-JAR_ARGS= '"start"'
CONTROL_SCRIPT_MANPAGE_TITLE= TOMCAT4CTL
WRKDIR?= work
@@ -54,19 +52,19 @@ WRKDIR?= work
pre-install:
@${ECHO_CMD} "Installation settings:"
- @${ECHO_CMD} " Destination directory: ${APP_HOME}"
- @${ECHO_CMD} " Control script location: ${CONTROL_SCRIPT}"
- @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
- @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
- @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
- @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
- @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
- @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
- @${ECHO_CMD} " WARP port: ${WARP_PORT}"
- @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
- @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
- @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
- @${ECHO_CMD} " Starting after install: ${AUTO_START}"
+ @${ECHO_CMD} " Destination directory: ${APP_HOME}"
+ @${ECHO_CMD} " Control program location: ${CONTROL_SCRIPT}"
+ @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
+ @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
+ @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
+ @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
+ @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
+ @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
+ @${ECHO_CMD} " WARP port: ${WARP_PORT}"
+ @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
+ @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
+ @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
+ @${ECHO_CMD} " Starting after install: ${AUTO_START}"
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@@ -115,8 +113,12 @@ do-install:
@${CP} ${WRKDIR}/server.xml ${APP_HOME}/conf/
@${ECHO_CMD} " [ DONE ]"
- @${ECHO_CMD} -n ">> Compiling and installing control script..."
- @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl.c
+ @${ECHO_CMD} -n ">> Compiling and installing control program..."
+ @${SED} \
+ -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \
+ -e "/%%JAR_ARGS%%/s//\"start\",/g" \
+ ${WRKDIR}/daemonctl.c > ${WRKDIR}/daemonctl_.c
+ @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl_.c
@${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT}
@${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT}
@${CHMOD} 6754 ${CONTROL_SCRIPT}
diff --git a/www/jakarta-tomcat41/files/daemonctl.c b/www/jakarta-tomcat41/files/daemonctl.c
index 23be5a7acffd..b8289abc33ab 100644
--- a/www/jakarta-tomcat41/files/daemonctl.c
+++ b/www/jakarta-tomcat41/files/daemonctl.c
@@ -4,7 +4,7 @@
*
* Daemon control program.
*
- * $FreeBSD: /tmp/pcvs/ports/www/jakarta-tomcat41/files/Attic/daemonctl.c,v 1.1 2002-03-30 14:51:12 znerd Exp $
+ * $FreeBSD: /tmp/pcvs/ports/www/jakarta-tomcat41/files/Attic/daemonctl.c,v 1.2 2002-04-03 19:49:27 znerd Exp $
*/
#include <assert.h>
@@ -34,20 +34,6 @@
#define ERR_STDERR_LOGFILE_OPEN 10
#define ERR_FORK_FAILED 11
-#if defined JAVA_ARGS
-#define JAVA_ARGS_COMMA ,
-#else
-#define JAVA_ARGS
-#define JAVA_ARGS_COMMA
-#endif
-
-#if defined JAR_ARGS
-#define JAR_ARGS_COMMA ,
-#else
-#define JAR_ARGS
-#define JAR_ARGS_COMMA
-#endif
-
#define private static
private void printUsage(void);
@@ -323,7 +309,7 @@ void start(void) {
file using pipe(2) */
/* Execute the command */
- execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", JAVA_ARGS JAVA_ARGS_COMMA "%%JAR_FILE%%", JAR_ARGS JAR_ARGS_COMMA NULL);
+ execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);
fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% as '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: ");
perror(NULL);
diff --git a/www/tomcat41/Makefile b/www/tomcat41/Makefile
index 1d4f3bd8821b..c68de1e366fb 100644
--- a/www/tomcat41/Makefile
+++ b/www/tomcat41/Makefile
@@ -45,8 +45,6 @@ REPLACE_FILES= ${FILESDIR}/daemonctl.c \
${FILESDIR}/jakarta-tomcat.sh \
${WRKSRC}/conf/server.xml
JAR_FILE= bin/bootstrap.jar
-JAVA_ARGS= '"-Dcatalina.home=${APP_HOME}"'
-JAR_ARGS= '"start"'
CONTROL_SCRIPT_MANPAGE_TITLE= TOMCAT4CTL
WRKDIR?= work
@@ -54,19 +52,19 @@ WRKDIR?= work
pre-install:
@${ECHO_CMD} "Installation settings:"
- @${ECHO_CMD} " Destination directory: ${APP_HOME}"
- @${ECHO_CMD} " Control script location: ${CONTROL_SCRIPT}"
- @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
- @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
- @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
- @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
- @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
- @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
- @${ECHO_CMD} " WARP port: ${WARP_PORT}"
- @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
- @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
- @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
- @${ECHO_CMD} " Starting after install: ${AUTO_START}"
+ @${ECHO_CMD} " Destination directory: ${APP_HOME}"
+ @${ECHO_CMD} " Control program location: ${CONTROL_SCRIPT}"
+ @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}"
+ @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}"
+ @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}"
+ @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
+ @${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
+ @${ECHO_CMD} " Shutdown listener port: ${SHUTDOWN_PORT}"
+ @${ECHO_CMD} " WARP port: ${WARP_PORT}"
+ @${ECHO_CMD} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
+ @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
+ @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
+ @${ECHO_CMD} " Starting after install: ${AUTO_START}"
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@@ -115,8 +113,12 @@ do-install:
@${CP} ${WRKDIR}/server.xml ${APP_HOME}/conf/
@${ECHO_CMD} " [ DONE ]"
- @${ECHO_CMD} -n ">> Compiling and installing control script..."
- @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl.c
+ @${ECHO_CMD} -n ">> Compiling and installing control program..."
+ @${SED} \
+ -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \
+ -e "/%%JAR_ARGS%%/s//\"start\",/g" \
+ ${WRKDIR}/daemonctl.c > ${WRKDIR}/daemonctl_.c
+ @cd ${WRKDIR} && ${CC} -DJAR_ARGS=${JAR_ARGS} -DJAVA_ARGS=${JAVA_ARGS} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl_.c
@${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT}
@${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT}
@${CHMOD} 6754 ${CONTROL_SCRIPT}
diff --git a/www/tomcat41/files/daemonctl.c b/www/tomcat41/files/daemonctl.c
index 39d3f4457355..49a45728ac74 100644
--- a/www/tomcat41/files/daemonctl.c
+++ b/www/tomcat41/files/daemonctl.c
@@ -4,7 +4,7 @@
*
* Daemon control program.
*
- * $FreeBSD: /tmp/pcvs/ports/www/tomcat41/files/Attic/daemonctl.c,v 1.1 2002-03-30 14:51:12 znerd Exp $
+ * $FreeBSD: /tmp/pcvs/ports/www/tomcat41/files/Attic/daemonctl.c,v 1.2 2002-04-03 19:49:27 znerd Exp $
*/
#include <assert.h>
@@ -34,20 +34,6 @@
#define ERR_STDERR_LOGFILE_OPEN 10
#define ERR_FORK_FAILED 11
-#if defined JAVA_ARGS
-#define JAVA_ARGS_COMMA ,
-#else
-#define JAVA_ARGS
-#define JAVA_ARGS_COMMA
-#endif
-
-#if defined JAR_ARGS
-#define JAR_ARGS_COMMA ,
-#else
-#define JAR_ARGS
-#define JAR_ARGS_COMMA
-#endif
-
#define private static
private void printUsage(void);
@@ -323,7 +309,7 @@ void start(void) {
file using pipe(2) */
/* Execute the command */
- execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", JAVA_ARGS JAVA_ARGS_COMMA "%%JAR_FILE%%", JAR_ARGS JAR_ARGS_COMMA NULL);
+ execl("%%JAVA_HOME%%/%%JAVA_CMD%%", "%%JAVA_HOME%%/%%JAVA_CMD%%", "-jar", %%JAVA_ARGS%% "%%JAR_FILE%%", %%JAR_ARGS%% NULL);
fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to start %%APP_TITLE%% as '%%JAVA_HOME%%/%%JAVA_CMD%% -jar %%JAR_FILE%%' in %%APP_HOME%%: ");
perror(NULL);