aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/tomcat7/Makefile84
-rw-r--r--www/tomcat7/distinfo6
-rw-r--r--www/tomcat7/files/patch-conf__server.xml29
-rw-r--r--www/tomcat7/files/pkg-install.in53
-rw-r--r--www/tomcat7/files/tomcat6.sh.in194
-rw-r--r--www/tomcat7/files/tomcat7.in190
-rw-r--r--www/tomcat7/pkg-descr2
-rw-r--r--www/tomcat7/pkg-plist60
8 files changed, 274 insertions, 344 deletions
diff --git a/www/tomcat7/Makefile b/www/tomcat7/Makefile
index ba75deaf6e98..c4793562b293 100644
--- a/www/tomcat7/Makefile
+++ b/www/tomcat7/Makefile
@@ -6,108 +6,76 @@
#
PORTNAME= tomcat
-PORTVERSION= 6.0.29
+PORTVERSION= 7.0.2
CATEGORIES= www java
MASTER_SITES= ${MASTER_SITE_APACHE}
-MASTER_SITE_SUBDIR= tomcat/tomcat-6/v${PORTVERSION}/bin
+MASTER_SITE_SUBDIR= tomcat/tomcat-7/v${PORTVERSION}-beta/bin
DISTNAME= apache-${PORTNAME}-${PORTVERSION}
MAINTAINER= ale@FreeBSD.org
-COMMENT= Open-source Java web server by Apache, 6.x branch
+COMMENT= Open-source Java web server by Apache, 7.x branch
USE_JAVA= yes
-JAVA_VERSION= 1.5+
-NO_BUILD= YES
-
-USE_RC_SUBR= tomcat6.sh
-SUB_FILES= pkg-install
-
-MAJOR_VER= ${PORTVERSION:R}
-APP_HOME?= ${PREFIX}/${DISTNAME:R}
-LOG_DIR= ${APP_HOME}/logs
-APP_SHORTNAME= ${PORTNAME}${MAJOR_VER:S/.//}
-TOMCAT_USER?= www
-TOMCAT_GROUP?= www
-HTTP_PORT?= 8180
-SHUTDOWN_PORT?= 8005
-AJP_1_3_PORT?= 8009
-STDOUT_LOG= ${LOG_DIR}/stdout.log
-STDERR_LOG= ${LOG_DIR}/stderr.log
-JAR_FILE= bin/bootstrap.jar
+JAVA_VERSION= 1.6+
+NO_BUILD= yes
+
+APP_SHORTNAME= tomcat7
+
+USE_RC_SUBR= ${APP_SHORTNAME}
+
+TOMCAT_SUBDIR?= ${DISTNAME:R}
+TOMCAT_HOME= ${PREFIX}/${TOMCAT_SUBDIR}
CONF_FILES= catalina.policy catalina.properties context.xml logging.properties server.xml tomcat-users.xml web.xml
CONF_EXT= sample
-PLIST_SUB= T=${APP_HOME:S/^${PREFIX}\///} CONF_EXT=${CONF_EXT} \
- WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP}
+PLIST_SUB= T=${TOMCAT_SUBDIR} CONF_EXT=${CONF_EXT}
LATEST_LINK= ${APP_SHORTNAME}
-SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \
- APP_HOME=${APP_HOME} \
- APP_SHORTNAME=${APP_SHORTNAME} \
- GROUP=${TOMCAT_GROUP} \
- HTTP_PORT=${HTTP_PORT} \
- JAR_FILE=${JAR_FILE} \
- SHUTDOWN_PORT=${SHUTDOWN_PORT} \
- STDERR_LOG=${STDERR_LOG} \
- STDOUT_LOG=${STDOUT_LOG} \
- TOMCAT_HOME=${APP_HOME} \
- TOMCAT_VERSION=${MAJOR_VER:S/.//} \
- USER=${TOMCAT_USER}
+SUB_LIST= TOMCAT_HOME=${TOMCAT_HOME} \
+ TOMCAT_USER=${WWWOWN}
.include <bsd.port.pre.mk>
pre-patch:
@${ECHO_MSG} "Installation settings:"
- @${ECHO_MSG} " Destination directory: ${APP_HOME}"
+ @${ECHO_MSG} " Destination directory: ${TOMCAT_HOME}"
@${ECHO_MSG} " Location of JDK: ${JAVA_HOME}"
@${ECHO_MSG} " Location of Java port: ${JAVA_PORT}"
- @${ECHO_MSG} " Running as (user/group): ${TOMCAT_USER}/${TOMCAT_GROUP}"
- @${ECHO_MSG} " HTTP port: ${HTTP_PORT}"
- @${ECHO_MSG} " Shutdown listener port: ${SHUTDOWN_PORT}"
- @${ECHO_MSG} " AJP 1.3 connector port: ${AJP_1_3_PORT}"
- @${ECHO_MSG} " Logfile stdout: ${STDOUT_LOG}"
- @${ECHO_MSG} " Logfile stderr: ${STDERR_LOG}"
post-patch:
- @${REINPLACE_CMD} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${WRKSRC}/conf/server.xml
- @${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.exe'` \
- `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.bak'`
+ @${FIND} ${WRKSRC} -name '*.bat' -delete
.for f in ${CONF_FILES}
@${MV} ${WRKSRC}/conf/${f} ${WRKSRC}/conf/${f}.${CONF_EXT}
.endfor
-pre-install:
- @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
do-install:
@${ECHO_MSG} -n ">> Creating destination directory..."
- @${MKDIR} ${APP_HOME}
- @${MKDIR} ${LOG_DIR}
- @${MKDIR} ${APP_HOME}/endorsed
+ @${MKDIR} ${TOMCAT_HOME}/logs
+ @${MKDIR} ${TOMCAT_HOME}/endorsed
@${ECHO_MSG} " [ DONE ]"
@${ECHO_MSG} -n ">> Copying files to destination directory..."
- @${CP} -R ${WRKSRC}/* ${APP_HOME}
+ @${CP} -R ${WRKSRC}/* ${TOMCAT_HOME}
@${ECHO_MSG} " [ DONE ]"
.for f in ${CONF_FILES}
-. if !exists(${APP_HOME}/conf/${f})
- @${CP} ${APP_HOME}/conf/${f}.${CONF_EXT} ${APP_HOME}/conf/${f}
+. if !exists(${TOMCAT_HOME}/conf/${f})
+ @${CP} ${TOMCAT_HOME}/conf/${f}.${CONF_EXT} ${TOMCAT_HOME}/conf/${f}
. else
@${ECHO_MSG} ">> Preserving local configuration file: ${f} [ DONE ]"
. endif
.endfor
@${ECHO_MSG} -n ">> Creating symlink to tools.jar..."
- @${LN} -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/lib/tools.jar
+ @${LN} -sf ${JAVA_HOME}/lib/tools.jar ${TOMCAT_HOME}/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}/webapps ${APP_HOME}/work
+ @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${TOMCAT_HOME}/conf ${TOMCAT_HOME}/logs \
+ ${TOMCAT_HOME}/temp ${TOMCAT_HOME}/webapps ${TOMCAT_HOME}/work
@${ECHO_MSG} " [ DONE ]"
@${ECHO_MSG} -n ">> Fixing permissions..."
- @${FIND} ${APP_HOME} -type d -print0 | ${XARGS} -0 ${CHMOD} 755
+ @${FIND} ${TOMCAT_HOME} -type d -print0 | ${XARGS} -0 ${CHMOD} 755
@${ECHO_MSG} " [ DONE ]"
.include <bsd.port.post.mk>
diff --git a/www/tomcat7/distinfo b/www/tomcat7/distinfo
index e8d1e70f86f3..450e55916ffe 100644
--- a/www/tomcat7/distinfo
+++ b/www/tomcat7/distinfo
@@ -1,3 +1,3 @@
-MD5 (apache-tomcat-6.0.29.tar.gz) = 7d614e03d18d3f21fcfdff96f0b6c311
-SHA256 (apache-tomcat-6.0.29.tar.gz) = 4cb25adf2b541c93a34e2e6b1b31d6da1f77ceaa688ac1a7c6635a475ae5266d
-SIZE (apache-tomcat-6.0.29.tar.gz) = 6407210
+MD5 (apache-tomcat-7.0.2.tar.gz) = 43b5ba6aec55dd9a30957e035d0aac5f
+SHA256 (apache-tomcat-7.0.2.tar.gz) = 9f48fffa64b16f4bb65701c467d73a068b4598110a5db66ef0bf347b32c37667
+SIZE (apache-tomcat-7.0.2.tar.gz) = 7022527
diff --git a/www/tomcat7/files/patch-conf__server.xml b/www/tomcat7/files/patch-conf__server.xml
deleted file mode 100644
index 0d5e5277dc93..000000000000
--- a/www/tomcat7/files/patch-conf__server.xml
+++ /dev/null
@@ -1,29 +0,0 @@
---- ./conf/server.xml.orig 2007-07-24 22:33:24.134058137 +0800
-+++ ./conf/server.xml 2007-07-24 22:34:42.223606359 +0800
-@@ -2,7 +2,7 @@
- define subcomponents such as "Valves" at this level.
- Documentation at /docs/config/server.html
- -->
--<Server port="8005" shutdown="SHUTDOWN">
-+<Server port="%%SHUTDOWN_PORT%%" shutdown="SHUTDOWN">
-
- <!--APR library loader. Documentation at /docs/apr.html -->
- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
-@@ -47,7 +47,7 @@
- APR (HTTP/AJP) Connector: /docs/apr.html
- Define a non-SSL HTTP/1.1 Connector on port 8080
- -->
-- <Connector port="8080" protocol="HTTP/1.1"
-+ <Connector port="%%HTTP_PORT%%" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="8443" />
- <!-- A "Connector" using the shared thread pool-->
-@@ -68,7 +68,7 @@
- -->
-
- <!-- Define an AJP 1.3 Connector on port 8009 -->
-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-+ <Connector port="%%AJP_1_3_PORT%%" protocol="AJP/1.3" redirectPort="8443" />
-
-
- <!-- An Engine represents the entry point (within Catalina) that processes
diff --git a/www/tomcat7/files/pkg-install.in b/www/tomcat7/files/pkg-install.in
deleted file mode 100644
index ddc5dfda878a..000000000000
--- a/www/tomcat7/files/pkg-install.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-#
-# Checks if the '%%USER%%' user and '%%GROUP%%' group exist. If they don't, then
-# an attempt is made to create both.
-#
-# $FreeBSD$
-#
-
-# Make sure we're called during the 'make install' process
-if [ "$2" != "PRE-INSTALL" ]; then
- exit 0
-fi
-
-# Set some constants
-UID=80
-GID=${UID}
-USER=%%USER%%
-GROUP=%%GROUP%%
-
-# See if the group already exists
-if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
-
- # If not, try to create it
- if pw groupadd "${GROUP}" -g ${GID}; then
- echo "Added group \"${GROUP}\"."
- elif pw groupadd "${GROUP}"; then
- echo "Added group \"${GROUP}\"."
- else
- echo "Adding group \"${GROUP}\" failed..."
- exit 1
- fi
-fi
-
-# See if the user already exists
-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" \
- -c "World Wide Web Owner";
- then
- echo "Added user \"${USER}\"."
- elif pw useradd "${USER}" -g "${GROUP}" -h - \
- -s "/sbin/nologin" -d "/nonexistent" \
- -c "World Wide Web Owner";
- then
- echo "Added user \"${USER}\"."
- else
- echo "Adding user \"${USER}\" failed..."
- exit 1
- fi
-fi
-exit 0
diff --git a/www/tomcat7/files/tomcat6.sh.in b/www/tomcat7/files/tomcat6.sh.in
deleted file mode 100644
index 42bf6c29fc62..000000000000
--- a/www/tomcat7/files/tomcat6.sh.in
+++ /dev/null
@@ -1,194 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# PROVIDE: tomcat%%TOMCAT_VERSION%%
-# REQUIRE: NETWORKING SERVERS
-# BEFORE: DAEMON
-# KEYWORD: shutdown
-
-#
-# Configuration settings for tomcat%%TOMCAT_VERSION%% in /etc/rc.conf:
-#
-# tomcat%%TOMCAT_VERSION%%_enable (bool):
-# Set to "NO" by default.
-# Set it to "YES" to enable tomcat%%TOMCAT_VERSION%%
-#
-# tomcat%%TOMCAT_VERSION%%_flags (str):
-# Set to "" by default.
-# Extra flags passed to start command
-#
-# tomcat%%TOMCAT_VERSION%%_catalina_home (str)
-# Set to "%%TOMCAT_HOME%%" by default.
-# Set the CATALINA_HOME variable for the Tomcat process
-#
-# tomcat%%TOMCAT_VERSION%%_catalina_base (str)
-# Set to "%%TOMCAT_HOME%%" by default.
-# Set the CATALINA_BASE variable for the Tomcat process
-#
-# tomcat%%TOMCAT_VERSION%%_catalina_tmpdir (str)
-# Set to "%%TOMCAT_HOME%%/temp" by default.
-# Set the CATALINA_TMPDIR variable for the Tomcat process
-#
-# tomcat%%TOMCAT_VERSION%%_stdout_log (str)
-# Set to "%%STDOUT_LOG%%" by default.
-# Set the location for the Tomcat process log (standard output)
-#
-# tomcat%%TOMCAT_VERSION%%_stderr_log (str)
-# Set to "%%STDERR_LOG%%" by default.
-# Set the location for the Tomcat process log (error output)
-#
-# tomcat%%TOMCAT_VERSION%%_stop_timeout (num)
-# Set to "10" by default.
-# Sets the timeout in seconds to allow tomcat to shutdown.
-# After the timeout has elapsed, tomcat will be killed.
-#
-# tomcat%%TOMCAT_VERSION%%_java_home (str):
-# tomcat%%TOMCAT_VERSION%%_java_vendor (str):
-# tomcat%%TOMCAT_VERSION%%_java_version (str):
-# tomcat%%TOMCAT_VERSION%%_java_os (str):
-# Specify the requirements of the Java VM to use. See javavm(1).
-#
-# tomcat%%TOMCAT_VERSION%%_classpath (str):
-# Set to "" by default.
-# Addtional classes to add to the CLASSPATH
-#
-# tomcat%%TOMCAT_VERSION%%_java_opts (str):
-# Set to "" by default.
-# Java VM args to use.
-#
-
-tomcat%%TOMCAT_VERSION%%_enable="${tomcat%%TOMCAT_VERSION%%_enable:-"NO"}"
-tomcat%%TOMCAT_VERSION%%_java_version="${tomcat%%TOMCAT_VERSION%%_java_version:-"%%JAVA_VERSION%%"}"
-tomcat%%TOMCAT_VERSION%%_user="${tomcat%%TOMCAT_VERSION%%_user:-"%%USER%%"}"
-tomcat%%TOMCAT_VERSION%%_catalina_home="${tomcat%%TOMCAT_VERSION%%_catalina_home:-"%%TOMCAT_HOME%%"}"
-tomcat%%TOMCAT_VERSION%%_catalina_base="${tomcat%%TOMCAT_VERSION%%_catalina_base:-"%%TOMCAT_HOME%%"}"
-tomcat%%TOMCAT_VERSION%%_catalina_tmpdir="${tomcat%%TOMCAT_VERSION%%_catalina_tmpdir:-"%%TOMCAT_HOME%%/temp"}"
-tomcat%%TOMCAT_VERSION%%_stdout_log="${tomcat%%TOMCAT_VERSION%%_stdout_log:-"%%STDOUT_LOG%%"}"
-tomcat%%TOMCAT_VERSION%%_stderr_log="${tomcat%%TOMCAT_VERSION%%_stderr_log:-"%%STDERR_LOG%%"}"
-tomcat%%TOMCAT_VERSION%%_stop_timeout="${tomcat%%TOMCAT_VERSION%%_stop_timeout:-"10"}"
-
-. /etc/rc.subr
-
-name="tomcat%%TOMCAT_VERSION%%"
-rcvar=`set_rcvar`
-pidfile="/var/run/%%APP_SHORTNAME%%.pid"
-
-load_rc_config "${name}"
-
-if [ -n "${tomcat%%TOMCAT_VERSION%%_java_home}" ] ; then
- export JAVA_HOME="${tomcat%%TOMCAT_VERSION%%_java_home}"
-fi
-
-if [ -n "${tomcat%%TOMCAT_VERSION%%_java_version}" ] ; then
- export JAVA_VERSION="${tomcat%%TOMCAT_VERSION%%_java_version}"
-fi
-
-if [ -n "${tomcat%%TOMCAT_VERSION%%_java_vendor}" ] ; then
- export JAVA_VENDOR="${tomcat%%TOMCAT_VERSION%%_java_vendor}"
-fi
-
-if [ -n "${tomcat%%TOMCAT_VERSION%%_java_os}" ] ; then
- export JAVA_OS="${tomcat%%TOMCAT_VERSION%%_java_os}"
-fi
-
-java_class="org.apache.catalina.startup.Bootstrap"
-java_command="%%LOCALBASE%%/bin/java \
- ${tomcat%%TOMCAT_VERSION%%_java_opts} \
- -Djava.endorsed.dirs=%%TOMCAT_HOME%%/endorsed \
- -classpath %%TOMCAT_HOME%%/%%JAR_FILE%%:${tomcat%%TOMCAT_VERSION%%_classpath} \
- -Dcatalina.base=${tomcat%%TOMCAT_VERSION%%_catalina_base} \
- -Dcatalina.home=${tomcat%%TOMCAT_VERSION%%_catalina_home} \
- -Djava.io.tmpdir=${tomcat%%TOMCAT_VERSION%%_catalina_tmpdir} \
- ${java_class}"
-
-log_args=">> ${tomcat%%TOMCAT_VERSION%%_stdout_log} \
- 2>> ${tomcat%%TOMCAT_VERSION%%_stderr_log} "
-
-required_files="${tomcat%%TOMCAT_VERSION%%_catalina_home}/conf/server.xml"
-
-command="/usr/sbin/daemon"
-flags="-p ${pidfile} ${java_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${log_args}"
-
-start_precmd="pid_touch"
-stop_cmd="tomcat_stop"
-status_cmd="tomcat_status"
-poll_cmd="tomcat_poll"
-
-pid_touch() {
- touch $pidfile
- chown $tomcat%%TOMCAT_VERSION%%_user $pidfile
-}
-
-tomcat_stop() {
- rc_pid=$(tomcat_check_pidfile $pidfile)
-
- if [ -z "$rc_pid" ]; then
- [ -n "$rc_fast" ] && return 0
- echo "${name} not running? (check $pidfile)."
- return 1
- fi
-
- echo "Stopping ${name}."
- ${java_command} stop
- tomcat_wait_max_for_pid ${tomcat%%TOMCAT_VERSION%%_stop_timeout} ${rc_pid}
- kill -KILL ${rc_pid} 2> /dev/null && echo "Killed."
- rm -f ${pidfile}
-}
-
-tomcat_status() {
- rc_pid=$(tomcat_check_pidfile $pidfile)
-
- if [ -z "$rc_pid" ]; then
- [ -n "$rc_fast" ] && return 0
- echo "${name} not running? (check $pidfile)."
- return 1
- fi
-}
-
-tomcat_poll() {
- while (true) ; do
- rc_pid=$(tomcat_check_pidfile $pidfile)
- [ -z "$rc_pid" ] && break
- sleep 2
- done
-}
-
-tomcat_check_pidfile() {
- _pidfile=$1
- if [ -z "$_pidfile" ]; then
- err 3 'USAGE: tomcat_check_pidfile pidfile'
- fi
- if [ ! -f $_pidfile ]; then
- debug "pid file ($_pidfile): not readable."
- return
- fi
- read _pid _junk < $_pidfile
- if [ -z "$_pid" ]; then
- debug "pid file ($_pidfile): no pid in file."
- return
- fi
- if [ -n "`%%LOCALBASE%%/bin/jps -l | grep -e "^$_pid $java_class\$"`" ]; then
- echo -n $_pid
- fi
-}
-
-tomcat_wait_max_for_pid() {
- _timeout=$1
- shift
- _pid=$1
- _prefix=
- while [ $_timeout -gt 0 ] ; do
- echo -n ${_prefix:-"Waiting (max $_timeout secs) for PIDS: "}$_pid
- _prefix=", "
- sleep 2
- kill -0 $_pid 2> /dev/null || break
- _timeout=$(($_timeout-2))
- done
- if [ -n "$_prefix" ]; then
- echo "."
- fi
-}
-
-run_rc_command "$1"
diff --git a/www/tomcat7/files/tomcat7.in b/www/tomcat7/files/tomcat7.in
new file mode 100644
index 000000000000..08a192de893c
--- /dev/null
+++ b/www/tomcat7/files/tomcat7.in
@@ -0,0 +1,190 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: tomcat7
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Configuration settings for tomcat7 in /etc/rc.conf:
+#
+# tomcat7_enable (bool):
+# Set to "NO" by default.
+# Set it to "YES" to enable tomcat7
+#
+# tomcat7_flags (str):
+# Set to "" by default.
+# Extra flags passed to start command
+#
+# tomcat7_catalina_base (str)
+# Set to "%%TOMCAT_HOME%%" by default.
+# Set the CATALINA_BASE variable for the Tomcat process
+#
+# tomcat7_catalina_tmpdir (str)
+# Set to "%%TOMCAT_HOME%%/temp" by default.
+# Set the CATALINA_TMPDIR variable for the Tomcat process
+#
+# tomcat7_stdout_log (str)
+# Set to "%%TOMCAT_HOME%%/logs/stdout.txt" by default.
+# Set the location for the Tomcat process log (standard output)
+#
+# tomcat7_stderr_log (str)
+# Set to "%%TOMCAT_HOME%%/logs/stderr.txt" by default.
+# Set the location for the Tomcat process log (error output)
+#
+# tomcat7_stop_timeout (num)
+# Set to "10" by default.
+# Sets the timeout in seconds to allow tomcat to shutdown.
+# After the timeout has elapsed, tomcat will be killed.
+#
+# tomcat7_java_home (str):
+# tomcat7_java_vendor (str):
+# tomcat7_java_version (str):
+# tomcat7_java_os (str):
+# Specify the requirements of the Java VM to use. See javavm(1).
+#
+# tomcat7_classpath (str):
+# Set to "" by default.
+# Addtional classes to add to the CLASSPATH
+#
+# tomcat7_java_opts (str):
+# Set to "" by default.
+# Java VM args to use.
+#
+
+tomcat7_enable="${tomcat7_enable:-"NO"}"
+tomcat7_java_version="${tomcat7_java_version:-"%%JAVA_VERSION%%"}"
+tomcat7_user="${tomcat7_user:-"%%TOMCAT_USER%%"}"
+tomcat7_catalina_home="%%TOMCAT_HOME%%"
+tomcat7_catalina_base="${tomcat7_catalina_base:-"%%TOMCAT_HOME%%"}"
+tomcat7_catalina_tmpdir="${tomcat7_catalina_tmpdir:-"%%TOMCAT_HOME%%/temp"}"
+tomcat7_stdout_log="${tomcat7_stdout_log:-"%%TOMCAT_HOME%%/logs/stdout.txt"}"
+tomcat7_stderr_log="${tomcat7_stderr_log:-"%%TOMCAT_HOME%%/logs/stderr.txt"}"
+tomcat7_stop_timeout="${tomcat7_stop_timeout:-"10"}"
+
+. /etc/rc.subr
+
+name="tomcat7"
+rcvar=`set_rcvar`
+pidfile="/var/run/tomcat7.pid"
+
+load_rc_config "${name}"
+
+if [ -n "${tomcat7_java_home}" ] ; then
+ export JAVA_HOME="${tomcat7_java_home}"
+fi
+
+if [ -n "${tomcat7_java_version}" ] ; then
+ export JAVA_VERSION="${tomcat7_java_version}"
+fi
+
+if [ -n "${tomcat7_java_vendor}" ] ; then
+ export JAVA_VENDOR="${tomcat7_java_vendor}"
+fi
+
+if [ -n "${tomcat7_java_os}" ] ; then
+ export JAVA_OS="${tomcat7_java_os}"
+fi
+
+java_class="org.apache.catalina.startup.Bootstrap"
+java_command="%%LOCALBASE%%/bin/java \
+ ${tomcat7_java_opts} \
+ -Djava.endorsed.dirs=%%TOMCAT_HOME%%/endorsed \
+ -classpath %%TOMCAT_HOME%%/bin/bootstrap.jar:%%TOMCAT_HOME%%/bin/tomcat-juli.jar${tomcat7_classpath} \
+ -Dcatalina.home=${tomcat7_catalina_home} \
+ -Dcatalina.base=${tomcat7_catalina_base} \
+ -Djava.io.tmpdir=${tomcat7_catalina_tmpdir} \
+ ${java_class}"
+
+log_args=">> ${tomcat7_stdout_log} \
+ 2>> ${tomcat7_stderr_log} "
+
+required_files="${tomcat7_catalina_base}/conf/server.xml"
+
+command="/usr/sbin/daemon"
+flags="-p ${pidfile} ${java_command} start ${tomcat7_flags} ${log_args}"
+
+start_precmd="pid_touch"
+stop_cmd="tomcat_stop"
+status_cmd="tomcat_status"
+poll_cmd="tomcat_poll"
+
+pid_touch() {
+ touch $pidfile
+ chown $tomcat7_user $pidfile
+}
+
+tomcat_stop() {
+ rc_pid=$(tomcat_check_pidfile $pidfile)
+
+ if [ -z "$rc_pid" ]; then
+ [ -n "$rc_fast" ] && return 0
+ echo "${name} not running? (check $pidfile)."
+ return 1
+ fi
+
+ echo "Stopping ${name}."
+ ${java_command} stop
+ tomcat_wait_max_for_pid ${tomcat7_stop_timeout} ${rc_pid}
+ kill -KILL ${rc_pid} 2> /dev/null && echo "Killed."
+ rm -f ${pidfile}
+}
+
+tomcat_status() {
+ rc_pid=$(tomcat_check_pidfile $pidfile)
+
+ if [ -z "$rc_pid" ]; then
+ [ -n "$rc_fast" ] && return 0
+ echo "${name} not running? (check $pidfile)."
+ return 1
+ fi
+}
+
+tomcat_poll() {
+ while (true) ; do
+ rc_pid=$(tomcat_check_pidfile $pidfile)
+ [ -z "$rc_pid" ] && break
+ sleep 2
+ done
+}
+
+tomcat_check_pidfile() {
+ _pidfile=$1
+ if [ -z "$_pidfile" ]; then
+ err 3 'USAGE: tomcat_check_pidfile pidfile'
+ fi
+ if [ ! -f $_pidfile ]; then
+ debug "pid file ($_pidfile): not readable."
+ return
+ fi
+ read _pid _junk < $_pidfile
+ if [ -z "$_pid" ]; then
+ debug "pid file ($_pidfile): no pid in file."
+ return
+ fi
+ if [ -n "`%%LOCALBASE%%/bin/jps -l | grep -e "^$_pid $java_class\$"`" ]; then
+ echo -n $_pid
+ fi
+}
+
+tomcat_wait_max_for_pid() {
+ _timeout=$1
+ shift
+ _pid=$1
+ _prefix=
+ while [ $_timeout -gt 0 ] ; do
+ echo -n ${_prefix:-"Waiting (max $_timeout secs) for PIDS: "}$_pid
+ _prefix=", "
+ sleep 2
+ kill -0 $_pid 2> /dev/null || break
+ _timeout=$(($_timeout-2))
+ done
+ if [ -n "$_prefix" ]; then
+ echo "."
+ fi
+}
+
+run_rc_command "$1"
diff --git a/www/tomcat7/pkg-descr b/www/tomcat7/pkg-descr
index 1d2f9b1b3582..10633299e3c6 100644
--- a/www/tomcat7/pkg-descr
+++ b/www/tomcat7/pkg-descr
@@ -1,6 +1,6 @@
Apache Tomcat is a web server written in 100% Pure Java.
-Apache Tomcat version 6.0 implements the Servlet 2.5 and JavaServer Pages 2.1
+Apache Tomcat version 7.0 implements the Servlet 3.0 and JavaServer Pages 2.2
specifications from the Java Community Process, and includes many additional
features that make it a useful platform for developing and deploying web
applications and web services.
diff --git a/www/tomcat7/pkg-plist b/www/tomcat7/pkg-plist
index 5af41a2f8c8a..a117d32fd02b 100644
--- a/www/tomcat7/pkg-plist
+++ b/www/tomcat7/pkg-plist
@@ -1,4 +1,4 @@
-@stopdaemon tomcat6
+@stopdaemon tomcat7
%%T%%/LICENSE
%%T%%/NOTICE
%%T%%/RELEASE-NOTES
@@ -42,17 +42,19 @@
%%T%%/lib/catalina-ha.jar
%%T%%/lib/catalina-tribes.jar
%%T%%/lib/catalina.jar
+%%T%%/lib/ecj-3.6.jar
%%T%%/lib/el-api.jar
%%T%%/lib/jasper-el.jar
-%%T%%/lib/jasper-jdt.jar
%%T%%/lib/jasper.jar
%%T%%/lib/jsp-api.jar
%%T%%/lib/servlet-api.jar
+%%T%%/lib/tomcat-api.jar
%%T%%/lib/tomcat-coyote.jar
%%T%%/lib/tomcat-dbcp.jar
%%T%%/lib/tomcat-i18n-es.jar
%%T%%/lib/tomcat-i18n-fr.jar
%%T%%/lib/tomcat-i18n-ja.jar
+%%T%%/lib/tomcat-util.jar
%%T%%/lib/tools.jar
%%T%%/temp/safeToDelete.tmp
%%T%%/webapps/ROOT/RELEASE-NOTES.txt
@@ -61,7 +63,6 @@
%%T%%/webapps/ROOT/build.xml
%%T%%/webapps/ROOT/favicon.ico
%%T%%/webapps/ROOT/index.html
-%%T%%/webapps/ROOT/index.jsp
%%T%%/webapps/ROOT/tomcat-power.gif
%%T%%/webapps/ROOT/tomcat.gif
%%T%%/webapps/ROOT/tomcat.svg
@@ -117,10 +118,12 @@
%%T%%/webapps/docs/config/context.html
%%T%%/webapps/docs/config/engine.html
%%T%%/webapps/docs/config/executor.html
+%%T%%/webapps/docs/config/filter.html
%%T%%/webapps/docs/config/globalresources.html
%%T%%/webapps/docs/config/host.html
%%T%%/webapps/docs/config/http.html
%%T%%/webapps/docs/config/index.html
+%%T%%/webapps/docs/config/jar-scanner.html
%%T%%/webapps/docs/config/listeners.html
%%T%%/webapps/docs/config/loader.html
%%T%%/webapps/docs/config/manager.html
@@ -134,12 +137,12 @@
%%T%%/webapps/docs/default-servlet.html
%%T%%/webapps/docs/deployer-howto.html
%%T%%/webapps/docs/developers.html
+%%T%%/webapps/docs/elapi/index.html
%%T%%/webapps/docs/extras.html
%%T%%/webapps/docs/funcspecs/fs-admin-apps.html
%%T%%/webapps/docs/funcspecs/fs-admin-objects.html
%%T%%/webapps/docs/funcspecs/fs-admin-opers.html
%%T%%/webapps/docs/funcspecs/fs-default.html
-%%T%%/webapps/docs/funcspecs/fs-invoker.html
%%T%%/webapps/docs/funcspecs/fs-jdbc-realm.html
%%T%%/webapps/docs/funcspecs/fs-jndi-realm.html
%%T%%/webapps/docs/funcspecs/fs-memory-realm.html
@@ -162,6 +165,7 @@
%%T%%/webapps/docs/jasper-howto.html
%%T%%/webapps/docs/jndi-datasource-examples-howto.html
%%T%%/webapps/docs/jndi-resources-howto.html
+%%T%%/webapps/docs/jspapi/index.html
%%T%%/webapps/docs/logging.html
%%T%%/webapps/docs/manager-howto.html
%%T%%/webapps/docs/maven-jars.html
@@ -169,7 +173,9 @@
%%T%%/webapps/docs/monitoring.html
%%T%%/webapps/docs/proxy-howto.html
%%T%%/webapps/docs/realm-howto.html
+%%T%%/webapps/docs/security-howto.html
%%T%%/webapps/docs/security-manager-howto.html
+%%T%%/webapps/docs/servletapi/index.html
%%T%%/webapps/docs/setup.html
%%T%%/webapps/docs/ssi-howto.html
%%T%%/webapps/docs/ssl-howto.html
@@ -195,6 +201,23 @@
%%T%%/webapps/examples/WEB-INF/classes/RequestParamExample.java
%%T%%/webapps/examples/WEB-INF/classes/SessionExample.class
%%T%%/webapps/examples/WEB-INF/classes/SessionExample.java
+%%T%%/webapps/examples/WEB-INF/classes/async/Async0$1.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async0.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async0.java
+%%T%%/webapps/examples/WEB-INF/classes/async/Async1$1.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async1.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async1.java
+%%T%%/webapps/examples/WEB-INF/classes/async/Async2$1.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async2.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async2.java
+%%T%%/webapps/examples/WEB-INF/classes/async/Async3.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Async3.java
+%%T%%/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.class
+%%T%%/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java
+%%T%%/webapps/examples/WEB-INF/classes/async/Stockticker$Stock.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Stockticker$TickListener.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Stockticker.class
+%%T%%/webapps/examples/WEB-INF/classes/async/Stockticker.java
%%T%%/webapps/examples/WEB-INF/classes/cal/Entries.class
%%T%%/webapps/examples/WEB-INF/classes/cal/Entries.java
%%T%%/webapps/examples/WEB-INF/classes/cal/Entry.class
@@ -232,16 +255,18 @@
%%T%%/webapps/examples/WEB-INF/classes/examples/LogTag.java
%%T%%/webapps/examples/WEB-INF/classes/examples/ShowSource.class
%%T%%/webapps/examples/WEB-INF/classes/examples/ShowSource.java
+%%T%%/webapps/examples/WEB-INF/classes/examples/ValuesTag.class
+%%T%%/webapps/examples/WEB-INF/classes/examples/ValuesTag.java
%%T%%/webapps/examples/WEB-INF/classes/filters/ExampleFilter.class
%%T%%/webapps/examples/WEB-INF/classes/filters/ExampleFilter.java
-%%T%%/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.class
-%%T%%/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java
%%T%%/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.class
%%T%%/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.class
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.java
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.class
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.java
+%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/ValuesBean.class
+%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/ValuesBean.java
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.class
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.java
%%T%%/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.class
@@ -282,6 +307,12 @@
%%T%%/webapps/examples/WEB-INF/tags/xhtmlbasic.tag
%%T%%/webapps/examples/WEB-INF/web.xml
%%T%%/webapps/examples/index.html
+%%T%%/webapps/examples/jsp/async/async1.jsp
+%%T%%/webapps/examples/jsp/async/async1.jsp.html
+%%T%%/webapps/examples/jsp/async/async3.jsp
+%%T%%/webapps/examples/jsp/async/async3.jsp.html
+%%T%%/webapps/examples/jsp/async/index.jsp
+%%T%%/webapps/examples/jsp/async/index.jsp.html
%%T%%/webapps/examples/jsp/cal/Entries.java.html
%%T%%/webapps/examples/jsp/cal/Entry.java.html
%%T%%/webapps/examples/jsp/cal/JspCalendar.java.html
@@ -335,12 +366,17 @@
%%T%%/webapps/examples/jsp/include/include.jsp.html
%%T%%/webapps/examples/jsp/index.html
%%T%%/webapps/examples/jsp/jsp2/el/Functions.java.html
+%%T%%/webapps/examples/jsp/jsp2/el/ValuesBean.java.html
+%%T%%/webapps/examples/jsp/jsp2/el/ValuesTag.java.html
%%T%%/webapps/examples/jsp/jsp2/el/basic-arithmetic.html
%%T%%/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp
%%T%%/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html
%%T%%/webapps/examples/jsp/jsp2/el/basic-comparisons.html
%%T%%/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp
%%T%%/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html
+%%T%%/webapps/examples/jsp/jsp2/el/composite.html
+%%T%%/webapps/examples/jsp/jsp2/el/composite.jsp
+%%T%%/webapps/examples/jsp/jsp2/el/composite.jsp.html
%%T%%/webapps/examples/jsp/jsp2/el/functions.html
%%T%%/webapps/examples/jsp/jsp2/el/functions.jsp
%%T%%/webapps/examples/jsp/jsp2/el/functions.jsp.html
@@ -460,6 +496,9 @@
%%T%%/webapps/examples/servlets/reqinfo.html
%%T%%/webapps/examples/servlets/reqparams.html
%%T%%/webapps/examples/servlets/sessions.html
+%%T%%/webapps/host-manager/401.jsp
+%%T%%/webapps/host-manager/403.jsp
+%%T%%/webapps/host-manager/404.jsp
%%T%%/webapps/host-manager/META-INF/context.xml
%%T%%/webapps/host-manager/WEB-INF/web.xml
%%T%%/webapps/host-manager/images/add.gif
@@ -471,8 +510,11 @@
%%T%%/webapps/host-manager/images/tomcat.gif
%%T%%/webapps/host-manager/images/update.gif
%%T%%/webapps/host-manager/images/void.gif
+%%T%%/webapps/host-manager/index.jsp
%%T%%/webapps/host-manager/manager.xml
%%T%%/webapps/manager/401.jsp
+%%T%%/webapps/manager/403.jsp
+%%T%%/webapps/manager/404.jsp
%%T%%/webapps/manager/META-INF/context.xml
%%T%%/webapps/manager/WEB-INF/jsp/sessionDetail.jsp
%%T%%/webapps/manager/WEB-INF/jsp/sessionsList.jsp
@@ -486,6 +528,7 @@
%%T%%/webapps/manager/images/tomcat.gif
%%T%%/webapps/manager/images/update.gif
%%T%%/webapps/manager/images/void.gif
+%%T%%/webapps/manager/index.jsp
%%T%%/webapps/manager/status.xsd
%%T%%/webapps/manager/xform.xsl
@exec mkdir %D/%%T%%/endorsed 2>/dev/null || true
@@ -531,6 +574,7 @@
@dirrm %%T%%/webapps/examples/jsp/checkbox
@dirrm %%T%%/webapps/examples/jsp/chat
@dirrm %%T%%/webapps/examples/jsp/cal
+@dirrm %%T%%/webapps/examples/jsp/async
@dirrm %%T%%/webapps/examples/jsp
@dirrm %%T%%/webapps/examples/WEB-INF/tags
@dirrm %%T%%/webapps/examples/WEB-INF/lib
@@ -555,12 +599,16 @@
@dirrm %%T%%/webapps/examples/WEB-INF/classes/checkbox
@dirrm %%T%%/webapps/examples/WEB-INF/classes/chat
@dirrm %%T%%/webapps/examples/WEB-INF/classes/cal
+@dirrm %%T%%/webapps/examples/WEB-INF/classes/async
@dirrm %%T%%/webapps/examples/WEB-INF/classes
@dirrm %%T%%/webapps/examples/WEB-INF
@dirrm %%T%%/webapps/examples
@dirrm %%T%%/webapps/docs/tribes
+@dirrm %%T%%/webapps/docs/servletapi
+@dirrm %%T%%/webapps/docs/jspapi
@dirrm %%T%%/webapps/docs/images
@dirrm %%T%%/webapps/docs/funcspecs
+@dirrm %%T%%/webapps/docs/elapi
@dirrm %%T%%/webapps/docs/config
@dirrm %%T%%/webapps/docs/architecture/startup
@dirrm %%T%%/webapps/docs/architecture/requestProcess