1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-06 11:41:52 +00:00

- update tomcat to 5.5.31

- replace a silly find construct in Makefile
- rewrite pkg-install
- include PATCH from PR 151078

PR:		150576
Submitted by:	Jason <jgh _at_ experts-exchange.com> (maintainer)
Approved by:	glarkin (mentor)
This commit is contained in:
Olli Hauer 2010-10-07 21:17:37 +00:00
parent ad4898ed81
commit 6cd2cdf89a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=262580
7 changed files with 123 additions and 50 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= tomcat
PORTVERSION= 5.5.30
PORTVERSION= 5.5.31
CATEGORIES= www java
MASTER_SITES= ${MASTER_SITE_APACHE}
MASTER_SITE_SUBDIR= tomcat/tomcat-5/v${PORTVERSION}/bin
@ -32,6 +32,7 @@ TOMCAT_USER?= www
TOMCAT_GROUP?= www
TOMCAT_UID?= 80
HTTP_PORT?= 8180
HTTP_TIMEOUT?= 20000
SHUTDOWN_PORT?= 8005
AJP_1_3_PORT?= 8009
STDOUT_LOG= ${LOG_DIR}/stdout.log
@ -53,8 +54,12 @@ SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \
APP_TITLE="${APP_TITLE}" \
GROUP=${TOMCAT_GROUP} \
HTTP_PORT=${HTTP_PORT} \
HTTP_TIMEOUT=${HTTP_TIMEOUT} \
JAR_FILE=${JAR_FILE} \
JAVA_HOME=${JAVA_HOME} \
LOG_DIR=${LOG_DIR} \
PID_FILE=${PID_FILE} \
PORTNAME=${PORTNAME} \
SHUTDOWN_PORT=${SHUTDOWN_PORT} \
STDERR_LOG=${STDERR_LOG} \
STDOUT_LOG=${STDOUT_LOG} \
@ -86,7 +91,7 @@ pre-patch:
post-patch:
@${ECHO_MSG} -n ">> Removing unneeded files..."
@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'` `${FIND} ${WRKSRC} -name '*.dll'`
@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.bat' -or -name '*.dll' -or -name '*.exe' -or -name '*.orig' \) -delete
@${RMDIR} ${WRKSRC}/bin/[i,x]64
@${ECHO_MSG} " [ DONE ]"
@ -96,9 +101,6 @@ post-patch:
@${ECHO_MSG} " [ DONE ]"
.endfor
pre-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
@${ECHO_MSG} -n ">> Creating destination directory..."
@${MKDIR} ${APP_HOME}
@ -118,28 +120,9 @@ do-install:
fi; \
done
@${CP} -R ${WRKSRC}/* ${APP_HOME}
@${ECHO_MSG} " [ DONE ]"
@${ECHO_MSG} -n ">> Creating log files..."
@${INSTALL} -m 664 -o ${TOMCAT_USER} -g ${TOMCAT_GROUP} /dev/null ${STDOUT_LOG}
@${INSTALL} -m 664 -o ${TOMCAT_USER} -g ${TOMCAT_GROUP} /dev/null ${STDERR_LOG}
@${ECHO_MSG} " [ DONE ]"
@${ECHO_MSG} -n ">> Creating symlink to tools.jar..."
@${LN} -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/common/lib/tools.jar
@${ECHO_MSG} " [ DONE ]"
@${ECHO_MSG} -n ">> Fixing ownership settings..."
@${CHOWN} -R ${TOMCAT_USER}:${TOMCAT_GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \
${APP_HOME}/temp ${APP_HOME}/work ${APP_HOME}/webapps
@${ECHO_MSG} " [ DONE ]"
@${ECHO_MSG} -n ">> Fixing permissions..."
@${FIND} ${APP_HOME} -type d | while read a; do\
${CHMOD} 755 "$$a"; \
done
@${ECHO_MSG} " [ DONE ]"
# create missing directories and fix permissions
post-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${ECHO_MSG} "${APP_TITLE} ${PORTVERSION} has been installed in ${APP_HOME}."
.include <bsd.port.post.mk>

View File

@ -1,3 +1,6 @@
MD5 (apache-tomcat-5.5.30.tar.gz) = 661dd3fbc25249e9ceb86652eb6a4f07
SHA256 (apache-tomcat-5.5.30.tar.gz) = ba6a25b642a5d034869a1f8a456cbebb8eb556fc788fe266286d78b344350f84
SIZE (apache-tomcat-5.5.30.tar.gz) = 8274143
MD5 (apache-tomcat-5.5.31.tar.gz) = 9ab07386e23f4c3dfc3b0a5e29b5f854
SHA256 (apache-tomcat-5.5.31.tar.gz) = 9f02f47d2cf351bcff4c0d013a253c965ad0cc0fc0305d086f2f653022ccfa82
SIZE (apache-tomcat-5.5.31.tar.gz) = 8277017
MD5 (apache-tomcat-5.5.31-compat.tar.gz) = 31958bdab2926e41b6f7f93a8e2304b2
SHA256 (apache-tomcat-5.5.31-compat.tar.gz) = 3b86e7a232bae1d94642b3119e0e713c2f27509b0e2c5f598666f77b6b1691b8
SIZE (apache-tomcat-5.5.31-compat.tar.gz) = 1651313

View File

@ -1,8 +1,6 @@
$FreeBSD$
--- conf/server.xml.orig Sun Jun 5 21:37:27 2005
+++ conf/server.xml Sun Jun 5 21:40:08 2005
@@ -10,7 +10,7 @@
--- ./conf/server.xml.orig 2010-09-04 21:54:16.000000000 +0200
+++ ./conf/server.xml 2010-10-01 23:00:25.000000000 +0200
@@ -27,7 +27,7 @@
define subcomponents such as "Valves" or "Loggers" at this level.
-->
@ -11,7 +9,7 @@ $FreeBSD$
<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
@@ -72,8 +72,8 @@
@@ -90,11 +90,11 @@
IP address of the remote client.
-->
@ -21,8 +19,12 @@ $FreeBSD$
+ <Connector port="%%HTTP_PORT%%" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
@@ -97,8 +97,8 @@
- connectionTimeout="20000" disableUploadTimeout="true" />
+ connectionTimeout="%%HTTP_TIMEOUT%%" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
@@ -115,8 +115,8 @@
clientAuth="false" sslProtocol="TLS" />
-->

View File

@ -11,7 +11,10 @@
# $FreeBSD$
#
PATH=/usr/bin:/bin:/usr/sbin:/usr/local/bin
USER=%%USER%%
GROUP=%%GROUP%%
PID_FILE=%%PID_FILE%%
# Make sure we're in the right stage of the process
@ -21,7 +24,7 @@ if [ "$2" = "DEINSTALL" ]; then
if [ -s ${PID_FILE} ]; then
PID=`cat ${PID_FILE}`
echo -n ">> Killing Tomcat process (${PID})..."
/bin/kill ${PID} > /dev/null 2> /dev/null
kill ${PID} > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
echo " [ DONE ]"
else
@ -38,10 +41,14 @@ if [ "$2" = "DEINSTALL" ]; then
fi
if [ "$2" = "POST-DEINSTALL" ]; then
# If the user exists, then display a message
# If the user/group exists, then display a message
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete the ${USER} user permanently, use 'pw userdel ${USER}'"
fi
if pw groupshow "${GROUP}" 2>&1 >/dev/null; then
echo "To delete the ${GROUP} group permanently, use 'pw groupdel ${GROUP}'"
fi
fi
exit 0

View File

@ -6,18 +6,20 @@
# $FreeBSD$
#
# Make sure we're called during the 'make install' process
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
PATH=/usr/bin:/bin:/usr/sbin:/usr/local/bin
# Set some constants
UID=%%UID%%
GID=${UID}
USER=%%USER%%
GROUP=%%GROUP%%
APP_HOME=%%APP_HOME%%
JAVA_HOME=%%JAVA_HOME%%
LOG_DIR=%%LOG_DIR%%
STDOUT_LOG=%%STDOUT_LOG%%
STDERR_LOG=%%STDERR_LOG%%
# See if the group already exists
uidgid() {
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
# If not, try to create it
@ -29,6 +31,8 @@ if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
else
echo "You already have a group \"${GROUP}\", so I will use it."
fi
# See if the user already exists
@ -36,12 +40,12 @@ if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
# If not, try to create it
if pw useradd "${USER}" -u ${UID} -g "${GROUP}" -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-s "/usr/sbin/nologin" -d "/nonexistent" \
-c "World Wide Web Owner";
then
echo "Added user \"${USER}\"."
elif pw useradd "${USER}" -g "${GROUP}" -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-s "/usr/sbin/nologin" -d "/nonexistent" \
-c "World Wide Web Owner";
then
echo "Added user \"${USER}\"."
@ -49,5 +53,55 @@ if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "Adding user \"${USER}\" failed..."
exit 1
fi
else
echo "You already have a user \"${USER}\", so I will use it."
fi
}
post() {
echo -n ">> Creating destination directory..."
mkdir -p ${APP_HOME}
mkdir -p ${LOG_DIR}
echo " [ DONE ]"
echo ">> Copying files to destination directory..."
echo " [ DONE ]"
echo -n ">> Creating log files..."
install -m 664 -o ${USER} -g ${GROUP} /dev/null ${STDOUT_LOG}
install -m 664 -o ${USER} -g ${GROUP} /dev/null ${STDERR_LOG}
echo " [ DONE ]"
echo -n ">> Creating symlink to tools.jar..."
ln -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/common/lib/tools.jar
echo " [ DONE ]"
echo -n ">> Fixing ownership settings..."
chown -R ${USER}:${GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \
${APP_HOME}/temp ${APP_HOME}/work ${APP_HOME}/webapps
chmod -R a+r ${APP_HOME}/common ${APP_HOME}/server ${APP_HOME}/bin
echo " [ DONE ]"
echo -n ">> Fixing permissions..."
find ${APP_HOME} -type d -exec chmod 755 {} \;
echo " [ DONE ] "
}
# PACKAGE_BUILDING is only defined on the build cluster or tinderbox!
# No interactive parts, there is no one who can answer!
if [ "x${PACKAGE_BUILDING}" != "x" ]; then
uidgid
post
exit 0
fi
if [ "$2" = "POST-INSTALL" ]; then
uidgid
post
exit 0
fi
exit 0

View File

@ -123,6 +123,7 @@ flags="-p ${pidfile} ${java_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${l
start_precmd=pid_touch
stop_cmd="tomcat%%TOMCAT_VERSION%%_stop"
status_cmd="tomcat%%TOMCAT_VERSION%%_status"
pid_touch ()
{
@ -133,9 +134,9 @@ pid_touch ()
tomcat%%TOMCAT_VERSION%%_stop() {
rc_pid=$(check_pidfile $pidfile $procname)
if [ -z "$rc_pid" ]; then
[ -n "$rc_fast" ] && return 0
if [ -n "$pidfile" ]; then
if [ -z `cat $pidfile` ]; then
[ -n `cat $pidfile` ] && return 0
if [ -n `cat $pidfile` ]; then
echo "${name} not running? (check $pidfile)."
else
echo "${name} not running?"
@ -145,11 +146,24 @@ tomcat%%TOMCAT_VERSION%%_stop() {
echo "Stopping ${name}."
${java_command} stop
tomcat_wait_max_for_pid ${tomcat%%TOMCAT_VERSION%%_stop_timeout} ${rc_pid}
tomcat_wait_max_for_pid ${tomcat%%TOMCAT_VERSION%%_stop_timeout} `cat $pidfile`
kill -KILL ${rc_pid} 2> /dev/null && echo "Killed."
echo -n > ${pidfile}
}
tomcat%%TOMCAT_VERSION%%_status() {
if [ ! -f $pidfile ]; then
pid_touch
fi
if [ -z `cat $pidfile` ]; then
echo "${name} is not running."
return 1
else
echo "${name} is running as pid `cat $pidfile`."
fi
}
tomcat_wait_max_for_pid() {
_timeout=$1
shift

View File

@ -46,15 +46,25 @@
%%T%%/common/lib/servlet-api.jar
%%T%%/common/lib/tools.jar
%%T%%/conf/Catalina/localhost/host-manager.xml.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/Catalina/localhost/host-manager.xml ]; then cp %D/%%T%%/conf/Catalina/localhost/host-manager.xml.%%CONF_EXT%% %D/%%T%%/conf/Catalina/localhost/host-manager.xml; fi
%%T%%/conf/Catalina/localhost/manager.xml.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/Catalina/localhost/manager.xml ]; then cp %D/%%T%%/conf/Catalina/localhost/manager.xml.%%CONF_EXT%% %D/%%T%%/conf/Catalina/localhost/manager.xml; fi
%%T%%/conf/catalina.policy.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/catalina.policy ]; then cp %D/%%T%%/conf/catalina.policy.%%CONF_EXT%% %D/%%T%%/conf/catalina.policy;fi
%%T%%/conf/catalina.properties.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/catalina.properties ]; then cp %D/%%T%%/conf/catalina.properties.%%CONF_EXT%% %D/%%T%%/conf/catalina.properties;fi
%%T%%/conf/context.xml.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/context.xml ]; then cp %D/%%T%%/conf/context.xml.%%CONF_EXT%% %D/%%T%%/conf/context.xml;fi
%%T%%/conf/logging.properties.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/logging.properties ]; then cp %D/%%T%%/conf/logging.properties.%%CONF_EXT%% %D/%%T%%/conf/logging.properties;fi
%%T%%/conf/server-minimal.xml.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/server-minimal.xml ]; then cp %D/%%T%%/conf/server-minimal.xml.%%CONF_EXT%% %D/%%T%%/conf/server-minimal.xml;fi
%%T%%/conf/server.xml.%%CONF_EXT%%
@exec [ -f %D/%%T%%/conf/server.xml ] || cp %D/%%T%%/conf/server.xml.%%CONF_EXT%% %D/%%T%%/conf/server.xml
%%T%%/conf/tomcat-users.xml.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/tomcat-users.xml ];then cp %D/%%T%%/conf/tomcat-users.xml.%%CONF_EXT%% %D/%%T%%/conf/tomcat-users.xml;fi
%%T%%/conf/web.xml.%%CONF_EXT%%
@exec if [ ! -f %D/%%T%%/conf/web.xml ];then cp %D/%%T%%/conf/web.xml.%%CONF_EXT%% %D/%%T%%/conf/web.xml;fi
%%T%%/logs/stderr.log
%%T%%/logs/stdout.log
%%T%%/server/lib/catalina-ant-jmx.jar