Now using files from www/jakarta-tomcat4.

Moved things around from one target to another. Now
displaying installation settings during pre-install. Doing
file replacements in post-patch.
Bumped PORTREVISION.
This commit is contained in:
Ernst de Haan 2002-04-16 20:13:16 +00:00
parent a5b086e407
commit 18684fadc2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=57772
6 changed files with 56 additions and 264 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= orion
PORTVERSION= 1.5.2
PORTREVISION= 18
PORTREVISION= 19
CATEGORIES= www java
MASTER_SITES= http://www.orionserver.com/distributions/ \
http://www.atlassian.com/software/orion/downloads/ \
@ -30,6 +30,7 @@ APP_TITLE= Orion Server
APP_SHORTNAME= ${PORTNAME}
CONTROL_SCRIPT_NAME= ${APP_SHORTNAME}ctl
CONTROL_SCRIPT= ${PREFIX}/bin/${CONTROL_SCRIPT_NAME}
CONTROL_SCRIPT_MANPAGE_TITLE= ${CONTROL_SCRIPT_NAME:U}
STARTUP_ORDER= 020
STARTUP_SCRIPT_NAME= ${PORTNAME}.sh
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/${STARTUP_ORDER}.${STARTUP_SCRIPT_NAME}
@ -44,8 +45,8 @@ AUTO_START?= NO
STOP_TIMEOUT?= 5
PID_FILE= /var/run/${APP_SHORTNAME}.pid
REPLACE_FILES= ${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.c \
${FILESDIR}/${CONTROL_SCRIPT_NAME}.1 \
${FILESDIR}/${STARTUP_SCRIPT_NAME} \
${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.1 \
${PORTSDIR}/www/jakarta-tomcat4/files/startup.sh \
${WRKSRC}/config/default-web-site.xml \
${WRKSRC}/config/rmi.xml
JAR_FILE= ${APP_SHORTNAME}.jar
@ -53,26 +54,9 @@ WRKDIR?= ${.CURDIR}/work
.include <bsd.port.pre.mk>
pre-install:
@${ECHO_CMD} "Installation settings:"
@${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} " Using Jikes: ${WITH_JIKES}"
@${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
@${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
@${ECHO_CMD} " RMI port: ${RMI_PORT}"
@${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
@${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
@${ECHO_CMD} " Starting after install: ${AUTO_START}"
@${ECHO_CMD} " Stop time-out: ${STOP_TIMEOUT} sec."
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@${ECHO_CMD} -n ">> Removing all .bat and .orig files..."
@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'`
post-patch:
@${ECHO_CMD} -n ">> Removing unneeded files..."
@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'`
@${ECHO_CMD} " [ DONE ]"
.for f in ${REPLACE_FILES}
@ -82,6 +66,7 @@ do-install:
-e "/%%APP_SHORTNAME%%/s//${APP_SHORTNAME}/g" \
-e "/%%APP_TITLE%%/s//${APP_TITLE}/g" \
-e "/%%CONTROL_SCRIPT%%/s//${CONTROL_SCRIPT:S/\//\\\//g}/g" \
-e "/%%CONTROL_SCRIPT_MANPAGE_TITLE%%/s//${CONTROL_SCRIPT_MANPAGE_TITLE}/g" \
-e "/%%CONTROL_SCRIPT_NAME%%/s//${CONTROL_SCRIPT_NAME}/g" \
-e "/%%GROUP%%/s//${GROUP}/g" \
-e "/%%HTTP_PORT%%/s//${HTTP_PORT}/g" \
@ -103,6 +88,24 @@ do-install:
@${ECHO_CMD} " [ DONE ]"
.endfor
pre-install:
@${ECHO_CMD} "Installation settings:"
@${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} " Using Jikes: ${WITH_JIKES}"
@${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
@${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
@${ECHO_CMD} " RMI port: ${RMI_PORT}"
@${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
@${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
@${ECHO_CMD} " Starting after install: ${AUTO_START}"
@${ECHO_CMD} " Stop time-out: ${STOP_TIMEOUT} sec."
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@${ECHO_CMD} -n ">> Creating destination directory..."
@${MKDIR} ${APP_HOME}
@${MKDIR} ${APP_HOME}/application-deployments
@ -132,13 +135,13 @@ do-install:
@${ECHO_CMD} " [ DONE ]"
@${ECHO_CMD} -n ">> Installing startup script..."
@${CP} ${WRKDIR}/${STARTUP_SCRIPT_NAME} ${STARTUP_SCRIPT}
@${CP} ${WRKDIR}/startup.sh ${STARTUP_SCRIPT}
@${CHMOD} 0544 ${STARTUP_SCRIPT}
@${ECHO_CMD} " [ DONE ]"
.if !defined(NOPORTDOCS)
@${ECHO_CMD} -n ">> Installing man pages..."
@${INSTALL_MAN} ${WRKDIR}/${CONTROL_SCRIPT_NAME}.1 ${MANPREFIX}/man/man1
@${INSTALL_MAN} ${WRKDIR}/daemonctl.1 ${MANPREFIX}/man/man1/${CONTROL_SCRIPT_NAME}.1
@${ECHO_CMD} " [ DONE ]"
.endif

View File

@ -1,32 +0,0 @@
#!/bin/sh
# -*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
# %%APP_TITLE%% startup script.
#
# $FreeBSD$
#
# Set some variables
MYSELF=`basename $0`
case "$1" in
start)
truncate -s 0 %%PID_FILE%%
chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% start > /dev/null" && echo -n ' %%APP_SHORTNAME%%'
;;
stop)
chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% stop > /dev/null" && echo -n ' %%APP_SHORTNAME%%'
;;
*)
echo ""
echo "Usage: ${MYSELF} { start | stop }"
echo ""
exit 64
;;
esac

View File

@ -1,75 +0,0 @@
.Dd February 21, 2002
.Dt ORIONCTL 1
.Os FreeBSD
.Sh NAME
.Nm %%CONTROL_SCRIPT_NAME%%
.Nd %%APP_TITLE%% server control interface
.Sh SYNOPSIS
.Nm
.Op Ar start | Ar restart | Ar stop
.Sh DESCRIPTION
The
.Nm
program provides an interface to the %%APP_TITLE%% application server.
.Pp
The program expects exactly one argument, either
.Ar start ,
.Ar restart
or
.Ar stop .
If more than one argument is given, then all arguments but the first are
ignored.
.Bl -tag -width indent
.It Ar start
Start %%APP_TITLE%%, if it is not already running.
.It Ar restart
Restart %%APP_TITLE%%. If it is already running, then it will be stopped and
then started right after that. Otherwise it will just be started up.
.It Ar stop
Stop %%APP_TITLE%%, if it is actually running.
.El
.Sh ERRORS
The following error conditions are detected. They will be checked in the
specified order. In each case an error message is printed with the name of the
control program prepended.
.Pp
If no argument is passed, then a simple help message is printed and the
program exists with error code 0.
.Pp
If at least one argument is passed, but it is different from
.Ar start ,
.Ar restart
or
.Ar stop
then the help message is printed as well, and the program exits with error
code 1.
.Pp
The following errors conditions are defined:
.Bl -tag -width indent
.It Em Illegal program argument (error code 1)
.It Em PID file not found (error code 2)
.It Em PID file too large (error code 3)
.It Em PID file contains illegal character (error code 4)
.It Em Kill of process failed (error code 5)
.It Em %%APP_TITLE%% is already running (error code 6)
.It Em %%APP_TITLE%% is not running (error code 7)
.It Em Unable to chdir to the %%APP_TITLE%% home directory (error code 8)
.It Em Unable to open the stdout log file (error code 9)
.It Em Unable to open the stderr log file (error code 10)
.It Em Unable to start %%APP_TITLE%% (error code 11)
.El
.Sh FILES
.Bl -tag -width -indent
.It Pa %%PID_FILE%%
The %%APP_TITLE%% PID file that is used to store the process ID of the
currently running process in. It is emptied as soon as the server is stopped
and filled with the process ID when it is started. It should never be writable
for anyone but
.Em www ,
.It Pa %%STARTUP_SCRIPT%%
A script that starts the
.Nm
program. It is used to start %%APP_TITLE%% at startup time.
.El
.Sh AUTHORS
.An Ernst de Haan Aq znerd@FreeBSD.org

View File

@ -7,7 +7,7 @@
PORTNAME= orion
PORTVERSION= 1.5.2
PORTREVISION= 18
PORTREVISION= 19
CATEGORIES= www java
MASTER_SITES= http://www.orionserver.com/distributions/ \
http://www.atlassian.com/software/orion/downloads/ \
@ -30,6 +30,7 @@ APP_TITLE= Orion Server
APP_SHORTNAME= ${PORTNAME}
CONTROL_SCRIPT_NAME= ${APP_SHORTNAME}ctl
CONTROL_SCRIPT= ${PREFIX}/bin/${CONTROL_SCRIPT_NAME}
CONTROL_SCRIPT_MANPAGE_TITLE= ${CONTROL_SCRIPT_NAME:U}
STARTUP_ORDER= 020
STARTUP_SCRIPT_NAME= ${PORTNAME}.sh
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/${STARTUP_ORDER}.${STARTUP_SCRIPT_NAME}
@ -44,8 +45,8 @@ AUTO_START?= NO
STOP_TIMEOUT?= 5
PID_FILE= /var/run/${APP_SHORTNAME}.pid
REPLACE_FILES= ${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.c \
${FILESDIR}/${CONTROL_SCRIPT_NAME}.1 \
${FILESDIR}/${STARTUP_SCRIPT_NAME} \
${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.1 \
${PORTSDIR}/www/jakarta-tomcat4/files/startup.sh \
${WRKSRC}/config/default-web-site.xml \
${WRKSRC}/config/rmi.xml
JAR_FILE= ${APP_SHORTNAME}.jar
@ -53,26 +54,9 @@ WRKDIR?= ${.CURDIR}/work
.include <bsd.port.pre.mk>
pre-install:
@${ECHO_CMD} "Installation settings:"
@${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} " Using Jikes: ${WITH_JIKES}"
@${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
@${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
@${ECHO_CMD} " RMI port: ${RMI_PORT}"
@${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
@${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
@${ECHO_CMD} " Starting after install: ${AUTO_START}"
@${ECHO_CMD} " Stop time-out: ${STOP_TIMEOUT} sec."
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@${ECHO_CMD} -n ">> Removing all .bat and .orig files..."
@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'`
post-patch:
@${ECHO_CMD} -n ">> Removing unneeded files..."
@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'`
@${ECHO_CMD} " [ DONE ]"
.for f in ${REPLACE_FILES}
@ -82,6 +66,7 @@ do-install:
-e "/%%APP_SHORTNAME%%/s//${APP_SHORTNAME}/g" \
-e "/%%APP_TITLE%%/s//${APP_TITLE}/g" \
-e "/%%CONTROL_SCRIPT%%/s//${CONTROL_SCRIPT:S/\//\\\//g}/g" \
-e "/%%CONTROL_SCRIPT_MANPAGE_TITLE%%/s//${CONTROL_SCRIPT_MANPAGE_TITLE}/g" \
-e "/%%CONTROL_SCRIPT_NAME%%/s//${CONTROL_SCRIPT_NAME}/g" \
-e "/%%GROUP%%/s//${GROUP}/g" \
-e "/%%HTTP_PORT%%/s//${HTTP_PORT}/g" \
@ -103,6 +88,24 @@ do-install:
@${ECHO_CMD} " [ DONE ]"
.endfor
pre-install:
@${ECHO_CMD} "Installation settings:"
@${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} " Using Jikes: ${WITH_JIKES}"
@${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}"
@${ECHO_CMD} " HTTP port: ${HTTP_PORT}"
@${ECHO_CMD} " RMI port: ${RMI_PORT}"
@${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}"
@${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}"
@${ECHO_CMD} " Starting after install: ${AUTO_START}"
@${ECHO_CMD} " Stop time-out: ${STOP_TIMEOUT} sec."
@PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
do-install:
@${ECHO_CMD} -n ">> Creating destination directory..."
@${MKDIR} ${APP_HOME}
@${MKDIR} ${APP_HOME}/application-deployments
@ -132,13 +135,13 @@ do-install:
@${ECHO_CMD} " [ DONE ]"
@${ECHO_CMD} -n ">> Installing startup script..."
@${CP} ${WRKDIR}/${STARTUP_SCRIPT_NAME} ${STARTUP_SCRIPT}
@${CP} ${WRKDIR}/startup.sh ${STARTUP_SCRIPT}
@${CHMOD} 0544 ${STARTUP_SCRIPT}
@${ECHO_CMD} " [ DONE ]"
.if !defined(NOPORTDOCS)
@${ECHO_CMD} -n ">> Installing man pages..."
@${INSTALL_MAN} ${WRKDIR}/${CONTROL_SCRIPT_NAME}.1 ${MANPREFIX}/man/man1
@${INSTALL_MAN} ${WRKDIR}/daemonctl.1 ${MANPREFIX}/man/man1/${CONTROL_SCRIPT_NAME}.1
@${ECHO_CMD} " [ DONE ]"
.endif

View File

@ -1,32 +0,0 @@
#!/bin/sh
# -*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
# %%APP_TITLE%% startup script.
#
# $FreeBSD$
#
# Set some variables
MYSELF=`basename $0`
case "$1" in
start)
truncate -s 0 %%PID_FILE%%
chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% start > /dev/null" && echo -n ' %%APP_SHORTNAME%%'
;;
stop)
chown %%USER%%:%%GROUP%% %%PID_FILE%%
chmod 600 %%PID_FILE%%
su -f -m %%USER%% -c "exec %%CONTROL_SCRIPT%% stop > /dev/null" && echo -n ' %%APP_SHORTNAME%%'
;;
*)
echo ""
echo "Usage: ${MYSELF} { start | stop }"
echo ""
exit 64
;;
esac

View File

@ -1,75 +0,0 @@
.Dd February 21, 2002
.Dt ORIONCTL 1
.Os FreeBSD
.Sh NAME
.Nm %%CONTROL_SCRIPT_NAME%%
.Nd %%APP_TITLE%% server control interface
.Sh SYNOPSIS
.Nm
.Op Ar start | Ar restart | Ar stop
.Sh DESCRIPTION
The
.Nm
program provides an interface to the %%APP_TITLE%% application server.
.Pp
The program expects exactly one argument, either
.Ar start ,
.Ar restart
or
.Ar stop .
If more than one argument is given, then all arguments but the first are
ignored.
.Bl -tag -width indent
.It Ar start
Start %%APP_TITLE%%, if it is not already running.
.It Ar restart
Restart %%APP_TITLE%%. If it is already running, then it will be stopped and
then started right after that. Otherwise it will just be started up.
.It Ar stop
Stop %%APP_TITLE%%, if it is actually running.
.El
.Sh ERRORS
The following error conditions are detected. They will be checked in the
specified order. In each case an error message is printed with the name of the
control program prepended.
.Pp
If no argument is passed, then a simple help message is printed and the
program exists with error code 0.
.Pp
If at least one argument is passed, but it is different from
.Ar start ,
.Ar restart
or
.Ar stop
then the help message is printed as well, and the program exits with error
code 1.
.Pp
The following errors conditions are defined:
.Bl -tag -width indent
.It Em Illegal program argument (error code 1)
.It Em PID file not found (error code 2)
.It Em PID file too large (error code 3)
.It Em PID file contains illegal character (error code 4)
.It Em Kill of process failed (error code 5)
.It Em %%APP_TITLE%% is already running (error code 6)
.It Em %%APP_TITLE%% is not running (error code 7)
.It Em Unable to chdir to the %%APP_TITLE%% home directory (error code 8)
.It Em Unable to open the stdout log file (error code 9)
.It Em Unable to open the stderr log file (error code 10)
.It Em Unable to start %%APP_TITLE%% (error code 11)
.El
.Sh FILES
.Bl -tag -width -indent
.It Pa %%PID_FILE%%
The %%APP_TITLE%% PID file that is used to store the process ID of the
currently running process in. It is emptied as soon as the server is stopped
and filled with the process ID when it is started. It should never be writable
for anyone but
.Em www ,
.It Pa %%STARTUP_SCRIPT%%
A script that starts the
.Nm
program. It is used to start %%APP_TITLE%% at startup time.
.El
.Sh AUTHORS
.An Ernst de Haan Aq znerd@FreeBSD.org